Python 3.13 image building is faling
See example job.
The psycopg2-binary package doesn't ship wheels for Python 3.13. In a different world we maybe should have installed the package from source but, as a workaround, ensure that the required packages to install from source are added to the Python image.
Relevant logs:
#9 [linux/amd64 2/2] RUN apt-get update && apt -y dist-upgrade && apt-get clean && pip install --no-cache-dir --upgrade pip && ([ -z "psycopg2-binary psycopg[binary] cffi cryptography lxml google-api-core[grpc]" ] || pip install --no-cache-dir --upgrade --no-cache psycopg2-binary psycopg[binary] cffi cryptography lxml google-api-core[grpc])
#9 0.113 Get:1 http://deb.debian.org/debian bookworm InRelease [151 kB]
#9 0.129 Get:2 http://deb.debian.org/debian bookworm-updates InRelease [55.4 kB]
#9 0.131 Get:3 http://deb.debian.org/debian-security bookworm-security InRelease [48.0 kB]
#9 0.202 Get:4 http://deb.debian.org/debian bookworm/main amd64 Packages [8787 kB]
#9 0.296 Get:5 http://deb.debian.org/debian bookworm-updates/main amd64 Packages [2468 B]
#9 0.333 Get:6 http://deb.debian.org/debian-security bookworm-security/main amd64 Packages [188 kB]
#9 1.495 Fetched 9232 kB in 1s (6574 kB/s)
#9 1.495 Reading package lists...
#9 2.133
#9 2.133 WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
#9 2.133
#9 2.135 Reading package lists...
#9 2.734 Building dependency tree...
#9 2.889 Reading state information...
#9 2.948 Calculating upgrade...
#9 3.221 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
#9 4.919 Requirement already satisfied: pip in /usr/local/lib/python3.13/site-packages (24.2)
#9 5.062 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable.It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning.
#9 5.947 Collecting psycopg2-binary
#9 6.004 Downloading psycopg2-binary-2.9.9.tar.gz (384 kB)
#9 6.099 Installing build dependencies: started
#9 8.062 Installing build dependencies: finished with status 'done'
#9 8.064 Getting requirements to build wheel: started
#9 8.306 Getting requirements to build wheel: finished with status 'error'
#9 8.313 error: subprocess-exited-with-error
#9 8.313
#9 8.313 × Getting requirements to build wheel did not run successfully.
#9 8.313 │ exit code: 1
#9 8.313 ╰─> [21 lines of output]
#9 8.313 running egg_info
#9 8.313 writing psycopg2_binary.egg-info/PKG-INFO
#9 8.313 writing dependency_links to psycopg2_binary.egg-info/dependency_links.txt
#9 8.313 writing top-level names to psycopg2_binary.egg-info/top_level.txt
#9 8.313
#9 8.313 Error: pg_config executable not found.
#9 8.313
#9 8.313 pg_config is required to build psycopg2 from source. Please add the directory
#9 8.313 containing pg_config to the $PATH or specify the full executable path with the
#9 8.313 option:
#9 8.313
#9 8.313 python setup.py build_ext --pg-config /path/to/pg_config build ...
#9 8.313
#9 8.313 or with the pg_config option in 'setup.cfg'.
#9 8.313
#9 8.313 If you prefer to avoid building psycopg2 from source, please install the PyPI
#9 8.313 'psycopg2-binary' package instead.
#9 8.313
#9 8.313 For further information please check the 'doc/src/install.rst' file (also at
#9 8.313 <https://www.psycopg.org/docs/install.html>).
#9 8.313
#9 8.313 [end of output]
#9 8.313
#9 8.313 note: This error originates from a subprocess, and is likely not a problem with pip.
#9 8.474 error: subprocess-exited-with-error
#9 8.474
#9 8.474 × Getting requirements to build wheel did not run successfully.
#9 8.474 │ exit code: 1
#9 8.474 ╰─> See above for output.
#9 8.474
#9 8.474 note: This error originates from a subprocess, and is likely not a problem with pip.