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

Allow using pdm run to run a command not on PATH #2217

Closed
whitequark opened this issue Aug 30, 2023 · 1 comment · Fixed by #2218
Closed

Allow using pdm run to run a command not on PATH #2217

whitequark opened this issue Aug 30, 2023 · 1 comment · Fixed by #2218
Assignees
Labels
⭐ enhancement Improvements for existing features

Comments

@whitequark
Copy link
Sponsor Contributor

Is your feature request related to a problem? Please describe.

At the moment if I want to run a script with environment variables PDM_PROJECT_ROOT, VIRTUAL_ENV, or any from the _.env_file line in [tool.pdm.scripts] section in pyproject.toml, I cannot do this. E.g.:

$ pdm run ./build_top.sh
[PdmUsageError]: Command './build_top.sh' is not found in your PATH.

Describe the solution you'd like

It would be nice if PDM checked if the command is an absolute or relative path and ran it directly in that case, without a PATH lookup. I have no opinion on what to do if it's both a local file and a command on PATH; any of "display an error on conflict", "prefer one or the other", or "require the path to have at least one separator for the local command to run" (i.e. require pdm run ./build.sh and disallow pdm run build.sh) are fine with me.

@whitequark whitequark added the ⭐ enhancement Improvements for existing features label Aug 30, 2023
@frostming frostming self-assigned this Aug 31, 2023
frostming added a commit that referenced this issue Aug 31, 2023
Fixes #2217

Signed-off-by: Frost Ming <me@frostming.com>
@whitequark
Copy link
Sponsor Contributor Author

That was fast! Thanks so much, this will improve my workflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⭐ enhancement Improvements for existing features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants