-
-
Notifications
You must be signed in to change notification settings - Fork 395
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
macOS Wheels #988
Merged
Merged
macOS Wheels #988
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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 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 |
---|---|---|
@@ -0,0 +1,119 @@ | ||
--- | ||
name: macOS | ||
|
||
on: | ||
push: {} | ||
|
||
jobs: | ||
build: | ||
name: py-${{ matrix.py.ver }} libgit2-${{ matrix.libgit2}} | ||
runs-on: macos-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
libgit2: ['maint/v0.99'] | ||
py: | ||
- ver: '3.6' | ||
release: '3.6.8' # last Python.org binary release | ||
- ver: '3.7' | ||
release: '3.7.7' | ||
- ver: '3.8' | ||
release: '3.8.2' | ||
env: | ||
HOMEBREW_CACHE: ${{ github.workspace }}/.cache/brew | ||
CCACHE_DIR: ${{ github.workspace }}/.cache/ccache | ||
CCACHE_COMPRESS: 1 | ||
PIP_CACHE_DIR: ${{ github.workspace }}/.cache/pip | ||
steps: | ||
- name: checkout pygit2 | ||
uses: actions/checkout@v2 | ||
with: | ||
path: pygit2 | ||
|
||
- name: checkout libgit2 | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: libgit2/libgit2 | ||
path: libgit2 | ||
ref: ${{ matrix.libgit2 }} | ||
|
||
- id: cache | ||
uses: actions/[email protected] | ||
with: | ||
path: .cache | ||
key: cache-libgit2.${{ matrix.libgit2 }}-py.${{ matrix.py.release }} | ||
restore-keys: | | ||
cache- | ||
|
||
- name: setup python | ||
run: | | ||
mkdir -p .cache/python/ .cache/pip/ | ||
PKG="python-${{ matrix.py.release }}-macosx10.9.pkg" | ||
URL="https://www.python.org/ftp/python/${{ matrix.py.release }}/$PKG" | ||
wget --no-verbose -P .cache/python -N "$URL" | ||
sudo installer -pkg ".cache/python/$PKG" -target / | ||
export PATH=/Library/Frameworks/Python.framework/Versions/${{ matrix.py.ver }}/bin:$PATH | ||
echo "::add-path::/Library/Frameworks/Python.framework/Versions/${{ matrix.py.ver }}/bin" | ||
which python3 | ||
python3 -VV | ||
test "$(python3 -V)" = "Python ${{ matrix.py.release }}" | ||
|
||
- name: setup | ||
run: | | ||
mkdir -p .cache/brew/ .cache/ccache/ | ||
brew install ccache pkg-config | ||
python3 -m venv venv/ | ||
echo "::add-path::${{ github.workspace }}/venv/bin:/usr/local/opt/ccache/libexec" | ||
venv/bin/pip3 install delocate pytest | ||
|
||
- name: build libgit2 | ||
id: libgit2 | ||
working-directory: libgit2 | ||
env: | ||
PKG_CONFIG_PATH: /dev/null | ||
run: | | ||
mkdir env/ | ||
cmake . \ | ||
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/libgit2/env \ | ||
-DBUILD_EXAMPLES=NO \ | ||
-DBUILD_CLAR=NO \ | ||
-DUSE_SSH=NO | ||
cmake --build . --target install | ||
VERSION=$(PKG_CONFIG_PATH=$(pwd) pkg-config --modversion libgit2) | ||
echo "::set-output name=version::$VERSION" | ||
|
||
- name: build pygit2 | ||
id: pygit2 | ||
working-directory: pygit2 | ||
env: | ||
LIBGIT2: "${{ github.workspace }}/libgit2/env" | ||
LDFLAGS: "-Wl,-rpath,'${{ github.workspace }}/libgit2/env/lib'" | ||
run: | | ||
python3 setup.py bdist_wheel | ||
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. FTR the recommended way of doing this is something like 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. Same outcome though afaik? |
||
delocate-listdeps dist/pygit2-*macosx*.whl | ||
delocate-wheel -v -w dist/fixed-wheels/ dist/pygit2-*macosx*.whl | ||
WHEEL=$(basename dist/fixed-wheels/*.whl) | ||
echo "::set-output name=wheel::$WHEEL" | ||
delocate-listdeps dist/fixed-wheels/$WHEEL | ||
|
||
- name: pygit2 tests | ||
working-directory: pygit2 | ||
run: | | ||
mv pygit2 pygit2~ | ||
mv ../libgit2/env ../libgit2/env~ | ||
pip3 install dist/fixed-wheels/pygit2-*.whl | ||
mkdir -p testresults/ | ||
pytest -v test/ --junitxml=testresults/testresults.xml | ||
|
||
- name: save test results | ||
uses: actions/upload-artifact@v1 | ||
if: always() | ||
with: | ||
name: "test-results-py_${{ matrix.py.ver }}-libgit2_${{ steps.libgit2.outputs.version }}" | ||
path: pygit2/testresults/ | ||
|
||
- name: save wheel | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: "macOS-wheel-py_${{ matrix.py.ver }}-libgit2_${{ steps.libgit2.outputs.version }}" | ||
path: pygit2/dist/fixed-wheels/ |
This file contains 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 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FTR here's a way to select the concrete "patch" version intelligently: https://github.com/amol-/dukpy/blob/54699a3/.travis.yml#L56-L109
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks - I need to select the last version available as a binary release from Python.org, not the latest patch version though. I don’t understand why they’re not built automatically, but they’re not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, re-reading, it does that, yes! Not sure it’s a big deal for us atm - we’re not typically using cutting edge CPython features
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep. Sometimes they release 3.6.8 for Linux, but stop at 3.6.6 for macOS. so this is something that my script accounts for. But yes, it shouldn't matter much. OTOH when you do exit-checks after the build but before publishing the artifacts, it may make sense to run tests on the recent version.
/me needs to find time and contribute that to cimultibuild...