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

Public PyPI url appears to be incorrect as a fallback for custom package repository #1942

Closed
3 tasks done
tdhopper opened this issue Jan 24, 2020 · 1 comment · Fixed by #2099
Closed
3 tasks done
Labels
kind/bug Something isn't working as expected

Comments

@tdhopper
Copy link

tdhopper commented Jan 24, 2020

  • 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).

Issue

I am trying to install a package from our internal pypi server. For whatever reason, it is failing with "No matching distribution found for setuptools". It appears to me that the pip install command generated by poetry has --extra-index-url https://pypi.org/ when it should have --extra-index-url https://pypi.org/simple.

Below is the output of the poetry add. The pip command that fails is

/Users/thopper/c/poetry-test/env/bin/pip install --no-deps --cert /Users/thopper/cert.pem --index-url https://artifactory.example.com/api/pypi/example-pypi/simple --extra-index-url https://pypi.org/ my_package==0.2.0

However, if I change it (manually) to

/Users/thopper/c/poetry-test/env/bin/pip install --no-deps --cert /Users/thopper/cert.pem --index-url https://artifactory.example.com/api/pypi/example-pypi/simple --extra-index-url https://pypi.org/simple my_package==0.2.0

it complete successfully. Is it possible that the hard coded address for PyPI is wrong?

$ poetry add my_package -vvv
Using virtualenv: /Users/thopper/c/poetry-test/env
PyPI: No packages found for my_package *
example-pypi: 2 packages found for my_package *
Using version ^0.2.0 for my_package

Updating dependencies
Resolving dependencies...
   1: fact: poetry-test is 0.1.0
   1: derived: poetry-test
   1: fact: poetry-test depends on my_package (^0.2.0)
   1: selecting poetry-test (0.1.0)
   1: derived: my_package (^0.2.0)
PyPI: No packages found for my_package >=0.2.0,<0.3.0
example-pypi: 1 packages found for my_package >=0.2.0,<0.3.0
PyPI: Getting info for my_package (0.2.0) from PyPI
   1: fact: my_package (0.2.0) depends on internal-yoyo-migrations (*)
   1: fact: my_package (0.2.0) depends on jinja2 (*)
   1: fact: my_package (0.2.0) depends on psycopg2-binary (*)
   1: fact: my_package (0.2.0) depends on python-sql (*)
   1: selecting my_package (0.2.0)
   1: derived: python-sql (*)
   1: derived: psycopg2-binary (*)
   1: derived: jinja2 (*)
   1: derived: internal-yoyo-migrations (*)
   1: selecting python-sql (1.0.0)
   1: selecting psycopg2-binary (2.8.4)
   1: fact: jinja2 (2.10.3) depends on MarkupSafe (>=0.23)
   1: selecting jinja2 (2.10.3)
   1: derived: MarkupSafe (>=0.23)
PyPI: Getting info for internal-yoyo-migrations (6.1.1) from PyPI
   1: fact: internal-yoyo-migrations (6.1.1) depends on text-unidecode (*)
   1: fact: internal-yoyo-migrations (6.1.1) depends on iniherit (*)
   1: selecting internal-yoyo-migrations (6.1.1)
   1: derived: iniherit (*)
   1: derived: text-unidecode (*)
   1: selecting markupsafe (1.1.1)
   1: fact: iniherit (0.3.9) depends on six (>=1.6.1)
   1: selecting iniherit (0.3.9)
   1: derived: six (>=1.6.1)
   1: selecting text-unidecode (1.3)
   1: selecting six (1.14.0)
   1: Version solving took 0.463 seconds.
   1: Tried 1 solutions.

Writing lock file


Package operations: 9 installs, 0 updates, 0 removals

  - Installing six (1.14.0)
  - Installing iniherit (0.3.9)
  - Installing markupsafe (1.1.1)
  - Installing text-unidecode (1.3)
  - Installing internal-yoyo-migrations (6.1.1)
  - Installing jinja2 (2.10.3)
  - Installing psycopg2-binary (2.8.4)
  - Installing python-sql (1.0.0)
  - Installing my_package (0.2.0)

