-
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
Adding a source even with secondary true take precedence #4704
Comments
I think I'm experiencing the same issue |
I can confirm that all versions |
Can Confirm this issue is still present in |
Also confirming here on Seems to be related to #3855 |
Hello there :) Sorry to bump but is there any news about that ? I'm still getting
... And so on for all packages other than torch. It's really breaking all poetry for my workflow (I need pytorch cu11 which needs to be downloaded from their source). P.S : Thanks in advance, |
For those who are still struggling..... Without sources, without any of the fancy stuff, just plain dependency declaration. torch = [
{ url="https://download.pytorch.org/whl/cu113/torch-1.10.1%2Bcu113-cp37-cp37m-linux_x86_64.whl", python=">=3.7,<3.8", markers="sys_platform == 'linux'"},
{ url="https://download.pytorch.org/whl/cu113/torch-1.10.1%2Bcu113-cp37-cp37m-win_amd64.whl", python=">=3.7,<3.8", markers="sys_platform == 'win32'"},
{ url="https://download.pytorch.org/whl/cu113/torch-1.10.1%2Bcu113-cp38-cp38-linux_x86_64.whl", python=">=3.8,<3.9", markers="sys_platform == 'linux'"},
{ url="https://download.pytorch.org/whl/cu113/torch-1.10.1%2Bcu113-cp38-cp38-win_amd64.whl", python=">=3.8,<3.9", markers="sys_platform == 'win32'"},
{ url="https://download.pytorch.org/whl/cu113/torch-1.10.1%2Bcu113-cp39-cp39-linux_x86_64.whl", python=">=3.9,<3.10", markers="sys_platform == 'linux'"},
{ url="https://download.pytorch.org/whl/cu113/torch-1.10.1%2Bcu113-cp39-cp39-win_amd64.whl", python=">=3.9,<3.10", markers="sys_platform == 'win32'"},
] (I know it's a quick fix, dependency resolution was really long, it's not a long term solution, but at least it will help you keep going :) ) |
Thanks @ierezell, that's also how I'm doing it now, "really long" is still an understatement tho :/ |
Hi @janpf, yes it's really long but I found out why....
Specifying one wheel only can reduce the time. Also, I realized that even with the many errors as 403 Client Error: Forbidden for url: https://download.pytorch.org/whl/cpu/mypy It's trying with pytorch URL and print errors but finally use the correct one and install everything. So specifying the source is "working". Hope that helps, |
Hey, I have the same issue and I'm in version 1.1.13. |
This issue is blocking "unlocking the poetry" potentials when it comes to leveraging poetry in the stack that uses PyTorch and its ecosystem. I have tried with following:
but the default
As mentioned in this ticket, #4704 this is a known issue. However, amongst all possible ways to address this issue, this solution of using secondary sources seems to be the ideal fix for the issue in question. As a short-term interim, I have also tried platform and version-specific settings. This would work fine if PyTorch was my leaf dependency. Because my setup involves using PyTorch, Torchvision, and Pytorch lightening. Because more dependencies rely on PyTorch, just specifying torch wheels in toml fails to solve the dependency:
Error:
I have been in knots with this one, particularly because there are so many issues open around this issue: The only solution that works cross-platform is https://github.com/nat-n/poethepoet but that is not a great solution either (not lining up with lock file, not using same cache etc, the need for additional pip run!). It would be great if we can fix this issue. |
The This is because a package might be available in both indices and the best version might be in either. This is common where there are post builds (production patches) or runtime environment specific wheel builds where one might not be available in PyPI etc. Additionally, this is a quirk of the There is also an option (new feature) to configure such repositories as |
This issue is an important blocker for my job as well. I really want to push forward poetry to teams because IMO it is the best tool available at the moment, but it's just impossible because of this issue.
Expecting that all PEP503 repositories will be configured to send 404 and not 403 is a big assumption. It has been like that for long, and is unlikely to change. @sdispater @abn moving forward, some propositions have been made, (to me) it seems to be on poetry's core contributor's side to pick one. |
@GuillaumeDesforges can you clarify how this issue is impacting your use case please? The From my understanding, the fact that Poetry looks for dependencies in both primary and secondary sources is a documented behaviour (this definitely also will need improvement given the confusion here). The
Personally, I do not think this is a big assumption at all. If a resource does not exist, it is reasonable to assume the response if all else is configured correct, to be Feel free to ping on discord if you have specific PRs or proposals you want to work on or get consensus on, happy to help. There are a few issues surrounding the use of pytorch binaries within a Poetry project. |
Ah! I didn't know that, my bad. Could you tell me in which release it has been fixed? It would be a huge help.
In my experience, you first refuse wrongly authenticated request on non-public resources, including possibly non-existing ones, as you might not want to leak information (e.g. a package name could be a private information you don't want to expose, so scanning and filtering 403 vs 404 would allow to make a leak). But I guess both can be considered. Either way, what matters is that poetry does not crash in such cases. |
Should be available since
I suspect our experiences and personal tastes differ here. Typically you'd opt for a 404. An example of this is github itself. From an unauthorised user's perspective the resource does not exist. Unless there is a need to act explicitly on a 403, returning it is not something I personally would choose unless I have to. And S3 buckets doing 403s is largely accepted as a confusing "feature".
Indeed. |
Hi! thanks for explaining why this is happening. In my case (in issue #5538), I was expecting that by setting my private repo as secondary, then Poetry would look into pipy first and then into my What I understand from your reply is that :
I would expect that poetry catches the failure and defaults to the first (and only) version available. As it is, |
This is incorrect. If no packages were found in secondaries Poetry will only consider the ones it already found. |
Hi! thanks for replying. In my case, it happens when I run an |
@diegoquintanav as i mentioned in #4704 (comment) the change to this being a warning and not an error; is already available since Poetry |
This is expected behavior. See https://python-poetry.org/docs/master/repositories/#secondary-package-sources. |
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: Linux 5.14.12 & 5.16.0
Poetry version: 1.1.11 & 1.2.0a2
Issue
Adding a source like
Works perfectly well when installing torch with
but when trying to add
mypy
with poetry addpoetry add mypy
then I got a :Which obviously doesn't work as mypy is not in the pytorch package repository....
I don't get why pypi is not the default and "Pytorch" just as a fallback.
Thanks in advance for any help,
Have a great day.
The text was updated successfully, but these errors were encountered: