Skip to content

Package Upgrade does not work as Advertised #2185

@baderj

Description

@baderj

Given the following requirements.in file without any pinned version:

playwright
titlecase

And this playwright.txt with both packages outdated:

#
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
#    pip-compile
#
greenlet==3.2.2
    # via playwright
playwright==1.51.0
    # via -r requirements.in
pyee==12.1.1
    # via playwright
titlecase==2.3
    # via -r requirements.in
typing-extensions==4.13.2
    # via pyee

I expect pip-compile --upgrade-package playwright to update playwright to the latest version (1.52 at the time of writing), but it stays at 1.51.0:

#
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
#    pip-compile
#
greenlet==3.2.2
    # via playwright
playwright==1.51.0
    # via -r requirements.in
pyee==12.1.1
    # via playwright
titlecase==2.3
    # via -r requirements.in
typing-extensions==4.13.2
    # via pyee

Doing general pip-compile --upgrade or giving the version number pip-compile --upgrade-package playwright==1.52 works as intended. But the first will update all packages, while the second requires knowing the latest version number. According to the documentation, a --upgrade-package is supposed to update a single package to the latest version.

Environment Versions

  1. Ubuntu 25.04
  2. Python version: 3.10.12
  3. pip version: 22.0.2
  4. pip-tools version: 7.3.0

Steps to replicate

  1. create a requirement.in with this content:
playwright
titlecase

and a requirement.txt with these outdated version:

#
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
#    pip-compile
#
greenlet==3.2.2
    # via playwright
playwright==1.51.0
    # via -r requirements.in
pyee==12.1.1
    # via playwright
titlecase==2.3
    # via -r requirements.in
typing-extensions==4.13.2
    # via pyee
  1. Run pip-compile --upgrade-package playwright

Expected result

playwright should now be at version 1.52 in the requirement.txt

Actual result

The requirements.txt does not change. The version can only be updated with either

  • first removing the requirements.txt and running pip-compile (this will update all dependencies)
  • running pip-compile --upgrade (again this will update everything)
  • specifying the version number with pip-compile --upgrade-package playwright==1.52, this works, but requires a lookup of the version number first.

Metadata

Metadata

Assignees

Labels

PR wantedFeature is discussed or bug is confirmed, PR neededawaiting responseAwaiting response from a contributorbugSomething is not workingneeds more infoNeed more info to clarify issuepipRelated to pipresolverRelated to dependency resolver

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions