python-poetry / python-poetry/poetry
Install without poetry.lock - option to respect existing version of installed dependencies
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
If there is no poetry.lock file, running poetry install currently will install the latest version of all dependencies specified in pyproject.toml and create a corresponding "latest versions" poetry.lock. This happens even if an older version of a dependency (whose version is still within the valid range of dependency versions specified by pyproject.toml) is already installed in the environment and available for use.
What I would like to see is an option (--skip-updates, --keep-existing, or whatever) to allow Poetry to use existing installed dependencies instead of automatically updating them to the latest available.
Use Case
We have a project which is co-developed with a number of plugins. When developing and testing, we want to have editable installs of the project itself as well as each plugin, so we are running poetry install multiple times (once for the base project, once for each plugin).
When a new plugin is first created, with its own pyproject.toml, it does not yet have its own poetry.lock. If the new plugin has an explicit dependency that is also a dependency of the base project, the first poetry install of the new plugin (before it has its own poetry.lock) will automatically pull and install the latest version of that dependency, overriding the version previously required and previously installed by the base project's poetry.lock and creating a version conflict that we have to manually resolve later.
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 the poetry install behavior when poetry.lock is absent, including how it reads pyproject.toml and handles already-installed dependencies. Clarify the intended semantics of the proposed option and verify that poetry install can preserve compatible existing versions without creating a conflicting lock state.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100