Skip to content

Commit 3336289

Browse files
authored
Merge branch 'main' into 3512-hangs-on-installpkg-sdist
2 parents 8e02c54 + 0b8f66f commit 3336289

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+906
-214
lines changed

.github/workflows/check.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ jobs:
3030
- "3.10"
3131
- "3.9"
3232
os:
33-
- ubuntu-latest
34-
- windows-latest
35-
- macos-latest
33+
- ubuntu-24.04
34+
- windows-2025
35+
- macos-15
3636
steps:
37-
- uses: actions/checkout@v4
37+
- uses: actions/checkout@v5
3838
with:
3939
fetch-depth: 0
4040
- name: Install the latest version of uv
@@ -70,12 +70,12 @@ jobs:
7070
- docs
7171
- pkg_meta
7272
os:
73-
- ubuntu-latest
74-
- windows-latest
73+
- ubuntu-24.04
74+
- windows-2025
7575
exclude:
7676
- { os: windows-latest, tox_env: docs }
7777
steps:
78-
- uses: actions/checkout@v4
78+
- uses: actions/checkout@v5
7979
with:
8080
fetch-depth: 0
8181
- name: Install the latest version of uv

.github/workflows/release.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ env:
99

1010
jobs:
1111
build:
12-
runs-on: ubuntu-latest
12+
runs-on: ubuntu-24.04
1313
steps:
14-
- uses: actions/checkout@v4
14+
- uses: actions/checkout@v5
1515
with:
1616
fetch-depth: 0
1717
- name: Install the latest version of uv
@@ -31,15 +31,15 @@ jobs:
3131
release:
3232
needs:
3333
- build
34-
runs-on: ubuntu-latest
34+
runs-on: ubuntu-24.04
3535
environment:
3636
name: release
3737
url: https://pypi.org/project/tox/${{ github.ref_name }}
3838
permissions:
3939
id-token: write
4040
steps:
4141
- name: Download all the dists
42-
uses: actions/download-artifact@v4
42+
uses: actions/download-artifact@v5
4343
with:
4444
name: ${{ env.dists-artifact-name }}
4545
path: dist/

.pre-commit-config.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v5.0.0
3+
rev: v6.0.0
44
hooks:
55
- id: end-of-file-fixer
66
- id: trailing-whitespace
77
- repo: https://github.com/python-jsonschema/check-jsonschema
8-
rev: 0.33.0
8+
rev: 0.33.3
99
hooks:
1010
- id: check-github-workflows
1111
args: ["--verbose"]
@@ -15,19 +15,19 @@ repos:
1515
- id: codespell
1616
additional_dependencies: ["tomli>=2.2.1"]
1717
- repo: https://github.com/tox-dev/pyproject-fmt
18-
rev: "v2.5.1"
18+
rev: "v2.6.0"
1919
hooks:
2020
- id: pyproject-fmt
2121
- repo: https://github.com/abravalheri/validate-pyproject
2222
rev: "v0.24.1"
2323
hooks:
2424
- id: validate-pyproject
2525
- repo: https://github.com/astral-sh/ruff-pre-commit
26-
rev: "v0.11.9"
26+
rev: "v0.12.11"
2727
hooks:
28-
- id: ruff-format
29-
- id: ruff
28+
- id: ruff-check
3029
args: ["--fix", "--unsafe-fixes", "--exit-non-zero-on-fix"]
30+
- id: ruff-format
3131
- repo: https://github.com/asottile/blacken-docs
3232
rev: 1.19.1
3333
hooks:
@@ -38,7 +38,7 @@ repos:
3838
hooks:
3939
- id: rst-backticks
4040
- repo: https://github.com/rbubley/mirrors-prettier
41-
rev: "v3.5.3"
41+
rev: "v3.6.2"
4242
hooks:
4343
- id: prettier
4444
- repo: local

docs/changelog.rst

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,82 @@ Release History
44

55
.. towncrier release notes start
66
7+
v4.29.0 (2025-08-29)
8+
--------------------
9+
10+
Features - 4.29.0
11+
~~~~~~~~~~~~~~~~~
12+
- A new tox life cycle event is now exposed for use via :doc:`Plugins
13+
API </plugins>` -- by :user:`webknjaz`.
14+
15+
The corresponding hook point is :func:`tox_extend_envs
16+
<tox.plugin.spec.tox_extend_envs>`. It allows plugin authors to
17+
declare ephemeral environments that they can then populate through
18+
the in-memory configuration loader interface.
19+
20+
This patch was made possible thanks to pair programming with
21+
:user:`gaborbernat` at PyCon US 2025. (:issue:`3510`, :issue:`3591`)
22+
23+
v4.28.4 (2025-07-31)
24+
--------------------
25+
26+
Features - 4.28.4
27+
~~~~~~~~~~~~~~~~~
28+
- Pass ssh-agent variables ``SSH_AGENT_PID`` and ``SSH_AUTH_SOCK`` in ``pass_env`` by default.
29+
- by :user:`daniilgankov` (:issue:`3572`)
30+
31+
v4.28.3 (2025-07-25)
32+
--------------------
33+
34+
No significant changes.
35+
36+
37+
v4.28.2 (2025-07-25)
38+
--------------------
39+
40+
Bugfixes - 4.28.2
41+
~~~~~~~~~~~~~~~~~
42+
- Don't pass in the filter argument to tar.extractall on old Python versions - by :user:`gaborbernat`. (:issue:`3568`)
43+
44+
v4.28.1 (2025-07-22)
45+
--------------------
46+
47+
Bugfixes - 4.28.1
48+
~~~~~~~~~~~~~~~~~
49+
- Use `tarfile.data_filter <https://docs.python.org/3/library/tarfile.html#tarfile.data_filter>`_ with ``extractall``
50+
only on supported Python versions:
51+
52+
- ``>= 3.11.4``
53+
- ``>= 3.10.12`` and ``< 3.11``
54+
- ``>= 3.9.17`` and ``< 3.10``
55+
56+
by :user:`gaborbernat`. (:issue:`3565`)
57+
58+
v4.28.0 (2025-07-20)
59+
--------------------
60+
61+
Features - 4.28.0
62+
~~~~~~~~~~~~~~~~~
63+
- Added ``constraints`` to allow specifying constraints files for all dependencies. (:issue:`3550`)
64+
- Allow disabling tox plugins via the ``TOX_DISABLED_EXTERNAL_PLUGINS`` environment variable - by :user:`gaborbernat`. (:issue:`3468`)
65+
66+
Improved Documentation - 4.28.0
67+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
68+
- The ``min_version``/``minversion`` config option is deprecated in favor of the ``requires`` option. (:issue:`3553`)
69+
70+
v4.27.0 (2025-06-17)
71+
--------------------
72+
73+
Features - 4.27.0
74+
~~~~~~~~~~~~~~~~~
75+
- Add ``free_threaded`` flag to to ``"python"`` entries in json output of ``--result-json``. (:issue:`3534`)
76+
77+
Bugfixes - 4.27.0
78+
~~~~~~~~~~~~~~~~~
79+
- Fix dependency-group name normalization. (:issue:`3539`)
80+
- Improves logging of environment variables by sorting them by key and redacting
81+
the values for the ones that are likely to contain secrets. (:issue:`3542`)
82+
783
v4.26.0 (2025-05-13)
884
--------------------
985

docs/changelog/3442.feature.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add ``__TOX_ENVIRONMENT_VARIABLE_ORIGINAL_CI``, which passes through the ``CI`` variable if present. This is intended for use by other libraries to detect if tox is running under CI.

docs/changelog/3534.feature.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/changelog/3578.bugfix.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Makes the error message more clear when pyproject.toml file cannot be loaded
2+
or is missing expected keys.

docs/config.rst

Lines changed: 39 additions & 9 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.0
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.0
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`
@@ -546,6 +552,16 @@ Base options
546552
- ✅
547553
- ✅
548554
- ✅
555+
* - SSH_AGENT_PID
556+
- ✅
557+
- ✅
558+
- ❌
559+
* - SSH_AUTH_SOCK
560+
- ✅
561+
- ✅
562+
- ❌
563+
564+
If the environment variable ``CI`` is present, ``__TOX_ENVIRONMENT_VARIABLE_ORIGINAL_CI`` will be set to the value of ``CI``. The ``CI`` variable itself will not be passed through.
549565

550566
More environment variable-related information can be found in :ref:`environment variable substitutions`.
551567

@@ -561,7 +577,7 @@ Base options
561577
.. code-block:: toml
562578
563579
[tool.tox.env_run_base]
564-
set_env = { file = "conf{/}local.env", TEST_TIMEOUT = 30 }
580+
set_env = { file = "conf{/}local.env", TEST_TIMEOUT = "30" }
565581
566582
.. tab:: INI
567583

@@ -936,15 +952,15 @@ Python run
936952
:keys: deps
937953
:default: <empty list>
938954

939-
Name of the Python dependencies. Installed into the environment prior to project after environment creation, but
955+
Python dependencies. Installed into the environment prior to project after environment creation, but
940956
before package installation. All installer commands are executed using the :ref:`tox_root` as the current working
941957
directory. Each value must be one of:
942958

943959
- a Python dependency as specified by :pep:`440`,
944960
- a `requirement file <https://pip.pypa.io/en/stable/user_guide/#requirements-files>`_ when the value starts with
945-
``-r`` (followed by a file path),
961+
``-r`` (followed by a file path or URL),
946962
- a `constraint file <https://pip.pypa.io/en/stable/user_guide/#constraints-files>`_ when the value starts with
947-
``-c`` (followed by a file path).
963+
``-c`` (followed by a file path or URL).
948964

