Skip to content

Commit 585e016

Browse files
committed
tox: Soft-deprecate '[tox] min_version'
We don't raise a warning or similar: this is purely to encourage new users (and existing users reworking their tox.ini files) to prefer '[tox] requires'. Signed-off-by: Stephen Finucane <[email protected]>
1 parent 29b5295 commit 585e016

File tree

4 files changed

+17
-10
lines changed

4 files changed

+17
-10
lines changed

docs/changelog/3553.doc.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The ``min_version``/``minversion`` config option is deprecated in favor of the ``requires`` option.

docs/config.rst

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ For example:
4646
.. code-block:: ini
4747
4848
[tox]
49-
min_version = 4.20
49+
requires =
50+
tox >= 4.20
5051
env_list =
5152
3.13
5253
3.12
@@ -74,7 +75,8 @@ This configuration file uses:
7475
.. code-block:: ini
7576
7677
[tox:tox]
77-
min_version = 4.0
78+
requires =
79+
tox >= 4.20
7880
env_list =
7981
3.13
8082
3.12
@@ -98,7 +100,8 @@ instead inside the ``pyproject.toml`` file under the ``tool.tox`` table and ``le
98100
[tool.tox]
99101
legacy_tox_ini = """
100102
[tox]
101-
min_version = 4.0
103+
requires =
104+
tox >= 4.20
102105
env_list =
103106
py310
104107
py39
@@ -203,6 +206,9 @@ The following options are set in the ``[tox]`` section of ``tox.ini`` or the ``[
203206
.. conf::
204207
:keys: min_version, minversion
205208
:default: <current version of tox>
209+
:version_deprecated: 4.28.0
210+
211+
**DEPRECATED** Prefer requiring a minimum tox version via :ref:`requires`.
206212

207213
A string to define the minimal tox version required to run. If the host's tox version is less than this, it will
208214
automatically create a provisioned tox environment that satisfies this requirement. See :ref:`provision_tox_env`

docs/upgrading.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,6 @@ version is above the version this feature was added to it, for example for setup
321321
Provisioning environment
322322
------------------------
323323

324-
The provisioning environment is triggered when ``minversion`` or ``requires`` are specified and the current environment
324+
The provisioning environment is triggered when ``min_version`` or ``requires`` are specified and the current environment
325325
does not satisfy the requirement. In tox 4, the provisioning environment (``.tox`` by default) must be explicitly
326326
configured and will not inherit values from ``[testenv]`` section.

docs/user_guide.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,8 @@ you want to do more research, we recommend taking a look at these projects:
385385

386386
Auto-provisioning
387387
-----------------
388-
In case the installed tox version does not satisfy either the :ref:`min_version` or the :ref:`requires`, tox will automatically
388+
389+
In case the installed tox version does not satisfy either the :ref:`requires` or the :ref:`min_version`, tox will automatically
389390
create a virtual environment under :ref:`provision_tox_env` name that satisfies those constraints and delegate all
390391
calls to this meta environment. This should allow satisfying constraints on your tox environment automatically,
391392
given you have at least version ``3.8.0`` of tox.
@@ -396,17 +397,16 @@ For example given:
396397

397398
.. code-block:: toml
398399
399-
min_version = "4"
400-
requires = ["tox-uv>=1"]
400+
requires = ["tox>=4", "tox-uv>=1"]
401401
402402
.. tab:: INI
403403

404404
.. code-block:: ini
405405
406406
[tox]
407-
min_version = 4
408-
requires = tox-uv>=1
409-
407+
requires =
408+
tox>=4
409+
tox-uv>=1
410410
411411
if the user runs it with tox ``3.8`` or later the installed tox application will automatically ensure that both the minimum version and
412412
requires constraints are satisfied, by creating a virtual environment under ``.tox`` folder, and then installing into it

0 commit comments

Comments
 (0)