-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Path dependencies with path dependencies #2877
Comments
@leahein appreciate you raising this. The root cause here is that there is some inconsistencies in internal assumptions made regarding the locked source path. From the root project: [package.source]
reference = ""
type = "directory"
url = "lib/my-lib-1/lib/my-lib-2" In this case when the package is attempted to be installed, the path constructed becomes poetry/poetry/installation/executor.py Lines 474 to 477 in 17b165b
All that said, it should also be acknowledged that this might not be a great idea to support either, We cannot expect relative paths to the portable. This means a project locked on one user's machine might not work on another. The case you have described above is probably an exception, but something we would like to handle a bit better as being discussed at #2270. |
I observe the same problem, but also for non-nested projects. I have a mono repository setup where dependencies between packages in the repository are defined with relative paths. If I understand your answer correctly, this has nothing to do in particular with nesting packages, but with the way the path is constructed. In my setup, I have a structure like this:
The dependency chain is now I was able to get it working by mutating all packages in the solver here: poetry/poetry/puzzle/solver.py Lines 229 to 233 in dfa5c0f
And setting for pkg in packages:
pkg.root_dir = self.package.root_dir thereby setting the root path of every package to the root directory of the package to be installed (which makes sense to me as all the relative root paths seem also to be relative to the package installed). But I am not sure what this could break (and especially the solver is a bit to complex to easily make a change). To me this seems independent of the problem of managing lock files and relative paths on multiple machines (i.e. the above mentioned setup should work, but it also does not solve the problem with multiple machines). If this is a different bug, I can open a new one if you want. |
This seems to be fixed in the meantime. |
-vvv
option).Issue
Path dependencies that rely on path dependencies don't seem to install correctly.
Example file structure:
Steps to reproduce:
The path for my-lib-2 is
lib/my-lib-1/lib/my-lib-1/lib/my-lib-2
, when it should be/lib/my-lib-1/lib/my-lib-2
.For the full output:
The text was updated successfully, but these errors were encountered: