Skip to content

fix(docker): build psycopg against the system libpq in the pypgstac image - #497

Open
lhoupert wants to merge 2 commits into
stac-utils:v0.10.0from
lhoupert:fix/pypgstac-image-system-libpq
Open

lhoupert wants to merge 2 commits into
stac-utils:v0.10.0from
lhoupert:fix/pypgstac-image-system-libpq

Conversation

@lhoupert

@lhoupert lhoupert commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Technical Context

  • Related Issues: none
  • Breaking Changes: No

Description

The pypgstac image now builds psycopg-c and psycopg2 from source against the image's libpq5 and OpenSSL, instead of installing the -binary wheels, which bundle their own libpq, OpenSSL, Kerberos and LDAP that OS upgrades never patch. Only the Docker build changes (the psycopg and migrations extras keep the binary wheels for pip users), and the build now fails if psycopg doesn't load its C implementation or a -binary wheel comes back.


Checklist

  • Linting: Code is formatted and linted
  • Tests: Tests pass. I have included new tests for these changes where applicable.
  • Edge Cases: I have manually verified "unhappy paths" and edge cases beyond the basic success criteria (e.g., database connection timeouts, malformed input, strict mapping rejections).
  • Documentation: I have updated README.md to reflect any new environment variables, configuration changes, or breaking updates.
  • Accountability: I can explain the implementation logic for every line of code submitted.

AI tool usage

  • AI (Copilot or something similar) supported my development of this PR. See our policy about AI tool use. Use of AI tools must be indicated.

Policy: We require a "human-in-the-loop." You are the author and are fully accountable for all submitted code. Please ensure all tool-generated content is thoroughly reviewed before submission to ensure it is not an "extractive contribution" that squanders maintainer time.

…mage

The -binary wheels bundle their own libpq and OpenSSL, which OS updates do not patch and image scanners do not fully list. The psycopg and migrations extras keep the binary wheels.
@lhoupert

Copy link
Copy Markdown
Contributor Author

CI fails at the image push but not the build. It seems to be because I am pushing that from a fork (denied: installation not allowed to Write organization package). I tested locally the image builds on amd64 and arm64, and test --pypgstac passes against pgstac-postgres:v0.10.1.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant