From 046fbe9de956cd8a8f59d92645358cb4470fcf47 Mon Sep 17 00:00:00 2001 From: Roman Yurchak Date: Fri, 26 Jun 2020 21:51:28 +0200 Subject: [PATCH 01/12] Add cibuildwheel setup --- .github/workflows/build-wheels.yml | 69 ++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 .github/workflows/build-wheels.yml diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml new file mode 100644 index 00000000..d8f4ac6b --- /dev/null +++ b/.github/workflows/build-wheels.yml @@ -0,0 +1,69 @@ +name: Build and upload to PyPI + +on: [push, pull_request] + +jobs: + build_wheels: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-18.04, windows-latest, macos-latest] + + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-python@v2 + name: Install Python + with: + python-version: '3.7' + + - name: Install cibuildwheel + run: | + python -m pip install cibuildwheel==1.5.1 + - name: Install Visual C++ for Python 2.7 + if: runner.os == 'Windows' + run: | + choco install vcpython27 -f -y + - name: Build wheels + run: | + python -m cibuildwheel --output-dir wheelhouse + - uses: actions/upload-artifact@v2 + with: + path: ./wheelhouse/*.whl + + build_sdist: + name: Build source distribution + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-python@v2 + name: Install Python + with: + python-version: '3.7' + + - name: Build sdist + run: python setup.py sdist + + - uses: actions/upload-artifact@v2 + with: + path: dist/*.tar.gz + + upload_pypi: + needs: [build_wheels, build_sdist] + runs-on: ubuntu-latest + # upload to PyPI on every tag starting with 'v' + # if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') + steps: + - uses: actions/download-artifact@v2 + with: + name: artifact + path: dist + + - uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.pypi_password }} + # To test: + repository_url: https://test.pypi.org/legacy/ From c502847ba33d4d4828d0eb7c67e6523f2ebe052c Mon Sep 17 00:00:00 2001 From: Roman Yurchak Date: Fri, 26 Jun 2020 22:00:25 +0200 Subject: [PATCH 02/12] Re-trigger CI --- .github/workflows/build-wheels.yml | 69 ---------------------- .github/workflows/python-package.yml | 88 +++++++++++++++++++--------- 2 files changed, 61 insertions(+), 96 deletions(-) delete mode 100644 .github/workflows/build-wheels.yml diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml deleted file mode 100644 index d8f4ac6b..00000000 --- a/.github/workflows/build-wheels.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: Build and upload to PyPI - -on: [push, pull_request] - -jobs: - build_wheels: - name: Build wheels on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-18.04, windows-latest, macos-latest] - - steps: - - uses: actions/checkout@v2 - - - uses: actions/setup-python@v2 - name: Install Python - with: - python-version: '3.7' - - - name: Install cibuildwheel - run: | - python -m pip install cibuildwheel==1.5.1 - - name: Install Visual C++ for Python 2.7 - if: runner.os == 'Windows' - run: | - choco install vcpython27 -f -y - - name: Build wheels - run: | - python -m cibuildwheel --output-dir wheelhouse - - uses: actions/upload-artifact@v2 - with: - path: ./wheelhouse/*.whl - - build_sdist: - name: Build source distribution - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - uses: actions/setup-python@v2 - name: Install Python - with: - python-version: '3.7' - - - name: Build sdist - run: python setup.py sdist - - - uses: actions/upload-artifact@v2 - with: - path: dist/*.tar.gz - - upload_pypi: - needs: [build_wheels, build_sdist] - runs-on: ubuntu-latest - # upload to PyPI on every tag starting with 'v' - # if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') - steps: - - uses: actions/download-artifact@v2 - with: - name: artifact - path: dist - - - uses: pypa/gh-action-pypi-publish@master - with: - user: __token__ - password: ${{ secrets.pypi_password }} - # To test: - repository_url: https://test.pypi.org/legacy/ diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 25a61478..d8f4ac6b 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -1,35 +1,69 @@ -# This workflow will install Python dependencies, run tests and lint with a variety of Python versions -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - -name: Python package +name: Build and upload to PyPI on: [push, pull_request] jobs: - build: - - runs-on: ubuntu-latest + build_wheels: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: matrix: - python-version: [3.6, 3.7, 3.8] + os: [ubuntu-18.04, windows-latest, macos-latest] + + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-python@v2 + name: Install Python + with: + python-version: '3.7' + - name: Install cibuildwheel + run: | + python -m pip install cibuildwheel==1.5.1 + - name: Install Visual C++ for Python 2.7 + if: runner.os == 'Windows' + run: | + choco install vcpython27 -f -y + - name: Build wheels + run: | + python -m cibuildwheel --output-dir wheelhouse + - uses: actions/upload-artifact@v2 + with: + path: ./wheelhouse/*.whl + + build_sdist: + name: Build source distribution + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install flake8 pytest - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - name: Lint with flake8 - run: | - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Test with pytest - run: | - pytest + - uses: actions/checkout@v2 + + - uses: actions/setup-python@v2 + name: Install Python + with: + python-version: '3.7' + + - name: Build sdist + run: python setup.py sdist + + - uses: actions/upload-artifact@v2 + with: + path: dist/*.tar.gz + + upload_pypi: + needs: [build_wheels, build_sdist] + runs-on: ubuntu-latest + # upload to PyPI on every tag starting with 'v' + # if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') + steps: + - uses: actions/download-artifact@v2 + with: + name: artifact + path: dist + + - uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.pypi_password }} + # To test: + repository_url: https://test.pypi.org/legacy/ From 7cde119b38c4402eba74ad894c101cdc55f8ff3b Mon Sep 17 00:00:00 2001 From: Roman Yurchak Date: Fri, 26 Jun 2020 22:05:13 +0200 Subject: [PATCH 03/12] More fixes --- .github/workflows/{python-package.yml => build-wheels.yml} | 3 +++ 1 file changed, 3 insertions(+) rename .github/workflows/{python-package.yml => build-wheels.yml} (93%) diff --git a/.github/workflows/python-package.yml b/.github/workflows/build-wheels.yml similarity index 93% rename from .github/workflows/python-package.yml rename to .github/workflows/build-wheels.yml index d8f4ac6b..a0f01bc1 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/build-wheels.yml @@ -26,6 +26,9 @@ jobs: run: | choco install vcpython27 -f -y - name: Build wheels + env: + CIBW_SKIP: "pp*-win* *p27* *p34*" + CIBW_BEFORE_BUILD: "pip install numpy cython" run: | python -m cibuildwheel --output-dir wheelhouse - uses: actions/upload-artifact@v2 From d0cd090301b98d33d24273cf40643f3069d76218 Mon Sep 17 00:00:00 2001 From: Roman Yurchak Date: Fri, 26 Jun 2020 22:11:10 +0200 Subject: [PATCH 04/12] Iter --- .github/workflows/build-wheels.yml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index a0f01bc1..36e41f23 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -1,10 +1,10 @@ -name: Build and upload to PyPI +name: build_wheels on: [push, pull_request] jobs: build_wheels: - name: Build wheels on ${{ matrix.os }} + name: ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: matrix: @@ -17,18 +17,12 @@ jobs: name: Install Python with: python-version: '3.7' - - name: Install cibuildwheel run: | python -m pip install cibuildwheel==1.5.1 - - name: Install Visual C++ for Python 2.7 - if: runner.os == 'Windows' - run: | - choco install vcpython27 -f -y - name: Build wheels env: - CIBW_SKIP: "pp*-win* *p27* *p34*" - CIBW_BEFORE_BUILD: "pip install numpy cython" + CIBW_SKIP: "pp*-win* *p27* *p35*" run: | python -m cibuildwheel --output-dir wheelhouse - uses: actions/upload-artifact@v2 @@ -36,7 +30,7 @@ jobs: path: ./wheelhouse/*.whl build_sdist: - name: Build source distribution + name: sdist runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -46,6 +40,9 @@ jobs: with: python-version: '3.7' + - name: Install dependencies + run: pip install setuptools cython numpy + - name: Build sdist run: python setup.py sdist From 8a5e4354c9bb222fab378110e9674921d2ee51b1 Mon Sep 17 00:00:00 2001 From: Roman Yurchak Date: Fri, 26 Jun 2020 22:29:27 +0200 Subject: [PATCH 05/12] Skip manylinux1 --- .github/workflows/build-wheels.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 36e41f23..ad8827ac 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -22,7 +22,8 @@ jobs: python -m pip install cibuildwheel==1.5.1 - name: Build wheels env: - CIBW_SKIP: "pp*-win* *p27* *p35*" + # we only build for Python 3.6+. On Linux manylinux2010 is used. + CIBW_SKIP: "pp*-win* *p27* *p35*" "*manylinux1*" run: | python -m cibuildwheel --output-dir wheelhouse - uses: actions/upload-artifact@v2 @@ -54,7 +55,7 @@ jobs: needs: [build_wheels, build_sdist] runs-on: ubuntu-latest # upload to PyPI on every tag starting with 'v' - # if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') steps: - uses: actions/download-artifact@v2 with: From d3edd565233d1db14e5761064d4115f0e18a71c5 Mon Sep 17 00:00:00 2001 From: Roman Yurchak Date: Fri, 26 Jun 2020 22:31:36 +0200 Subject: [PATCH 06/12] Fix typo --- .github/workflows/build-wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index ad8827ac..83e808b3 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -23,7 +23,7 @@ jobs: - name: Build wheels env: # we only build for Python 3.6+. On Linux manylinux2010 is used. - CIBW_SKIP: "pp*-win* *p27* *p35*" "*manylinux1*" + CIBW_SKIP: "pp*-win* *p27* *p35* *manylinux1*" run: | python -m cibuildwheel --output-dir wheelhouse - uses: actions/upload-artifact@v2 From 95299d0937dde9fe27cc420d3b28c32b4b5eba63 Mon Sep 17 00:00:00 2001 From: Roman Yurchak Date: Fri, 26 Jun 2020 22:44:31 +0200 Subject: [PATCH 07/12] Test wheels --- .github/workflows/build-wheels.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 83e808b3..31b58e09 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -24,6 +24,8 @@ jobs: env: # we only build for Python 3.6+. On Linux manylinux2010 is used. CIBW_SKIP: "pp*-win* *p27* *p35* *manylinux1*" + CIBW_TEST_REQUIRES: "pytest pandas scikit-learn" + CIBW_TEST_COMMAND: "pytest {package}" run: | python -m cibuildwheel --output-dir wheelhouse - uses: actions/upload-artifact@v2 From de3a601684ed8078a564b1dc715077a7e8641f2b Mon Sep 17 00:00:00 2001 From: Roman Yurchak Date: Fri, 26 Jun 2020 22:51:26 +0200 Subject: [PATCH 08/12] Fix tests --- .github/workflows/build-wheels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 31b58e09..f9bf4a08 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -23,9 +23,9 @@ jobs: - name: Build wheels env: # we only build for Python 3.6+. On Linux manylinux2010 is used. - CIBW_SKIP: "pp*-win* *p27* *p35* *manylinux1*" + CIBW_SKIP: "pp*-win* *p27* *p35* CIBW_TEST_REQUIRES: "pytest pandas scikit-learn" - CIBW_TEST_COMMAND: "pytest {package}" + CIBW_TEST_COMMAND: "pytest {package}/sklearn_extra" run: | python -m cibuildwheel --output-dir wheelhouse - uses: actions/upload-artifact@v2 From f18c9fc80e70ac34dbc7f9e9f36492b935095ac9 Mon Sep 17 00:00:00 2001 From: Roman Yurchak Date: Fri, 26 Jun 2020 22:56:36 +0200 Subject: [PATCH 09/12] Fix syntax --- .github/workflows/build-wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index f9bf4a08..56eb8db8 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -23,7 +23,7 @@ jobs: - name: Build wheels env: # we only build for Python 3.6+. On Linux manylinux2010 is used. - CIBW_SKIP: "pp*-win* *p27* *p35* + CIBW_SKIP: "pp*-win* *p27* *p35*" CIBW_TEST_REQUIRES: "pytest pandas scikit-learn" CIBW_TEST_COMMAND: "pytest {package}/sklearn_extra" run: | From 6ebbdd37b8372c4a24392ad6edf168e2074b033b Mon Sep 17 00:00:00 2001 From: Roman Yurchak Date: Fri, 26 Jun 2020 23:01:28 +0200 Subject: [PATCH 10/12] Try pytest --pyargs --- .github/workflows/build-wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 56eb8db8..80112c66 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -25,7 +25,7 @@ jobs: # we only build for Python 3.6+. On Linux manylinux2010 is used. CIBW_SKIP: "pp*-win* *p27* *p35*" CIBW_TEST_REQUIRES: "pytest pandas scikit-learn" - CIBW_TEST_COMMAND: "pytest {package}/sklearn_extra" + CIBW_TEST_COMMAND: "pytest --pyargs sklearn_extra" run: | python -m cibuildwheel --output-dir wheelhouse - uses: actions/upload-artifact@v2 From fb989756befdb85df53ff10db3dd61110d77f96d Mon Sep 17 00:00:00 2001 From: Roman Yurchak Date: Fri, 26 Jun 2020 23:18:41 +0200 Subject: [PATCH 11/12] Skip pypy wheels --- .github/workflows/build-wheels.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 80112c66..23bc2661 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -22,8 +22,9 @@ jobs: python -m pip install cibuildwheel==1.5.1 - name: Build wheels env: - # we only build for Python 3.6+. On Linux manylinux2010 is used. - CIBW_SKIP: "pp*-win* *p27* *p35*" + # We only build for Python 3.6+. On Linux manylinux2010 is used. + # Skipping pypy wheels since scipy & scikit-learn haven't built them yet. + CIBW_SKIP: "pp*-win* *p27* *p35* *pypy*" CIBW_TEST_REQUIRES: "pytest pandas scikit-learn" CIBW_TEST_COMMAND: "pytest --pyargs sklearn_extra" run: | From 6306d65b6b4a3c52d362e3f33d5196b56dc66bc4 Mon Sep 17 00:00:00 2001 From: Roman Yurchak Date: Fri, 26 Jun 2020 23:40:42 +0200 Subject: [PATCH 12/12] Skip pypy wheels for good --- .github/workflows/build-wheels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 23bc2661..5988eca1 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -23,8 +23,8 @@ jobs: - name: Build wheels env: # We only build for Python 3.6+. On Linux manylinux2010 is used. - # Skipping pypy wheels since scipy & scikit-learn haven't built them yet. - CIBW_SKIP: "pp*-win* *p27* *p35* *pypy*" + # Skipping pypy wheels for now since scipy & scikit-learn haven't build them yet. + CIBW_SKIP: "pp* *p27* *p35*" CIBW_TEST_REQUIRES: "pytest pandas scikit-learn" CIBW_TEST_COMMAND: "pytest --pyargs sklearn_extra" run: |