tox: tox fails due to ssl

Thanks for submitting an issue!

You’re welcome.

Stacktrace:

Jims-MacBook-Pro:pytest-tags jimbrannlund$ tox
GLOB sdist-make: /Users/jimbrannlund/dev/pytest-tags/setup.py
py27-pytest29 inst-nodeps: /Users/jimbrannlund/dev/pytest-tags/.tox/dist/pytest-tags-1.5.dev3+gc8cf057.d20180508.zip
ERROR: invocation failed (exit code 1), logfile: /Users/jimbrannlund/dev/pytest-tags/.tox/py27-pytest29/log/py27-pytest29-4.log
ERROR: actionid: py27-pytest29
msg: installpkg
cmdargs: ['/Users/jimbrannlund/dev/pytest-tags/.tox/py27-pytest29/bin/pip', 'install', '-U', '--no-deps', '/Users/jimbrannlund/dev/pytest-tags/.tox/dist/pytest-tags-1.5.dev3+gc8cf057.d20180508.zip']

Processing ./.tox/dist/pytest-tags-1.5.dev3+gc8cf057.d20180508.zip
    Complete output from command python setup.py egg_info:
    Download error on https://pypi.org/simple/setuptools_scm/: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) -- Some packages may not be found!
    Download error on https://pypi.org/simple/setuptools-scm/: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) -- Some packages may not be found!
    Couldn't find index page for 'setuptools_scm' (maybe misspelled?)
    Download error on https://pypi.org/simple/: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) -- Some packages may not be found!
    No local packages or working download links found for setuptools_scm
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/8g/g0s3c_xn0d793245v_mj5khm0000gn/T/pip-req-build-QWAMDv/setup.py", line 41, in <module>
        'Programming Language :: Python :: 3.6'])
      File "/Users/jimbrannlund/dev/pytest-tags/.tox/py27-pytest29/lib/python2.7/site-packages/setuptools/__init__.py", line 128, in setup
        _install_setup_requires(attrs)
      File "/Users/jimbrannlund/dev/pytest-tags/.tox/py27-pytest29/lib/python2.7/site-packages/setuptools/__init__.py", line 123, in _install_setup_requires
        dist.fetch_build_eggs(dist.setup_requires)
      File "/Users/jimbrannlund/dev/pytest-tags/.tox/py27-pytest29/lib/python2.7/site-packages/setuptools/dist.py", line 504, in fetch_build_eggs
        replace_conflicting=True,
      File "/Users/jimbrannlund/dev/pytest-tags/.tox/py27-pytest29/lib/python2.7/site-packages/pkg_resources/__init__.py", line 774, in resolve
        replace_conflicting=replace_conflicting
      File "/Users/jimbrannlund/dev/pytest-tags/.tox/py27-pytest29/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1057, in best_match
        return self.obtain(req, installer)
      File "/Users/jimbrannlund/dev/pytest-tags/.tox/py27-pytest29/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1069, in obtain
        return installer(requirement)
      File "/Users/jimbrannlund/dev/pytest-tags/.tox/py27-pytest29/lib/python2.7/site-packages/setuptools/dist.py", line 571, in fetch_build_egg
        return cmd.easy_install(req)
      File "/Users/jimbrannlund/dev/pytest-tags/.tox/py27-pytest29/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 667, in easy_install
        raise DistutilsError(msg)
    distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('setuptools_scm')
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/8g/g0s3c_xn0d793245v_mj5khm0000gn/T/pip-req-build-QWAMDv/

MacOS 10.12.6

tox --version: 3.0.0 imported from /usr/local/lib/python3.6/site-packages/tox/init.py

pip3 list:

Package          Version  
---------------- ---------
certifi          2018.4.16
pip              10.0.1   
pipenv           11.10.3  
pluggy           0.6.0    
py               1.5.3    
setuptools       39.1.0   
six              1.11.0   
tox              3.0.0    
virtualenv       15.2.0   
virtualenv-clone 0.3.0    
wheel            0.31.0   

tox.ini:


# Tox (http://tox.testrun.org/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.

[tox]
envlist = py{27,36}-pytest{29,30,31,32,33,34,35}, flake8

[testenv]
commands = py.test -v -r a {posargs}
deps =
    pytest29: pytest==2.9.2
    pytest30: pytest==3.0.7
    pytest31: pytest==3.1.3
    pytest32: pytest==3.2.5
    pytest33: pytest==3.3.2
    pytest34: pytest==3.4.2
    pytest35: pytest==3.5.1

[testenv:flake8]
skip_install = true
basepython = python
deps = flake8
commands = flake8 {posargs:.}

[flake8]
exclude = .tox,build

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 16 (6 by maintainers)

Commits related to this issue

Most upvoted comments

I’m experiencing this issue as well on more recent Pythons (latest available Python 3.5 binary for macOS).

I can replicate the issue by simply invoking tox twice on any of my projects. For example, consider portend:

portend master $ tox -e py35
py35 create: /Users/jaraco/code/main/portend/.tox/py35
py35 installdeps: setuptools>=31.0.1
py35 develop-inst: /Users/jaraco/code/main/portend
py35 installed: You are using pip version 10.0.1, however version 18.1 is available.,You should consider upgrading via the 'pip install --upgrade pip' command.,atomicwrites==1.2.1,attrs==18.2.0,docutils==0.14,flake8==3.6.0,importlib-metadata==0.7,jaraco.functools==1.20,mccabe==0.6.1,more-itertools==4.3.0,pathlib2==2.3.3,pluggy==0.8.0,-e git+gh://jaraco/portend@00351e5cf677a5636dd5466ef6b5b50548fb72c5#egg=portend,py==1.7.0,pycodestyle==2.4.0,pyflakes==2.0.0,pytest==4.0.1,pytest-checkdocs==1.1.1,pytest-flake8==1.0.2,pytz==2018.7,six==1.11.0,tempora==1.14
py35 run-test-pre: PYTHONHASHSEED='2537722485'
py35 runtests: commands[0] | pytest
================================================================================== test session starts ==================================================================================
platform darwin -- Python 3.5.4, pytest-4.0.1, py-1.7.0, pluggy-0.8.0
cachedir: .tox/py35/.pytest_cache
rootdir: /Users/jaraco/code/main/portend, inifile: pytest.ini
plugins: flake8-1.0.2, checkdocs-1.1.1
collected 14 items

portend.py ......                                                                                                                                                                 [ 42%]
setup.py ..                                                                                                                                                                       [ 57%]
test_portend.py .....                                                                                                                                                             [ 92%]
docs/conf.py .                                                                                                                                                                    [100%]

=============================================================================== 14 passed in 1.26 seconds ===============================================================================
________________________________________________________________________________________ summary ________________________________________________________________________________________
  py35: commands succeeded
  congratulations :)
portend master $ tox -e py35 -v
using tox.ini: /Users/jaraco/code/main/portend/tox.ini
using tox-3.5.3 from /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tox/__init__.py
py35 reusing: /Users/jaraco/code/main/portend/.tox/py35
  /Users/jaraco/code/main/portend$ /Users/jaraco/code/main/portend/.tox/py35/bin/python /Users/jaraco/code/main/portend/setup.py --name
Download error on https://pypi.org/simple/setuptools_scm/: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:719) -- Some packages may not be found!
Download error on https://pypi.org/simple/setuptools-scm/: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:719) -- Some packages may not be found!
Couldn't find index page for 'setuptools_scm' (maybe misspelled?)
Download error on https://pypi.org/simple/: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:719) -- Some packages may not be found!
No local packages or working download links found for setuptools_scm>=1.15.0
Traceback (most recent call last):
  File "/Users/jaraco/code/main/portend/setup.py", line 8, in <module>
    setuptools.setup(use_scm_version=True)
  File "/Users/jaraco/code/main/portend/.tox/py35/lib/python3.5/site-packages/setuptools/__init__.py", line 128, in setup
    _install_setup_requires(attrs)
  File "/Users/jaraco/code/main/portend/.tox/py35/lib/python3.5/site-packages/setuptools/__init__.py", line 123, in _install_setup_requires
    dist.fetch_build_eggs(dist.setup_requires)
  File "/Users/jaraco/code/main/portend/.tox/py35/lib/python3.5/site-packages/setuptools/dist.py", line 504, in fetch_build_eggs
    replace_conflicting=True,
  File "/Users/jaraco/code/main/portend/.tox/py35/lib/python3.5/site-packages/pkg_resources/__init__.py", line 774, in resolve
    replace_conflicting=replace_conflicting
  File "/Users/jaraco/code/main/portend/.tox/py35/lib/python3.5/site-packages/pkg_resources/__init__.py", line 1057, in best_match
    return self.obtain(req, installer)
  File "/Users/jaraco/code/main/portend/.tox/py35/lib/python3.5/site-packages/pkg_resources/__init__.py", line 1069, in obtain
    return installer(requirement)
  File "/Users/jaraco/code/main/portend/.tox/py35/lib/python3.5/site-packages/setuptools/dist.py", line 571, in fetch_build_egg
    return cmd.easy_install(req)
  File "/Users/jaraco/code/main/portend/.tox/py35/lib/python3.5/site-packages/setuptools/command/easy_install.py", line 667, in easy_install
    raise DistutilsError(msg)
distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('setuptools_scm>=1.15.0')
  /Users/jaraco/code/main/portend$ /Users/jaraco/code/main/portend/.tox/py35/bin/python -m pip freeze >/Users/jaraco/code/main/portend/.tox/py35/log/py35-4.log
py35 installed: You are using pip version 10.0.1, however version 18.1 is available.,You should consider upgrading via the 'pip install --upgrade pip' command.,atomicwrites==1.2.1,attrs==18.2.0,docutils==0.14,flake8==3.6.0,importlib-metadata==0.7,jaraco.functools==1.20,mccabe==0.6.1,more-itertools==4.3.0,pathlib2==2.3.3,pluggy==0.8.0,-e git+gh://jaraco/portend@00351e5cf677a5636dd5466ef6b5b50548fb72c5#egg=portend,py==1.7.0,pycodestyle==2.4.0,pyflakes==2.0.0,pytest==4.0.1,pytest-checkdocs==1.1.1,pytest-flake8==1.0.2,pytz==2018.7,six==1.11.0,tempora==1.14
________________________________________________________________________________________ summary ________________________________________________________________________________________
ERROR:   py35: InvocationError for command '/Users/jaraco/code/main/portend/.tox/py35/bin/python /Users/jaraco/code/main/portend/setup.py --name' (exited with code 1)

Upgrading pip and setuptools to the latest results in the same outcome.

The first run works fine, but the second run fails when tox invokes setup.py --name. Because the package declares a setup_requires argument, and because tox isn’t honoring the PEP-518 declaration for that build dependency, the setup.py invocation falls back to honoring setup_requires, invoking the deprecated easy_install which has only old TLS support as was included in the Python 3.5.4 build on macOS.

My instinct is that tox should not be invoking setup.py (anything) and if it needs the name of the local package, it should get it another way. I believe the importlib_metadata project would be the best place for that functionality, and in issue 27, I’ve captured the shortcoming of that library. That issue also links to a workaround I’ve implemented in pytest-checkdocs that works with the current releases of importlib_metadata.

Fixed by installing non mac os python 2.7 brew install python@2