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 add --frozen-lockfile --no-sync still runs the resolver #3372

Open
1 task
ncoghlan opened this issue Jan 7, 2025 · 1 comment
Open
1 task

pdm add --frozen-lockfile --no-sync still runs the resolver #3372

ncoghlan opened this issue Jan 7, 2025 · 1 comment
Labels
🐛 bug Something isn't working

Comments

@ncoghlan
Copy link

ncoghlan commented Jan 7, 2025

Describe the bug

There no longer appears to be a way to get pdm add to just edit pyproject.toml without performing a full resolution first.

To reproduce

Run pdm add --frozen-lockfile --no-sync some-file.

This will start a full resolver run (presumably to check locking is still possible) before modifying pyproject.toml, but I don't want pdm add to check that, I have a separate script for updating the lock file for all the required environments and exporting the relevant groups to flat requirements files as needed)

Expected Behavior

PDM edits pyproject.toml and does nothing else.

Environment Information

$ pdm info
PDM version:
  2.22.1
Python Interpreter:
  /home/acoghlan/.../.venv/bin/python (3.12)
Project Root:
  /home/acoghlan/...
Local Packages:

$ pdm info --env
{
  "implementation_name": "cpython",
  "implementation_version": "3.12.6",
  "os_name": "posix",
  "platform_machine": "x86_64",
  "platform_release": "5.15.167.4-microsoft-standard-WSL2",
  "platform_system": "Linux",
  "platform_version": "#1 SMP Tue Nov 5 00:21:55 UTC 2024",
  "python_full_version": "3.12.6",
  "platform_python_implementation": "CPython",
  "python_version": "3.12",
  "sys_platform": "linux"
}

Verbose Command Output

No response

Additional Context

No response

Are you willing to submit a PR to fix this bug?

  • Yes, I would like to submit a PR.
@ncoghlan ncoghlan added the 🐛 bug Something isn't working label Jan 7, 2025
@ncoghlan
Copy link
Author

ncoghlan commented Jan 7, 2025

If the goal of the resolution is to determine the appropriate constraint to add to pyproject.toml for a newly added project that might already be included in the lock file, while covering all potential edge cases (like the previous lock file entry only applying to some platforms), then I can see why it's the default behaviour.

It would just be nice to be able to say "add the latest version on PyPI to pyproject.toml, let me deal with the rest". (Which may make this a feature request rather than a bug report, although I'm pretty sure specifying --no-lock used to turn off resolution completely when adding new dependencies).

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

1 participant