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

trusted-host ignored for dependencies from setup_requires #4156

Closed
jeffallen opened this issue Dec 5, 2016 · 4 comments
Closed

trusted-host ignored for dependencies from setup_requires #4156

jeffallen opened this issue Dec 5, 2016 · 4 comments
Labels
auto-locked Outdated issues that have been locked by automation C: setup_requires For when someone uses setup_requires

Comments

@jeffallen
Copy link

  • Pip version: 9.0.1
  • Python version: 2.7
  • Operating System: windows 7

Description:

Windows 7 does not trust the issuer for python.org. This is fixable by loading the signer's cert in the trusted store, but it is also fixable using --trusted-host.

When installing wile, I get an error about setuptools_scm not installed. This is because wile depends on setuptools_scm only for setup (setup_requires=['setuptools_scm']). pip detects the missing dependency but it fails to load it because of the certificate problem.

It seems to me that trusted-host works correctly for normal depends, but does not work when resolving dependencies from setup_requires.

What I've run:

C:\Users\msfadmin>pip list
DEPRECATION: The default format will switch to columns in the future. You can us
e --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.con
f under the [list] section) to disable this warning.
acme (0.9.3)
cffi (1.9.1)
click (6.6)
cryptography (1.6)
enum34 (1.1.6)
funcsigs (1.0.2)
idna (2.1)
ipaddress (1.0.17)
mock (2.0.0)
ndg-httpsclient (0.4.2)
pbr (1.10.0)
pip (9.0.1)
pyasn1 (0.1.9)
pycparser (2.17)
pyOpenSSL (16.2.0)
pyRFC3339 (1.0)
pytz (2016.7)
requests (2.12.3)
setuptools (20.10.1)
six (1.10.0)

C:\Users\msfadmin>pip install wile
Collecting wile
Downloading wile-0.3.1.tar.gz
Complete output from command python setup.py egg_info:
Download error on https://pypi.python.org/simple/setuptools_scm/: [SSL: CERT
IFICATE_VERIFY_FAILED] certificate verify failed (ssl.c:590) -- Some packages m
ay not be found!
Download error on https://pypi.python.org/simple/setuptools-scm/: [SSL: CERT
IFICATE_VERIFY_FAILED] certificate verify failed (ssl.c:590) -- Some packages m
ay not be found!
Couldn't find index page for 'setuptools_scm' (maybe misspelled?)
Download error on https://pypi.python.org/simple/: [SSL: CERTIFICATE_VERIFY

FAILED] certificate verify failed (ssl.c:590) -- Some packages may not be found
!
No local packages or download links found for setuptools_scm
Traceback (most recent call last):
File "", line 1, in
File "c:\temp\pip-build-1ipvuz\wile\setup.py", line 42, in
'Topic :: Utilities',
File "c:\python27\lib\distutils\core.py", line 111, in setup
setup_distribution = dist = klass(attrs)
File "c:\python27\lib\site-packages\setuptools\dist.py", line 269, in in
it

self.fetch_build_eggs(attrs['setup_requires'])
File "c:\python27\lib\site-packages\setuptools\dist.py", line 313, in fetc
h_build_eggs
replace_conflicting=True,
File "c:\python27\lib\site-packages\pkg_resources_init
.py", line 826,
in resolve
dist = best[req.key] = env.best_match(req, ws, installer)
File "c:\python27\lib\site-packages\pkg_resources_init
.py", line 1092,
in best_match
return self.obtain(req, installer)
File "c:\python27\lib\site-packages\pkg_resources_init
.py", line 1104,
in obtain
return installer(requirement)
File "c:\python27\lib\site-packages\setuptools\dist.py", line 380, in fetc
h_build_egg
return cmd.easy_install(req)
File "c:\python27\lib\site-packages\setuptools\command\easy_install.py", l
ine 634, in easy_install
raise DistutilsError(msg)
distutils.errors.DistutilsError: Could not find suitable distribution for Re
quirement.parse('setuptools_scm')

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in c:\temp\pip-build
-1ipvuz\wile\

C:\Users\msfadmin>pip --trusted-host=pypi.python.org install wile
Collecting wile
Downloading wile-0.3.1.tar.gz
Complete output from command python setup.py egg_info:
Download error on https://pypi.python.org/simple/setuptools_scm/: [SSL: CERT
IFICATE_VERIFY_FAILED] certificate verify failed (ssl.c:590) -- Some packages m
ay not be found!
Download error on https://pypi.python.org/simple/setuptools-scm/: [SSL: CERT
IFICATE_VERIFY_FAILED] certificate verify failed (ssl.c:590) -- Some packages m
ay not be found!
Couldn't find index page for 'setuptools_scm' (maybe misspelled?)
Download error on https://pypi.python.org/simple/: [SSL: CERTIFICATE_VERIFY

FAILED] certificate verify failed (ssl.c:590) -- Some packages may not be found
!
No local packages or download links found for setuptools_scm
Traceback (most recent call last):
File "", line 1, in
File "c:\temp\pip-build-pswlpu\wile\setup.py", line 42, in
'Topic :: Utilities',
File "c:\python27\lib\distutils\core.py", line 111, in setup
setup_distribution = dist = klass(attrs)
File "c:\python27\lib\site-packages\setuptools\dist.py", line 269, in in
it

