-
Notifications
You must be signed in to change notification settings - Fork 7
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
Route as '--find-links' replacement #2
Comments
Assuming pytorch’s find-link page is valid HTML5 (I quickly checked and it seems to be the case), you should be able to just route all pytorch-related packages to it: # Run `simpleindex path/to/this/file.toml` to start the server.
[routes.torch]
source = "http"
to = "https://download.pytorch.org/whl/torch_stable.html"
[routes."torch{suffix}"]
source = "http"
to = "https://download.pytorch.org/whl/torch_stable.html"
[routes."{project}"]
source = "http"
to = "https://pypi.org/simple/{project}/"
[host]
host = "127.0.0.1"
port = 8000 # Add this to `pyproject.toml`
[[tool.poetry.source]]
name = "local"
url = "http://127.0.0.1:8000/"
default = true This should be able to make Poetry find the packages. I said should be because it does not. Pytorch’s find-links page has links like this <a href="torch-0.1-cp27-cp27m-macosx_10_6_x86_64.whl">torch-0.1-cp27-cp27m-macosx_10_6_x86_64.whl</a> Simpleindex uses 302 FOUND to redirect requests to the actual page, and Poetry would resolve PEP 503 does not really say what should happen when an endpoint returns redirection, but pip’s behaviour is likely more expected by users since that’s what every web browser in the world does, so Poetry should probably match it. |
Thanks a lot for looking into this. I think I saw a bug report and PR in poetry's ticket tracker about URL redirections. Maybe it is related: |
Yeah, I think those are the exact same issue. |
I see python-poetry/poetry#3198 has been merged, so should this be closed? |
@uranusjr Absolutely. Although I lost touch with the topic, I don't see any reason to keep this ticket open. Thanks for answering my initial question. |
I see people are struggling with installing pytorch on Windows, especially with poetry since it does not know how to do something like pip's
--find-links
option does. Would simpleindex be able to help in such a scenario?Typically the recommended installation command for Windows looks like:
which seems to be impossible to do with poetry.
The text was updated successfully, but these errors were encountered: