[Python-modules-commits] [tox] 01/08: Import tox_2.5.0.orig.tar.gz
Barry Warsaw
barry at moszumanska.debian.org
Wed Nov 16 20:48:56 UTC 2016
This is an automated email from the git hooks/post-receive script.
barry pushed a commit to branch master
in repository tox.
commit 8d36ef34abba11611396515cf27b3337bc1cfcb6
Author: Barry Warsaw <barry at python.org>
Date: Wed Nov 16 15:36:26 2016 -0500
Import tox_2.5.0.orig.tar.gz
---
CHANGELOG | 43 +++++++++++++
CONTRIBUTORS | 2 +
PKG-INFO | 20 +++++-
README.rst | 11 ++++
doc/_templates/indexsidebar.html | 21 -------
doc/_templates/layout.html | 15 -----
doc/_templates/localtoc.html | 4 +-
doc/config.txt | 21 +++----
doc/drafts/tox_conda_notes_niccodemus.md | 11 +++-
doc/example/basic.txt | 12 ++--
doc/example/jenkins.txt | 2 +
doc/install.txt | 2 +-
setup.py | 10 +--
tests/test_config.py | 63 +++++++++++--------
tests/test_venv.py | 45 ++++----------
tests/test_z_cmdline.py | 101 ++++++++++++++++++++++++++++++-
tox.egg-info/PKG-INFO | 20 +++++-
tox.egg-info/SOURCES.txt | 2 -
tox.egg-info/requires.txt | 2 +-
tox.ini | 1 -
tox/__init__.py | 2 +-
tox/_pytestplugin.py | 3 +
tox/config.py | 51 +++++++---------
tox/session.py | 19 +++---
tox/venv.py | 7 +--
25 files changed, 316 insertions(+), 174 deletions(-)
diff --git a/CHANGELOG b/CHANGELOG
index b15f81d..27ba1b3 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,46 @@
+2.5.0
+----------
+
+- slightly backward incompatible: fix issue310: the {posargs} substitution
+ now properly preserves the tox command line positional arguments. Positional
+ arguments with spaces are now properly handled.
+ NOTE: if your tox invocation previously used extra quoting for positional arguments to
+ work around issue310, you need to remove the quoting. Example:
+ tox -- "'some string'" # has to now be written simply as
+ tox -- "some string"
+ thanks holger krekel. You can set ``minversion = 2.5.0`` in the ``[tox]``
+ section of ``tox.ini`` to make sure people using your tox.ini use the correct version.
+
+- fix #359: add COMSPEC to default passenv on windows. Thanks
+ @anthrotype.
+
+- add support for py36 and py37 and add py36-dev and py37(nightly) to
+ travis builds of tox. Thanks John Vandenberg.
+
+- fix #348: add py2 and py3 as default environments pointing to
+ "python2" and "python3" basepython executables. Also fix #347 by
+ updating the list of default envs in the tox basic example.
+ Thanks Tobias McNulty.
+
+- make "-h" and "--help-ini" options work even if there is no tox.ini,
+ thanks holger krekel.
+
+- add {:} substitution, which is replaced with os-specific path
+ separator, thanks Lukasz Rogalski.
+
+- fix #305: ``downloadcache`` test env config is now ignored as pip-8
+ does caching by default. Thanks holger krekel.
+
+- output from install command in verbose (-vv) mode is now printed to console instead of
+ being redirected to file, thanks Lukasz Rogalski
+
+- fix #399. Make sure {envtmpdir} is created if it doesn't exist at the
+ start of a testenvironment run. Thanks Manuel Jacob.
+
+- fix #316: Lack of commands key in ini file is now treated as an error.
+ Reported virtualenv status is 'nothing to do' instead of 'commands
+ succeeded', with relevant error message displayed. Thanks Lukasz Rogalski.
+
2.4.1
-----
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index a4c13e3..e8552b5 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -33,3 +33,5 @@ Eugene Yunak
Mark Hirota
Itxaka Serrano
Alex Grönholm
+Lukasz Rogalski
+Manuel Jacob
diff --git a/PKG-INFO b/PKG-INFO
index 29ed099..47e1216 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: tox
-Version: 2.4.1
+Version: 2.5.0
Summary: virtualenv-based automation of test activities
Home-page: https://tox.readthedocs.org/
Author: holger krekel
@@ -10,6 +10,17 @@ Description:
What is Tox?
--------------------
+
+ .. image:: https://img.shields.io/pypi/v/tox.svg
+ :target: https://pypi.org/project/tox/
+ .. image:: https://img.shields.io/pypi/pyversions/tox.svg
+ :target: https://pypi.org/project/tox/
+ .. image:: https://travis-ci.org/tox-dev/tox.svg?branch=master
+ :target: https://travis-ci.org/tox-dev/tox
+ .. image:: https://img.shields.io/appveyor/ci/RonnyPfannschmidt/tox/master.svg
+ :target: https://ci.appveyor.com/project/RonnyPfannschmidt/tox
+
+
Tox is a generic virtualenv management and test command line tool you can use for:
* checking your package installs correctly with different Python versions and
@@ -41,5 +52,10 @@ Classifier: Operating System :: MacOS :: MacOS X
Classifier: Topic :: Software Development :: Testing
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Utilities
-Classifier: Programming Language :: Python
+Classifier: Programming Language :: Python :: 2
+Classifier: Programming Language :: Python :: 2.6
+Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
+Classifier: Programming Language :: Python :: 3.3
+Classifier: Programming Language :: Python :: 3.4
+Classifier: Programming Language :: Python :: 3.5
diff --git a/README.rst b/README.rst
index 7d8f6d9..8d0b92e 100644
--- a/README.rst
+++ b/README.rst
@@ -2,6 +2,17 @@
What is Tox?
--------------------
+
+.. image:: https://img.shields.io/pypi/v/tox.svg
+ :target: https://pypi.org/project/tox/
+.. image:: https://img.shields.io/pypi/pyversions/tox.svg
+ :target: https://pypi.org/project/tox/
+.. image:: https://travis-ci.org/tox-dev/tox.svg?branch=master
+ :target: https://travis-ci.org/tox-dev/tox
+.. image:: https://img.shields.io/appveyor/ci/RonnyPfannschmidt/tox/master.svg
+ :target: https://ci.appveyor.com/project/RonnyPfannschmidt/tox
+
+
Tox is a generic virtualenv management and test command line tool you can use for:
* checking your package installs correctly with different Python versions and
diff --git a/doc/_templates/indexsidebar.html b/doc/_templates/indexsidebar.html
deleted file mode 100644
index 12bf335..0000000
--- a/doc/_templates/indexsidebar.html
+++ /dev/null
@@ -1,21 +0,0 @@
-<h3>Download</h3>
-{% if version.endswith('(hg)') %}
-<p>This documentation is for version <b>{{ version }}</b>, which is
- not released yet.</p>
-<p>You can use it from the
- <a href="http://code.google.com/p/pytox/source/checkout">Mercurial repo</a> or look for
- released versions in the <a href="http://pypi.python.org/pypi/tox">Python
- Package Index</a>.</p>
-{% else %}
-<p>Current: <b>{{ version }}</b>
-[<a href="{{ pathto('changelog') }}">Changes</a>]</p>
-<p>
-<a href="http://pypi.python.org/pypi/tox">tox on PyPI</a>
-</p>
-<pre>pip install tox</pre>
-{% endif %}
-
-<h3>Questions? Suggestions?</h3>
-
-<p>Checkout <a href="{{ pathto('support') }}">support channels</a>
-</p>
diff --git a/doc/_templates/layout.html b/doc/_templates/layout.html
deleted file mode 100644
index 1892483..0000000
--- a/doc/_templates/layout.html
+++ /dev/null
@@ -1,15 +0,0 @@
-{% extends "!layout.html" %}
-
-
-{% block footer %}
-{{ super() }}
-<script type="text/javascript">
-var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
-document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
-</script>
-<script type="text/javascript">
-try {
-var pageTracker = _gat._getTracker("UA-17241637-3");
-pageTracker._trackPageview();
-} catch(err) {}</script>
-{% endblock %}
diff --git a/doc/_templates/localtoc.html b/doc/_templates/localtoc.html
index c48ed71..94b9277 100644
--- a/doc/_templates/localtoc.html
+++ b/doc/_templates/localtoc.html
@@ -30,7 +30,9 @@
</td></tr><tr><td>
<a href="{{ pathto('support') }}">support</a>
</td><td>
-</td></tr></table>
+ <a href="{{ pathto('plugins') }}">plugins/hooks</a>
+</td>
+</tr></table>
</div>
{% extends "basic/localtoc.html" %}
diff --git a/doc/config.txt b/doc/config.txt
index dab7777..812dbc1 100644
--- a/doc/config.txt
+++ b/doc/config.txt
@@ -99,9 +99,9 @@ Complete list of settings that you can put into ``testenv*`` sections:
``{packages}`` which will be replaced by the packages to
install. You should also accept ``{opts}`` if you are using
pip or easy_install -- it will contain index server options
- if you have configured them via :confval:`indexserver`
- and the deprecated :confval:`downloadcache` option
- if you have configured it.
+ such as ``--pre`` (configured as ``pip_pre``) and potentially
+ index-options from the deprecated :confval:`indexserver`
+ option.
**default**::
@@ -227,16 +227,7 @@ Complete list of settings that you can put into ``testenv*`` sections:
.. confval:: downloadcache=path
- **DEPRECATED** -- as of August 2013 this option is not very
- useful because of pypi's CDN and because of caching pypi
- server solutions like `devpi <http://doc.devpi.net>`_.
-
- use this directory for caching downloads. This value is overriden
- by the environment variable ``PIP_DOWNLOAD_CACHE`` if it exists. If
- you specify a custom :confval:`install_command` that uses an
- installer other than pip, your installer must support the
- `--download-cache` command-line option.
- **default**: no download cache will be used.
+ **IGNORED** -- Since pip-8 has caching by default this option is now ignored. Please remove it from your configs as a future tox version might bark on it.
.. confval:: sitepackages=True|False
@@ -362,6 +353,10 @@ Globally available substitutions
(DEPRECATED) the directory where sdist-packages will be copied to so that
they may be accessed by other processes or tox runs.
+``{:}``
+ OS-specific path separator (``:`` os *nix family, ``;`` on Windows). May be used in `setenv`,
+ when target variable is path variable (e.g. PATH or PYTHONPATH).
+
substitutions for virtualenv-related sections
+++++++++++++++++++++++++++++++++++++++++++++
diff --git a/doc/drafts/tox_conda_notes_niccodemus.md b/doc/drafts/tox_conda_notes_niccodemus.md
index a54189a..071f1dd 100644
--- a/doc/drafts/tox_conda_notes_niccodemus.md
+++ b/doc/drafts/tox_conda_notes_niccodemus.md
@@ -1,3 +1,4 @@
+```
[tox]
envlist=py27,py35
@@ -28,6 +29,7 @@ type=venv
type=conda
type=conda-reqs
type=conda-env
+```
1. Create a new ``create_env_command`` option.
;2. Create a new ``env_activate_command`` option (also consider how to make that platform dependent).
@@ -35,13 +37,13 @@ type=conda-env
3. env type concept: different types change the default options.
1. tox_addoption can now add new "testenv" sections to tox.ini:
-
+```
[virtualenv]
[conda]
[venv]
-
+```
2. extend hooks:
-
+```
* tox_addoption
* tox_configure
for each requested env in config:
@@ -51,9 +53,11 @@ type=conda-env
tox_runtest_pre(envmeta, env)
tox_runtest(envmeta, env, popen)
tox_runtest_post(envmeta, env)
+```
3. separate virtualenv details from "VirtualEnv" class into a plugin.
+```
[tox]
envlist={py27,py35}-{sdist,wheel,conda}
@@ -72,6 +76,7 @@ commands = py.test
[testenv:conda]
packages = sdist,wheel
commands = py.test --conda-only
+```
* tox_addoption
* tox_get_python_executable
diff --git a/doc/example/basic.txt b/doc/example/basic.txt
index a8d074d..310bef5 100644
--- a/doc/example/basic.txt
+++ b/doc/example/basic.txt
@@ -31,15 +31,15 @@ you can run restrict the test run to the python2.6 environment.
Available "default" test environments names are::
py
- py24
- py25
+ py2
py26
py27
- py30
- py31
- py32
+ py3
py33
py34
+ py35
+ py36
+ py37
jython
pypy
pypy3
@@ -243,7 +243,7 @@ Integration with "setup.py test" command
it breaks packaging/testing approaches as used by downstream distributions
which expect ``setup.py test`` to run tests with the invocation interpreter
rather than setting up many virtualenvs and installing packages. If you need to
- define ``setup.py test`` you can can better see about integrating your eventual
+ define ``setup.py test`` you can better see about integrating your eventual
test runner with it, here is an `example of setup.py test integration with pytest <http://docs.pytest.org/en/latest/goodpractices.html#integrating-with-setuptools-python-setup-py-test-pytest-runner>`_.
As the python eco-system rather moves away from using ``setup.py`` as a tool entry
point it's maybe best to not go for any ``setup.py test`` integration.
diff --git a/doc/example/jenkins.txt b/doc/example/jenkins.txt
index 94cb22d..32f185c 100644
--- a/doc/example/jenkins.txt
+++ b/doc/example/jenkins.txt
@@ -23,6 +23,8 @@ using these steps:
* add a **Python-build step** with this content (see also next example)::
import tox
+
+ os.chdir(os.getenv('WORKSPACE'))
tox.cmdline() # environment is selected by ``TOXENV`` env variable
* check ``Publish JUnit test result report`` and enter
diff --git a/doc/install.txt b/doc/install.txt
index 5b2f752..3bbbf2b 100644
--- a/doc/install.txt
+++ b/doc/install.txt
@@ -27,7 +27,7 @@ It is fine to install ``tox`` itself into a virtualenv_ environment.
Install from Checkout
-------------------------
-Consult the Bitbucket page to get a checkout of the mercurial repository:
+Consult the Bitbucket page to get a checkout of the git repository:
https://github.com/tox-dev/tox
diff --git a/setup.py b/setup.py
index 051f98b..289a1ea 100644
--- a/setup.py
+++ b/setup.py
@@ -36,7 +36,7 @@ def has_environment_marker_support():
def main():
version = sys.version_info[:2]
- install_requires = ['virtualenv>=1.11.2', 'py>=1.4.17', 'pluggy>=0.3.0,<0.5.0']
+ install_requires = ['virtualenv>=1.11.2', 'py>=1.4.17', 'pluggy>=0.3.0,<1.0']
extras_require = {}
if has_environment_marker_support():
extras_require[':python_version=="2.6"'] = ['argparse']
@@ -48,7 +48,7 @@ def main():
description='virtualenv-based automation of test activities',
long_description=open("README.rst").read(),
url='https://tox.readthedocs.org/',
- version='2.4.1',
+ version='2.5.0',
license='http://opensource.org/licenses/MIT',
platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'],
author='holger krekel',
@@ -70,9 +70,9 @@ def main():
'Operating System :: MacOS :: MacOS X',
'Topic :: Software Development :: Testing',
'Topic :: Software Development :: Libraries',
- 'Topic :: Utilities',
- 'Programming Language :: Python',
- 'Programming Language :: Python :: 3'],
+ 'Topic :: Utilities'] + [
+ ('Programming Language :: Python :: %s' % x) for x in
+ '2 2.6 2.7 3 3.3 3.4 3.5'.split()]
)
if __name__ == '__main__':
diff --git a/tests/test_config.py b/tests/test_config.py
index 9c10c38..42b3570 100644
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -598,6 +598,17 @@ class TestIniParser:
assert argvlist[2] == ['cmd2', '-m', "something"] + posargs
assert argvlist[3] == ['cmd3', 'something[]else']
+ def test_posargs_are_added_escaped_issue310(self, newconfig):
+ config = newconfig("""
+ [section]
+ key= cmd0 {posargs}
+ """)
+ reader = SectionReader("section", config._cfg)
+ posargs = ['hello world', '--x==y z', '--format=%(code)s: %(text)s']
+ reader.addsubstitutions(posargs)
+ argvlist = reader.getargvlist('key')
+ assert argvlist[0] == ['cmd0'] + posargs
+
def test_substitution_with_multiple_words(self, newconfig):
inisource = """
[section]
@@ -835,6 +846,7 @@ class TestConfigTestEnv:
assert "PATHEXT" in envconfig.passenv
assert "SYSTEMDRIVE" in envconfig.passenv
assert "SYSTEMROOT" in envconfig.passenv
+ assert "COMSPEC" in envconfig.passenv
assert "TEMP" in envconfig.passenv
assert "TMP" in envconfig.passenv
else:
@@ -980,31 +992,6 @@ class TestConfigTestEnv:
envconfig = config.envconfigs['python']
assert envconfig.pip_pre
- def test_downloadcache(self, newconfig, monkeypatch):
- monkeypatch.delenv("PIP_DOWNLOAD_CACHE", raising=False)
- config = newconfig("""
- [testenv]
- downloadcache=thecache
- """)
- envconfig = config.envconfigs['python']
- assert envconfig.downloadcache.basename == 'thecache'
-
- def test_downloadcache_env_override(self, newconfig, monkeypatch):
- monkeypatch.setenv("PIP_DOWNLOAD_CACHE", 'fromenv')
- config = newconfig("""
- [testenv]
- downloadcache=somepath
- """)
- envconfig = config.envconfigs['python']
- assert envconfig.downloadcache.basename == "fromenv"
-
- def test_downloadcache_only_if_in_config(self, newconfig, tmpdir,
- monkeypatch):
- monkeypatch.setenv("PIP_DOWNLOAD_CACHE", tmpdir)
- config = newconfig('')
- envconfig = config.envconfigs['python']
- assert not envconfig.downloadcache
-
def test_simple(tmpdir, newconfig):
config = newconfig("""
[testenv:py26]
@@ -1468,7 +1455,7 @@ class TestGlobalOptions:
assert str(env.basepython) == sys.executable
def test_default_environments(self, tmpdir, newconfig, monkeypatch):
- envs = "py26,py27,py32,py33,py34,py35,py36,jython,pypy,pypy3"
+ envs = "py26,py27,py32,py33,py34,py35,py36,py37,jython,pypy,pypy3,py2,py3"
inisource = """
[tox]
envlist = %s
@@ -1482,6 +1469,8 @@ class TestGlobalOptions:
assert env.basepython == "jython"
elif name.startswith("pypy"):
assert env.basepython == name
+ elif name in ("py2", "py3"):
+ assert env.basepython == 'python' + name[-1]
else:
assert name.startswith("py")
bp = "python%s.%s" % (name[2], name[3])
@@ -1874,6 +1863,28 @@ class TestIndexServer:
assert config.indexserver['local1'].url == config.indexserver['default'].url
+class TestConfigConstSubstitutions:
+ @pytest.mark.parametrize('pathsep', [':', ';'])
+ def test_replace_pathsep_unix(self, monkeypatch, newconfig, pathsep):
+ monkeypatch.setattr('os.pathsep', pathsep)
+ config = newconfig("""
+ [testenv]
+ setenv =
+ PATH = dira{:}dirb{:}dirc
+ """)
+ envconfig = config.envconfigs["python"]
+ assert envconfig.setenv["PATH"] == pathsep.join(["dira", "dirb", "dirc"])
+
+ def test_pathsep_regex(self):
+ """Sanity check for regex behavior for empty colon."""
+ regex = tox.config.Replacer.RE_ITEM_REF
+ match = next(regex.finditer("{:}"))
+ mdict = match.groupdict()
+ assert mdict['sub_type'] is None
+ assert mdict['substitution_value'] == ""
+ assert mdict['default_value'] == ""
+
+
class TestParseEnv:
def test_parse_recreate(self, newconfig):
diff --git a/tests/test_venv.py b/tests/test_venv.py
index d0e0ba7..4918cfe 100644
--- a/tests/test_venv.py
+++ b/tests/test_venv.py
@@ -140,42 +140,10 @@ def test_install_deps_wildcard(newmocksession):
assert l[-1].cwd == venv.envconfig.config.toxinidir
assert "pip" in str(args[0])
assert args[1] == "install"
- # arg = "--download-cache=" + str(venv.envconfig.downloadcache)
- # assert arg in args[2:]
args = [arg for arg in args if str(arg).endswith("dep1-1.1.zip")]
assert len(args) == 1
- at pytest.mark.parametrize("envdc", [True, False])
-def test_install_downloadcache(newmocksession, monkeypatch, tmpdir, envdc):
- if envdc:
- monkeypatch.setenv("PIP_DOWNLOAD_CACHE", tmpdir)
- else:
- monkeypatch.delenv("PIP_DOWNLOAD_CACHE", raising=False)
- mocksession = newmocksession([], """
- [testenv:py123]
- deps=
- dep1
- dep2
- """)
- venv = mocksession.getenv("py123")
- action = mocksession.newaction(venv, "getenv")
- tox_testenv_create(action=action, venv=venv)
- l = mocksession._pcalls
- assert len(l) == 1
-
- tox_testenv_install_deps(action=action, venv=venv)
- assert len(l) == 2
- args = l[-1].args
- assert l[-1].cwd == venv.envconfig.config.toxinidir
- assert "pip" in str(args)
- assert args[1] == "install"
- assert "dep1" in args
- assert "dep2" in args
- deps = list(filter(None, [x[1] for x in venv._getliveconfig().deps]))
- assert deps == ['dep1', 'dep2']
-
-
def test_install_deps_indexserver(newmocksession):
mocksession = newmocksession([], """
[tox]
@@ -642,6 +610,7 @@ def test_run_install_command(newmocksession):
def test_run_custom_install_command(newmocksession):
mocksession = newmocksession([], """
[testenv]
+ commands={envpython} --version
install_command=easy_install {opts} {packages}
""")
venv = mocksession.getenv('python')
@@ -658,6 +627,7 @@ def test_run_custom_install_command(newmocksession):
def test_command_relative_issue26(newmocksession, tmpdir, monkeypatch):
mocksession = newmocksession([], """
[testenv]
+ commands={envpython} --version
""")
x = tmpdir.ensure("x")
venv = mocksession.getenv("python")
@@ -732,3 +702,14 @@ def test_tox_testenv_pre_post(newmocksession):
assert l == []
mocksession.runtestenv(venv)
assert l == ['started', 'finished']
+
+
+def test_error_when_commands_missing(newmocksession):
+ mocksession = newmocksession([], """
+ [testenv]
+ """)
+
+ venv = mocksession.getenv('python')
+ venv.status = None
+ mocksession.runtestenv(venv)
+ assert venv.status == 'nothing to do'
diff --git a/tests/test_z_cmdline.py b/tests/test_z_cmdline.py
index ef65564..febeecb 100644
--- a/tests/test_z_cmdline.py
+++ b/tests/test_z_cmdline.py
@@ -199,6 +199,34 @@ def test_minversion(cmd, initproj):
assert result.ret
+def test_notoxini_help_still_works(initproj, cmd):
+ initproj("example123-0.5", filedefs={
+ 'tests': {'test_hello.py': "def test_hello(): pass"},
+ })
+ result = cmd.run("tox", "-h")
+ result.stderr.fnmatch_lines([
+ "*ERROR*tox.ini*"
+ ])
+ result.stdout.fnmatch_lines([
+ "*--help*"
+ ])
+ assert not result.ret
+
+
+def test_notoxini_help_ini_still_works(initproj, cmd):
+ initproj("example123-0.5", filedefs={
+ 'tests': {'test_hello.py': "def test_hello(): pass"},
+ })
+ result = cmd.run("tox", "--help-ini")
+ result.stderr.fnmatch_lines([
+ "*ERROR*tox.ini*"
+ ])
+ result.stdout.fnmatch_lines([
+ "*setenv*"
+ ])
+ assert not result.ret
+
+
def test_envdir_equals_toxini_errors_out(cmd, initproj):
initproj("interp123-0.7", filedefs={
'tox.ini': '''
@@ -323,6 +351,8 @@ def test_venv_special_chars_issue252(cmd, initproj):
'tox.ini': '''
[tox]
envlist = special&&1
+ [testenv]
+ commands={envpython} --version
[testenv:special&&1]
changedir=tests
'''
@@ -440,7 +470,10 @@ def test_package_install_fails(cmd, initproj):
install_requires=['qweqwe123'],
)
""",
- 'tox.ini': '',
+ 'tox.ini': """
+ [testenv]
+ commands={envpython} --version
+ """,
})
result = cmd.run("tox", )
assert result.ret
@@ -513,6 +546,8 @@ class TestToxRun:
def test_develop(initproj, cmd):
initproj("example123", filedefs={'tox.ini': """
+ [testenv]
+ commands={envpython} --version
"""})
result = cmd.run("tox", "-vv", "--develop")
assert not result.ret
@@ -522,6 +557,7 @@ def test_develop(initproj, cmd):
def test_usedevelop(initproj, cmd):
initproj("example123", filedefs={'tox.ini': """
[testenv]
+ commands={envpython} --version
usedevelop=True
"""})
result = cmd.run("tox", "-vv")
@@ -531,6 +567,8 @@ def test_usedevelop(initproj, cmd):
def test_usedevelop_mixed(initproj, cmd):
initproj("example123", filedefs={'tox.ini': """
+ [testenv]
+ commands={envpython} --version
[testenv:devenv]
usedevelop=True
[testenv:nondev]
@@ -620,6 +658,7 @@ def test_notest(initproj, cmd):
initproj("example123", filedefs={'tox.ini': """
# content of: tox.ini
[testenv:py26]
+ commands={envpython} --version
basepython=python
"""})
result = cmd.run("tox", "-v", "--notest")
@@ -636,7 +675,10 @@ def test_notest(initproj, cmd):
def test_PYC(initproj, cmd, monkeypatch):
- initproj("example123", filedefs={'tox.ini': ''})
+ initproj("example123", filedefs={'tox.ini': """
+ [testenv]
+ commands={envpython} --version
+ """})
monkeypatch.setenv("PYTHONDOWNWRITEBYTECODE", 1)
result = cmd.run("tox", "-v", "--notest")
assert not result.ret
@@ -646,7 +688,10 @@ def test_PYC(initproj, cmd, monkeypatch):
def test_env_VIRTUALENV_PYTHON(initproj, cmd, monkeypatch):
- initproj("example123", filedefs={'tox.ini': ''})
+ initproj("example123", filedefs={'tox.ini': """
+ [testenv]
+ commands={envpython} --version
+ """})
monkeypatch.setenv("VIRTUALENV_PYTHON", '/FOO')
result = cmd.run("tox", "-v", "--notest")
assert not result.ret, result.stdout.lines
@@ -672,6 +717,8 @@ def test_separate_sdist_no_sdistfile(cmd, initproj):
'tox.ini': """
[tox]
distshare=%s
+ [testenv]
+ commands={envpython} --version
""" % distshare
})
result = cmd.run("tox", "--sdistonly")
@@ -689,6 +736,8 @@ def test_separate_sdist(cmd, initproj):
[tox]
distshare=%s
sdistsrc={distshare}/pkg123-0.7.zip
+ [testenv]
+ commands={envpython} --version
""" % distshare
})
result = cmd.run("tox", "--sdistonly")
@@ -709,6 +758,8 @@ def test_sdist_latest(tmpdir, newconfig):
[tox]
distshare=%s
sdistsrc={distshare}/pkg123-*
+ [testenv]
+ commands={envpython} --version
""" % distshare)
p = distshare.ensure("pkg123-1.4.5.zip")
distshare.ensure("pkg123-1.4.5a1.zip")
@@ -756,6 +807,23 @@ def test_envsitepackagesdir_skip_missing_issue280(cmd, initproj):
""")
+ at pytest.mark.parametrize('verbosity', ['', '-v', '-vv'])
+def test_verbosity(cmd, initproj, verbosity):
+ initproj("pkgX-0.0.5", filedefs={
+ 'tox.ini': """
+ [testenv]
+ commands={envpython} --version
+ """})
+ result = cmd.run("tox", verbosity)
+ assert result.ret == 0
+
+ needle = "Successfully installed pkgX-0.0.5"
+ if verbosity == '-vv':
+ assert any(needle in line for line in result.outlines)
+ else:
+ assert all(needle not in line for line in result.outlines)
+
+
def verify_json_report_format(data, testenvs=True):
assert data["reportversion"] == "1"
assert data["toxversion"] == tox.__version__
@@ -773,3 +841,30 @@ def verify_json_report_format(data, testenvs=True):
assert isinstance(pyinfo["version_info"], list)
assert pyinfo["version"]
assert pyinfo["executable"]
+
+
+def test_envtmpdir(initproj, cmd):
+ initproj("foo", filedefs={
+ # This file first checks that envtmpdir is existent and empty. Then it
+ # creates an empty file in that directory. The tox command is run
+ # twice below, so this is to test whether the directory is cleared
+ # before the second run.
+ 'check_empty_envtmpdir.py': '''if True:
+ import os
+ from sys import argv
+ envtmpdir = argv[1]
+ assert os.path.exists(envtmpdir)
+ assert os.listdir(envtmpdir) == []
+ open(os.path.join(envtmpdir, 'test'), 'w').close()
+ ''',
+ 'tox.ini': '''
+ [testenv]
+ commands=python check_empty_envtmpdir.py {envtmpdir}
+ '''
+ })
+
+ result = cmd.run("tox")
+ assert not result.ret
+
+ result = cmd.run("tox")
+ assert not result.ret
diff --git a/tox.egg-info/PKG-INFO b/tox.egg-info/PKG-INFO
index 29ed099..47e1216 100644
--- a/tox.egg-info/PKG-INFO
+++ b/tox.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: tox
-Version: 2.4.1
+Version: 2.5.0
Summary: virtualenv-based automation of test activities
Home-page: https://tox.readthedocs.org/
Author: holger krekel
@@ -10,6 +10,17 @@ Description:
What is Tox?
--------------------
+
+ .. image:: https://img.shields.io/pypi/v/tox.svg
+ :target: https://pypi.org/project/tox/
+ .. image:: https://img.shields.io/pypi/pyversions/tox.svg
+ :target: https://pypi.org/project/tox/
+ .. image:: https://travis-ci.org/tox-dev/tox.svg?branch=master
+ :target: https://travis-ci.org/tox-dev/tox
+ .. image:: https://img.shields.io/appveyor/ci/RonnyPfannschmidt/tox/master.svg
+ :target: https://ci.appveyor.com/project/RonnyPfannschmidt/tox
+
+
Tox is a generic virtualenv management and test command line tool you can use for:
* checking your package installs correctly with different Python versions and
@@ -41,5 +52,10 @@ Classifier: Operating System :: MacOS :: MacOS X
Classifier: Topic :: Software Development :: Testing
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Utilities
-Classifier: Programming Language :: Python
+Classifier: Programming Language :: Python :: 2
+Classifier: Programming Language :: Python :: 2.6
+Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
+Classifier: Programming Language :: Python :: 3.3
+Classifier: Programming Language :: Python :: 3.4
+Classifier: Programming Language :: Python :: 3.5
diff --git a/tox.egg-info/SOURCES.txt b/tox.egg-info/SOURCES.txt
index a3addbf..6a8ac85 100644
--- a/tox.egg-info/SOURCES.txt
+++ b/tox.egg-info/SOURCES.txt
@@ -21,8 +21,6 @@ doc/links.txt
doc/plugins.txt
doc/support.txt
doc/_static/sphinxdoc.css
-doc/_templates/indexsidebar.html
-doc/_templates/layout.html
doc/_templates/localtoc.html
doc/announce/release-0.5.txt
doc/announce/release-1.0.txt
diff --git a/tox.egg-info/requires.txt b/tox.egg-info/requires.txt
index c75bfbb..d1c8e7c 100644
--- a/tox.egg-info/requires.txt
+++ b/tox.egg-info/requires.txt
@@ -1,6 +1,6 @@
virtualenv>=1.11.2
py>=1.4.17
-pluggy>=0.3.0,<0.5.0
+pluggy>=0.3.0,<1.0
[:python_version=="2.6"]
argparse
diff --git a/tox.ini b/tox.ini
index a2bbd96..f6d9d52 100644
--- a/tox.ini
+++ b/tox.ini
@@ -30,7 +30,6 @@ commands=
py.test -v check_sphinx.py {posargs}
[testenv:flakes]
-platform=linux
deps = pytest-flakes>=0.2
pytest-pep8
diff --git a/tox/__init__.py b/tox/__init__.py
index b202fe5..5ad70f2 100644
--- a/tox/__init__.py
+++ b/tox/__init__.py
@@ -1,5 +1,5 @@
#
-__version__ = '2.4.1'
+__version__ = '2.5.0'
from .hookspecs import hookspec, hookimpl # noqa
diff --git a/tox/_pytestplugin.py b/tox/_pytestplugin.py
index 785070d..129678a 100644
--- a/tox/_pytestplugin.py
+++ b/tox/_pytestplugin.py
@@ -65,6 +65,9 @@ class ReportExpectMock:
def __getattr__(self, name):
if name[0] == "_":
raise AttributeError(name)
+ elif name == 'verbosity':
+ # FIXME: special case for property on Reporter class, may it be generalized?
+ return 0
def generic_report(*args, **kwargs):
self._calls.append((name,) + args)
diff --git a/tox/config.py b/tox/config.py
index c1d894a..14ac4a7 100644
--- a/tox/config.py
+++ b/tox/config.py
@@ -9,6 +9,7 @@ import string
import pkg_resources
import itertools
import pluggy
+from subprocess import list2cmdline
import tox.interpreters
from tox import hookspecs
@@ -21,8 +22,8 @@ import tox
iswin32 = sys.platform == "win32"
default_factors = {'jython': 'jython', 'pypy': 'pypy', 'pypy3': 'pypy3',
- 'py': sys.executable}
-for version in '26,27,32,33,34,35,36'.split(','):
+ 'py': sys.executable, 'py2': 'python2', 'py3': 'python3'}
+for version in '26,27,32,33,34,35,36,37'.split(','):
default_factors['py' + version] = 'python%s.%s' % tuple(version)
hookimpl = pluggy.HookimplMarker("tox")
@@ -228,7 +229,11 @@ def parseconfig(args=None, plugins=()):
else:
inipath = py.path.local().join('setup.cfg')
if not inipath.check():
- feedback("toxini file %r not found" % (basename), sysexit=True)
+ helpoptions = option.help or option.helpini
+ feedback("toxini file %r not found" % (basename),
+ sysexit=not helpoptions)
+ if helpoptions:
+ return config
try:
parseini(config, inipath)
@@ -256,14 +261,6 @@ class VersionAction(argparse.Action):
raise SystemExit(0)
-class CountAction(argparse.Action):
- def __call__(self, parser, namespace, values, option_string=None):
- if hasattr(namespace, self.dest):
- setattr(namespace, self.dest, int(getattr(namespace, self.dest)) + 1)
- else:
- setattr(namespace, self.dest, 0)
-
-
class SetenvDict:
def __init__(self, dict, reader):
self.reader = reader
@@ -315,9 +312,9 @@ def tox_addoption(parser):
help="show help about options")
parser.add_argument("--help-ini", "--hi", action="store_true", dest="helpini",
help="show help about ini-names")
- parser.add_argument("-v", nargs=0, action=CountAction, default=0,
- dest="verbosity",
- help="increase verbosity of reporting output.")
+ parser.add_argument("-v", action='count', dest="verbosity", default=0,
+ help="increase verbosity of reporting output. -vv mode turns off "
+ "output redirection for package installation")
parser.add_argument("--showconfig", action="store_true",
help="show configuration information for all environments. ")
parser.add_argument("-l", "--listenvs", action="store_true",
@@ -416,15 +413,9 @@ def tox_addoption(parser):
name="envlogdir", type="path", default="{envdir}/log",
help="venv log directory")
- def downloadcache(testenv_config, value):
- if value:
- # env var, if present, takes precedence
- downloadcache = os.environ.get("PIP_DOWNLOAD_CACHE", value)
- return py.path.local(downloadcache)
-
parser.add_testenv_attribute(
- name="downloadcache", type="string", default=None, postprocess=downloadcache,
- help="(deprecated) set PIP_DOWNLOAD_CACHE.")
+ name="downloadcache", type="string", default=None,
+ help="(ignored) has no effect anymore, pip-8 uses local caching by default")
parser.add_testenv_attribute(
name="changedir", type="path", default="{toxinidir}",
@@ -473,6 +464,7 @@ def tox_addoption(parser):
passenv.add("SYSTEMDRIVE") # needed for pip6
passenv.add("SYSTEMROOT") # needed for python's crypto module
passenv.add("PATHEXT") # needed for discovering executables
+ passenv.add("COMSPEC") # needed for distutils cygwincompiler
passenv.add("TEMP")
passenv.add("TMP")
else:
@@ -1045,6 +1037,10 @@ class Replacer:
start, end = match.span()
return match.string[start:end]
... 135 lines suppressed ...
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/tox.git
More information about the Python-modules-commits
mailing list