How to update setuptools to current during travis build

I am trying to develop a python program with the latest version of setuptools. But every time my assembly crashes 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 this:

  • Updating / reinstalling setuptools in travis.yml has no effect since the "virtualenv" created by tox has previous setuptools
  • unable to update / reinstall setuptools before calling setup.py on tox (dependencies are installed after this step)

Any idea?

I run 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 toxicity configuration ("tox.ini") is as follows:

[tox]
envlist = py26, py27

[testenv]
commands =
    nosetests

[testenv:py26]

[testenv:py27]
+4
source share
3

:

[testenv]
deps =
  setuptools==5.4.1  # Or whatever version you need
commands =
  nosetests
+5

, setuptools install:

install:
  - pip install -U pip wheel
  - pip install setuptools==24.0.3
  - pip install -r ourapp/requirements/requirements.txt
+4

In tox.ini:

deps =
    setuptools=38.2.5

It will block the initial installation of python with this version in a toxic environment. Then avec will install the one that is required for the egg.

+1
source

Source: https://habr.com/ru/post/1548186/


All Articles