949965
If you are only defining :pep:`508` requirements (aka no pip requirement files), you should use
950966
:ref:`dependency_groups` instead.
@@ -971,6 +987,21 @@ Python run
971987
-r requirements.txt
972988
-c constraints.txt
973989
990+
.. note::
991+
992+
:ref:`constraints` is the preferred way to specify constraints files since they will apply to package dependencies
993+
also.
994+
995+
.. conf::
996+
:keys: constraints
997+
:default: <empty list>
998+
:version_added: 4.28.0
999+
1000+
`Constraints files <https://pip.pypa.io/en/stable/user_guide/#constraints-files>`_ to use during package and
1001+
dependency installation. Provided constraints files will be used when installing package dependencies and any
1002+
additional dependencies specified in :ref:`deps`, but will not be used when installing the package itself.
1003+
Each value must be a file path or URL.
1004+
9741005
.. conf::
9751006
:keys: use_develop, usedevelop
9761007
:default: false
@@ -1204,7 +1235,6 @@ Pip installer
12041235
This command will be executed only if executing on Continuous Integrations is detected (for example set environment
12051236
variable ``CI=1``) or if journal is active.
12061237

1207-
12081238
.. conf::
12091239
:keys: pip_pre
12101240
:default: false
@@ -1221,7 +1251,7 @@ Pip installer
12211251

12221252
If ``constrain_package_deps`` is true, then tox will create and use ``{env_dir}{/}constraints.txt`` when installing
12231253
package dependencies during ``install_package_deps`` stage. When this value is set to false, any conflicting package
1224-
dependencies will override explicit dependencies and constraints passed to ``deps``.
1254+
dependencies will override explicit dependencies and constraints passed to :ref:`deps`.
12251255

12261256
.. conf::
12271257
:keys: use_frozen_constraints

docs/installation.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ Installation
22
============
33

44
As tool
5-
--------
5+
-------
66

77
:pypi:`tox` is a CLI tool that needs a Python interpreter (version 3.9 or higher) to run. We recommend either
8-
:pypi:`pipx` or :pypi:`uv` to install tox into an isolated environment. This has the added benefit that later you'll
8+
:pypi:`pipx` or :pypi:`uv` to install tox into an isolated environment. This has the added benefit that later you'll
99
be able to upgrade tox without affecting other parts of the system. We provide method for ``pip`` too here but we
1010
discourage that path if you can:
1111

@@ -17,7 +17,6 @@ discourage that path if you can:
1717
uv tool install tox
1818
tox --help
1919
20-
2120
.. tab:: pipx
2221

2322
.. code-block:: bash
@@ -40,6 +39,7 @@ discourage that path if you can:
4039

4140
wheel
4241
~~~~~
42+
4343
Installing tox via a wheel (default with pip) requires an installer that can understand the ``python-requires`` tag (see
4444
:pep:`503`), with pip this is version ``9.0.0`` (released in November 2016). Furthermore, in case you're not installing
4545
it via PyPI you need to use a mirror that correctly forwards the ``python-requires`` tag (notably the OpenStack mirrors
@@ -49,19 +49,22 @@ don't do this, or older :gh_repo:`devpi/devpi` versions - added with version ``4
4949

5050
sdist
5151
~~~~~
52+
5253
When installing via a source distribution you need an installer that handles the :pep:`517` specification. In case of
5354
``pip`` this is version ``18.0.0`` or later (released in July 2018). If you cannot upgrade your pip to support this you
5455
need to ensure that the build requirements from :gh:`pyproject.toml <tox-dev/tox/blob/main/pyproject.toml>` are
5556
satisfied before triggering the installation.
5657

5758
via ``setup.py``
5859
----------------
60+
5961
We don't recommend and officially support this method. You should prefer using an installer that supports :pep:`517`
6062
interface, such as pip ``19.0.0`` or later. That being said you might be able to still install a package via this method
6163
if you satisfy build dependencies before calling the installation command (as described under :ref:`sdist`).
6264

6365
latest unreleased
6466
-----------------
67+
6568
Installing an unreleased version is discouraged and should be only done for testing purposes. If you do so you'll need
6669
a pip version of at least ``18.0.0`` and use the following command:
6770

0 commit comments

Comments
 (0)