]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Fix wheel check in linux workflow and improve it
authorFederico Caselli <cfederico87@gmail.com>
Mon, 17 Aug 2020 21:29:50 +0000 (23:29 +0200)
committerFederico Caselli <cfederico87@gmail.com>
Mon, 17 Aug 2020 21:48:21 +0000 (23:48 +0200)
Change-Id: I3b208674649e41bca0285d00aa11cc5975eb971a

.github/workflows/create-wheels.yaml
.github/workflows/scripts/can_install.py [new file with mode: 0644]

index 1861353a68ad6d34305557b3b882eb426621a68a..f1c8b04f1e61e6d69894799489df3fe3ee83b545 100644 (file)
@@ -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 (file)
index 0000000..61685d9
--- /dev/null
@@ -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)