Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use tomli in place of unmaintained toml package #629

Merged
merged 1 commit into from Oct 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions autopep8.py
Expand Up @@ -4040,22 +4040,22 @@ def read_config(args, parser):

def read_pyproject_toml(args, parser):
"""Read pyproject.toml and load configuration."""
import toml
import tomli

config = None

if os.path.exists(args.global_config):
with open(args.global_config) as fp:
config = toml.load(fp)
with open(args.global_config, "rb") as fp:
config = tomli.load(fp)

if not args.ignore_local_config:
parent = tail = args.files and os.path.abspath(
os.path.commonprefix(args.files))
while tail:
pyproject_toml = os.path.join(parent, "pyproject.toml")
if os.path.exists(pyproject_toml):
with open(pyproject_toml) as fp:
config = toml.load(fp)
with open(pyproject_toml, "rb") as fp:
config = tomli.load(fp)
break
(parent, tail) = os.path.split(parent)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -10,7 +10,7 @@


INSTALL_REQUIRES = (
['pycodestyle >= 2.9.1', 'toml']
['pycodestyle >= 2.9.1', 'tomli']
)


Expand Down