[Python-modules-commits] [tox] 01/09: Import tox_2.1.1.orig.tar.gz
Barry Warsaw
barry at moszumanska.debian.org
Mon Jul 13 22:46:07 UTC 2015
This is an automated email from the git hooks/post-receive script.
barry pushed a commit to branch master
in repository tox.
commit 6e320b49d2b82f58d78631a1881c4f13f0a3e72e
Author: Barry Warsaw <barry at ubuntu.com>
Date: Mon Jul 13 18:23:42 2015 -0400
Import tox_2.1.1.orig.tar.gz
---
CHANGELOG | 104 ++++
PKG-INFO | 6 +-
README.rst | 4 +-
doc/Makefile | 1 +
doc/announce/release-2.0.txt | 111 ++++
doc/conf.py | 6 +-
doc/config-v2.txt | 4 +-
doc/config.txt | 66 ++-
doc/example/basic.txt | 34 +-
doc/example/general.txt | 9 +-
doc/example/jenkins.txt | 2 +-
doc/index.txt | 20 +-
doc/install.txt | 2 +-
doc/links.txt | 1 -
doc/plugins.txt | 82 +++
doc/support.txt | 3 +-
setup.cfg | 3 +
setup.py | 37 +-
tests/test_config.py | 626 +++++++++++++++-------
tests/test_interpreters.py | 62 ++-
tests/test_result.py | 13 +-
tests/test_venv.py | 171 +++---
tests/test_z_cmdline.py | 116 ++--
tox.egg-info/PKG-INFO | 6 +-
tox.egg-info/SOURCES.txt | 14 +-
tox.egg-info/requires.txt | 4 +
tox.ini | 44 +-
tox/__init__.py | 10 +-
tox/__main__.py | 5 +-
tox/_config.py | 818 ----------------------------
tox/_exception.py | 16 -
tox/_pytestplugin.py | 74 ++-
tox/_quickstart.py | 17 +-
tox/_verlib.py | 16 +-
tox/config.py | 1126 +++++++++++++++++++++++++++++++++++++++
tox/hookspecs.py | 32 ++
tox/interpreters.py | 98 ++--
tox/result.py | 27 +-
tox/{_cmdline.py => session.py} | 232 ++++----
tox/vendor/__init__.py | 1 -
tox/{_venv.py => venv.py} | 203 +++----
41 files changed, 2651 insertions(+), 1575 deletions(-)
diff --git a/CHANGELOG b/CHANGELOG
index 5f118e2..54ea8be 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,107 @@
+2.1.1
+----------
+
+- fix platform skipping for detox
+
+- report skipped platforms as skips in the summary
+
+2.1.0
+----------
+
+- fix issue258, fix issue248, fix issue253: for non-test commands
+ (installation, venv creation) we pass in the full invocation environment.
+
+- remove experimental --set-home option which was hardly used and
+ hackily implemented (if people want home-directory isolation we should
+ figure out a better way to do it, possibly through a plugin)
+
+- fix issue259: passenv is now a line-list which allows to intersperse
+ comments. Thanks stefano-m.
+
+- allow envlist to be a multi-line list, to intersperse comments
+ and have long envlist settings split more naturally. Thanks Andre Caron.
+
+- introduce a TOX_TESTENV_PASSENV setting which is honored
+ when constructing the set of environment variables for test environments.
+ Thanks Marc Abramowitz for pushing in this direction.
+
+
+2.0.2
+----------
+
+- fix issue247: tox now passes the LANG variable from the tox invocation
+ environment to the test environment by default.
+
+- add SYSTEMDRIVE into default passenv on windows to allow pip6 to work.
+ Thanks Michael Krause.
+
+
+2.0.1
+-----------
+
+- fix wheel packaging to properly require argparse on py26.
+
+2.0.0
+-----------
+
+- (new) introduce environment variable isolation:
+ tox now only passes the PATH and PIP_INDEX_URL variable from the tox
+ invocation environment to the test environment and on Windows
+ also ``SYSTEMROOT``, ``PATHEXT``, ``TEMP`` and ``TMP`` whereas
+ on unix additionally ``TMPDIR`` is passed. If you need to pass
+ through further environment variables you can use the new ``passenv`` setting,
+ a space-separated list of environment variable names. Each name
+ can make use of fnmatch-style glob patterns. All environment
+ variables which exist in the tox-invocation environment will be copied
+ to the test environment.
+
+- a new ``--help-ini`` option shows all possible testenv settings and
+ their defaults.
+
+- (new) introduce a way to specify on which platform a testenvironment is to
+ execute: the new per-venv "platform" setting allows to specify
+ a regular expression which is matched against sys.platform.
+ If platform is set and doesn't match the platform spec in the test
+ environment the test environment is ignored, no setup or tests are attempted.
+
+- (new) add per-venv "ignore_errors" setting, which defaults to False.
+ If ``True``, a non-zero exit code from one command will be ignored and
+ further commands will be executed (which was the default behavior in tox <
+ 2.0). If ``False`` (the default), then a non-zero exit code from one command
+ will abort execution of commands for that environment.
+
+- show and store in json the version dependency information for each venv
+
+- remove the long-deprecated "distribute" option as it has no effect these days.
+
+- fix issue233: avoid hanging with tox-setuptools integration example. Thanks simonb.
+
+- fix issue120: allow substitution for the commands section. Thanks
+ Volodymyr Vitvitski.
+
+- fix issue235: fix AttributeError with --installpkg. Thanks
+ Volodymyr Vitvitski.
+
+- tox has now somewhat pep8 clean code, thanks to Volodymyr Vitvitski.
+
+- fix issue240: allow to specify empty argument list without it being
+ rewritten to ".". Thanks Daniel Hahler.
+
+- introduce experimental (not much documented yet) plugin system
+ based on pytest's externalized "pluggy" system.
+ See tox/hookspecs.py for the current hooks.
+
+- introduce parser.add_testenv_attribute() to register an ini-variable
+ for testenv sections. Can be used from plugins through the
+ tox_add_option hook.
+
+- rename internal files -- tox offers no external API except for the
+ experimental plugin hooks, use tox internals at your own risk.
+
+- DEPRECATE distshare in documentation
+
+
+
1.9.2
-----------
diff --git a/PKG-INFO b/PKG-INFO
index e411bc0..7e64fc6 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: tox
-Version: 1.9.2
+Version: 2.1.1
Summary: virtualenv-based automation of test activities
Home-page: http://tox.testrun.org/
Author: holger krekel
@@ -10,7 +10,7 @@ Description:
What is Tox?
--------------------
- Tox as is a generic virtualenv management and test command line tool you can use for:
+ 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
interpreters
@@ -29,7 +29,7 @@ Description:
have fun,
- holger krekel, 2014
+ holger krekel, 2015
Platform: unix
diff --git a/README.rst b/README.rst
index c107df0..1435598 100644
--- a/README.rst
+++ b/README.rst
@@ -2,7 +2,7 @@
What is Tox?
--------------------
-Tox as is a generic virtualenv management and test command line tool you can use for:
+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
interpreters
@@ -21,5 +21,5 @@ For more information and the repository please checkout:
have fun,
-holger krekel, 2014
+holger krekel, 2015
diff --git a/doc/Makefile b/doc/Makefile
index 77b2083..4ffb98b 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -38,6 +38,7 @@ clean:
install: clean html
@rsync -avz $(BUILDDIR)/html/ testrun.org:/www/testrun.org/tox/latest
+ #dev
#latexpdf
#@scp $(BUILDDIR)/latex/*.pdf testrun.org:www-tox/latest
diff --git a/doc/announce/release-2.0.txt b/doc/announce/release-2.0.txt
new file mode 100644
index 0000000..e05af6c
--- /dev/null
+++ b/doc/announce/release-2.0.txt
@@ -0,0 +1,111 @@
+tox-2.0: plugins, platform, env isolation
+==========================================
+
+tox-2.0 was released to pypi, a major new release with *mostly*
+backward-compatible enhancements and fixes:
+
+- experimental support for plugins, see https://testrun.org/tox/latest/plugins.html
+ which includes also a refined internal registration mechanism for new testenv
+ ini options. You can now ask tox which testenv ini parameters exist
+ with ``tox --help-ini``.
+
+- ENV isolation: only pass through very few environment variables from the
+ tox invocation to the test environments. This may break test runs that
+ previously worked with tox-1.9 -- you need to either use the
+ ``setenv`` or ``passenv`` ini variables to set appropriate environment
+ variables.
+
+- PLATFORM support: you can set ``platform=REGEX`` in your testenv sections
+ which lets tox skip the environment if the REGEX does not match ``sys.platform``.
+
+- tox now stops execution of test commands if the first of them fails unless
+ you set ``ignore_errors=True``.
+
+Thanks to Volodymyr Vitvitski, Daniel Hahler, Marc Abramowitz, Anthon van
+der Neuth and others for contributions.
+
+More documentation about tox in general:
+
+ http://tox.testrun.org/
+
+Installation:
+
+ pip install -U tox
+
+code hosting and issue tracking on bitbucket:
+
+ https://bitbucket.org/hpk42/tox
+
+What is tox?
+----------------
+
+tox standardizes and automates tedious test activities driven from a
+simple ``tox.ini`` file, including:
+
+* creation and management of different virtualenv environments
+ with different Python interpreters
+* packaging and installing your package into each of them
+* running your test tool of choice, be it nose, py.test or unittest2 or other tools such as "sphinx" doc checks
+* testing dev packages against each other without needing to upload to PyPI
+
+best,
+Holger Krekel, merlinux GmbH
+
+2.0.0
+-----------
+
+- (new) introduce environment variable isolation:
+ tox now only passes the PATH and PIP_INDEX_URL variable from the tox
+ invocation environment to the test environment and on Windows
+ also ``SYSTEMROOT``, ``PATHEXT``, ``TEMP`` and ``TMP`` whereas
+ on unix additionally ``TMPDIR`` is passed. If you need to pass
+ through further environment variables you can use the new ``passenv`` setting,
+ a space-separated list of environment variable names. Each name
+ can make use of fnmatch-style glob patterns. All environment
+ variables which exist in the tox-invocation environment will be copied
+ to the test environment.
+
+- a new ``--help-ini`` option shows all possible testenv settings and
+ their defaults.
+
+- (new) introduce a way to specify on which platform a testenvironment is to
+ execute: the new per-venv "platform" setting allows to specify
+ a regular expression which is matched against sys.platform.
+ If platform is set and doesn't match the platform spec in the test
+ environment the test environment is ignored, no setup or tests are attempted.
+
+- (new) add per-venv "ignore_errors" setting, which defaults to False.
+ If ``True``, a non-zero exit code from one command will be ignored and
+ further commands will be executed (which was the default behavior in tox <
+ 2.0). If ``False`` (the default), then a non-zero exit code from one command
+ will abort execution of commands for that environment.
+
+- show and store in json the version dependency information for each venv
+
+- remove the long-deprecated "distribute" option as it has no effect these days.
+
+- fix issue233: avoid hanging with tox-setuptools integration example. Thanks simonb.
+
+- fix issue120: allow substitution for the commands section. Thanks
+ Volodymyr Vitvitski.
+
+- fix issue235: fix AttributeError with --installpkg. Thanks
+ Volodymyr Vitvitski.
+
+- tox has now somewhat pep8 clean code, thanks to Volodymyr Vitvitski.
+
+- fix issue240: allow to specify empty argument list without it being
+ rewritten to ".". Thanks Daniel Hahler.
+
+- introduce experimental (not much documented yet) plugin system
+ based on pytest's externalized "pluggy" system.
+ See tox/hookspecs.py for the current hooks.
+
+- introduce parser.add_testenv_attribute() to register an ini-variable
+ for testenv sections. Can be used from plugins through the
+ tox_add_option hook.
+
+- rename internal files -- tox offers no external API except for the
+ experimental plugin hooks, use tox internals at your own risk.
+
+- DEPRECATE distshare in documentation
diff --git a/doc/conf.py b/doc/conf.py
index 9c573d7..630cb80 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -41,15 +41,15 @@ master_doc = 'index'
# General information about the project.
project = u'tox'
-copyright = u'2013, holger krekel and others'
+copyright = u'2015, holger krekel and others'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
-release = "1.9"
-version = "1.9.0"
+release = "2.1"
+version = "2.1.0"
# The full version, including alpha/beta/rc tags.
# The language for content autogenerated by Sphinx. Refer to documentation
diff --git a/doc/config-v2.txt b/doc/config-v2.txt
index 42973c4..b621bc1 100644
--- a/doc/config-v2.txt
+++ b/doc/config-v2.txt
@@ -27,7 +27,7 @@ coming up with its configuration language:
section for each combination. Examples of real life situations
arising from this:
- * http://code.larlet.fr/django-rest-framework/src/eed0f39a7e45/tox.ini
+ * https://github.com/tomchristie/django-rest-framework/blob/b001a146d73348af18cfc4c943d87f2f389349c9/tox.ini
* https://bitbucket.org/tabo/django-treebeard/src/93b579395a9c/tox.ini
@@ -216,7 +216,7 @@ Transforming the examples: django-rest
------------------------------------------------
The original `django-rest-framework tox.ini
-<http://code.larlet.fr/django-rest-framework/src/eed0f39a7e45/tox.ini>`_
+<https://github.com/tomchristie/django-rest-framework/blob/b001a146d73348af18cfc4c943d87f2f389349c9/tox.ini>`_
file has 159 lines and a lot of repetition, the new one would +have 20
lines and almost no repetition::
diff --git a/doc/config.txt b/doc/config.txt
index b5a717f..ed9290c 100644
--- a/doc/config.txt
+++ b/doc/config.txt
@@ -19,7 +19,7 @@ List of optional global options::
toxworkdir=path # tox working directory, defaults to {toxinidir}/.tox
setupdir=path # defaults to {toxinidir}
distdir=path # defaults to {toxworkdir}/dist
- distshare=path # defaults to {homedir}/.tox/distshare
+ distshare=path # (DEPRECATED) defaults to {homedir}/.tox/distshare
envlist=ENVLIST # defaults to the list of all environments
skipsdist=BOOL # defaults to false
@@ -30,7 +30,7 @@ and will first lookup global tox settings in this section::
[tox:jenkins]
... # override [tox] settings for the jenkins context
- # note: for jenkins distshare defaults to ``{toxworkdir}/distshare``.
+ # note: for jenkins distshare defaults to ``{toxworkdir}/distshare`` (DEPRECATED)
.. confval:: skip_missing_interpreters=BOOL
@@ -110,6 +110,26 @@ Complete list of settings that you can put into ``testenv*`` sections:
pip install {opts} {packages}
+.. confval:: ignore_errors=True|False(default)
+
+ .. versionadded:: 2.0
+
+ If ``True``, a non-zero exit code from one command will be ignored and
+ further commands will be executed (which was the default behavior in tox <
+ 2.0). If ``False`` (the default), then a non-zero exit code from one command
+ will abort execution of commands for that environment.
+
+ It may be helpful to note that this setting is analogous to the ``-i`` or
+ ``ignore-errors`` option of GNU Make. A similar name was chosen to reflect the
+ similarity in function.
+
+ Note that in tox 2.0, the default behavior of tox with respect to
+ treating errors from commands changed. Tox < 2.0 would ignore errors by
+ default. Tox >= 2.0 will abort on an error by default, which is safer and more
+ typical of CI and command execution tools, as it doesn't make sense to
+ run tests if installing some prerequisite failed and it doesn't make sense to
+ try to deploy if tests failed.
+
.. confval:: pip_pre=True|False(default)
.. versionadded:: 1.9
@@ -155,6 +175,12 @@ Complete list of settings that you can put into ``testenv*`` sections:
(Experimentally introduced in 1.6.1) all installer commands are executed
using the ``{toxinidir}`` as the current working directory.
+.. confval:: platform=REGEX
+
+ A testenv can define a new ``platform`` setting as a regular expression.
+ If a non-empty expression is defined and does not match against the
+ ``sys.platform`` string the test environment will be skipped.
+
.. confval:: setenv=MULTI-LINE-LIST
.. versionadded:: 0.9
@@ -163,6 +189,27 @@ Complete list of settings that you can put into ``testenv*`` sections:
will be used for all test command invocations as well as for installing
the sdist package into a virtual environment.
+.. confval:: passenv=SPACE-SEPARATED-GLOBNAMES
+
+ .. versionadded:: 2.0
+
+ A list of wildcard environment variable names which
+ shall be copied from the tox invocation environment to the test
+ environment when executing test commands. If a specified environment
+ variable doesn't exist in the tox invocation environment it is ignored.
+ You can use ``*`` and ``?`` to match multiple environment variables with
+ one name.
+
+ Note that the ``PATH``, ``LANG`` and ``PIP_INDEX_URL`` variables are
+ unconditionally passed down and on Windows ``SYSTEMROOT``, ``PATHEXT``,
+ ``TEMP`` and ``TMP`` will be passed down as well whereas on unix
+ ``TMPDIR`` will be passed down. You can override these variables
+ with the ``setenv`` option.
+
+ If defined the ``TOX_TESTENV_PASSENV`` environment variable (in the tox
+ invocation environment) can define additional space-separated variable
+ names that are to be passed down to the test command environment.
+
.. confval:: recreate=True|False(default)
Always recreate virtual environment if this option is True.
@@ -180,15 +227,6 @@ Complete list of settings that you can put into ``testenv*`` sections:
`--download-cache` command-line option.
**default**: no download cache will be used.
-.. confval:: distribute=True|False
-
- **DEPRECATED** -- as of August 2013 you should use setuptools
- which has merged most of distribute_ 's changes. Just use
- the default, Luke! In future versions of tox this option might
- be ignored and setuptools always chosen.
-
- **default:** False.
-
.. confval:: sitepackages=True|False
Set to ``True`` if you want to create virtual environments that also
@@ -292,7 +330,7 @@ Globally available substitutions
the directory where sdist-packages will be created in
``{distshare}``
- the directory where sdist-packages will be copied to so that
+ (DEPRECATED) the directory where sdist-packages will be copied to so that
they may be accessed by other processes or tox runs.
substitutions for virtualenv-related sections
@@ -526,8 +564,8 @@ Reading it line by line:
Complex factor conditions
+++++++++++++++++++++++++
-Sometimes you need to specify same line for several factors or create a special
-case for a combination of factors. Here is how you do it::
+Sometimes you need to specify the same line for several factors or create a
+special case for a combination of factors. Here is how you do it::
[tox]
envlist = py{26,27,33}-django{15,16}-{sqlite,mysql}
diff --git a/doc/example/basic.txt b/doc/example/basic.txt
index e0dbece..d0ad004 100644
--- a/doc/example/basic.txt
+++ b/doc/example/basic.txt
@@ -46,6 +46,19 @@ Available "default" test environments names are::
However, you can also create your own test environment names,
see some of the examples in :doc:`examples <../examples>`.
+specifying a platform
+-----------------------------------------------
+
+.. versionadded:: 2.0
+
+If you want to specify which platform(s) your test environment
+runs on you can set a platform regular expression like this::
+
+ platform = linux2|darwin
+
+If the expression does not match against ``sys.platform``
+the test environment will be skipped.
+
whitelisting non-virtualenv commands
-----------------------------------------------
@@ -160,6 +173,22 @@ To force tox to recreate a (particular) virtual environment::
would trigger a complete reinstallation of the existing py27 environment
(or create it afresh if it doesn't exist).
+passing down environment variables
+-------------------------------------------
+
+.. versionadded:: 2.0
+
+By default tox will only pass the ``PATH`` environment variable (and on
+windows ``SYSTEMROOT`` and ``PATHEXT``) from the tox invocation to the
+test environments. If you want to pass down additional environment
+variables you can use the ``passenv`` option::
+
+ [testenv]
+ passenv = LANG
+
+When your test commands execute they will execute with
+the same LANG setting as the one with which tox was invoked.
+
setting environment variables
-------------------------------------------
@@ -225,7 +254,10 @@ a test run when ``python setup.py test`` is issued::
#import here, cause outside the eggs aren't loaded
import tox
import shlex
- errno = tox.cmdline(args=shlex.split(self.tox_args))
+ args = self.tox_args
+ if args:
+ args = shlex.split(self.tox_args)
+ errno = tox.cmdline(args=args)
sys.exit(errno)
setup(
diff --git a/doc/example/general.txt b/doc/example/general.txt
index b7aab37..1a27549 100644
--- a/doc/example/general.txt
+++ b/doc/example/general.txt
@@ -147,8 +147,8 @@ section, for example::
Avoiding expensive sdist
------------------------
-Some projects are large enough that running and sdist, followed by
-an install everytime can be prohibitively costly. To solve this,
+Some projects are large enough that running an sdist, followed by
+an install every time can be prohibitively costly. To solve this,
there are two different options you can add to the ``tox`` section. First,
you can simply ask tox to please not make an sdist::
@@ -156,7 +156,7 @@ you can simply ask tox to please not make an sdist::
skipsdist=True
If you do this, your local software package will not be installed into
-the virtualenv. You should probably be ok with that, or take steps
+the virtualenv. You should probably be okay with that, or take steps
to deal with it in your commands section::
[testenv]
@@ -164,7 +164,8 @@ to deal with it in your commands section::
python setup.py develop
py.test
-Running setup.py develop is a common enough model that it has its own option::
+Running ``setup.py develop`` is a common enough model that it has its own
+option::
[testenv]
usedevelop=True
diff --git a/doc/example/jenkins.txt b/doc/example/jenkins.txt
index 2d8dc25..b93bec4 100644
--- a/doc/example/jenkins.txt
+++ b/doc/example/jenkins.txt
@@ -148,7 +148,7 @@ the "copy-artifacts" plugin will copy it to our ``distshare`` area.
Now everything proceeds as :ref:`artifacts` shows it.
So if you are using defaults you can re-use and debug exactly the
-same ``tox.ini`` file and make use of automatical sharing of
+same ``tox.ini`` file and make use of automatic sharing of
your artifacts between runs or Jenkins jobs.
.. include:: ../links.txt
diff --git a/doc/index.txt b/doc/index.txt
index 17d063d..e1bc20e 100644
--- a/doc/index.txt
+++ b/doc/index.txt
@@ -5,7 +5,7 @@ vision: standardize testing in Python
---------------------------------------------
``tox`` aims to automate and standardize testing in Python. It is part
-of a larger vision of easing the packaging, testing and release process
+of a larger vision of easing the packaging, testing and release process
of Python software.
What is Tox?
@@ -21,6 +21,7 @@ Tox is a generic virtualenv_ management and test command line tool you can use f
* acting as a frontend to Continuous Integration servers, greatly
reducing boilerplate and merging CI and shell-based testing.
+
Basic example
-----------------
@@ -62,10 +63,9 @@ Current features
- test-tool agnostic: runs py.test, nose or unittests in a uniform manner
-* supports :ref:`using different / multiple PyPI index servers <multiindex>`
+* :doc:`(new in 2.0) plugin system <plugins>` to modify tox execution with simple hooks.
-* uses pip_ and setuptools_ by default. Experimental
- support for configuring the installer command
+* uses pip_ and setuptools_ by default. Support for configuring the installer command
through :confval:`install_command=ARGV`.
* **cross-Python compatible**: CPython-2.6, 2.7, 3.2 and higher,
@@ -74,11 +74,11 @@ Current features
* **cross-platform**: Windows and Unix style environments
* **integrates with continuous integration servers** like Jenkins_
- (formerly known as Hudson) and helps you to avoid boilerplatish
+ (formerly known as Hudson) and helps you to avoid boilerplatish
and platform-specific build-step hacks.
* **full interoperability with devpi**: is integrated with and
- is used for testing in the devpi_ system, a versatile pypi
+ is used for testing in the devpi_ system, a versatile pypi
index server and release managing tool.
* **driven by a simple ini-style config file**
@@ -89,6 +89,9 @@ Current features
* **professionally** :doc:`supported <support>`
+* supports :ref:`using different / multiple PyPI index servers <multiindex>`
+
+
.. _pypy: http://pypy.org
.. _`tox.ini`: :doc:configfile
@@ -103,6 +106,8 @@ Current features
support
changelog
links
+ plugins
+ example/result
announce/release-0.5
announce/release-1.0
announce/release-1.1
@@ -110,6 +115,9 @@ Current features
announce/release-1.3
announce/release-1.4
announce/release-1.4.3
+ announce/release-1.8
+ announce/release-1.9
+ announce/release-2.0
.. include:: links.txt
diff --git a/doc/install.txt b/doc/install.txt
index 2851571..7e5d547 100644
--- a/doc/install.txt
+++ b/doc/install.txt
@@ -8,7 +8,7 @@ Install info in a nutshell
**Operating systems**: Linux, Windows, OSX, Unix
-**Installer Requirements**: setuptools_ or Distribute_
+**Installer Requirements**: setuptools_
**License**: MIT license
diff --git a/doc/links.txt b/doc/links.txt
index 2d98869..9c16034 100644
--- a/doc/links.txt
+++ b/doc/links.txt
@@ -13,7 +13,6 @@
.. _`easy_install`: http://peak.telecommunity.com/DevCenter/EasyInstall
.. _pip: https://pypi.python.org/pypi/pip
.. _setuptools: https://pypi.python.org/pypi/setuptools
-.. _distribute: https://pypi.python.org/pypi/distribute
.. _`jenkins`: http://jenkins-ci.org/
.. _sphinx: https://pypi.python.org/pypi/Sphinx
.. _discover: https://pypi.python.org/pypi/discover
diff --git a/doc/plugins.txt b/doc/plugins.txt
new file mode 100644
index 0000000..8e7041c
--- /dev/null
+++ b/doc/plugins.txt
@@ -0,0 +1,82 @@
+.. be in -*- rst -*- mode!
+
+tox plugins
+===========
+
+.. versionadded:: 2.0
+
+With tox-2.0 a few aspects of tox running can be experimentally modified
+by writing hook functions. The list of of available hook function is
+to grow over time on a per-need basis.
+
+
+writing a setuptools entrypoints plugin
+---------------------------------------
+
+If you have a ``tox_MYPLUGIN.py`` module you could use the following
+rough ``setup.py`` to make it into a package which you can upload to the
+Python packaging index::
+
+ # content of setup.py
+ from setuptools import setup
+
+ if __name__ == "__main__":
+ setup(
+ name='tox-MYPLUGIN',
+ description='tox plugin decsription',
+ license="MIT license",
+ version='0.1',
+ py_modules=['tox_MYPLUGIN'],
+ entry_points={'tox': ['MYPLUGIN = tox_MYPLUGIN']},
+ install_requires=['tox>=2.0'],
+ )
+
+If installed, the ``entry_points`` part will make tox see and integrate
+your plugin during startup.
+
+You can install the plugin for development ("in-place") via::
+
+ pip install -e .
+
+and later publish it via something like::
+
+ python setup.py sdist register upload
+
+
+Writing hook implementations
+----------------------------
+
+A plugin module defines one or more hook implementation functions
+by decorating them with tox's ``hookimpl`` marker::
+
+ from tox import hookimpl
+
+ @hookimpl
+ def tox_addoption(parser):
+ # add your own command line options
+
+
+ @hookimpl
+ def tox_configure(config):
+ # post process tox configuration after cmdline/ini file have
+ # been parsed
+
+If you put this into a module and make it pypi-installable with the ``tox``
+entry point you'll get your code executed as part of a tox run.
+
+
+
+tox hook specifications and related API
+---------------------------------------
+
+.. automodule:: tox.hookspecs
+ :members:
+
+.. autoclass:: tox.config.Parser()
+ :members:
+
+.. autoclass:: tox.config.Config()
+ :members:
+
+.. autoclass:: tox.config.TestenvConfig()
+ :members:
diff --git a/doc/support.txt b/doc/support.txt
index 1ece16a..29962e7 100644
--- a/doc/support.txt
+++ b/doc/support.txt
@@ -21,9 +21,8 @@ professional support
If you are looking for on-site teaching or consulting support,
contact holger at `merlinux.eu`_, an association of
-experienced `well-known Python developers`_.
+experienced well-known Python developers.
-.. _`well-known Python developers`: http://merlinux.eu/people.txt
.. _`Maciej Fijalkowski`: http://www.ohloh.net/accounts/fijal
.. _`Benjamin Peterson`: http://www.ohloh.net/accounts/gutworth
.. _`Testing In Python (TIP) mailing list`: http://lists.idyll.org/listinfo/testing-in-python
diff --git a/setup.cfg b/setup.cfg
index 861a9f5..6f08d0e 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,3 +1,6 @@
+[bdist_wheel]
+universal = 1
+
[egg_info]
tag_build =
tag_date = 0
diff --git a/setup.py b/setup.py
index e14f7aa..a72a5fc 100644
--- a/setup.py
+++ b/setup.py
@@ -1,5 +1,5 @@
import sys
-from setuptools import setup
+import setuptools
from setuptools.command.test import test as TestCommand
@@ -15,29 +15,52 @@ class Tox(TestCommand):
import tox
tox.cmdline(self.test_args)
+def has_environment_marker_support():
+ """
+ Tests that setuptools has support for PEP-426 environment marker support.
+
+ The first known release to support it is 0.7 (and the earliest on PyPI seems to be 0.7.2
+ so we're using that), see: http://pythonhosted.org/setuptools/history.html#id142
+
+ References:
+
+ * https://wheel.readthedocs.org/en/latest/index.html#defining-conditional-dependencies
+ * https://www.python.org/dev/peps/pep-0426/#environment-markers
+ """
+ import pkg_resources
+ try:
+ return pkg_resources.parse_version(setuptools.__version__) >= pkg_resources.parse_version('0.7.2')
+ except Exception as exc:
+ sys.stderr.write("Could not test setuptool's version: %s\n" % exc)
+ return False
def main():
version = sys.version_info[:2]
- install_requires = ['virtualenv>=1.11.2', 'py>=1.4.17', ]
- if version < (2, 7):
- install_requires += ['argparse']
- setup(
+ install_requires = ['virtualenv>=1.11.2', 'py>=1.4.17', 'pluggy>=0.3.0,<0.4.0']
+ extras_require = {}
+ if has_environment_marker_support():
+ extras_require[':python_version=="2.6"'] = ['argparse']
+ else:
+ if version < (2, 7):
+ install_requires += ['argparse']
+ setuptools.setup(
name='tox',
description='virtualenv-based automation of test activities',
long_description=open("README.rst").read(),
url='http://tox.testrun.org/',
- version='1.9.2',
+ version='2.1.1',
license='http://opensource.org/licenses/MIT',
platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'],
author='holger krekel',
author_email='holger at merlinux.eu',
- packages=['tox', 'tox.vendor'],
+ packages=['tox'],
entry_points={'console_scripts': 'tox=tox:cmdline\ntox-quickstart=tox._quickstart:main'},
# we use a public tox version to test, see tox.ini's testenv
# "deps" definition for the required dependencies
tests_require=['tox'],
cmdclass={"test": Tox},
install_requires=install_requires,
+ extras_require=extras_require,
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
diff --git a/tests/test_config.py b/tests/test_config.py
index f957771..8aa7abd 100644
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -4,9 +4,9 @@ from textwrap import dedent
import py
import pytest
import tox
-import tox._config
-from tox._config import * # noqa
-from tox._config import _split_env
+import tox.config
+from tox.config import * # noqa
+from tox.venv import VirtualEnv
class TestVenvConfig:
@@ -18,6 +18,7 @@ class TestVenvConfig:
assert config.toxworkdir.realpath() == tmpdir.join(".tox").realpath()
assert config.envconfigs['py1'].basepython == sys.executable
assert config.envconfigs['py1'].deps == []
+ assert config.envconfigs['py1'].platform == ".*"
def test_config_parsing_multienv(self, tmpdir, newconfig):
config = newconfig([], """
@@ -63,8 +64,8 @@ class TestVenvConfig:
def test_force_dep_version(self, initproj):
"""
- Make sure we can override dependencies configured in tox.ini when using the command line option
- --force-dep.
+ Make sure we can override dependencies configured in tox.ini when using the command line
+ option --force-dep.
"""
initproj("example123-0.5", filedefs={
'tox.ini': '''
@@ -81,7 +82,7 @@ class TestVenvConfig:
config = parseconfig(
['--force-dep=dep1==1.5', '--force-dep=dep2==2.1',
'--force-dep=dep3==3.0'])
- assert config.option.force_dep== [
+ assert config.option.force_dep == [
'dep1==1.5', 'dep2==2.1', 'dep3==3.0']
assert [str(x) for x in config.envconfigs['python'].deps] == [
'dep1==1.5', 'dep2==2.1', 'dep3==3.0', 'dep4==4.0',
@@ -91,12 +92,55 @@ class TestVenvConfig:
"""
Ensure correct parseini._is_same_dep is working with a few samples.
"""
- assert parseini._is_same_dep('pkg_hello-world3==1.0', 'pkg_hello-world3')
- assert parseini._is_same_dep('pkg_hello-world3==1.0', 'pkg_hello-world3>=2.0')
- assert parseini._is_same_dep('pkg_hello-world3==1.0', 'pkg_hello-world3>2.0')
- assert parseini._is_same_dep('pkg_hello-world3==1.0', 'pkg_hello-world3<2.0')
- assert parseini._is_same_dep('pkg_hello-world3==1.0', 'pkg_hello-world3<=2.0')
- assert not parseini._is_same_dep('pkg_hello-world3==1.0', 'otherpkg>=2.0')
+ assert DepOption._is_same_dep('pkg_hello-world3==1.0', 'pkg_hello-world3')
+ assert DepOption._is_same_dep('pkg_hello-world3==1.0', 'pkg_hello-world3>=2.0')
+ assert DepOption._is_same_dep('pkg_hello-world3==1.0', 'pkg_hello-world3>2.0')
+ assert DepOption._is_same_dep('pkg_hello-world3==1.0', 'pkg_hello-world3<2.0')
+ assert DepOption._is_same_dep('pkg_hello-world3==1.0', 'pkg_hello-world3<=2.0')
+ assert not DepOption._is_same_dep('pkg_hello-world3==1.0', 'otherpkg>=2.0')
+
+
+class TestConfigPlatform:
+ def test_config_parse_platform(self, newconfig):
+ config = newconfig([], """
+ [testenv:py1]
+ platform = linux2
+ """)
+ assert len(config.envconfigs) == 1
+ assert config.envconfigs['py1'].platform == "linux2"
+
+ def test_config_parse_platform_rex(self, newconfig, mocksession, monkeypatch):
+ config = newconfig([], """
+ [testenv:py1]
+ platform = a123|b123
+ """)
+ assert len(config.envconfigs) == 1
+ envconfig = config.envconfigs['py1']
+ venv = VirtualEnv(envconfig, session=mocksession)
+ assert not venv.matching_platform()
+ monkeypatch.setattr(sys, "platform", "a123")
+ assert venv.matching_platform()
+ monkeypatch.setattr(sys, "platform", "b123")
+ assert venv.matching_platform()
+ monkeypatch.undo()
+ assert not venv.matching_platform()
+
+ @pytest.mark.parametrize("plat", ["win", "lin", ])
+ def test_config_parse_platform_with_factors(self, newconfig, plat, monkeypatch):
+ monkeypatch.setattr(sys, "platform", "win32")
+ config = newconfig([], """
+ [tox]
+ envlist = py27-{win,lin,osx}
+ [testenv]
+ platform =
+ win: win32
... 5951 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