[EnvCommandError]
Command ['/Users/thopper/c/poetry-test/env/bin/pip', 'install', '--no-deps', '--cert', '/Users/thopper/cert.pem', '--index-url', 'https://artifactory.example.com/api/pypi/example-pypi/simple', '--extra-index-url', 'https://pypi.org/', 'my_package==0.2.0'] errored with the following return code 1, and output:
Looking in indexes: https://artifactory.example.com/api/pypi/example-pypi/simple, https://pypi.org/
Collecting my_package==0.2.0
  Using cached https://artifactory.example.com/api/pypi/example-pypi/my_package/0.2.0/my_package-0.2.0.tar.gz
  Installing build dependencies: started
  Installing build dependencies: finished with status 'error'
  Complete output from command /Users/thopper/c/poetry-test/env/bin/python -m pip install --ignore-installed --no-user --prefix /private/var/folders/mg/9dh5w1r93w3630s4p0y33_c40000gn/T/pip-build-env-y1xpueb9 --no-warn-script-location --no-binary :none: --only-binary :none: -i https://artifactory.example.com/api/pypi/example-pypi/simple --extra-index-url https://pypi.org/ -- setuptools wheel:
  Looking in indexes: https://artifactory.example.com/api/pypi/example-pypi/simple, https://pypi.org/
  Collecting setuptools
    Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)'),)': /api/pypi/example-pypi/simple/setuptools/
    Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)'),)': /api/pypi/example-pypi/simple/setuptools/
    Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)'),)': /api/pypi/example-pypi/simple/setuptools/
    Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)'),)': /api/pypi/example-pypi/simple/setuptools/
    Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)'),)': /api/pypi/example-pypi/simple/setuptools/
    Could not fetch URL https://artifactory.example.com/api/pypi/example-pypi/simple/setuptools/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='artifactory.example.com', port=443): Max retries exceeded with url: /api/pypi/example-pypi/simple/setuptools/ (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)'),)) - skipping
    Could not find a version that satisfies the requirement setuptools (from versions: )
  No matching distribution found for setuptools
  You are using pip version 18.1, however version 20.0.2 is available.
  You should consider upgrading via the 'pip install --upgrade pip' command.

  ----------------------------------------
Command "/Users/thopper/c/poetry-test/env/bin/python -m pip install --ignore-installed --no-user --prefix /private/var/folders/mg/9dh5w1r93w3630s4p0y33_c40000gn/T/pip-build-env-y1xpueb9 --no-warn-script-location --no-binary :none: --only-binary :none: -i https://artifactory.example.com/api/pypi/example-pypi/simple --extra-index-url https://pypi.org/ -- setuptools wheel" failed with error code 1 in None
You are using pip version 18.1, however version 20.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.


Traceback (most recent call last):
  File "/Users/thopper/.poetry/lib/poetry/_vendor/py3.6/clikit/console_application.py", line 131, in run
    status_code = command.handle(parsed_args, io)
  File "/Users/thopper/.poetry/lib/poetry/_vendor/py3.6/clikit/api/command/command.py", line 120, in handle
    status_code = self._do_handle(args, io)
  File "/Users/thopper/.poetry/lib/poetry/_vendor/py3.6/clikit/api/command/command.py", line 171, in _do_handle
    return getattr(handler, handler_method)(args, io, self)
  File "/Users/thopper/.poetry/lib/poetry/_vendor/py3.6/cleo/commands/command.py", line 92, in wrap_handle
    return self.handle()
  File "/Users/thopper/.poetry/lib/poetry/console/commands/add.py", line 149, in handle
    status = installer.run()
  File "/Users/thopper/.poetry/lib/poetry/installation/installer.py", line 74, in run
    self._do_install(local_repo)
  File "/Users/thopper/.poetry/lib/poetry/installation/installer.py", line 286, in _do_install
    self._execute(op)
  File "/Users/thopper/.poetry/lib/poetry/installation/installer.py", line 302, in _execute
    getattr(self, '_execute_{}'.format(method))(operation)
  File "/Users/thopper/.poetry/lib/poetry/installation/installer.py", line 327, in _execute_install
    self._installer.install(operation.package)
  File "/Users/thopper/.poetry/lib/poetry/installation/pip_installer.py", line 97, in install
    self.run(*args)
  File "/Users/thopper/.poetry/lib/poetry/installation/pip_installer.py", line 123, in run
    return self._env.run_pip(*args, **kwargs)
  File "/Users/thopper/.poetry/lib/poetry/utils/env.py", line 843, in run_pip
    return self._run(cmd, **kwargs)
  File "/Users/thopper/.poetry/lib/poetry/utils/env.py", line 1071, in _run
    return super(VirtualEnv, self)._run(cmd, **kwargs)
  File "/Users/thopper/.poetry/lib/poetry/utils/env.py", line 875, in _run
    raise EnvCommandError(e, input=input_)
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
1 participant