Features
- Read a dotted patch version after an interpreter name, such as
py3.12.1orcpython-3.12.1, from an environment name, and refuse an undeclared-eenvironment whose Python version tox cannot read, such aspy3121,3.12.1or3, instead of running it on the fallback interpreter (#4532) by @ericdelorefice and @gaborbernat.
Changes
- Make the legacy
tox --showconfig -aandtox --help-ini -ashow every defined environment, and fix the--showconfighelp, which claimed that was the default; without-athey showenv_list(#4540) by @gaborbernat and @xixi-box. (#4538) - Limit
tox -pandtox --parallelwithout a value to the CPU count, as-p autodoes, instead of running every selected environment at once (#4480) by @cansentay. - Report factors passed to
-fthat appear in no environment name, with a close match, instead of selecting nothing without saying why. As with-m, one unknown factor fails the command even when another-fgroup selects environments (#4537) by @Harp404 and @gaborbernat.
Bug fixes
- On Python 3.11.0–3.11.3, extract a source distribution the way the
datatar filter does: ignore archived owners, strip unsafe permissions, normalize paths and refuse special files and hard links to non-regular files (#4487) by @xixi-box and @gaborbernat. (#4484) - Keep a joined
--conf=<path>,-c<path>or--root=<path>during shell completion instead of loading the current directory's project (#4486) by @xixi-box and @gaborbernat. (#4485) - Load a TOML file passed with
-cunder another name, such as a copy oftox.toml, instead of reading it as INI (#4530) by @Harp404 and @gaborbernat. (#4529) - Name only the environments that form the cycle in the circular
dependserror, not the ones that lead into it (#4479) by @JROtto5 and @gaborbernat. - Reject a
--hashseedabove4294967295, and ignore one fromTOX_HASH_SEEDor the user config, instead of letting the interpreter abort (#4517) by @qianeric-backup and @gaborbernat. - Reject a negative
commands_retrywith an error, instead of skipping every command and reporting the environment as passed (#4536) by @Harp404 and @gaborbernat. - Reject an out-of-range
--exit-and-dump-after(negative, or past the thread timeout limit) with a usage error, and ignore one fromTOX_EXIT_AND_DUMP_AFTERor the user config, instead of crashing infaulthandler(#4533) by @qianeric-backup and @gaborbernat. - Report the output path and filesystem error when
tox config -ocannot write the requested file (#4483) by @qianeric-backup.
Security
- A
:in a host variable no longer starts the default of the{[section]key}reference it supplies (#4492) by @gaborbernat. (GHSA-x6h3-7262-cprp) - Create a recreated environment in its own directory, not in the target of the symlink it replaced (#4488) by @gaborbernat. (GHSA-fr8f-x54h-mj7x)
- Create the work directory owner-only on POSIX also when tox creates it before environment setup (#4526) by @gaborbernat. (GHSA-w693-j59x-jf7r)
- Expand
${NAME}in adepsentry or requirements file line in one pass, so a${OTHER}inside a variable's value stays literal (#4497) by @gaborbernat. (GHSA-rvc4-v86f-44w7) - Fail on a
-r,-corconstraintsURL with a scheme other thanhttp,httpsorfile, instead of printing a secret in the error (#4520) by @gaborbernat. (GHSA-jm68-4p79-vjpq) - Give a TOML
set_envreference its own copy of the referenced environment's variables, soTOX_ENV_NAMEand multi-line values stay correct (#4519) by @gaborbernat. (GHSA-jvqj-vmh8-rh5h) - In INI commands, keep a multi-line substitution that follows another substitution in the same command (#4491) by @gaborbernat. (GHSA-h3hp-7hf3-v24x)
- Keep
#text in an-xoverride read through an INI{[section]key}reference; drop any\#escape added as a workaround (#4512) by @gaborbernat. (GHSA-x5cf-5q6w-j9mr) - Keep a substitution inside its quoted argument when that argument continues on the next line of
install_command(#4493) by @gaborbernat. (GHSA-8c6w-xxj9-xw7v) - Keep positional arguments,
{glob:...}matches andTOX_FACTOR_<label>values literal when joined with a set host variable (#4510) by @gaborbernat. (GHSA-973j-cr58-r5j4) - Keep refusing a work directory whose cleanup was refused or interrupted; delete it if tox 4.67.11 to 4.67.17 said
tox will not remove it(#4490) by @gaborbernat. (GHSA-r896-w2xg-246c) - Mask URL credentials and secret flags in errors about rejected command line arguments (#4507) by @gaborbernat. (GHSA-25fg-rr6h-j853)
- Mask URL credentials in the warning that explains why tox recreates an environment (#4518) by @gaborbernat. (GHSA-cg5x-g2vr-5pqm)
- Mask a URL password that an unbalanced quote fuses into a command's program name (#4508) by @gaborbernat. (GHSA-rpq3-qxcr-j53q)
- Mask a URL password whose user name or password holds an unencoded
/,?,#or whitespace (#4509) by @gaborbernat. (GHSA-hrj9-4287-r44r) - Mask a secret flag that follows a comma, colon, bracket,
&or|inside another argument (#4500) by @gaborbernat. (GHSA-9f32-7248-w2cv) - Mask a secret-named
${VAR}from a requirements file in the install cache and the recreate warning, also when the parser strips or unquotes it (#4524) by @gaborbernat. (GHSA-652r-w8g3-hqqx) - Mask secrets in configuration error messages, such as a password in a value that fails type conversion (#4521) by @gaborbernat. (GHSA-8g3g-cp8x-2xf2)
- On Windows, keep an INI command argument such as
tests{/}{posargs}ortests{/}"{env:NAME}"as one argument when the value after{/}contains spaces (#4503) by @gaborbernat. (GHSA-hq5q-qhh5-xrhm) - On Windows, look up a bare command name only on
PATH, not in the current directory; use{tox_root}{/}make.batfor a script next to the configuration (#4525) by @gaborbernat. (GHSA-46m6-vxc8-x459) - Prefix
./whenargs_are_pathsrewrites a path to a bare name, sopip install .from a subfolder installs that folder (#4516) by @gaborbernat. (GHSA-32wg-pmq5-f6ph) - Refuse a dependency version that makes pip install a local path, such as
setuptools=={env:VERSION}withVERSION=1.0+x.zip(#4523) by @gaborbernat. (GHSA-jj6v-45f9-r696) - Refuse a line break within a path reference such as
{change_dir}, or one entry of a referenced list, indepsorconstraints, and replace it with a space in an INI command argument (#4513) by @gaborbernat. (GHSA-pjfj-p8g9-hh9q) - Refuse a substituted separator that would close a factor group or add an entry in an INI list, set, dictionary or
env_list(#4506) by @gaborbernat. (GHSA-rx4r-9qj4-rx5v) - Refuse a symlink or Windows junction at the work directory, or between it and
tox_root, that leads to a directory tox did not use; delete the link or point it at an empty directory (#4502) by @gaborbernat. (GHSA-qvr7-gm47-pc48) - Refuse a work directory that other accounts can change before creating, cleaning or running any environment in it (#4504) by @gaborbernat. (GHSA-92rh-4qvm-r7q5)
- Refuse to empty an environment or work directory whose path goes through a link another account can retarget (#4494) by @gaborbernat. (GHSA-h3gv-qq8x-xvmx)
- Reject a substitution nested in another's default when it adds pip options or entries, as tox already does without the outer default (#4499) by @gaborbernat. (GHSA-94cx-46r6-fg4m)
- Remove other accounts' write access before emptying an exposed work directory, and stop if anything remains (#4489) by @gaborbernat. (GHSA-4ch2-rc75-f96w)
- Send the user name and password of an HTTP(S)
-ror-cURL as basic authentication, so the download works and a malformed URL no longer prints the password (#4515) by @gaborbernat. (GHSA-xxc6-7758-898f) - Skip
recreate_commandswhen the environment directory is a symlink or Windows junction, and emptyenv_log_dirbefore they run, so their logs stay out of link targets (#4496) by @gaborbernat. (GHSA-p792-5wh6-qq5c) - Stop with exit code 2 when
--no-provision,-x,--workdir,--discover,--skip-env-install,--runneror an abbreviated, joined or clustered-c,--confor--rootfollows an unknown option; put them before options of plugins inrequires(#4514) by @gaborbernat. (GHSA-q3rp-hcjj-58cf) - With
constrain_package_deps, fail when a generated constraint line would add a pip option or a line break (#4511) by @gaborbernat. (GHSA-qpvr-c299-fj87) - With
constrain_package_deps, fail the run when the generatedconstraints.txtholds${NAME}andNAMEis set, instead of letting pip expand it (#4498) by @gaborbernat. (GHSA-7f9v-qph2-3pfw) - Pass each requirement from an unquoted
deps,constraintsorrequiresreference in an INI command as one argument, without comments (#4505) by @gaborbernat. (GHSA-5r79-84x3-f5fq) - Refuse a symlink or junction at or above
pkg_dirinstead of building the package into its target (#4495) by @gaborbernat. (GHSA-ww48-327h-hvj8) - Refuse a symlink or junction on the path to
env_dir,env_tmp_dir,env_log_dirormeta_dirinside the project (#4501) by @gaborbernat. (GHSA-v2f9-v2c6-c3v8) - Reject a pip option that a partial
constraintssubstitution adds inside quotes, after a backslash or after a tab (#4522) by @gaborbernat. (GHSA-qmw7-263r-wf3g)
New Contributors
- @cansentay made their first contribution in #4480
- @Harp404 made their first contribution in #4530