python-poetry / python-poetry/poetry

Add a `poetry check --sync` command

Open
#8,846 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/feature
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 check command group would also mean that it would be available in pre-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-run flag does not offer this functionality, indicating a gap that poetry check --sync could fill.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.