pdm: 'pdm update' does not update pyproject.toml

  • [ x] I have searched the issue tracker and believe that this is not a duplicate.

Make sure you run commands with -v flag before pasting the output.

Steps to reproduce

 pdm init
 pdm add numpy==1.22.0

modify pyproject.toml

dependencies = [
    "numpy>=1.22.0",
]

continue

$ pdm update numpy -v
Updating packages: numpy.
STATUS: Resolving dependencies
pdm.termui: ======== Start resolving requirements ========
pdm.termui:   numpy>=1.22.0
pdm.termui:   python>=3.11
pdm.termui:   Adding requirement numpy>=1.22.0
pdm.termui:   Adding requirement python>=3.11
pdm.termui: ======== Starting round 0 ========
STATUS: Resolving: new pin python>=3.11
pdm.termui: Pinning: python None
pdm.termui: ======== Ending round 0 ========
pdm.termui: ======== Starting round 1 ========
STATUS: Resolving: new pin numpy 1.25.0
pdm.termui: Pinning: numpy 1.25.0
pdm.termui: ======== Ending round 1 ========
pdm.termui: ======== Starting round 2 ========
pdm.termui: ======== Resolution Result ========
pdm.termui: Stable pins:
pdm.termui:   python None
pdm.termui:    numpy 1.25.0
STATUS: Fetching hashes for resolved packages...
pdm.termui: Fetching hashes for numpy@1.25.0
  Lock successful
STATUS: Resolving packages from lockfile...
STATUS: Fetching hashes for resolved packages...
Synchronizing working set with lock file: 0 to add, 1 to update, 0 to remove

pdm.termui: Removing distribution numpy
unearth.preparer: Using cached <Link https://files.pythonhosted.org/packages/de/8b/b2d73b913be92056b1f77b0b9d184d93f368353540adf91e699a10a2effb/numpy-1.25.0-cp311-cp311-win_amd64.whl (from None)>
  v Update numpy 1.22.0 -> 1.25.0 successful

  All complete!

Actual behavior

[project]
name = ""
version = ""
description = ""
authors = [
    {name = "vitidev", email = "vitidev@users.noreply.github.com"},
]
dependencies = [
    "numpy>=1.22.0",
]
requires-python = ">=3.11"
license = {text = "MIT"}

Expected behavior

[project]
name = ""
version = ""
description = ""
authors = [
    {name = "vitidev", email = "vitidev@users.noreply.github.com"},
]
dependencies = [
    "numpy>=1.25.0",
]
requires-python = ">=3.11"
license = {text = "MIT"}

Environment Information

# Paste the output of `pdm info && pdm info --env` below:
pdm info && pdm info --env
PDM version:
  2.7.4
Python Interpreter:
  G:\Dev\Python\python.EXE (3.11)
Project Root:
  z:/test
Local Packages:
  z:\test\__pypackages__\3.11
{
  "implementation_name": "cpython",
  "implementation_version": "3.11.3",
  "os_name": "nt",
  "platform_machine": "AMD64",
  "platform_release": "10",
  "platform_system": "Windows",
  "platform_version": "10.0.19045",
  "python_full_version": "3.11.3",
  "platform_python_implementation": "CPython",
  "python_version": "3.11",
  "sys_platform": "win32"
}

flags --update-eager, --update-all do nothing.

pdm lock also affected same for active venv

Is this a bug or a new update policy? I haven’t used pdm for a long time

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 15 (2 by maintainers)

Most upvoted comments

Another aspect is to consider when you will need an update to pyproject.toml? For a library, the version bounds that used to work should keep working, you only need to update the lockfile to update the package versions in your working set. If you believe a package version doesn’t work any more and you need to update the lower bounds, if you know the exact minimum supported versions, modify the specifiers manually, or if you don’t, run pdm update --unconstraints <package>[ <package2>...] to update for the single packages. I don’t think there will be any practical case you need to update and rewrite the version bounds for all packages.