Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cached version of current project used when using pdm lock #1441

Closed
1 task done
tgolsson opened this issue Oct 17, 2022 · 4 comments
Closed
1 task done

Cached version of current project used when using pdm lock #1441

tgolsson opened this issue Oct 17, 2022 · 4 comments
Labels
🐛 bug Something isn't working

Comments

@tgolsson
Copy link
Contributor

tgolsson commented Oct 17, 2022

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

Steps to reproduce

I'm working on a package that that has a self-referential pattern for its own optional dependencies; as described for foo[socks,jwt] here: https://pdm.fming.dev/latest/usage/dependency/#add-dependencies. I ran pdm lock to generate a lockfile. I then changed the description and ran pdm lock again.

The exact config is:

[project.optional-dependencies]
a = ["some-pkg==1.2.3"]
b = [
    "another-package=1.2.3.4",
]
ci = ["gsutil>=4.66", "pkg[a,b]"]

Actual behavior

After changing the description, the base case foo uses the old summary but the target foo[socks,jwt] uses the new summary.

Like this:

[[package]]
name = "pkg"
version = "0.1.0"
requires_python = "~=3.8"
summary = "old summary"
dependencies = [ "..." ]

[[package]]
name = "pkg"
version = "0.1.0"
extras = ["a", "b"]
requires_python = "~=3.8"
summary = "new summary"
dependencies = [ "..." ]

Expected behavior

Both package references use the same summary. Deleting ~/.cache/pdm/metadata/package_meta_NNNNN.json and running pdm lock again solves the issue, making both references use new summary.

Environment Information

# Paste the output of `pdm info && pdm info --env` below:
PDM version:
  2.1.5
Python Interpreter:
  <REDACTED>/pkg/.venv/bin/python (3.8)
Project Root:
  <REDACTED>/pkg
Project Packages:
  None
{
  "implementation_name": "cpython",
  "implementation_version": "3.8.10",
  "os_name": "posix",
  "platform_machine": "x86_64",
  "platform_release": "5.15.68.1-microsoft-standard-WSL2",
  "platform_system": "Linux",
  "platform_version": "#1 SMP Mon Sep 19 19:14:52 UTC 2022",
  "python_full_version": "3.8.10",
  "platform_python_implementation": "CPython",
  "python_version": "3.8",
  "sys_platform": "linux"
}
@tgolsson tgolsson added the 🐛 bug Something isn't working label Oct 17, 2022
@tgolsson tgolsson changed the title Cached version of local package used when using pdm lock Cached version of current project used when using pdm lock Oct 17, 2022
@frostming
Copy link
Collaborator

Is pkg a published package? then updating description should bump the version right?

@tgolsson
Copy link
Contributor Author

No; and I think that may have been part of the problem. pkg is the local package described in the pyproject.toml. It unfortunately collides with a package on pypi, and when later working with pdm update it failed because of this - so it might have silently affected other packages too.

@tgolsson
Copy link
Contributor Author

Not related to collisions or so: repro here. https://github.com/tgolsson/pdm-repro-summary. That package definitely doesn't collide with anything. Installs cleanly, can be built...

@tgolsson
Copy link
Contributor Author

This might be related to the same issue as in #1470.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants