-
-
Notifications
You must be signed in to change notification settings - Fork 413
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
Using relative path fails for commands with --project argument #1220
Comments
We don't allow adding packages beyond the project root, because it will break the reproducibility(You can't make it work on another machine where the path is changed), and it also makes the package not distributable. I notice you are implementing a monorepo, you may be interested in Monas |
@frostming Is there any chance you could reconsider the point about referencing projects beyond It seems to me like resolving the dep to an absolute URL doesn't protect reproducibility against unintentional mistakes any more than allowing a relative URL? For instance, a dependency at the absolute URL To me this feels like an artificial limit of PDM to certain project structures, since reproducibility can be broken with the absolute URL too. Unless I am missing something obvious? :) Perhaps PDM could allow the relative URL, but generate a warning so that the user knows they are doing something potentially harmful? p.s. I saw your link to https://github.com/frostming/monas it looks nice but it's too much of a change for us at the moment since we are not using a monorepo. p.p.s I am a HUGE fan of PDM! 🚀 very nice work! |
There is a valid edge case here, where you have a wider constellation of packages defined by git submodules, which then, for development purposes, need to be side loaded in as editable packages. This is something the package manager should allow, with a warning if need be proclaiming that if the directory out of the project root is unmanaged, then this will affect reproducibility. |
Steps to reproduce
When
pdm add
command is run outside the project directory using--project
argument, it fails to recognize path relative to current directoryObviously, the path '/Users/michaeljaison/Sync/python-repo-skeleton/packages/greet/packages/translate-gmj' does not exist, because it is relative to '/Users/michaeljaison/Sync/python-repo-skeleton/' directory.
But the same command also fails if the path is specified relative to the actual project location.
❯ pdm add --project packages/greet ../translate-gmj -v [RequirementError]: The local path ../translate-gmj does not exist.
Actual behavior
Not able to use
--project
argument to usepdm
outside of project directoryExpected behavior
pdm
should convert relative paths relative to current directory.Environment Information
The text was updated successfully, but these errors were encountered: