python-poetry / python-poetry/poetry
Add a `poetry check --sync` command
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 34.3k
- Forks
- 2.5k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 30
Description
Summary
In my development process, I often face version mismatches amongst developers, primarily due to updates in the poetry.lock file that do not violate the requirements present in pyproject.toml. This leads to issues such as linting failures from updated package stubs. While poetry check --lock ensures consistency between pyproject.toml and poetry.lock, it doesn't verify if the working environment matches the versions in poetry.lock.
Proposal
I propose the addition of a new command: poetry check --sync. This command would check that the environment's package versions are in sync with those in poetry.lock, without performing any installations or updates.
Justification
- Prevent Mismatches: This command would serve as a preventive measure against version mismatches, enhancing the reliability of our development environment.
- Adding this to the
poetry checkcommand group would also mean that it would be available inpre-commit - Convenience: It provides a straightforward way to verify environment consistency without the side effects of installing or updating packages, unlike the current
poetry install --sync. - Filling a Gap: Currently, there is no option to simply check for version consistency. The
--dry-runflag does not offer this functionality, indicating a gap thatpoetry check --synccould fill.
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
The issue names no implementation files, entry points, or tests. Start by examining the existing poetry check --lock command and determine how environment versions should be compared with poetry.lock; done means the new --sync check reports mismatches without installing or updating packages.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, devtools
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100