Skip to content

Commit 99dd844

Browse files
pre-commit-ci[bot]gaborbernat
authored andcommitted
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci Signed-off-by: Bernát Gábor <[email protected]>
1 parent 0ed31db commit 99dd844

File tree

6 files changed

+15
-19
lines changed

6 files changed

+15
-19
lines changed

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ repos:
2828
rev: v1.12.1
2929
hooks:
3030
- id: blacken-docs
31-
additional_dependencies: [ black==21.12b0 ]
31+
additional_dependencies: [ black==22.6 ]
3232
- repo: https://github.com/pre-commit/pygrep-hooks
3333
rev: v1.9.0
3434
hooks:

docs/changelog/2463.feature.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Use ``tomllib`` on Python 3.11 or later and ``tomli`` instead of ``toml`` library on lower versions - by :user:`gaborbernat`.

docs/example/jenkins.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ with this:
6363
url = "https://bitbucket.org/hpk42/tox/raw/default/toxbootstrap.py"
6464
# os.environ['USETOXDEV']="1" # use tox dev version
6565
d = dict(__file__="toxbootstrap.py")
66-
exec urllib.urlopen(url).read() in d
66+
exec(urllib.urlopen(url).read(), globals=d)
6767
d["cmdline"](["--recreate"])
6868
6969
The downloaded ``toxbootstrap.py`` file downloads all necessary files to

setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ install_requires =
4242
virtualenv!=20.0.0,!=20.0.1,!=20.0.2,!=20.0.3,!=20.0.4,!=20.0.5,!=20.0.6,!=20.0.7,>=16.0.0
4343
colorama>=0.4.1 ;platform_system=="Windows"
4444
importlib-metadata>=0.12;python_version<"3.8"
45-
toml;python_version<"3.11"
45+
tomli>=2.0.1;python_version<"3.11"
4646
python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*
4747

4848
[options.packages.find]

src/tox/config/__init__.py

+5-10
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from __future__ import print_function
22

33
import argparse
4-
import io
54
import itertools
65
import json
76
import os
@@ -22,13 +21,9 @@
2221
import six
2322

2423
if sys.version_info >= (3, 11):
25-
import tomllib as toml_loader
26-
toml_mode = "rb"
27-
toml_encoding = None
24+
import tomllib as toml
2825
else:
29-
import toml as toml_loader
30-
toml_mode = "r"
31-
toml_encoding = "UTF-8"
26+
import tomli as toml
3227

3328
from packaging import requirements
3429
from packaging.utils import canonicalize_name
@@ -313,9 +308,9 @@ def parseconfig(args, plugins=()):
313308

314309

315310
def get_py_project_toml(path):
316-
with io.open(str(path), mode=toml_mode, encoding=toml_encoding) as file_handler:
317-
config_data = toml_loader.load(file_handler)
318-
return config_data
311+
with open(str(path), mode="rb") as file_handler:
312+
config_data = toml.load(file_handler)
313+
return config_data
319314

320315

321316
def propose_configs(cli_config_file):

tox.ini

+6-6
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ passenv =
4848
basepython = python3.10
4949
skip_install = true
5050
deps =
51-
pre-commit>=2.16
51+
pre-commit>=2.20
5252
extras =
5353
lint
5454
commands =
@@ -65,8 +65,8 @@ setenv =
6565
COVERAGE_FILE = {toxworkdir}/.coverage
6666
skip_install = true
6767
deps =
68-
coverage>=6.2
69-
diff-cover>=6.4
68+
coverage>=6.4.4
69+
diff-cover>=6.5.1
7070
parallel_show_output = true
7171
commands =
7272
coverage combine
@@ -90,7 +90,7 @@ description = check that the long description is valid
9090
basepython = python3.9
9191
skip_install = true
9292
deps =
93-
twine>=3.7.1
93+
twine>=4.0.1
9494
extras =
9595
commands =
9696
pip wheel -w {envtmpdir}/build --no-deps .
@@ -114,9 +114,9 @@ passenv =
114114
*
115115
basepython = python3.10
116116
deps =
117-
gitpython>=3.1.24
117+
gitpython>=3.1.27
118118
packaging>=21.3
119-
towncrier>=21.3
119+
towncrier>=21.9
120120
commands =
121121
python {toxinidir}/tasks/release.py --version {posargs}
122122

0 commit comments

Comments
 (0)