This repository was archived by the owner on Sep 26, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-12
lines changed Expand file tree Collapse file tree 2 files changed +10
-12
lines changed Original file line number Diff line number Diff line change 2121except ImportError :
2222 setuptools_version = None
2323
24+ try :
25+ import tomli as toml
26+ except ImportError :
27+ # tomllib added to the stdlib in Python 3.11
28+ import tomllib as toml
29+
2430toxconf = tox_config .parseconfig ('tox' )
2531# we later filter out any _onlytox commands...
2632toxconf_pre = configparser .ConfigParser ()
@@ -246,19 +252,9 @@ def get_dependencies(groups,all_extras=False):
246252
247253
248254def get_buildreqs ():
249- try :
250- import pip ._vendor .pytoml as toml
251- except Exception :
252- try :
253- # pip>=20.1
254- import pip ._vendor .toml as toml
255- except Exception :
256- # pip>=21.2.1
257- import pip ._vendor .tomli as toml
258-
259255 buildreqs = []
260256 if os .path .exists ('pyproject.toml' ):
261- with open ('pyproject.toml' ) as f :
257+ with open ('pyproject.toml' , 'rb' ) as f :
262258 pp = toml .load (f )
263259 if 'build-system' in pp :
264260 buildreqs += pp ['build-system' ].get ("requires" ,[])
Original file line number Diff line number Diff line change 4343 # Pretty much part of every python distribution now anyway.
4444 # Use it e.g. to be able to read pyproject.toml
4545 # pinning to avoid https://github.com/pyviz/pyctdev/issues/12
46- 'pip >=19.1.1'
46+ 'pip >=19.1.1' ,
47+ # Added to no longer depend on tomli vendored by pip.
48+ 'tomli>=2;python_version<"3.11"' ,
4749 ],
4850 extras_require = {
4951 'tests' : ['flake8' ],
You can’t perform that action at this time.
0 commit comments