File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ dev = [
3434 " pytest>=7.0.0" ,
3535 " pytest-cov>=4.0.0" ,
3636 " ruff>=0.4.0" ,
37+ " tomli>=1.1.0; python_version < '3.11'" ,
3738]
3839
3940[project .urls ]
Original file line number Diff line number Diff line change @@ -583,7 +583,10 @@ def test_ruff_known_first_party(self):
583583 """ruff known-first-party should be ['deadcode'], not ['*']."""
584584 from pathlib import Path
585585
586- import tomllib
586+ try :
587+ import tomllib # Python >=3.11
588+ except ModuleNotFoundError :
589+ import tomli as tomllib # Python 3.10 backport
587590
588591 pyproject = Path (__file__ ).parent .parent / "pyproject.toml"
589592 with open (pyproject , "rb" ) as f :
@@ -600,7 +603,10 @@ def test_package_data_includes_py_typed(self):
600603 """pyproject.toml should have package-data config for py.typed."""
601604 from pathlib import Path
602605
603- import tomllib
606+ try :
607+ import tomllib # Python >=3.11
608+ except ModuleNotFoundError :
609+ import tomli as tomllib # Python 3.10 backport
604610
605611 pyproject = Path (__file__ ).parent .parent / "pyproject.toml"
606612 with open (pyproject , "rb" ) as f :
You can’t perform that action at this time.
0 commit comments