From 0c6c235e4aadb571cb6904909272a679b95dec49 Mon Sep 17 00:00:00 2001 From: Federico Caselli Date: Mon, 27 Jul 2020 22:31:29 +0200 Subject: [PATCH] Improve github action workflows - in create wheel set minimum versions of setuptools and wheel to avoid failure in python 3.5 with metadata configured in setup.cfg - update action versions - test also cext in the pull requests Change-Id: Iaa5e4e4000c7faa688b51f2f41428c7dd7cae9c3 (cherry picked from commit 8e89f040391cddad1bec9002bbb6b3c39f43445e) --- .github/workflows/create-wheels.yaml | 33 ++++++++++++++-------------- .github/workflows/run-on-pr.yaml | 6 +++-- .github/workflows/run-test.yaml | 2 +- 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/.github/workflows/create-wheels.yaml b/.github/workflows/create-wheels.yaml index e551e3a338..1861353a68 100644 --- a/.github/workflows/create-wheels.yaml +++ b/.github/workflows/create-wheels.yaml @@ -47,7 +47,7 @@ jobs: uses: actions/checkout@v2 - name: Set up Python - uses: actions/setup-python@v1 + uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} architecture: ${{ matrix.architecture }} @@ -72,7 +72,7 @@ jobs: run: | python -m pip install --upgrade pip pip --version - pip install setuptools wheel + pip install setuptools>=44 wheel>=0.34 pip wheel -w dist --no-use-pep517 -v --no-deps . - name: Install wheel @@ -116,7 +116,7 @@ jobs: - name: Set up Python for twine # twine on py2 is very old and is no longer updated, so we change to python 3.8 before upload - uses: actions/setup-python@v1 + uses: actions/setup-python@v2 with: python-version: "3.8" @@ -161,7 +161,7 @@ jobs: steps: - name: Checkout repo uses: actions/checkout@v2 - + - name: Get python version id: linux-py-version env: @@ -174,9 +174,9 @@ jobs: echo "::set-output name=python-version::$version" - name: Set up Python - uses: actions/setup-python@v1 + uses: actions/setup-python@v2 with: - python-version: ${{ steps.linux-py-version.outputs.python-version }} + python-version: ${{ steps.linux-py-version.outputs.python-version }} architecture: ${{ matrix.architecture }} - name: Remove tag_build from setup.cfg @@ -196,17 +196,16 @@ jobs: # this step uses the image provided by pypa here https://github.com/pypa/manylinux to generate the wheels on linux # the action uses the image for manylinux2010 but can generate also a manylinux1 wheel # change the tag of this image to change the image used - # NOTE: the output folder is "wheelhouse", not the classic "dist" - uses: RalfG/python-wheels-manylinux-build@v0.2.2-manylinux2010_x86_64 - # this action generates 3 wheels in wheelhouse/. linux, manylinux1 and manylinux2010 + uses: RalfG/python-wheels-manylinux-build@v0.3-manylinux2010_x86_64 + # this action generates 3 wheels in dist/. linux, manylinux1 and manylinux2010 with: # python-versions is the output of the previous step and is in the form -. Eg cp37-cp37mu python-versions: ${{ matrix.python-version }} - build-requirements: "setuptools wheel" + build-requirements: "setuptools>=44 wheel>=0.34" # Create the wheel using --no-use-pep517 since locally we have pyproject # This flag should be removed once sqlalchemy supports pep517 # `--no-deps` is used to only generate the wheel for the current library. Redundant in sqlalchemy since it has no dependencies - pip-wheel-args: "--no-use-pep517 -v --no-deps" + pip-wheel-args: "-w ./dist --no-use-pep517 -v --no-deps" - name: Check created wheel # check that the wheel is compatible with the current installation. @@ -220,7 +219,7 @@ jobs: echo Wheel tag ${{ matrix.python-version }}. Installed version $version. if [[ "${{ matrix.python-version }}" = "$version" ]] then - pip install -f wheelhouse --no-index sqlalchemy + pip install -f dist --no-index sqlalchemy python -c 'from sqlalchemy import cprocessors, cresultproxy, cutils' pip install pytest pytest-xdist ${{ matrix.extra-requires }} pytest -n2 -q test -k 'not MockReconnectTest' --nomemory @@ -234,7 +233,7 @@ jobs: # the wheel creation step generates 3 wheels: linux, manylinux1 and manylinux2010 # Pypi accepts only the manylinux versions run: | - cd wheelhouse + cd dist echo ::set-output name=wheel1::`ls *manylinux1*` echo ::set-output name=wheel2010::`ls *manylinux2010*` @@ -247,7 +246,7 @@ jobs: # this is a release to the event is called release: https://help.github.com/en/actions/reference/events-that-trigger-workflows#release-event-release # the release event has the structure of this response https://developer.github.com/v3/repos/releases/#create-a-release upload_url: ${{ github.event.release.upload_url }} - asset_path: wheelhouse/${{ steps.wheel-name.outputs.wheel1 }} + asset_path: dist/${{ steps.wheel-name.outputs.wheel1 }} asset_name: ${{ steps.wheel-name.outputs.wheel1 }} asset_content_type: application/zip # application/octet-stream @@ -260,13 +259,13 @@ jobs: # this is a release to the event is called release: https://help.github.com/en/actions/reference/events-that-trigger-workflows#release-event-release # the release event has the structure of this response https://developer.github.com/v3/repos/releases/#create-a-release upload_url: ${{ github.event.release.upload_url }} - asset_path: wheelhouse/${{ steps.wheel-name.outputs.wheel2010 }} + asset_path: dist/${{ steps.wheel-name.outputs.wheel2010 }} asset_name: ${{ steps.wheel-name.outputs.wheel2010 }} asset_content_type: application/zip # application/octet-stream - name: Set up Python for twine # twine on py2 is very old and is no longer updated, so we change to python 3.8 before upload - uses: actions/setup-python@v1 + uses: actions/setup-python@v2 with: python-version: "3.8" @@ -283,4 +282,4 @@ jobs: TWINE_PASSWORD: ${{ secrets.pypi_token }} run: | pip install -U twine - twine upload --skip-existing wheelhouse/*manylinux* + twine upload --skip-existing dist/*manylinux* diff --git a/.github/workflows/run-on-pr.yaml b/.github/workflows/run-on-pr.yaml index 3569105c3e..53b4f5a095 100644 --- a/.github/workflows/run-on-pr.yaml +++ b/.github/workflows/run-on-pr.yaml @@ -25,6 +25,7 @@ jobs: python-version: - "3.8" build-type: + - "cext" - "nocext" architecture: - x64 @@ -37,7 +38,7 @@ jobs: uses: actions/checkout@v2 - name: Set up python - uses: actions/setup-python@v1 + uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} architecture: ${{ matrix.architecture }} @@ -45,7 +46,8 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install tox + pip install --upgrade tox setuptools + pip list - name: Run tests run: tox -e github-${{ matrix.build-type }} -- -q --nomemory ${{ matrix.pytest-args }} diff --git a/.github/workflows/run-test.yaml b/.github/workflows/run-test.yaml index 12b5ebafd4..6a10b9626f 100644 --- a/.github/workflows/run-test.yaml +++ b/.github/workflows/run-test.yaml @@ -74,7 +74,7 @@ jobs: uses: actions/checkout@v2 - name: Set up python - uses: actions/setup-python@v1 + uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} architecture: ${{ matrix.architecture }} -- 2.47.2