-
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
Poetry 1.1.0a2 Breaks Support for File Dependencies on Networked Drives #2643
Comments
Just following up. This issue is still present in the latest Could this just be poetry/poetry/puzzle/provider.py Lines 686 to 696 in 4769f72
|
@KyleKing can you try using a url dependency with direct-reference instead here? The issue with using a path dependency is that we expect it to be on the local machine. For network mounts, you will have to use That said the specific code path you have pointed out needs to be fixed too, since we should really be testing if the path already is absolute and if so deal without using a relative path. But I also suspect this will have some downstream implications. Eitherway, for your use case I feel a url dependency is more appropriate. We did make an improvement in python-poetry/poetry-core#22 to support this properly. Would be good to verify that it works. |
Okay, that makes sense. I just have a couple of quick questions about modifying the toml file and how can I test
For the hypothetical TOML file for this ticket (old way): [tool.poetry.dev-dependencies.project_a]
path = "\\\\company.com\\dfsroot\\project_a-0.1.1-py3-none-any.whl" Should this be correct? [tool.poetry.dev-dependencies.project_a]
url = "file:///company.com/dfsroot/project_a-0.1.1-py3-none-any.whl" > poetry --version
Poetry version 1.1.0b2 When I try the latter, I get a
Alternatively, swapping
|
Hmm, thanks for the details @KyleKing much appreciated. It might be better to handle this as a file dependency (as you originally did) I reckon. I forgot that poetry handles file uri's as file dependnecies as opposed to url dependency, so my original recommendation is moot As for the the issue itself, I think adding an "is absolute" test might work. Assuming that Regarding the URI, you are correct that |
Oh okay, I tested from pathlib import Path
full_path = Path('\\\\company.com\\dfsroot\\project_a-0.1.1-py3-none-any.whl')
full_path.is_file() # True
full_path.is_absolute() # True Do you want me to submit a PR with this change? Something like: if (package.dependency.is_directory() or package.dependency.is_file()) and (
dep.is_directory() or dep.is_file()
):
if (dep.full_path.is_absolute()) {
dep._path = dep.full_path.as_posix()
} else {
relative_path = Path(
os.path.relpath(
dep.full_path.as_posix(), package.root_dir.as_posix()
)
)
# TODO: Improve the way we set the correct relative path for dependencies
dep._path = relative_path
} Although I think this change may be better grouped in a PR with changes that resolve the relative path TODO item |
Just following up, the latest poetry 1.1.1 (and 1.1.4) version won't let me use dependencies on mounted drive locations. Can I help make code changes? What would be the desired behaviour of poetry in these cases? |
@python-poetry/triage I submitted PR (#3466 ) that resolves this issue. Is there any additional input that I can provide? |
Still an issue, but not worth nudging maintainers until reviewed |
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. |
I am on the latest {*pre-release} 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:
Win10 1909
Poetry version:
1.1.0a2
Link of a Gist with the contents of your pyproject.toml file:
See example toml snippet at bottom
Issue
Poetry 1.1.0a2
attempts to determine the relative path to a file dependency, but this fails (os.path.relpath
raises a ValueError) if the dependency is not on the same drive. In my use case, we deploy wheel/tar files to a folder on a networked drive (\\company.com\dfsroot\etc...
) so that the files are accessible to all internal users.Poetry 1.1.0a1
does not have this issue, so I have downgraded to 1.1.0a1 for nowpoetry/poetry/puzzle/provider.py
Lines 680 to 690 in feef53b
Logs
poetry update -vvv
Example TOML
The text was updated successfully, but these errors were encountered: