python-poetry / python-poetry/poetry
Path develop dependencies without locked version
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 34.3k
- Forks
- 2.5k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 30
Description
- I have searched the issues of this repo and believe that this is not a duplicate.
- I have searched the documentation and believe that my question is not covered.
Feature Request
I have a monorepo kind of project with one main pyproject.toml and subpackages defined like this:
sub-module = {path = "libraries/sub-module", develop = true}
Currently the poetry.lock file contains the version of that package at the time poetry lock was called. If I change the version in libraries/sub-module without calling poetry lock, doing poetry install will each time reinstall that package (to the wrong version as it's a path dependency):
• Updating sub-module (0.2 libraries/sub-module -> 0.1 libraries/submodule) ### sub-module is actually still at version 0.2
What I would like instead is for the lock file to have a special version (e.g. "current", or just ignore the version), and for poetry install to only install the path dependency if the currently installed version is different than the one at the given path. So calling poetry install a second time would be a no-op.
I think this could be the default behavior because the version cannot actually be enforced with a path dependency. But it might not be that straightforward as the lock file contains other metadata (like transitive dependencies) which can be version-dependent. Another option is to have a flag to enable that behavior per dependency.
My request is a bit related to #936
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how poetry.lock records the version and transitive metadata for develop path dependencies declared in pyproject.toml, then follow how poetry install compares and reinstalls them. Define the behavior for changed package versions and dependency metadata; done means a second poetry install is a no-op when the path dependency is already current.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100