python-poetry / python-poetry/poetry

Using `@latest` should not change the constraint pattern

Open
#3,503 2 comments 2 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

  • [X ] I am on the latest Poetry version.
  • [X ] I have searched the issues of this repo and believe that this is not a duplicate.
  • OS version and name: Ubuntu 18.04
  • Poetry version: 1.1.4

Issue

According to the docs, to upgrade to the latest version of a package you already have, for example Flask, you can do: poetry add Flask@latest. The issue is that it changes the constraint you have. So if you start with:

Flask = "1.1.1"

in your pyproject.toml, it'll change it to:

Flask = "^1.1.2"

I would expect it to not add the ^. This expected behavior matches npm. Doing npm install typescript@latest changes "typescript": "3.8.3" to "typescript": "4.1.3".

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

Start with the poetry add Flask@latest behavior described in the issue and reproduce it using the provided pyproject.toml constraint. Trace the add CLI handling for the @latest specifier, then verify that upgrading the package changes only the version and preserves the existing constraint pattern.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.