self.fetch_build_eggs(attrs['setup_requires'])
File "c:\python27\lib\site-packages\setuptools\dist.py", line 313, in fetc
h_build_eggs
replace_conflicting=True,
File "c:\python27\lib\site-packages\pkg_resources_init
.py", line 826,
in resolve
dist = best[req.key] = env.best_match(req, ws, installer)
File "c:\python27\lib\site-packages\pkg_resources_init
.py", line 1092,
in best_match
return self.obtain(req, installer)
File "c:\python27\lib\site-packages\pkg_resources_init
.py", line 1104,
in obtain
return installer(requirement)
File "c:\python27\lib\site-packages\setuptools\dist.py", line 380, in fetc
h_build_egg
return cmd.easy_install(req)
File "c:\python27\lib\site-packages\setuptools\command\easy_install.py", l
ine 634, in easy_install
raise DistutilsError(msg)
distutils.errors.DistutilsError: Could not find suitable distribution for Re
quirement.parse('setuptools_scm')

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in c:\temp\pip-build
-pswlpu\wile\

C:\Users\msfadmin>pip --trusted-host=pypi.python.org install setuptools_scm
Collecting setuptools_scm
Downloading setuptools_scm-1.15.0-py2.py3-none-any.whl
Installing collected packages: setuptools-scm
Successfully installed setuptools-scm-1.15.0

C:\Users\msfadmin>pip --trusted-host=pypi.python.org install wile
Collecting wile
Downloading wile-0.3.1.tar.gz
Requirement already satisfied: six in c:\python27\lib\site-packages (from wile)
Requirement already satisfied: acme>=0.6 in c:\python27\lib\site-packages (from
wile)
Requirement already satisfied: click>=6.0 in c:\python27\lib\site-packages (from
wile)
Requirement already satisfied: pyOpenSSL in c:\python27\lib\site-packages (from
wile)
Requirement already satisfied: cryptography in c:\python27\lib\site-packages (fr
om wile)
Requirement already satisfied: setuptools_scm in c:\python27\lib\site-packages (
from wile)
Requirement already satisfied: setuptools>=1.0 in c:\python27\lib\site-packages
(from acme>=0.6->wile)
Requirement already satisfied: requests in c:\python27\lib\site-packages (from a
cme>=0.6->wile)
Requirement already satisfied: pyasn1 in c:\python27\lib\site-packages (from acm
e>=0.6->wile)
Requirement already satisfied: ndg-httpsclient in c:\python27\lib\site-packages
(from acme>=0.6->wile)
Requirement already satisfied: pytz in c:\python27\lib\site-packages (from acme>
=0.6->wile)
Requirement already satisfied: mock in c:\python27\lib\site-packages (from acme>
=0.6->wile)
Requirement already satisfied: pyrfc3339 in c:\python27\lib\site-packages (from
acme>=0.6->wile)
Requirement already satisfied: ipaddress in c:\python27\lib\site-packages (from
cryptography->wile)
Requirement already satisfied: enum34 in c:\python27\lib\site-packages (from cry
ptography->wile)
Requirement already satisfied: cffi>=1.4.1 in c:\python27\lib\site-packages (fro
m cryptography->wile)
Requirement already satisfied: idna>=2.0 in c:\python27\lib\site-packages (from
cryptography->wile)
Requirement already satisfied: funcsigs>=1; python_version < "3.3" in c:\python2
7\lib\site-packages (from mock->acme>=0.6->wile)
Requirement already satisfied: pbr>=0.11 in c:\python27\lib\site-packages (from
mock->acme>=0.6->wile)
Requirement already satisfied: pycparser in c:\python27\lib\site-packages (from
cffi>=1.4.1->cryptography->wile)
Installing collected packages: wile
Running setup.py install for wile ... done
Successfully installed wile-0.3.1

@piotr-dobrogost
Copy link

piotr-dobrogost commented Dec 5, 2016

setup_requires is handled by setuptools not pip itself so finding out how to allow setuptools to reach this host and acting accordingly would solve this problem; see https://pip.pypa.io/en/stable/reference/pip_install/#controlling-setup-requires
Btw, setuptools use certifi (https://pypi.org/project/certifi/) to obtain root certificates.
Someone already asked this on SO – How to get easy_install to ignore certifcate

@pfmoore
Copy link
Member

pfmoore commented Dec 5, 2016

"Windows 7 does not trust the issuer for python.org" That seems incorrect to me - I have no problem with https URLs from python.org, and I'm on Windows 7. OTOH, it may be that your issue is specific to setuptools/certifi and hence limited to setup_requires handling (which I don't use, so can't really comment on).

@RonnyPfannschmidt
Copy link
Contributor

there is 2 ways to resolve this

a) get the package to provide a wheel
b) support the implementation efforts for PEP518 in pip and switch the package over to it

note: im the author/maintainer of setuptools_scm

@dstufft
Copy link
Member

dstufft commented Mar 30, 2017

This is basically just the age old problem that pip doesn't control setup_requires. Luckily that use case is being superseded by PEP 518 which implementing support for that is being tracked in #3691.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation C: setup_requires For when someone uses setup_requires
Projects
None yet
Development

No branches or pull requests

6 participants