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

Local path in wheel metadata seems wrong #4709

Closed
3 tasks done
Hartorn opened this issue Nov 4, 2021 · 6 comments
Closed
3 tasks done

Local path in wheel metadata seems wrong #4709

Hartorn opened this issue Nov 4, 2021 · 6 comments
Labels
status/duplicate Duplicate issues

Comments

@Hartorn
Copy link
Contributor

Hartorn commented Nov 4, 2021

  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
  • OS version and name: Docker container Ubuntu 18.04
  • Poetry version: 1.1.11
  • Link of a Gist with the contents of your pyproject.toml file:

Issue

We have a pyproject.toml with deps towards local non-poetry python project, declared in subfolder.

local_package = {path = "./subfolder/local_package", develop = true}

Everything is working fine (install, lockfile, and so on), except when creating a package.
I built the wheel using poetry build, and when trying to install the package with pip afterwards, I got an error

  File "/poetry_cache/virtualenvs/hawk-AVX97199-py3.6/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3103, in __init__
    raise RequirementParseError(str(e))
pip._vendor.pkg_resources.RequirementParseError: Invalid URL: subfolder/local_package

I tried the poetry export function (worked fine), and noticed the local deps are written as vaedataset @ file:///full/path/to/subfolder/local_package

I checked the inside of the wheel and it's written in the metadata Requires-Dist: local_package @ subfolder/local_package
I think the error comes from here, shouldn't it be something similar, like an URI file://./subfolder/local_package or something like this ?

@Hartorn Hartorn added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Nov 4, 2021
@Hartorn
Copy link
Contributor Author

Hartorn commented Nov 4, 2021

Additional info :
I made some tests, seems like it's not supported to have relative URI inside wheel, so file://./foo/bar is a no-go
ValueError: non-local file URIs are not supported on this platform: 'file://./foo/bar'.

Finally, URI should be the same as in poetry export, full path : file:///path/to/foo/bar
With full path, the wheel is working

@jsirois
Copy link

jsirois commented Nov 15, 2021

This is a definitive bug via:

  1. https://www.python.org/dev/peps/pep-0345/#version-specifiers ->
  2. https://www.python.org/dev/peps/pep-0440/#file-urls

In fact, if attempting to publish wheels to PyPI for others to use, the file:// url presented in poetry export wouldn't work either. For publish the requirement must be switched to be the project==version of that local project.

@dimbleby
Copy link
Contributor

dimbleby commented Oct 9, 2022

duplicate #5273

(Per #5273 (comment) it should be an easy fix to use an absolute path. Though I still don't understand the use case for a wheel that points at a local path, it's not as though you can distribute that wheel and expect anyone else to be able install it)

@jsirois
Copy link

jsirois commented Oct 9, 2022

@dimbleby you absolutely can in a corporate environment with consistent network mounts via, say, NFS. So no PyPI involved here and folks can assume the mount.

@dimbleby
Copy link
Contributor

dimbleby commented Oct 9, 2022

pull request is invited

@neersighted neersighted added status/duplicate Duplicate issues and removed kind/bug Something isn't working as expected area/build-system Related to PEP 517 packaging (see poetry-core) status/triage This issue needs to be triaged labels Oct 9, 2022
@neersighted neersighted closed this as not planned Won't fix, can't repro, duplicate, stale Oct 9, 2022
Copy link

github-actions bot commented Mar 1, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status/duplicate Duplicate issues
Projects
None yet
Development

No branches or pull requests

5 participants