Skip to content
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

Some PyPI dependencies not installed when installing a package from a private repository #1897

Closed
3 tasks done
vladimir-genkin opened this issue Jan 16, 2020 · 5 comments · Fixed by #2099
Closed
3 tasks done
Labels
kind/bug Something isn't working as expected

Comments

@vladimir-genkin
Copy link

  • 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: Ubuntu 19.10
  • Poetry version: 1.0.2

Issue

When running poetry install with the pyproject.toml containing a package from a private repository, poetry does install most of the packages from PyPI, but when it comes to installing the private package itself, it fails to install some dependencies:

 Looking in indexes: https://private-repository-url/+simple, https://pypi.org/
 Collecting poetry>=0.12
   ERROR: Could not find a version that satisfies the requirement poetry>=0.12 (from versions: none)

The workaround was to specify the PyPI source in pyproject.toml:

[[tool.poetry.source]]
name = "pypi-repository"
url = "https://pypi.org/simple/"
default = true

So it seems that a possible fix is to add simple/ at the end of PyPI url.

@vladimir-genkin vladimir-genkin added the kind/bug Something isn't working as expected label Jan 16, 2020
@finswimmer
Copy link
Member

Hello @vladimir-genkin ,

what you describe is exactly this what is written in the docs: https://python-poetry.org/docs/repositories/#install-dependencies-from-a-private-repository

fin swimmer

@peterdeme
Copy link

Hey guys, we just spent 3 hours debugging this issue. @finswimmer why not auto-append /simple from the end of the URL if it's missing?

@declension
Copy link

See near-duplicate: #1942

@aperiodic
Copy link

aperiodic commented Jan 30, 2020

@finswimmer the docs say that the private repository will take precedence over PyPI, but will not be used exclusively unless that source is configured as the default source. The bug here (and in #1942) is that when a package is installed from a private repository, dependencies of the private package that are on PyPI are not found (even though the private repository is not configured to be the default) because the PyPI URL that poetry passes to pip is incorrect.

To demonstrate that this is the case, I added secondary = true to the source definition for our private repository in our pyproject.toml, exactly as recommended by the docs you linked to, but poetry still cannot find setuptools when trying to install a direct dependency from our private repository:

[EnvCommandError]
Command ['/Users/Daniel/src/work/redacted/data-atlas/env/bin/pip', 'install', '--no-deps', '--cert', '/Users/Daniel/.pip/certs/PythonIndicesCerts.pem', '--index-url', 'https://redacted.com/api/pypi/redacted-pypi/simple', '--extra-index-url', 'https://pypi.org/',
 'fucine==0.2.0'] errored with the following return code 1, and output:
Looking in indexes: https://redacted.com/api/pypi/datsci-pypi/simple, https://pypi.org/
Collecting fucine==0.2.0
  Using cached https://redacted.com/api/pypi/datsci-pypi/fucine/0.2.0/fucine-0.2.0.tar.gz
  Installing build dependencies: started
  Installing build dependencies: finished with status 'error'
  Complete output from command /Users/Daniel/src/work/redacted/data-atlas/env/bin/python3.6 -m pip install --ignore-installed --no-user --prefix /private/var/folders/hc/c5w3vvjs221c7bbb50m9lyn40000gp/T/pip-build-env-qpmwx5_4 --no-warn-script-location --no-binary :none: --only-binary :none: -i https://redacted.com/api/pypi/datsci-pypi/simple --extra-index-url https://pypi.org/ -- setuptools wheel:
  Looking in indexes: https://redacted.com/api/pypi/datsci-pypi/simple, https://pypi.org/
  Collecting setuptools
    Could not find a version that satisfies the requirement setuptools (from versions: )

Note the incorrect PyPI URL https://pypi.org/ appears throughout, instead of the correct URL https://pypi.org/simple/.

Adding PyPI explicitly to our pyproject.toml as a poetry source, with the correct URL https://pypi.org/simple/, resolves the problem, as it did for @vladimir-genkin.

Copy link

github-actions bot commented Mar 3, 2024

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected
Projects
None yet
5 participants