Adding a source even with secondary true take precedence
See original GitHub issue-
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
[[tool.poetry.source]]
name = "pytorch"
url = "https://download.pytorch.org/whl/cu111"
secondary = true
Works perfectly well when installing torch with
torch = { version = "=1.10.0+cpu", source = "pytorch"}
but when trying to add mypy
with poetry add poetry add mypy
then I got a :
403 Client Error: Forbidden for url: https://download.pytorch.org/whl/cpu/mypy
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.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:13
- Comments:21 (7 by maintainers)
Top Results From Across the Web
Confused about Operator Precedence in Python
This outputs True. But shouldn't division have higher precedence than "is" and shouldn't this expression return a ZeroDivsionError?
Read more >Operator precedence - JavaScript - MDN Web Docs - Mozilla
Operator precedence determines how operators are parsed concerning each other. Operators with higher precedence become the operands of operators with lower ...
Read more >Repositories | Documentation | Poetry - Python dependency ...
Any package source not marked as secondary will take precedence over PyPI. Note. If you prefer to disable PyPI completely, you may choose...
Read more >Should I fully parenthesize expressions or rely on precedence ...
Good developers strive to write code that is clear and correct. Parentheses in conditionals, even if they are not strictly required, ...
Read more >Combining and Negating Conditions with AND, OR, and NOT
You can use the AND and OR operators to combine two or more conditions into a compound condition. AND, OR, and a third...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I think I’m experiencing the same issue
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: toml setting
but the default
false
is not recognized for some reason and ends up getting the 403: Error:As mentioned in this ticket, https://github.com/python-poetry/poetry/issues/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: toml setting
Error:
I have been in knots with this one, particularly because there are so many issues open around this issue: https://github.com/python-poetry/poetry/issues/2543 https://github.com/python-poetry/poetry/issues/4231 https://github.com/python-poetry/poetry/issues/3855 https://github.com/python-poetry/poetry/issues/2613 https://github.com/python-poetry/poetry/issues/4704 https://github.com/python-poetry/poetry/issues/2339
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.