-
Notifications
You must be signed in to change notification settings - Fork 76
ENH: determine wheel tags by Python interpreter introspection & tests and CI improvements #202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
a604d11
ENH: determine wheel tags by Python interpreter introspection
dnicolodi dcc1b7d
BUG: fix extension filename suffix for Cygwin Python
dnicolodi b7e693d
TST: remove redundant and flaky test
dnicolodi 57c9e7d
TST: simplify checks for executable mode
dnicolodi acf26e4
TST: simplify
dnicolodi 578c2c4
TST: drop dependency on GitPython
dnicolodi b58a273
TST: account for Cygwin also having .dll.a files
dnicolodi 6ce635a
CI: add Pyston on Ubuntu 20.04 configuration
dnicolodi d582d46
CI: add Homebrew Python on macOS configuration
dnicolodi d893887
CI: actually run with Cygwin Python
dnicolodi a03c9e7
CI: update GitHub Actions and sundry tweaks
dnicolodi 65f1b1c
CI: patch pip to fix issue with Homebrew Python
dnicolodi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ concurrency: | |
cancel-in-progress: true | ||
|
||
jobs: | ||
pytest: | ||
test: | ||
runs-on: ${{ matrix.os }}-latest | ||
env: | ||
FORCE_COLOR: true | ||
|
@@ -35,10 +35,10 @@ jobs: | |
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up target Python | ||
uses: actions/setup-python@v2 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
|
||
|
@@ -60,3 +60,178 @@ jobs: | |
flags: tests | ||
env_vars: PYTHON | ||
name: ${{ matrix.python }} | ||
|
||
cygwin: | ||
runs-on: windows-latest | ||
env: | ||
FORCE_COLOR: true | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python: | ||
- '3.9' | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Cygwin | ||
uses: cygwin/cygwin-install-action@v2 | ||
with: | ||
packages: >- | ||
python39 | ||
python39-devel | ||
python39-pip | ||
python39-setuptools | ||
cmake | ||
gcc-core | ||
gcc-g++ | ||
git | ||
make | ||
ninja | ||
|
||
- name: Fix git dubious ownership | ||
# This addresses the "fatal: detected dubious ownership in | ||
# repository" and "fatal: not in a git directory" errors | ||
# encountered when trying to run Cygwin git in a directory not | ||
# owned by the current user. This happens when the tests run | ||
# Cygwin git in a directory outside the Cygwin filesystem. | ||
run: git config --global --add safe.directory '*' | ||
shell: C:\cygwin\bin\env.exe CYGWIN_NOWINPATH=1 CHERE_INVOKING=1 C:\cygwin\bin\bash.exe -leo pipefail -o igncr {0} | ||
|
||
- name: Get pip cache path | ||
id: pip-cache-path | ||
run: echo "path=$(cygpath -w $(python -m pip cache dir))" >> $GITHUB_OUTPUT | ||
shell: C:\cygwin\bin\env.exe CYGWIN_NOWINPATH=1 CHERE_INVOKING=1 C:\cygwin\bin\bash.exe -leo pipefail -o igncr {0} | ||
|
||
- name: Restore cache | ||
# Cygwin Python cannot use binary wheels from PyPI. Building | ||
# some dependencies takes considerable time. Caching the built | ||
# wheels speeds up the CI job quite a bit. | ||
dnicolodi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.pip-cache-path.outputs.path }} | ||
key: cygwin-pip-${{ github.sha }} | ||
restore-keys: cygwin-pip- | ||
|
||
- name: Install | ||
# Cygwin patches Python's ensurepip module to look for the | ||
# wheels needed to initialize a new virtual environment in | ||
# /usr/share/python-wheels/ but nothing in Cygwin actually | ||
# puts the setuptools and pip wheels there. Fix this. | ||
run: | | ||
mkdir /usr/share/python-wheels/ | ||
pushd /usr/share/python-wheels/ | ||
python -m pip --disable-pip-version-check download setuptools pip | ||
popd | ||
python -m pip --disable-pip-version-check install .[test] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like the nox configuration would also install |
||
shell: C:\cygwin\bin\env.exe CYGWIN_NOWINPATH=1 CHERE_INVOKING=1 C:\cygwin\bin\bash.exe -leo pipefail -o igncr {0} | ||
|
||
- name: Run tests | ||
run: >- | ||
python -m pytest --showlocals -vv --cov | ||
--cov-config setup.cfg | ||
--cov-report=xml:coverage-${{ matrix.python }}.xml | ||
shell: C:\cygwin\bin\env.exe CYGWIN_NOWINPATH=1 CHERE_INVOKING=1 C:\cygwin\bin\bash.exe -leo pipefail -o igncr {0} | ||
|
||
- name: Send coverage report | ||
uses: codecov/codecov-action@v1 | ||
if: ${{ always() }} | ||
env: | ||
PYTHON: cygwin-${{ matrix.python }} | ||
with: | ||
flags: tests | ||
env_vars: PYTHON | ||
name: cygwin-${{ matrix.python }} | ||
|
||
pyston: | ||
runs-on: ubuntu-20.04 | ||
env: | ||
FORCE_COLOR: true | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python: | ||
- '3.8' | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install pyston | ||
run: | | ||
wget https://github.com/pyston/pyston/releases/download/pyston_2.3.5/pyston_2.3.5_20.04_amd64.deb | ||
sudo apt install $(pwd)/pyston_2.3.5_20.04_amd64.deb | ||
|
||
- name: Install | ||
run: pyston -m pip --disable-pip-version-check install .[test] | ||
|
||
- name: Run tests | ||
run: >- | ||
pyston -m pytest --showlocals -vv --cov | ||
--cov-config setup.cfg | ||
--cov-report=xml:coverage-pyston.xml | ||
|
||
- name: Send coverage report | ||
uses: codecov/codecov-action@v1 | ||
if: ${{ always() }} | ||
env: | ||
PYTHON: pyston | ||
with: | ||
flags: tests | ||
env_vars: PYTHON | ||
name: pyston | ||
|
||
homebrew: | ||
runs-on: macos-latest | ||
env: | ||
FORCE_COLOR: true | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python: | ||
- '3.7' | ||
- '3.8' | ||
- '3.9' | ||
- '3.10' | ||
- '3.11' | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Homebrew Python | ||
run: | | ||
brew install --overwrite python@${{ matrix.python }} | ||
echo /usr/local/opt/python@${{ matrix.python }}/libexec/bin/ >> $GITHUB_PATH | ||
|
||
- name: Patch pip | ||
# Patch https://github.com/pypa/pip/issues/11539 | ||
run: | | ||
cat >>/usr/local/lib/python${{ matrix.python }}/site-packages/pip/_internal/locations/_sysconfig.py <<EOF | ||
def get_prefixed_libs(prefix: str) -> typing.Tuple[str, str]: | ||
if "venv" in sysconfig.get_scheme_names(): | ||
paths = sysconfig.get_paths(vars={"base": prefix, "platbase": prefix}, scheme="venv") | ||
else: | ||
paths = sysconfig.get_paths(vars={"base": prefix, "platbase": prefix}) | ||
return (paths["purelib"], paths["platlib"]) | ||
EOF | ||
|
||
- name: Install | ||
run: python -m pip --disable-pip-version-check install .[test] | ||
|
||
- name: Run tests | ||
run: >- | ||
python -m pytest --showlocals -vv --cov | ||
--cov-config setup.cfg | ||
--cov-report=xml:coverage-homebrew-${{ matrix.python }}.xml | ||
|
||
- name: Send coverage report | ||
uses: codecov/codecov-action@v1 | ||
if: ${{ always() }} | ||
env: | ||
PYTHON: homebrew-${{ matrix.python }} | ||
with: | ||
flags: tests | ||
env_vars: PYTHON | ||
name: homebrew-${{ matrix.python }} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.