1

Just starting out using tox for testing a library with Python 2.7 and 3.4. After using the following tox.ini file I had two questions:

[tox]
envlist = {py27,py3}
sitepackages = True

[testenv]
deps= -rrequirements.txt
commands = nosetests -w tests/ --with-coverage --cover-erase --cover-package=pyppa --with-xunit --xunit-file={toxinidir}/build/ppa-python-sdk_{envname}_unit_tests.xml
coverage xml -o {toxinidir}/build/{envname}_coverage.xml

After running tox I had the following questions:

  1. The project depends on numpy and scipy which are both installed in my global environment, I thought that using sitepackages = True in the tox.ini file would prevent tox from installing these in the virutalenvironment and force it to use those in the global environment but tox installed the latest versions in the .tox/ virtual environments for both 2.7 and 3. Am I misunderstanding the sitepackages directive?
  2. Looking underneath the .tox/ directory at the virtual environment directories I see the following (abbreviated) structure:

.

  .tox/
    py27/
      include/
        python2.7/
      lib
        python2.7/
      ...
    py3/
      include/
        python2.7/
      lib
        python2.7/
      ...

I assure you that this is not a typo. There are directories named python2.7 under the py3 virtual environment include and lib sub-directories and these are the only sub-directories in include and lib. Everything seems to work but I'm just curious as to why these directories are named this way. Can someone shed some light on this?

Thanks.

4

1 回答 1

1

1)sitepackages不是全局 Tox 设置。这是一个环境设置,所以把它放在[testenv].

2)py3不是预定义的变体。改为使用py34

于 2015-08-10T15:49:51.730 回答