From a53cfc6714edef225141f1fdcb057693ad90bd97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Robert?= Date: Tue, 5 Apr 2022 19:09:08 +0200 Subject: [PATCH 1/2] GHA: Disable all but mingw64 --- .github/workflows/conda.yml | 44 ---------------------- .github/workflows/pip.yml | 24 ------------ .github/workflows/wheels.yml | 73 ------------------------------------ 3 files changed, 141 deletions(-) delete mode 100644 .github/workflows/conda.yml delete mode 100644 .github/workflows/wheels.yml diff --git a/.github/workflows/conda.yml b/.github/workflows/conda.yml deleted file mode 100644 index e3839d0..0000000 --- a/.github/workflows/conda.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Conda - -on: - workflow_dispatch: - push: - branches: - - master - pull_request: - -jobs: - build: - strategy: - fail-fast: false - matrix: - platform: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.6", "3.8"] - - runs-on: ${{ matrix.platform }} - - # The setup-miniconda action needs this to activate miniconda - defaults: - run: - shell: "bash -l {0}" - - steps: - - uses: actions/checkout@v2 - - - name: Get conda - uses: conda-incubator/setup-miniconda@v2.1.1 - with: - python-version: ${{ matrix.python-version }} - channels: conda-forge - - - name: Prepare - run: conda install conda-build conda-verify - - - name: Build - run: conda build conda.recipe - - - name: Install - run: conda install -c ${CONDA_PREFIX}/conda-bld/ python_example - - - name: Test - run: python tests/test.py diff --git a/.github/workflows/pip.yml b/.github/workflows/pip.yml index 9675b18..9cf09eb 100644 --- a/.github/workflows/pip.yml +++ b/.github/workflows/pip.yml @@ -8,30 +8,6 @@ on: - master jobs: - build: - strategy: - fail-fast: false - matrix: - platform: [windows-latest, macos-latest, ubuntu-latest] - python-version: ["3.6", "3.10"] - - runs-on: ${{ matrix.platform }} - - steps: - - uses: actions/checkout@v2 - - - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Add requirements - run: python -m pip install --upgrade wheel setuptools - - - name: Build and install - run: pip install --verbose . - - - name: Test - run: python tests/test.py build-mingw64: runs-on: windows-latest diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml deleted file mode 100644 index a1454f1..0000000 --- a/.github/workflows/wheels.yml +++ /dev/null @@ -1,73 +0,0 @@ -name: Wheels - -on: - workflow_dispatch: - pull_request: - push: - branches: - - master - release: - types: - - published - -jobs: - build_sdist: - name: Build SDist - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Build SDist - run: pipx run build --sdist - - - name: Check metadata - run: pipx run twine check dist/* - - - uses: actions/upload-artifact@v2 - with: - path: dist/*.tar.gz - - - build_wheels: - name: Wheels on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - - steps: - - uses: actions/checkout@v2 - - - uses: pypa/cibuildwheel@v2.3.1 - env: - CIBW_ARCHS_MACOS: auto universal2 - - - name: Verify clean directory - run: git diff --exit-code - shell: bash - - - name: Upload wheels - uses: actions/upload-artifact@v2 - with: - path: wheelhouse/*.whl - - - upload_all: - name: Upload if release - needs: [build_wheels, build_sdist] - runs-on: ubuntu-latest - if: github.event_name == 'release' && github.event.action == 'published' - - steps: - - uses: actions/setup-python@v2 - - - uses: actions/download-artifact@v2 - with: - name: artifact - path: dist - - - uses: pypa/gh-action-pypi-publish@v1.4.2 - with: - user: __token__ - password: ${{ secrets.pypi_password }} From 0fcb53318a78ccfb0c7a695789565695ed0ac3f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Robert?= Date: Fri, 8 Apr 2022 10:42:55 +0200 Subject: [PATCH 2/2] GHA: Fix Mingw64 pip install --- .github/workflows/pip.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pip.yml b/.github/workflows/pip.yml index 9cf09eb..08e1963 100644 --- a/.github/workflows/pip.yml +++ b/.github/workflows/pip.yml @@ -21,11 +21,22 @@ jobs: install: >- mingw-w64-x86_64-gcc mingw-w64-x86_64-python-pip + mingw-w64-x86_64-python-wheel - uses: actions/checkout@v2 + - name: Install pybind11 + # This is required because --no-build-isolation disable dependences + # installation + run: pip install pybind11 + - name: Build and install - run: pip install . + # --no-build-isolation is required because the vanilla setuptool does not + # support Mingw64.See patches here: + # https://github.com/msys2/MINGW-packages/tree/master/mingw-w64-python-setuptools + # Without those patches build_ext fails with: + # error: --plat-name must be one of ('win32', 'win-amd64', 'win-arm32', 'win-arm64') + run: pip install --no-build-isolation . - name: Test run: python tests/test.py