-
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
exporter: prepend file for local dependencies #3121
Conversation
Tried to fix the same thing in #3120. Wanted to point out that AFAIK the
Which means the |
I'm honestly confused why with 1.1 Poetry (apparently deliberately) started to generate |
Yes actually you're right. It seemed to work for me because the package was already installed and then But yes you're right, its's very confusing. Especially because |
I believe this was implemented according to PEP-440. See python-poetry/poetry-core#22 for implementation. Or is the serialised version incorrect? IIRC, it should only use |
Yes the URI notation with
|
I'd suggesst that we make it absolute. Since at the point at which we write the serialised version, the if not dependency.source_url.path.is_absolute():
dependency.source_url = dependency.source_url.path.resolve() I am not sure if there is a scenario where this will fail for some reason. Would be great to check for nested dependencies with relative path dependencies included. Prior to the |
I think just using the path = path_to_url(self.path) if self.path.is_absolute() else self.path
requirement += " @ {}".format(path) however for directory dependencies the logic does not exist requirement += " @ {}".format(self._path.as_posix()) It's also not possible to transform the directory dependency to a file dependency, because |
I think for now the best way is to include the logic into |
You might want to drop the commits not relevant to this PR. I will get back to this later this week. As for the where the logic lands, I am not too fussed. Just need to make sure the compatibility call to |
I've changed it to a draft PR, as I still want to make some checks and tests regarding some nested dependencies. |
The exporting seems to work fine with nested dependencies, however the installation seems to cause trouble. As |
@maxispeicher this is an issue with all scenarios relying on PEP 517 isolated builds and relative path dependenncies. As things stand, the only real way to use them is to use absolute path. This is not something that can resolved in core per say, because the PEP 517 api is only called once the isolated build environment is setup. So unless the package itself specifies that it needs to include the relative path dependencies as part of its |
@abn Do you think you can manage to review this one, as it is still a blocker from some projects. |
I recently ran into this issue. Any way I can help get this landed? Maybe just a friendly nudge to @abn ? |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Pull Request Check List
When exporting to
requirements.txt
poetry uses the PEP-508 standard. However pip install supports direct references which need a prependendfile://
information for local dependencies. This PR includes thisfile://
annotation for file and directory depencies.Resolves: #3189