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

Cannot use file:/// with absolute path to specify a path dependency #8904

Closed
harrandt opened this issue Jan 24, 2024 · 4 comments
Closed

Cannot use file:/// with absolute path to specify a path dependency #8904

harrandt opened this issue Jan 24, 2024 · 4 comments
Labels
kind/bug Something isn't working as expected

Comments

@harrandt
Copy link

Poetry (version 1.7.1)
Python 3.9
Windows 10

Issue

According to this pull request and the documentation it should be a possible to use file:/// paths to specify a dependency like

[tool.poetry.dependencies]
my_package = { path = "file:///C:/wheelhouse/my_package-0.5.2-py3-none-any.whl" }

but in my case this does not work.

With C:\my_project\pyproject.toml and running the command poetry install in C:\my_project as the current working directory, I get the following error message:

Path C:\my_project\wheelhouse\my_package-0.5.2-py3-none-any.whl for my_package does not exist

Please notice that the current working directory is prepended to the path to the package with C: removed.

Is this something that should work in theory or are absolute paths not supported?

@harrandt harrandt added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Jan 24, 2024
@harrandt
Copy link
Author

Yet another question, I would like to have a feature like pip's find-links to be able to use a local folder as repo and I saw that there were many discussions about that.

Do you think it would be worth a shot to open up a pull request for something like

[[tool.poetry.source]]
name = "foo"
path = "file:///C:/wheelhouse/"

? It could just look at wheel files in the specified directory.

Or

[[tool.poetry.source]]
name = "foo"
url = "file:///C:/wheelhouse/index.html"

which would work without a webserver and contains relativ paths, e.g. created by piprepo.

@dimbleby
Copy link
Contributor

dimbleby commented Jan 24, 2024

According to python-poetry/poetry-core#512 and the documentation it should be a possible to use file:/// paths to specify a dependency like

you've misunderstood the pull request: that's about how path dependencies are written in package metadata and not how they are specified in pyproject.toml

so far as I can see, the documentation you've linked to just doesn't say the thing that you say it says. I find no mention of "file:///" under the path dependencies section at all.

ie there's no reason to expect that what you're doing should work. Just provide a regular path as per the documentation

please close

@harrandt
Copy link
Author

Ok, thanks for the clarification.

Copy link

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 Feb 29, 2024
@abn abn removed the status/triage This issue needs to be triaged label Mar 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

3 participants