3 new commits in tox:
https://bitbucket.org/hpk42/tox/commits/54204edbaa7e/
Changeset: 54204edbaa7e
User: carljm
Date: 2014-10-06 23:36:05+00:00
Summary: Add --pre and testenv pip_pre options, no --pre by default.
Affected #: 6 files
diff -r e89dddec56e6c5844aeb6cc50ea5e2956f53bca6 -r
54204edbaa7e82c125a1034ba3e1f124ff0cbb1e CHANGELOG
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,12 @@
+1.9.0.dev
+-----------
+
+- fix issue193: Remove ``--pre`` from the default ``install_command``; by
+ default tox will now only install final releases from PyPI for unpinned
+ dependencies. Use ``pip_pre = true`` in a testenv or the ``--pre``
+ command-line option to restore the previous behavior.
+
+
1.8.1.dev
-----------
diff -r e89dddec56e6c5844aeb6cc50ea5e2956f53bca6 -r
54204edbaa7e82c125a1034ba3e1f124ff0cbb1e doc/config.txt
--- a/doc/config.txt
+++ b/doc/config.txt
@@ -106,7 +106,22 @@
**default**::
- pip install --pre {opts} {packages}
+ pip install {opts} {packages}
+
+.. confval:: pip_pre=True|False(default)
+
+ .. versionadded:: 1.9
+
+ If ``True``, adds ``--pre`` to the ``opts`` passed to
+ :confval:`install_command`. If :confval:`install_command` uses pip, this
+ will cause it to install the latest available pre-release of any
+ dependencies without a specified version. If ``False`` (the default), pip
+ will only install final releases of unpinned dependencies.
+
+ Passing the ``--pre`` command-line option to tox will force this to
+ ``True`` for all testenvs.
+
+ Don't set this option if your :confval:`install_command` does not use pip.
.. confval:: whitelist_externals=MULTI-LINE-LIST
diff -r e89dddec56e6c5844aeb6cc50ea5e2956f53bca6 -r
54204edbaa7e82c125a1034ba3e1f124ff0cbb1e tests/test_config.py
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -106,6 +106,7 @@
envconfig = config.envconfigs['python']
assert envconfig.args_are_paths
assert not envconfig.recreate
+ assert not envconfig.pip_pre
def test_defaults_distshare(self, tmpdir, newconfig):
config = newconfig([], "")
@@ -620,6 +621,24 @@
'some_install', '--arg=%s/foo' % config.toxinidir, 'python',
'{opts}', '{packages}']
+ def test_pip_pre(self, newconfig):
+ config = newconfig("""
+ [testenv]
+ pip_pre=true
+ """)
+ envconfig = config.envconfigs['python']
+ assert envconfig.pip_pre
+
+ def test_pip_pre_cmdline_override(self, newconfig):
+ config = newconfig(
+ ['--pre'],
+ """
+ [testenv]
+ pip_pre=false
+ """)
+ envconfig = config.envconfigs['python']
+ assert envconfig.pip_pre
+
def test_downloadcache(self, newconfig, monkeypatch):
monkeypatch.delenv("PIP_DOWNLOAD_CACHE", raising=False)
config = newconfig("""
diff -r e89dddec56e6c5844aeb6cc50ea5e2956f53bca6 -r
54204edbaa7e82c125a1034ba3e1f124ff0cbb1e tests/test_venv.py
--- a/tests/test_venv.py
+++ b/tests/test_venv.py
@@ -211,6 +211,25 @@
assert "-i ABC" in args
assert "dep3" in args
+def test_install_deps_pre(newmocksession):
+ mocksession = newmocksession([], """
+ [testenv]
+ pip_pre=true
+ deps=
+ dep1
+ """)
+ venv = mocksession.getenv('python')
+ venv.create()
+ l = mocksession._pcalls
+ assert len(l) == 1
+ l[:] = []
+
+ venv.install_deps()
+ assert len(l) == 1
+ args = " ".join(l[0].args)
+ assert "--pre " in args
+ assert "dep1" in args
+
def test_installpkg_indexserver(newmocksession, tmpdir):
mocksession = newmocksession([], """
[tox]
diff -r e89dddec56e6c5844aeb6cc50ea5e2956f53bca6 -r
54204edbaa7e82c125a1034ba3e1f124ff0cbb1e tox/_config.py
--- a/tox/_config.py
+++ b/tox/_config.py
@@ -105,6 +105,8 @@
dest="indexurl", metavar="URL",
help="set indexserver url (if URL is of form name=url set the "
"url for the 'name' indexserver, specifically)")
+ parser.add_argument("--pre", action="store_true", dest="pre",
+ help="pass --pre option to install_command")
parser.add_argument("-r", "--recreate", action="store_true",
dest="recreate",
help="force recreation of virtual environments")
@@ -381,15 +383,17 @@
downloadcache = os.environ.get("PIP_DOWNLOAD_CACHE", downloadcache)
vc.downloadcache = py.path.local(downloadcache)
- pip_default_opts = ["--pre", "{opts}", "{packages}"]
vc.install_command = reader.getargv(
section,
"install_command",
- "pip install " + " ".join(pip_default_opts),
+ "pip install {opts} {packages}",
)
if '{packages}' not in vc.install_command:
raise tox.exception.ConfigError(
"'install_command' must contain '{packages}' substitution")
+ vc.pip_pre = config.option.pre or reader.getbool(
+ section, "pip_pre", False)
+
return vc
def _getenvdata(self, reader, toxsection):
diff -r e89dddec56e6c5844aeb6cc50ea5e2956f53bca6 -r
54204edbaa7e82c125a1034ba3e1f124ff0cbb1e tox/_venv.py
--- a/tox/_venv.py
+++ b/tox/_venv.py
@@ -260,6 +260,8 @@
if self.envconfig.downloadcache:
self.envconfig.downloadcache.ensure(dir=1)
l.append("--download-cache=%s" % self.envconfig.downloadcache)
+ if self.envconfig.pip_pre:
+ l.append("--pre")
return l
def run_install_command(self, packages, options=(),
https://bitbucket.org/hpk42/tox/commits/dc37c2432796/
Changeset: dc37c2432796
User: carljm
Date: 2014-10-07 16:44:37+00:00
Summary: Expand help text for --pre option.
Affected #: 1 file
diff -r 54204edbaa7e82c125a1034ba3e1f124ff0cbb1e -r
dc37c2432796b22e0dcee512f8baffb3a223b4e0 tox/_config.py
--- a/tox/_config.py
+++ b/tox/_config.py
@@ -106,7 +106,8 @@
help="set indexserver url (if URL is of form name=url set the "
"url for the 'name' indexserver, specifically)")
parser.add_argument("--pre", action="store_true", dest="pre",
- help="pass --pre option to install_command")
+ help="install pre-releases and development versions of dependencies. "
+ "This will pass the --pre option to install_command (pip by
default).")
parser.add_argument("-r", "--recreate", action="store_true",
dest="recreate",
help="force recreation of virtual environments")
https://bitbucket.org/hpk42/tox/commits/d4916d4cc83a/
Changeset: d4916d4cc83a
User: hpk42
Date: 2014-10-21 14:38:21+00:00
Summary: Merged in carljm/tox (pull request #123)
Add --pre and testenv pip_pre options, no --pre by default.
Affected #: 6 files
diff -r 2c1f0d218f7c5c4f3994aa1b7f82aedb7680d3e9 -r
d4916d4cc83a6abb7706383e9a249242fb4337fc CHANGELOG
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,12 @@
+1.9.0.dev
+-----------
+
+- fix issue193: Remove ``--pre`` from the default ``install_command``; by
+ default tox will now only install final releases from PyPI for unpinned
+ dependencies. Use ``pip_pre = true`` in a testenv or the ``--pre``
+ command-line option to restore the previous behavior.
+
+
1.8.1.dev
-----------
diff -r 2c1f0d218f7c5c4f3994aa1b7f82aedb7680d3e9 -r
d4916d4cc83a6abb7706383e9a249242fb4337fc doc/config.txt
--- a/doc/config.txt
+++ b/doc/config.txt
@@ -106,7 +106,22 @@
**default**::
- pip install --pre {opts} {packages}
+ pip install {opts} {packages}
+
+.. confval:: pip_pre=True|False(default)
+
+ .. versionadded:: 1.9
+
+ If ``True``, adds ``--pre`` to the ``opts`` passed to
+ :confval:`install_command`. If :confval:`install_command` uses pip, this
+ will cause it to install the latest available pre-release of any
+ dependencies without a specified version. If ``False`` (the default), pip
+ will only install final releases of unpinned dependencies.
+
+ Passing the ``--pre`` command-line option to tox will force this to
+ ``True`` for all testenvs.
+
+ Don't set this option if your :confval:`install_command` does not use pip.
.. confval:: whitelist_externals=MULTI-LINE-LIST
diff -r 2c1f0d218f7c5c4f3994aa1b7f82aedb7680d3e9 -r
d4916d4cc83a6abb7706383e9a249242fb4337fc tests/test_config.py
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -106,6 +106,7 @@
envconfig = config.envconfigs['python']
assert envconfig.args_are_paths
assert not envconfig.recreate
+ assert not envconfig.pip_pre
def test_defaults_distshare(self, tmpdir, newconfig):
config = newconfig([], "")
@@ -620,6 +621,24 @@
'some_install', '--arg=%s/foo' % config.toxinidir, 'python',
'{opts}', '{packages}']
+ def test_pip_pre(self, newconfig):
+ config = newconfig("""
+ [testenv]
+ pip_pre=true
+ """)
+ envconfig = config.envconfigs['python']
+ assert envconfig.pip_pre
+
+ def test_pip_pre_cmdline_override(self, newconfig):
+ config = newconfig(
+ ['--pre'],
+ """
+ [testenv]
+ pip_pre=false
+ """)
+ envconfig = config.envconfigs['python']
+ assert envconfig.pip_pre
+
def test_downloadcache(self, newconfig, monkeypatch):
monkeypatch.delenv("PIP_DOWNLOAD_CACHE", raising=False)
config = newconfig("""
diff -r 2c1f0d218f7c5c4f3994aa1b7f82aedb7680d3e9 -r
d4916d4cc83a6abb7706383e9a249242fb4337fc tests/test_venv.py
--- a/tests/test_venv.py
+++ b/tests/test_venv.py
@@ -211,6 +211,25 @@
assert "-i ABC" in args
assert "dep3" in args
+def test_install_deps_pre(newmocksession):
+ mocksession = newmocksession([], """
+ [testenv]
+ pip_pre=true
+ deps=
+ dep1
+ """)
+ venv = mocksession.getenv('python')
+ venv.create()
+ l = mocksession._pcalls
+ assert len(l) == 1
+ l[:] = []
+
+ venv.install_deps()
+ assert len(l) == 1
+ args = " ".join(l[0].args)
+ assert "--pre " in args
+ assert "dep1" in args
+
def test_installpkg_indexserver(newmocksession, tmpdir):
mocksession = newmocksession([], """
[tox]
diff -r 2c1f0d218f7c5c4f3994aa1b7f82aedb7680d3e9 -r
d4916d4cc83a6abb7706383e9a249242fb4337fc tox/_config.py
--- a/tox/_config.py
+++ b/tox/_config.py
@@ -105,6 +105,9 @@
dest="indexurl", metavar="URL",
help="set indexserver url (if URL is of form name=url set the "
"url for the 'name' indexserver, specifically)")
+ parser.add_argument("--pre", action="store_true", dest="pre",
+ help="install pre-releases and development versions of dependencies. "
+ "This will pass the --pre option to install_command (pip by
default).")
parser.add_argument("-r", "--recreate", action="store_true",
dest="recreate",
help="force recreation of virtual environments")
@@ -381,15 +384,17 @@
downloadcache = os.environ.get("PIP_DOWNLOAD_CACHE", downloadcache)
vc.downloadcache = py.path.local(downloadcache)
- pip_default_opts = ["--pre", "{opts}", "{packages}"]
vc.install_command = reader.getargv(
section,
"install_command",
- "pip install " + " ".join(pip_default_opts),
+ "pip install {opts} {packages}",
)
if '{packages}' not in vc.install_command:
raise tox.exception.ConfigError(
"'install_command' must contain '{packages}' substitution")
+ vc.pip_pre = config.option.pre or reader.getbool(
+ section, "pip_pre", False)
+
return vc
def _getenvdata(self, reader, toxsection):
diff -r 2c1f0d218f7c5c4f3994aa1b7f82aedb7680d3e9 -r
d4916d4cc83a6abb7706383e9a249242fb4337fc tox/_venv.py
--- a/tox/_venv.py
+++ b/tox/_venv.py
@@ -260,6 +260,8 @@
if self.envconfig.downloadcache:
self.envconfig.downloadcache.ensure(dir=1)
l.append("--download-cache=%s" % self.envconfig.downloadcache)
+ if self.envconfig.pip_pre:
+ l.append("--pre")
return l
def run_install_command(self, packages, options=(),
Repository URL: https://bitbucket.org/hpk42/tox/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
_______________________________________________
pytest-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pytest-commit