diff options
author | Federico Caselli <cfederico87@gmail.com> | 2020-08-17 23:29:50 +0200 |
---|---|---|
committer | Federico Caselli <cfederico87@gmail.com> | 2020-08-17 23:48:21 +0200 |
commit | e7875b39f8e28e0c27d96926f7cab3f7839c0250 (patch) | |
tree | 57061ea1d2fa7ecb5dd2db92b6b7de1d48f18a51 | |
parent | 5b44be7a13ccefc46b8a69fd95677051de5f3bf7 (diff) | |
download | sqlalchemy-e7875b39f8e28e0c27d96926f7cab3f7839c0250.tar.gz |
Fix wheel check in linux workflow and improve it
Change-Id: I3b208674649e41bca0285d00aa11cc5975eb971a
-rw-r--r-- | .github/workflows/create-wheels.yaml | 6 | ||||
-rw-r--r-- | .github/workflows/scripts/can_install.py | 24 |
2 files changed, 26 insertions, 4 deletions
diff --git a/.github/workflows/create-wheels.yaml b/.github/workflows/create-wheels.yaml index 1861353a6..f1c8b04f1 100644 --- a/.github/workflows/create-wheels.yaml +++ b/.github/workflows/create-wheels.yaml @@ -214,10 +214,8 @@ jobs: # - check the c extension # - runs the tests run: | - pip install -q wheel - version=`python -W ignore -c 'from wheel.pep425tags import get_abbr_impl, get_impl_ver, get_abi_tag; print("{0}{1}-{2}".format(get_abbr_impl(), get_impl_ver(), get_abi_tag()))'` - echo Wheel tag ${{ matrix.python-version }}. Installed version $version. - if [[ "${{ matrix.python-version }}" = "$version" ]] + pip install packaging>=20.4 + if python .github/workflows/scripts/can_install.py "${{ matrix.python-version }}" then pip install -f dist --no-index sqlalchemy python -c 'from sqlalchemy import cprocessors, cresultproxy, cutils' diff --git a/.github/workflows/scripts/can_install.py b/.github/workflows/scripts/can_install.py new file mode 100644 index 000000000..61685d978 --- /dev/null +++ b/.github/workflows/scripts/can_install.py @@ -0,0 +1,24 @@ +import sys +from packaging import tags + +to_check = "--" +found = False +if len(sys.argv) > 1: + to_check = sys.argv[1] + for t in tags.sys_tags(): + start = "-".join(str(t).split("-")[:2]) + if to_check.lower() == start: + print( + "Wheel tag {0} matches installed version {1}.".format( + to_check, t + ) + ) + found = True + break +if not found: + print( + "Wheel tag {0} not found in installed version tags {1}.".format( + to_check, [str(t) for t in tags.sys_tags()] + ) + ) + exit(1) |