简体   繁体   中英

Prevent Travis Python environment from pre-installing packages

Is there a way to prevent the Travis Python environment from pre-installing pytest , nose , mock etc.? The versions are old and causing order-dependent problems when upgrading. I want to specify my dependencies only in setup.py , but pytest and py require mutual upgrades, which seems to always fail.

I see there is a virtualenv key for .travis.yml which is sometimes mentioned briefly, but I don't see proper documentation for it.

I didn't find a way to do this, but I found a relatively clean workaround: virtualenvwrapper.sh has a wipeenv command I did not previously know. So now I setup a "modern and clean" virtualenv like this:

before_install:
  - pip install -U pip setuptools virtualenvwrapper
  - source $(which virtualenvwrapper.sh)
  - wipeenv

I don't have to worry about the exact list of packages or intersection of them with my own, and the install / script sections can proceed unhindered by whatever Travis setup for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM