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

pdm: groups at the top of pdm.lock don't update once lockfile exists #999

Open
abathur opened this issue Jun 26, 2024 · 3 comments · May be fixed by #1035
Open

pdm: groups at the top of pdm.lock don't update once lockfile exists #999

abathur opened this issue Jun 26, 2024 · 3 comments · May be fixed by #1035

Comments

@abathur
Copy link
Contributor

abathur commented Jun 26, 2024

I'm not sure if this is expected behavior, a pdm problem, a sign we're holding pdm wrong, or a sign I'm holding dream2nix wrong--but I noticed that new/removed/renamed groups added to my pyproject.toml under [tool.pdm.dev-dependencies] don't get updated in the [metadata] section at the top of pdm.lock unless I remove the file before running nix run .#blah.lock.

@phaer
Copy link
Member

phaer commented Jun 28, 2024

@abathur Thanks for the report, that's not expected behavior! Going to have a look, a reproducer would be appreciated due to time constraints :)

@purepani
Copy link
Contributor

purepani commented Jul 30, 2024

I believe this happens because there's no actual lock invalidation.
The lock module stores the hash in its own generated lock.json, but we generate the lock file using pdm, so the lock module has nowhere to actually put the hash.

I started implementing an invalidation scheme based on the content hash that pdm stores in the lock file, but it might be a little maintainer-heavy to do that since any change in how pdm generates the hash has to be implemented here as well(it's not that hard; there's a lockfile version indicator in the lock file, but it is a bit annoying).
@phaer is there a better solution here? Only other one I can think of is just generating a second lock file for d2n.

@phaer
Copy link
Member

phaer commented Jul 30, 2024

@phaer is there a better solution here? Only other one I can think of is just generating a second lock file for d2n.

Thanks for reminding me of this. Not using the PDM module myself atm, so maybe @DavHau would have a better idea? To me your proposal sounds fine if we want to avoid storing our own invalidationHashes outside of pdm.lock, as we do with pip and nodejs.

@purepani purepani linked a pull request Aug 9, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants