-
Notifications
You must be signed in to change notification settings - Fork 6
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
Generate manylinux wheels #13
Open
DanShort12
wants to merge
34
commits into
makeclean:master
Choose a base branch
from
DanShort12:generate_manylinux_wheels
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 28 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
fb3ae38
Merge pull request #4 from DanShort12/serialise_plasma_source
DanShort12 f6059de
Use cibuildwheel to create wheels
DanShort12 3fd24bf
Work in manylinux container
DanShort12 f1381ba
No sudo as we're in a container
DanShort12 9f5d9e4
Use yum rather than apt
DanShort12 00ec010
Use yum package names
DanShort12 4972b86
Use cmake3
DanShort12 b7ceb2e
Register cmake3 as alternative for cmake
DanShort12 b404fd3
Run pip as a python module
DanShort12 a4c46d8
Use manylinux installed python
DanShort12 494abf5
Install auditwheel and repair
DanShort12 90a2b40
Test to determine which python is used for test
DanShort12 d83d4cd
Use correct python version for tests
DanShort12 037f1b1
Run tests from within tests directory
DanShort12 c3e9ebe
Support Python 3.9
DanShort12 1883ec6
Publish wheel to test PyPI
DanShort12 c54d596
Fix indentation
DanShort12 6e66b52
Don't upload to TestPyPI for now
DanShort12 8144f77
Generate version from git tags and commits
DanShort12 7e499ad
Refactor actions and include publish to PyPI
DanShort12 9b2ecf2
Fix yaml syntax error
DanShort12 319d361
Add missing steps identifier
DanShort12 ada610a
Add missing run identifier
DanShort12 a8109aa
Action not finding artifact after download
DanShort12 4feb6f3
GitHub doesn't have 3.9 installed
DanShort12 b943a17
Add some log messages when creating version
DanShort12 a76d50c
Get full repo history so we know number of commits
DanShort12 5169061
Use post as the version extension
DanShort12 f01ed23
Verbose twine output
DanShort12 eb070b6
Run workflow when a release is created
DanShort12 952ff27
Don't reinstall twine
DanShort12 acaff6e
Check TestPyPI and PyPI versions
DanShort12 8a21eb9
Use same account for PyPI and TestPyPI
DanShort12 e866b3e
trigger GitHub actions
DanShort12 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 | ||||
---|---|---|---|---|---|---|
|
@@ -7,39 +7,97 @@ on: | |||||
branches: [ master ] | ||||||
|
||||||
jobs: | ||||||
build_and_test: | ||||||
build: | ||||||
|
||||||
runs-on: ubuntu-latest | ||||||
container: quay.io/pypa/manylinux2014_x86_64 | ||||||
strategy: | ||||||
matrix: | ||||||
python-version: [3.6, 3.7, 3.8] | ||||||
|
||||||
steps: | ||||||
- uses: actions/checkout@v2 | ||||||
- name: Set up Python ${{ matrix.python-version }} | ||||||
uses: actions/setup-python@v2 | ||||||
with: | ||||||
python-version: ${{ matrix.python-version }} | ||||||
fetch-depth: 0 # Get the repo history so we can version by number of commits | ||||||
- name: Install OpenMC | ||||||
run: | | ||||||
sudo apt-get install -y g++ cmake libhdf5-dev | ||||||
yum install -y gcc-c++ cmake3 hdf5-devel | ||||||
alternatives --install /usr/local/bin/cmake cmake /usr/bin/cmake3 20 \ | ||||||
--slave /usr/local/bin/ctest ctest /usr/bin/ctest3 \ | ||||||
--slave /usr/local/bin/cpack cpack /usr/bin/cpack3 \ | ||||||
--slave /usr/local/bin/ccmake ccmake /usr/bin/ccmake3 \ | ||||||
--family cmake | ||||||
git clone --recurse-submodules https://github.com/openmc-dev/openmc.git | ||||||
cd openmc | ||||||
git checkout | ||||||
mkdir build && cd build | ||||||
cmake .. | ||||||
make | ||||||
sudo make install | ||||||
- name: Install plasma source | ||||||
make install | ||||||
- name: Build plasma source | ||||||
run: | | ||||||
pip install -r requirements-develop.txt | ||||||
export PYVER=${{ matrix.python-version }} | ||||||
alias python=$(ls -d /opt/python/* | grep ${PYVER//.})/bin/python | ||||||
python -m pip install -r requirements-develop.txt | ||||||
python -m pip install auditwheel | ||||||
python setup.py bdist_wheel | ||||||
python -m pip install --verbose dist/*.whl | ||||||
- name: Run tests | ||||||
run: | | ||||||
pytest tests | ||||||
python -m auditwheel show dist/*.whl | ||||||
python -m auditwheel repair dist/*.whl | ||||||
- name: Upload wheel artifact | ||||||
uses: actions/upload-artifact@v2 | ||||||
with: | ||||||
name: dist | ||||||
path: wheelhouse | ||||||
|
||||||
test: | ||||||
runs-on: ubuntu-latest | ||||||
needs: build | ||||||
strategy: | ||||||
matrix: | ||||||
python-version: [3.6, 3.7, 3.8] | ||||||
|
||||||
steps: | ||||||
- uses: actions/checkout@v2 | ||||||
- name: Set up Python ${{ matrix.python-version }} | ||||||
uses: actions/setup-python@v2 | ||||||
with: | ||||||
python-version: ${{ matrix.python-version }} | ||||||
- name: Download build | ||||||
uses: actions/download-artifact@v2 | ||||||
with: | ||||||
name: dist | ||||||
path: dist | ||||||
- name: Install plasma source | ||||||
run: | | ||||||
python -m pip install --no-index --find-links=file:dist parametric-plasma-source | ||||||
- name: Run tests | ||||||
run: | | ||||||
python -m pip install -r requirements-develop.txt | ||||||
cd tests | ||||||
python -m pytest | ||||||
|
||||||
publish: | ||||||
runs-on: ubuntu-latest | ||||||
needs: test | ||||||
|
||||||
steps: | ||||||
- name: Download build | ||||||
uses: actions/download-artifact@v2 | ||||||
with: | ||||||
name: dist | ||||||
path: dist | ||||||
- name: Publish wheel artifact to TestPyPI | ||||||
env: | ||||||
TWINE_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }} | ||||||
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }} | ||||||
run: | | ||||||
python3 -m pip install twine | ||||||
python3 -m twine upload --repository testpypi dist/* | ||||||
- name: Release wheel artifact to PyPI | ||||||
if: startsWith(github.ref, 'refs/tags') | ||||||
env: | ||||||
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||||||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||||||
run: | | ||||||
python3 -m pip install twine | ||||||
python3 -m twine upload dist/* | ||||||
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. Could add this, just to provide more info should it ever break
Suggested change
|
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 |
---|---|---|
|
@@ -58,12 +58,35 @@ def build_extension(self, ext): | |
) | ||
|
||
|
||
def get_version(release_override="0.0.1"): | ||
cwd = os.path.dirname(os.path.realpath(__file__)) | ||
version = subprocess.check_output( | ||
["git", "describe", "--always", "--tags"], stderr=None, cwd=cwd | ||
).strip().decode("utf-8") | ||
if "." not in version: | ||
# Git doesn't know about a tag yet, so manually set a version and get the total | ||
# number of commits | ||
num_commits = subprocess.check_output( | ||
["git", "rev-list", "--count", "HEAD"], stderr=None, cwd=cwd | ||
).strip().decode("utf-8") | ||
version = release_override + ".post" + num_commits | ||
else: | ||
if "-" in version: | ||
# This commit doesn't correspond to an annotated tag, so mark it as post and | ||
# get the number of commits since the last annotated tag | ||
version_split = version.split("-") | ||
tag_version = version_split[0] | ||
num_commits = version_split[1] | ||
version = tag_version + ".post" + num_commits | ||
return version | ||
|
||
|
||
with open("README.md", "r") as fh: | ||
long_description = fh.read() | ||
|
||
setup( | ||
name="parametric_plasma_source", | ||
version="0.0.6", | ||
version=get_version("0.0.6"), | ||
author="Andrew Davis", | ||
author_email="[email protected]", | ||
description="Parametric plasma source for fusion simulations in OpenMC", | ||
|
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.
Could add this, just to provide more info should it ever break