Introduce editablePackageSources
to mkPoetryEnv
#101
Merged
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.
This introduces a new parameter to
mkPoetryEnv
which can be used to specify sources for additional python packages that should be available in the resulting environment, loading directly from the mutable source directory. This allows you to call binaries that need to load python modules (likepython -m
orgunicorn
) for development.This
editablePackageSources
parameter could be read from the packages entry inpyproject.toml
(or inferred if it doesn't exist), and that's whatpoetry install
does, but this would be rather complex to implement correctly, so passing it manually seems to make more sense to me.The implementation of this works the same way as
poetry install
works:.pth
files (somewhat documented here) are created in the environments site-packages directory, which reference the mutable directory and lets python know to find the modules there.This PR is sponsored by Niteo