From ecb23d2a0848b7ae972cb04e2774ff82cc226174 Mon Sep 17 00:00:00 2001 From: Nikolaus Waxweiler Date: Mon, 9 Aug 2021 14:38:38 +0100 Subject: [PATCH 1/8] Build sdist and pure wheel, set CU2QU_WITH_CYTHON for binaries --- .github/workflows/ci.yml | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0de5c56..1b080dd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,7 @@ on: jobs: - build: + build-binaries: name: Build wheel ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: @@ -18,6 +18,8 @@ jobs: os: [ "ubuntu-20.04", "windows-2019", "macos-11" ] env: CIBW_ARCHS: auto64 + CIBW_SKIP: pp* + CU2QU_WITH_CYTHON: true steps: - uses: actions/checkout@v2 with: @@ -35,11 +37,36 @@ jobs: name: wheels-${{ matrix.os }} path: dist/*.whl + build-pure: + name: Build sdist and pure wheel + runs-on: "ubuntu-20.04" + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + fetch-depth: 0 + # Use PyPy just so we can test the package on it. + - uses: actions/setup-python@v2 + with: + python-version: 'pypy-3.7' + - name: Install tox + run: python -m pip install tox + - name: Run tox + run: tox -e py-nocy + - name: Build wheels + run: tox -e pure-wheel + - uses: actions/upload-artifact@v2 + with: + name: wheels-pure + path: | + dist/*.whl + dist/*.zip + deploy: # only run if the commit is tagged... if: startsWith(github.ref, 'refs/tags/v') # ... and all build jobs completed successfully - needs: [build] + needs: [build-binaries, build-pure] runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -101,5 +128,4 @@ jobs: else echo "DEBUG: This is a final release" fi - python setup.py sdist - twine upload dist/wheels-*/*.whl dist/*.zip + twine upload dist/wheels-*/*.whl dist/wheels-*/*.zip From dbf86b0604803f73cf50e3925130e487c52a0c79 Mon Sep 17 00:00:00 2001 From: Nikolaus Waxweiler Date: Mon, 9 Aug 2021 14:45:24 +0100 Subject: [PATCH 2/8] Try and pass CU2QU_WITH_CYTHON into CIBW --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1b080dd..331f5ff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: env: CIBW_ARCHS: auto64 CIBW_SKIP: pp* - CU2QU_WITH_CYTHON: true + CIBW_ENVIRONMENT: CU2QU_WITH_CYTHON="true" steps: - uses: actions/checkout@v2 with: @@ -27,9 +27,9 @@ jobs: fetch-depth: 0 - uses: actions/setup-python@v2 with: - python-version: 3.9 + python-version: "3.x" - name: Install cibuildwheel - run: python -m pip install cibuildwheel==2.0.1 + run: python -m pip install -U pip cibuildwheel==2.0.1 - name: Build wheels run: python -m cibuildwheel --output-dir dist - uses: actions/upload-artifact@v2 From af3cb8afe7a80d88221593563696037e776d3603 Mon Sep 17 00:00:00 2001 From: Nikolaus Waxweiler Date: Mon, 9 Aug 2021 14:50:40 +0100 Subject: [PATCH 3/8] Install test deps --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index ca28293..1a99925 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,4 +9,5 @@ build-backend = "setuptools.build_meta" [tool.cibuildwheel] test-requires = "pytest" +before-test = "pip install -r requirements.txt" test-command = "pytest {project}/tests" From 493104896f3604e5bb3770f4d1219e2a71ee8ef0 Mon Sep 17 00:00:00 2001 From: Nikolaus Waxweiler Date: Mon, 9 Aug 2021 15:10:20 +0100 Subject: [PATCH 4/8] Don't use tox for building --- .github/workflows/ci.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 331f5ff..c26c25b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,11 +50,9 @@ jobs: with: python-version: 'pypy-3.7' - name: Install tox - run: python -m pip install tox - - name: Run tox - run: tox -e py-nocy - - name: Build wheels - run: tox -e pure-wheel + run: python -m pip install -U pip setuptools wheel + - name: Build sdist and pure wheel + run: python setup.py sdist bdist_wheel - uses: actions/upload-artifact@v2 with: name: wheels-pure From b53e884a9b67b7bcc55fd46ae2a670393dd8f0fb Mon Sep 17 00:00:00 2001 From: Nikolaus Waxweiler Date: Mon, 9 Aug 2021 15:20:30 +0100 Subject: [PATCH 5/8] Add testing on pypy --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c26c25b..ea892d0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,7 +50,9 @@ jobs: with: python-version: 'pypy-3.7' - name: Install tox - run: python -m pip install -U pip setuptools wheel + run: python -m pip install -U pip setuptools wheel pytest -r requirements.txt + - name: Test + run: pytest - name: Build sdist and pure wheel run: python setup.py sdist bdist_wheel - uses: actions/upload-artifact@v2 From a398ff6f95b9d260acf7c25f74d496ea318251ec Mon Sep 17 00:00:00 2001 From: Nikolaus Waxweiler Date: Mon, 9 Aug 2021 15:25:55 +0100 Subject: [PATCH 6/8] Actually install package to test --- .github/workflows/ci.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ea892d0..0834251 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,12 +49,14 @@ jobs: - uses: actions/setup-python@v2 with: python-version: 'pypy-3.7' - - name: Install tox - run: python -m pip install -U pip setuptools wheel pytest -r requirements.txt - - name: Test - run: pytest - name: Build sdist and pure wheel run: python setup.py sdist bdist_wheel + - name: Prepare for testing + run: | + python -m pip install -U pip setuptools wheel pytest -r requirements.txt + python -m pip install dist/*.whl + - name: Test + run: pytest - uses: actions/upload-artifact@v2 with: name: wheels-pure From a6b3f17c77a14b00e31c27354e7b7e031b5cd5d3 Mon Sep 17 00:00:00 2001 From: Nikolaus Waxweiler Date: Mon, 9 Aug 2021 15:30:45 +0100 Subject: [PATCH 7/8] Make wheel available earlier --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0834251..144aa9e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,12 +49,12 @@ jobs: - uses: actions/setup-python@v2 with: python-version: 'pypy-3.7' + - name: Install packaging tooling + run: python -m pip install -U pip setuptools wheel - name: Build sdist and pure wheel run: python setup.py sdist bdist_wheel - name: Prepare for testing - run: | - python -m pip install -U pip setuptools wheel pytest -r requirements.txt - python -m pip install dist/*.whl + run: python -m pip install pytest -r requirements.txt dist/*.whl - name: Test run: pytest - uses: actions/upload-artifact@v2 From 879370cbbbbc5e359a5fe58ca3417fcbcdef3b38 Mon Sep 17 00:00:00 2001 From: Nikolaus Waxweiler Date: Mon, 9 Aug 2021 16:56:50 +0100 Subject: [PATCH 8/8] Try cross-compiling ARM wheels on macOS --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 144aa9e..250817a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,8 @@ jobs: os: [ "ubuntu-20.04", "windows-2019", "macos-11" ] env: CIBW_ARCHS: auto64 + # macOS: Explicitly list ARM variants here for cross-compilation. + CIBW_ARCHS_MACOS: "x86_64 universal2 arm64" CIBW_SKIP: pp* CIBW_ENVIRONMENT: CU2QU_WITH_CYTHON="true" steps: