5

I'm trying to develop a python program with a recent version of setuptools. But every time my build fails with the following message:

$ tox -e $TOX_ENV

GLOB sdist-make: /home/travis/build/kartoch/myapp/setup.py

py26 create: /home/travis/build/kartoch/myapp/.tox/py26

py26 inst: /home/travis/build/kartoch/myapp/.tox/dist/myapp-0.1.0.zip

ERROR: invocation failed, logfile: /home/travis/build/kartoch/myapp/.tox/py26/log/py26-1.log

[...]

Unpacking ./.tox/dist/myap-0.1.0.zip

Running setup.py (path:/tmp/pip-P4VhFx-build/setup.py) egg_info for package from file:///home/travis/build/kartoch/myapp/.tox/dist/myapp-0.1.0.zip

The required version of setuptools (>=5.4.1) is not available,

and can't be installed while this script is running. Please

install a more recent version first, using

'easy_install -U setuptools'.

(Currently using setuptools 3.6 (/home/travis/build/kartoch/myapp/.tox/py26/lib/python2.6/site-packages))

Complete output from command python setup.py egg_info:

So far the problem is:

  • updating / re-install setuptools in travis.yml has no effect, as 'virtualenv' generated by tox has previous setuptools
  • cannot upgrade / re-install setuptools before the call to setup.py by tox (dependencies are installed after this step)

Any idea ?

I'm launching my tests with the following'.travis.yml':

language: python
env:
  - TOX_ENV=py26
  - TOX_ENV=py27
install:
  - pip install tox
script: 
  - tox -e $TOX_ENV

The tox configuration ('tox.ini') is the following:

[tox]
envlist = py26, py27

[testenv]
commands =
    nosetests

[testenv:py26]

[testenv:py27]
Kartoch
  • 7,610
  • 9
  • 40
  • 68

3 Answers3

8

Use:

[testenv]
deps =
  setuptools==5.4.1  # Or whatever version you need
commands =
  nosetests
Thomas Orozco
  • 53,284
  • 11
  • 113
  • 116
5

I was able to solve this by adding an updated setuptools to the install section:

install:
  - pip install -U pip wheel
  - pip install setuptools==24.0.3
  - pip install -r ourapp/requirements/requirements.txt
shacker
  • 14,712
  • 8
  • 89
  • 89
1

In the tox.ini:

deps =
    setuptools=38.2.5

It will block the initial python installation with this version within the tox environment. Then avec it will install the one required by the egg.

encolpe
  • 311
  • 2
  • 3