diff options
Diffstat (limited to 'tox/_config.py')
-rw-r--r-- | tox/_config.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/tox/_config.py b/tox/_config.py index 0348080..c20e251 100644 --- a/tox/_config.py +++ b/tox/_config.py @@ -125,10 +125,11 @@ def prepare_parse(pkgname): help="set PYTHONHASHSEED to SEED before running commands. " "Defaults to a random integer in the range 1 to 4294967295. " "Passing 'noset' suppresses this behavior.") - parser.add_argument("--force-dep-version", action="append", - metavar="DEP==VER", default=None, + parser.add_argument("--force-dep", action="append", + metavar="REQ", default=None, help="Forces a certain version of one of the dependencies " - "when configuring the virtual environment.") + "when configuring the virtual environment. REQ Examples " + "'pytest<2.4' or 'django>=1.6'.") parser.add_argument("args", nargs="*", help="additional arguments available to command positional substitution") return parser @@ -400,9 +401,9 @@ class parseini: :param config: Config instance :return: the new dependency that should be used for virtual environments """ - if not config.option.force_dep_version: + if not config.option.force_dep: return name - for forced_dep in config.option.force_dep_version: + for forced_dep in config.option.force_dep: if self._is_same_dep(forced_dep, name): return forced_dep return name @@ -410,7 +411,8 @@ class parseini: @classmethod def _is_same_dep(cls, dep1, dep2): """ - Returns True if both dependency definitions refer to the same package, even if versions differ. + Returns True if both dependency definitions refer to the + same package, even if versions differ. """ dep1_name = pkg_resources.Requirement.parse(dep1).project_name dep2_name = pkg_resources.Requirement.parse(dep2).project_name |