Can't install packages from private static repository
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: macOS Monterey (12.2.1)
- Poetry version: 1.1.13
- Link of a Gist with the contents of your pyproject.toml file: pyproject.toml
Issue
Hey, everyone! 😄
I’m trying to use Poetry as the dependency manager for one of our internal applications. Here we have an internal private PyPI repository that is essentially a static index (served on Github Pages) following the https://<DOMAIN>/python-package-server/<PACKAGE_NAME>/
URL pattern. For each package, we have a list of links to specific repositories where the artifacts live in. Here is an example of what a page looks like for a package in this repository. 👇
<!DOCTYPE html>
<html>
<head>
<title>Links for package</title>
</head>
<body>
<h1>Links for package</h1>
<!-- package-server-links-start -->
<a href="git+https://github.com/<redacted>/package@2.0.0#egg=package-2.0.0">package-2.0.0</a><br/>
<a href="git+https://github.com/<redacted>/package@1.1.0#egg=package-1.1.0">package-1.1.0</a><br/>
<a href="git+https://github.com/<redacted>/package@1.0.0#egg=package-1.0.0">package-1.0.0</a><br/>
</body>
</html>
After adding the private source to pyproject.toml
, the resolver was unable to find matching versions for that package
Loading configuration file /Users/me/Library/Application Support/pypoetry/config.toml
Loading configuration file /Users/me/projects/my-project/poetry.toml
Adding repository private (https://<DOMAIN>/python-package-server)
Using virtualenv: /Users/me/projects/my-project/.venv
[urllib3.connectionpool] Starting new HTTPS connection (1): <DOMAIN>:443
[urllib3.connectionpool] https://<DOMAIN>:443 "GET /python-package-server/package/ HTTP/1.1" 304 0
private: 0 packages found for package * # <---- at least it tried :)
private: 0 packages found for package * # <---- once again? maybe
[urllib3.connectionpool] Starting new HTTPS connection (1): pypi.org:443
[urllib3.connectionpool] https://pypi.org:443 "GET /pypi/package/json/ HTTP/1.1" 404 1988
PyPI: No packages found for package *
I guess this is happening because this format doesn’t seem to be fully PEP 503 complaint, although we never had issues with PIP or PDM before.
After checking for previous discussions, I ended up finding this PR which seems to be related but I’m not completely sure. I’ve tested that specific version (from 5517) to see if it would work on my use case, but, unfortunately, it didn’t.
Any clues on what could be the issue here? 🤔
Thanks!
Issue Analytics
- State:
- Created a year ago
- Comments:7 (4 by maintainers)
GitHub packages supporting Python packages might be helpful in your case. Alternatively, I could also recommend that you use a github release action, similar to
https://github.com/python-poetry/poetry/blob/0d418fc00eab4f15ac7e13063369f85f50aba901/.github/workflows/release.yml#L36-L42
And then in your html file link to the release assets, like in https://github.com/python-poetry/poetry/releases/download/1.2.0b1/poetry-1.2.0b1-py3-none-any.whl.
It seems like my use case falls between the find-links and the PEP 503 index approach. I guess a find-links functionality would probably work for this case but doesn’t seem ideal.
Agreed. Although I feel that, in some cases, setting up a proper private package index might be prohibitive/not worth the effort.