jeudi 25 janvier 2018

tox how to provide trusted host in pip install?

I created local pypi server, I added indexserver config in my tox.ini to point to my local pypi server.

$ cat tox.ini

[tox]
indexserver =
    default = https://localhost
    trusted_host = localhost

envlist = py27
skipdist = True

[testenv]
commands=
    flake8 MyLib
    py.test -l --cov=MyLib --cov-report term-missing --cov-report xml --no-cov-on-fail

When I run the tox command, its give ssl error.

$ tox -rv
using tox.ini: /var/lib/jenkins/workspace/cicd-mylib/tox.ini
using tox-0.0.0.dev0 from /usr/lib/python2.6/site-packages/tox/__init__.pyc
GLOB sdist-make: /var/lib/jenkins/workspace/cicd-mylib/setup.py
  /var/lib/jenkins/workspace/cicd-mylib$ /usr/bin/python /var/lib/jenkins/workspace/cicd-mylib/setup.py sdist --formats=zip --dist-dir /var/lib/jenkins/workspace/cicd-mylib/.tox/dist >/var/lib/jenkins/workspace/cicd-mylib/.tox/log/tox-0.log
py27 recreate: /var/lib/jenkins/workspace/cicd-mylib/.tox/py27
  /var/lib/jenkins/workspace/cicd-mylib/.tox$ /usr/bin/python -m virtualenv --python /var/lib/jenkins/.pyenv/shims/python2.7 py27 >/var/lib/jenkins/workspace/cicd-mylib/.tox/py27/log/py27-0.log
py27 inst: /var/lib/jenkins/workspace/cicd-mylib/.tox/dist/MyLib-2.0.26.zip
  /var/lib/jenkins/workspace/cicd-mylib$ /var/lib/jenkins/workspace/cicd-mylib/.tox/py27/bin/pip install -i https://localhost /var/lib/jenkins/workspace/cicd-mylib/.tox/dist/MyLib-2.0.26.zip >/var/lib/jenkins/workspace/cicd-mylib/.tox/py27/log/py27-1.log
ERROR: invocation failed (exit code 1), logfile: /var/lib/jenkins/workspace/cicd-mylib/.tox/py27/log/py27-1.log
ERROR: actionid: py27
msg: installpkg
cmdargs: ['/var/lib/jenkins/workspace/cicd-mylib/.tox/py27/bin/pip', 'install', '-i', 'https://localhost', '/var/lib/jenkins/workspace/cicd-mylib/.tox/dist/MyLib-2.0.26.zip']

Processing ./.tox/dist/MyLib-2.0.26.zip
Collecting cython (from MyLib==2.0.26)
  Could not fetch URL https://localhost/cython/: There was a problem confirming the ssl certificate: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661) - skipping
  Could not find a version that satisfies the requirement cython (from MyLib==2.0.26) (from versions: )
No matching distribution found for cython (from MyLib==2.0.26)

  /var/lib/jenkins/workspace/cicd-mylib$ /var/lib/jenkins/workspace/cicd-mylib/.tox/py27/bin/pip freeze >/var/lib/jenkins/workspace/cicd-mylib/.tox/py27/log/py27-2.log
py27 installed:
_______________________________________________________________________________________________________________ summary _______________________________________________________________________________________________________________
ERROR:   py27: InvocationError: /var/lib/jenkins/workspace/cicd-mylib/.tox/py27/bin/pip install -i https://localhost /var/lib/jenkins/workspace/cicd-mylib/.tox/dist/MyLib-2.0.26.zip (see /var/lib/jenkins/workspace/cicd-mylib/.tox/py27/log/py27-1.log)

When tox runs, its not passing --trusted-host variable in command cmdargs: ['/var/lib/jenkins/workspace/cicd-mylib/.tox/py27/bin/pip', 'install', '-i', 'https://localhost', '/var/lib/jenkins/workspace/cicd-mylib/.tox/dist/MyLib-2.0.26.zip']

How to pass that?

Aucun commentaire:

Enregistrer un commentaire