-
-
Notifications
You must be signed in to change notification settings - Fork 424
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
Packages add/remove with --dev does not work if custom scripts configuration block defined [tool.pdm.scripts] #2056
Comments
This bug report makes no sense to me, nor can I reproduce it. There should be some problem on your side, can you provide a example repository(or docker image) to reproduce this issue? A rough guess is you might open the file for change but not saved yet. The IDE or editor you use always show the un-saved content. |
Yes it is strange one, but I have not figured it out yet, therefore created this issue to get more ideas. Strange that happens with my work laptop and I can`t reproduce it on my personal one. In the example I am using python 3.9.2 (which has issues, Win 10, WSL, VS Code) and in personal project python 3.11(no issues, Win 11, WSL, VS Code) pdm list |grep pytest │ pytest │ 7.4.0 │ │ pdm remove pytest --dev 🎉 All complete! Package still in the list: Also not removed from .toml conf under tool.pdm.dev-dependencies section. venv path is correct. After commenting out "[tool.pdm.scripts]" in toml config: pdm list |grep pytest pdm remove pytest --dev ✔ Remove exceptiongroup 1.1.1 successful 🎉 All complete! pdm list |grep pytest Package was removed, also from toml config. |
@mrx88 This doesn't help at all. You may need to do some investigation yourself. |
I figured out how to fix it: [tool.pdm.scripts] block was under [build-system] in toml config, when moving it above [build-system] package remove/add and toml config update works as expected. Not sure if such behavior is expected or it`s a bug. |
So you mean such structure: [tool.pdm.dev-dependencies]
dev = ["pytest"]
[build-system]
...
[tool.pdm.scripts]
... Noted, will try it tomorrow. |
Fixed by #2061 |
Steps to reproduce
[tool.pdm.scripts] hello = {shell = "echo hello"}
pdm add pytest --dev
Note: if removing [tool.pdm.scripts] section, step 2 works fine.
Actual behavior
--dev packages add/remove does not work if custom scripts configuration block defined [tool.pdm.scripts]
Expected behavior
--dev packages add/remove should work if custom scripts defined under [tool.pdm.scripts]
Environment Information
The text was updated successfully, but these errors were encountered: