Skip to content

Commit

Permalink
Merge pull request #573 from nanonyme/nanonyme/tomllib
Browse files Browse the repository at this point in the history
Use tomllib instead of vendored tomli when available
  • Loading branch information
takluyver committed Aug 2, 2022
2 parents 5270ab2 + dba0f31 commit 0850387
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions flit_core/flit_core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
from pathlib import Path
import re

from .vendor import tomli
try:
import tomllib
except ImportError:
from .vendor import tomli as tomllib

from .versionno import normalise_version

log = logging.getLogger(__name__)
Expand Down Expand Up @@ -66,7 +70,7 @@ class ConfigError(ValueError):
def read_flit_config(path):
"""Read and check the `pyproject.toml` file with data about the package.
"""
d = tomli.loads(path.read_text('utf-8'))
d = tomllib.loads(path.read_text('utf-8'))
return prep_toml_config(d, path)


Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ dependencies = [
"flit_core >=3.7.1",
"requests",
"docutils",
"tomli",
"tomli-w",
]
requires-python = ">=3.6"
Expand All @@ -29,6 +28,7 @@ test = [
"responses",
"pytest>=2.7.3",
"pytest-cov",
"tomli",
]
doc = [
"sphinx",
Expand Down

0 comments on commit 0850387

Please sign in to comment.