-
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 add with --index-url option #7685
Comments
https://python-poetry.org/docs/repositories/, please close |
Thanks! |
Sorry, I read the docs and clearly I'm missing something. So I have in [[tool.poetry.source]]
name = "pytorch-cpu"
url = "https://download.pytorch.org/whl/cpu"
default = false
secondary = true I do: poetry add --source pytorch-cpu torch and see: [tool.poetry.dependencies]
python = ">=3.9,<3.11"
typed-argument-parser = "^1.7.2"
opencv-python = "4.6.0.66"
pillow = "^9.3.0"
tqdm = "^4.64.1"
scikit-image = "^0.19.3"
numpy = "^1.23.5"
tornado = "^6.2"
parse = "^1.19.0"
more-itertools = "^9.0.0"
torch = {version = "^2.0.0+cpu", source = "pytorch-cpu"}
[tool.poetry.group.dev.dependencies]
isort = "^5.11.2"
pyupgrade = "^3.3.1"
black = "^22.12.0"
mypy = "^0.991"
flake8 = "^6.0.0"
pre-commit = "^2.20.0"
pytest-cov = "^4.0.0"
ipdb = "^0.13.11"
pdbpp = "^0.10.3" All looks fine. Then I try
I tried to convert all my entries to: isort = { version = "^5.11.2", source = "pypi" }
... Play with Basically, I want to use The rationale here is: I want to publish a package with torch-cpu dependency but I want to be able to work locally using the torch-gpu enabled. |
please read the docs again - specifically the bit that says "All package sources (including secondary sources) will be searched during the package lookup process." - and subscribe to #6713 |
Ok, I got it, I just have to wait it searches... I was having difficult to understand this bit:
I still don't understand that statement, but I glad I got it to work as I wanted. [tool.poetry.dependencies]
torch = {version = "^2.0.0+cpu", source = "pytorch-cpu"}
...
[tool.poetry.group.dev.dependencies]
torch = {version = "^2.0.0", source = "pypi"}
... |
I'm going to say what I think everyone that came to this issue is thinking. The answer from @hyliu1989 should be on the documentation of |
@Martins6 if you want to see docs changes then by far the best way to make that happen is to submit a merge request |
The best way to make things happen has failed. What is the second best way? |
... and respond to maintainer's feedback on your merge request |
from #8246 (review)
As a newcomer to using Poetry, I like the call out to Pytorch in @hyliu1989 's PR. it is the most common case where private repositories would be used. Also before reading this thread, I wouldn't know to look at the private repository page, the first place I would look is the docs for |
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. |
Feature Request
I do this with pip:
I can't find an equivalent in
poetry
. Suggestion:The text was updated successfully, but these errors were encountered: