tox

Reporting cumulative coverage across multiple Python versions

筅森魡賤 提交于 2019-12-09 15:54:09
问题 I have code that runs conditionally depending on the current version of Python, because I'm supporting 2.6, 2.7, and 3.3 from the same package. I currently generate a coverage report like this, using the default version of Python: coverage run --source mypackage setup.py test coverage report -m coverage html This is useful but not ideal, as it only reports coverage on Python 2.7. Instead, I would like to generate a cumulative report of the test coverage across 2.6, 2.7, and 3.2. How do I

tox can't detect python interpreter in D:\python27 path

假如想象 提交于 2019-12-08 20:40:28
问题 My tox.ini file looks like this [tox] envlist=py27 [testenv] deps= pytest This fails to find my base python installation which is at D:\python27 and not the standard c:\python27 location If I change tox.ini to this, it works but looks ugly. [tox] envlist=cpy27,dpy27 skip_missing_interpreters=True toxworkdir={toxinidir}/build/tox [testenv] basepython= cpy27: C:\Python27\python.exe dpy27: D:\Python27\python.exe deps= pytest so my question, how can I configure tox so it can figure out where

ImportError: No module named zlib; tox

随声附和 提交于 2019-12-08 07:48:50
问题 I am trying to run tox tests as python 2.6. I just installed 2.6 and am now getting past the "Interpreter error: no python 2.6" style error, but tox is now crashing at zlib. Zlib is on my machine however. My tox issue looks like: $ tox -e py26 GLOB sdist-make: /home/cchilders/work_projects/webapi/setup.py py26 create: /home/cchilders/work_projects/webapi/.tox/py26 ERROR: invocation failed (exit code 1), logfile: /home/cchilders/work_projects/webapi/.tox/py26/log/py26-0.log ERROR: actionid:

What should a Python project structure look like for Travis CI to find and run tests?

徘徊边缘 提交于 2019-12-04 05:46:04
I currently have a project with the following .travis.yml file: language: python install: "pip install tox" script: "tox" Locally, tox properly executes and runs 35 tests, but on Travis CI, it runs 0 tests . More details: https://travis-ci.org/neverendingqs/pyiterable/builds/78954867 I also tried other ways, including: language: python python: - "2.6" - "2.7" - "3.2" - "3.3" - "3.4" - "3.5.0b3" - "3.5-dev" - "nightly" # also fails with just `nosetest` and no `install` step install: "pip install coverage unittest2" script: "nosetests --with-coverage --cover-package=pyiterable" They also could

Install-time dependencies in requirements.txt

◇◆丶佛笑我妖孽 提交于 2019-12-04 04:22:21
问题 I'm using tox to prepare venv and run unit tests and my application needs openopt library which in turn imports numpy.distutils.core in its setup.py. No matter how I order numpy and openopt in my requirements.txt I can't ensure numpy is installed before setup.py from openopt is executed and exit with ImportError: No module named numpy.distutils.core How can I fix that? For development I can add numpy to requirements.txt, run tox, add openopt and run tox again but it's not production-ready

How to import all the environment variables in tox

牧云@^-^@ 提交于 2019-12-03 22:21:54
I'm using following in setenv to import the environment variable from where I run, but is there a way to import all the variables so that I don't really need to import one by one. e.g: {env:TEMPEST_CONFIG:} and {env:TEMPEST_CONFIG_DIR:} used to import these 2 variables. [testenv:nosetests] setenv = TEMPEST_CONFIG={env:TEMPEST_CONFIG:} TEMPEST_CONFIG_DIR={env:TEMPEST_CONFIG_DIR:} deps = {[testenv]deps} commands = find . -type f -name "*.pyc" -delete bash {toxinidir}/tools/setup.sh nosetests --with-xunit {posargs} You can use passenv . If you pass the catch all wildcard * you have access to all

How to run Tox with Travis-CI

假如想象 提交于 2019-12-02 18:09:32
How do you test different Python versions with Tox from within Travis-CI ? I have a tox.ini : [tox] envlist = py{27,33,34,35} recreate = True [testenv] basepython = py27: python2.7 py33: python3.3 py34: python3.4 py35: python3.5 deps = -r{toxinidir}/pip-requirements.txt -r{toxinidir}/pip-requirements-test.txt commands = py.test which runs my Python unittests in several Python versions and works perfectly. I want to setup a build in Travis-CI to automatically run this when I push changes to Github, so I have a .travis.yml : language: python python: - "2.7" - "3.3" - "3.4" - "3.5" install: - pip

Does tox.ini need escaping for anchors in URLs (hash #)?

自作多情 提交于 2019-12-02 10:14:39
I have a tox.ini like this [tox] skipsdist = True envlist = begin,py35,py36,end [testenv] commands = pip install -e git+ssh://git@bitbucket.org/org/repo#egg=repo[server] and I get the error Could not detect requirement name for 'git+ssh://git@bitbucket.org/org/repo.git', please specify one with #egg=your_package_name It looks very much as if the # is treated as a comment. Is that the case? How can I escape it? What I tried \# : The \ is recognized, but not the rest - so it is not an escape character Quoting the whole string: ERROR: InvocationError: could not find executable 'pip install -e git

Copying setup.py Dependencies with Tox

不打扰是莪最后的温柔 提交于 2019-12-02 02:49:34
问题 setup.py often depends on a couple external files, most notably README.md for long_description , and maybe VERSION for version . e.g. root = os.path.dirname(os.path.abspath(__file__)) setuptools.setup( name = 'package', version = open(os.path.join(root, 'VERSION')).read().strip(), description = 'A Simple Package', long_description = open(os.path.join(root, 'README.md')).read().strip(), # ... ) However, when trying to run tests with tox on such a package, I get the following error: ERROR:

Copying setup.py Dependencies with Tox

一世执手 提交于 2019-12-02 02:19:51
setup.py often depends on a couple external files, most notably README.md for long_description , and maybe VERSION for version . e.g. root = os.path.dirname(os.path.abspath(__file__)) setuptools.setup( name = 'package', version = open(os.path.join(root, 'VERSION')).read().strip(), description = 'A Simple Package', long_description = open(os.path.join(root, 'README.md')).read().strip(), # ... ) However, when trying to run tests with tox on such a package, I get the following error: ERROR: invocation failed (exit code 1), logfile: .tox/py36/log/py36-6.log ERROR: actionid: py36 msg: installpkg