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

[bug] inherit_metadata would be written in lock file if the file is not pdm.lock even strategy config is true #3232

Closed
1 task done
monchin opened this issue Oct 30, 2024 · 0 comments · Fixed by #3236
Closed
1 task done
Assignees
Labels
🐛 bug Something isn't working

Comments

@monchin
Copy link
Contributor

monchin commented Oct 30, 2024

  • 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

  1. Init a pdm project with pyproject.toml
[project]
name = "pdm_test"
version = "0.1.0"
description = "test"
authors = [
    {name = "mon", email = "fake@email.com"},
]
dependencies = [
    "numpy>=2.0.0"
]
requires-python = "==3.10.*"
readme = "README.md"
license = {text = "MIT"}

[tool.pdm]
distribution = false
  1. In this project, run pdm config strategy.inherit_metadata false, and ensure with pdm config strategy.inherit_metadata
  2. Run pdm lock -L pdm.test.lock

Actual behavior

pdm.test.lock's strategy would be strategy = ["inherit_metadata"]

Expected behavior

pdm.test.lock's strategy should be strategy = []

Environment Information

pdm 2.19.3

I found that in this line, it actually would not be run if we set -L pdm.test.lock, so maybe it should be run regardless of if self._lockfile is None?

@monchin monchin added the 🐛 bug Something isn't working label Oct 30, 2024
@frostming frostming self-assigned this Oct 31, 2024
frostming added a commit that referenced this issue Oct 31, 2024
…t pdm.lock even strategy config is true

Fixes #3232

Signed-off-by: Frost Ming <me@frostming.com>
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
2 participants