]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
Run windows tests in a way more similar to the built packages
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sat, 21 Aug 2021 01:14:52 +0000 (03:14 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sat, 21 Aug 2021 01:50:53 +0000 (03:50 +0200)
.github/workflows/tests.yml
psycopg_c/setup.py

index 9aa107db3c4ea4622773cf661cd2bddb3bff3499..274cb95c948d7263dcd9e563ede3b6594afd4dd8 100644 (file)
@@ -158,21 +158,15 @@ jobs:
         run: tox -c psycopg -e ${{ matrix.python }} -- --color yes
 
       # Build a wheel package of the C extensions.
-      # Specify a pg_config explicitly because there are wrong ones along the
-      # path (https://github.com/actions/virtual-environments/issues/3730).
-      #
-      # Don't add the Postgres bindir to the path because that causes problems
-      # in delocating (https://github.com/pypa/cibuildwheel/issues/766).
-      #
       # If the wheel is not delocated, import fails with some dll not found
       # (but it won't tell which one).
       - name: Build the C wheel
         if: ${{ matrix.impl == 'c' }}
         run: |
-          $env:PG_CONFIG = "C:\Program Files\PostgreSQL\13\bin\pg_config.exe"
+          $env:Path = "C:\Program Files\PostgreSQL\13\bin\;$env:Path"
           python ./psycopg_c/setup.py bdist_wheel
           pip install delvewheel
-          &"delvewheel" repair @(Get-ChildItem psycopg_c\dist\*.whl)
+          &"delvewheel" repair --no-mangle libiconv-2.dll @(Get-ChildItem psycopg_c\dist\*.whl)
 
       # tox will only build the package from sdist, not from wheel, so we can't
       # use it for testing. Just test everything in the global installation.
@@ -181,4 +175,6 @@ jobs:
         run: |
           pip install ./psycopg/[test]
           &"pip" install @(Get-ChildItem wheelhouse\*.whl)
+          # Fix the path for the tests using ctypes
+          $env:Path = "C:\Program Files\PostgreSQL\13\bin\;$env:Path"
           pytest --color yes
index 6e131db5f7d7e93df1e22750146305da40245aca..71ea0af47c7356200d80c586a11beea19e3a067f 100644 (file)
@@ -29,9 +29,7 @@ with open("psycopg_c/version.py") as f:
 
 
 def get_config(what: str) -> str:
-    # Allow to specify PG_CONFIG using an env var
-    # Changing the path in the cibuildwheel image seems difficult
-    pg_config = os.environ.get("PG_CONFIG", "pg_config")
+    pg_config = "pg_config"
     try:
         out = sp.run([pg_config, f"--{what}"], stdout=sp.PIPE, check=True)
     except Exception as e: