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.
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
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: