Skip to content

fix: resolve the venv path so entrypoint shebangs are absolute - #171

Open
akashchamp wants to merge 1 commit into
python-poetry:mainfrom
akashchamp:fix-relative-venv-path
Open

akashchamp wants to merge 1 commit into
python-poetry:mainfrom
akashchamp:fix-relative-venv-path

Conversation

@akashchamp

Copy link
Copy Markdown

Resolve the path argument of poetry bundle venv before handing it to the bundler. With a relative path (e.g. ../bundle) the generated entrypoints got a relative shebang (#!../bundle/bin/python) and failed with "bad interpreter" when run from any other directory.

Resolves #97

Verified with a small project that has a console script: before the change poetry bundle venv ../out wrote #!../out/bin/python and running ./out/bin/demo from the parent directory failed; after it the shebang is #!/tmp/mv/out/bin/python and the script runs. Added a console test that fails without the change; ruff check/format and mypy are clean. I did not add a changelog entry since the file has no unreleased section.

A relative path passed to `poetry bundle venv` ended up in the shebangs of the bundled entrypoints, so they only worked from the original directory.

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.

Bundle breaks when using relative path

1 participant