Bundle pyenv in the Docker image for on-demand Python versions#225
Merged
Oskar Haarklou Veileborg (BarrensZeppelin) merged 2 commits intoJun 3, 2026
Merged
Conversation
Install pyenv (pinned to v2.7.1) just below uv, along with the Alpine build dependencies needed to compile CPython from source. This lets the bundled tooling build/install arbitrary Python versions on demand. Only the `pyenv` binary is symlinked onto the PATH; pyenv's shims directory is deliberately left off PATH so its shims don't shadow the system Python that the CLI runs on. bash is required since pyenv and the pyenv-installer are bash scripts.
|
🚀 Preview package published! Install with: pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple socketsecurity==2.4.1.dev3Docker image: |
Bump version to 2.4.1 and document the pyenv addition. The CLI is unchanged; this release exists to publish a Docker image that includes pyenv for on-demand Python version installation.
f7912a2 to
9a13afe
Compare
Martin Torp (mtorp)
approved these changes
Jun 3, 2026
dcab444
into
main
23 of 24 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds pyenv to the
socketdev/cliDocker image (just below theuvinstall), so the image can build and install arbitrary Python versions on demand. Tracked in ENG-5094.What changed
v2.7.1(latest stable; the coana reference used the olderv2.6.20), via the pyenv-installer.bash+bzip2-dev,libffi-dev,libxslt-dev,linux-headers,ncurses-dev,openssl-dev,readline-dev,sqlite-dev,xz-dev,zlib-dev).bashis required because pyenv and the pyenv-installer are bash scripts.pyenvbinary is symlinked onto thePATH; pyenv's shims directory is intentionally omitted, so its shims don't shadow the system Python the CLI runs on.2.4.0->2.4.1(+uv.lock, CHANGELOG) so this ships in a published image. No CLI code changes.Verification
Built the image locally (
scripts/build_container.sh pypi-build=local stable=false) and replayed every pyenv action the coana CLI invokes (python-versions-manager.ts) inside the container:which pyenv,pyenv global(system),pyenv install --list(241 versions),pyenv versions --bare,pyenv prefix— all succeed.pyenv install --skip-existing 3.11.14compiles CPython in ~1m18s with no missing-module warnings; the built interpreter runs and imports every stdlib module backed by the added build deps (ssl, ctypes, lzma, bz2, sqlite3, readline, zlib, curses).python3still resolves to the system/usr/local/bin/python3(3.14.5) and.pyenv/shimsis not onPATH.Public Changelog
The
socketdev/cliDocker image now bundles pyenv (v2.7.1) with the build dependencies needed to compile CPython, allowing it to install arbitrary Python versions on demand.