From d6460bb8932de122dee33fd9b5d6b6d877934eda Mon Sep 17 00:00:00 2001 From: "Keto D. Zhang" Date: Mon, 14 Mar 2022 10:33:27 -0700 Subject: [PATCH 1/3] Add manylinux workflow --- .github/workflows/publish.yml | 49 +++++++++++++++++++++++++++++++++-- pyproject.toml | 2 +- source/MulensModel/version.py | 2 +- 3 files changed, 49 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 676f32cd..aa938ed1 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -5,8 +5,36 @@ on: types: [published] jobs: - publish: + build_binary_manylinux: + runs-on: ubuntu-latest + container: quay.io/pypa/manylinux_2_24_x86_64 + + strategy: + matrix: + python-version: + - cp37-cp37m + - cp38-cp38 + - cp39-cp39 + - cp310-cp310 + + steps: + - uses: actions/checkout@v2 + + - name: Build Python wheels + # Build linux wheels with the image then use auditwheel + # to convert to it a manylinux wheel. + env: + PYTHON_VERSION: ${{ matrix.python-version }} + run: | + /opt/python/$PYTHON_VERSION/bin/python -m build --wheel + find dist/ -type f -name *.whl | xargs -L 1 auditwheel repair --wheel-dir dist/ + + - uses: actions/upload-artifact@v2 + with: + name: dist + path: dist/*manylinux*.whl + build_source: runs-on: ubuntu-latest steps: @@ -15,7 +43,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: "3.9" + python-version: "3.10" - name: Install dependencies run: | @@ -25,6 +53,23 @@ jobs: - name: Build package run: python setup.py sdist + - uses: actions/upload-artifact@v2 + with: + name: dist + path: dist/*.tar.gz + + publish: + needs: [build_source, build_binary_manylinux] + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - uses: actions/download-artifact@v2 + with: + name: dist + path: dist/ + - name: Publish package to PyPI # All files in dist/ are published uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/pyproject.toml b/pyproject.toml index 374b58cb..8d91941b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] requires = [ - "setuptools>=42", + "setuptools", "wheel" ] build-backend = "setuptools.build_meta" diff --git a/source/MulensModel/version.py b/source/MulensModel/version.py index 7f908504..6c8e6b97 100644 --- a/source/MulensModel/version.py +++ b/source/MulensModel/version.py @@ -1 +1 @@ -__version__ = "2.7.2" +__version__ = "0.0.0" From 7a9c7ac209e67b131be6f1d59ff02383223664be Mon Sep 17 00:00:00 2001 From: "Keto D. Zhang" Date: Mon, 14 Mar 2022 11:05:27 -0700 Subject: [PATCH 2/3] Don't require binary distribution to succeed --- .github/workflows/publish.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index aa938ed1..1aa34077 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,3 +1,11 @@ +# This workflow is triggered by a new release on GitHub and then uploads +# MulensModel package to PyPI. +# +# If the publish step finishes succesfully, the source distribution is +# guaranteed to be published. Binary distributions are published only if +# their respective build steps passes. If any binary distribution fails, +# package maintainers may manually debug, build, and publish without the +# automated workflow. name: Upload Python Package to PyPI on: @@ -30,6 +38,8 @@ jobs: find dist/ -type f -name *.whl | xargs -L 1 auditwheel repair --wheel-dir dist/ - uses: actions/upload-artifact@v2 + # Only upload manylinux wheels to artifact. + # Normal linux wheels is not allowed in PyPI with: name: dist path: dist/*manylinux*.whl @@ -59,7 +69,9 @@ jobs: path: dist/*.tar.gz publish: - needs: [build_source, build_binary_manylinux] + # Publish to PyPI and update GitHub release + # Here we require only the source build to start publishing + needs: [build_source] runs-on: ubuntu-latest steps: From 9bc713b15beec5eeadc46c4e285e7bef979a1a64 Mon Sep 17 00:00:00 2001 From: "Keto D. Zhang" Date: Mon, 14 Mar 2022 11:09:21 -0700 Subject: [PATCH 3/3] Undo version --- source/MulensModel/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/MulensModel/version.py b/source/MulensModel/version.py index 6c8e6b97..7f908504 100644 --- a/source/MulensModel/version.py +++ b/source/MulensModel/version.py @@ -1 +1 @@ -__version__ = "0.0.0" +__version__ = "2.7.2"