-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
C: configurationCLI and configurationCLI and configurationC: dependenciesC: packagingInstallation and packaging of BlackInstallation and packaging of Black
Description
Describe the bug
I have a pyproject.toml for configuring various other tools (not black), which includes a list with mixed type contents, as explicitly support by the v1.0.0 of the toml spec.
When I run black it crashes with a cryptic traceback from inside the toml library.
To Reproduce
mkdir new_project
cat <<EOT > ./new_project/pyproject.toml
# this example is from the toml spec
contributors = [
"Foo Bar <foo@example.com>",
{ name = "Baz Qux", email = "bazqux@example.com", url = "https://example.com/bazqux" }
]
EOT
cd new_project
black .Expected behavior
It shouldn't crash.
Environment (please complete the following information):
- Version: black, version 21.5b1
- OS and Python version: MacOs Python 3.8.8
Since the presently used "toml" library explicitly only supports up to version 0.5.0 of the spec (from about two years ago), I'd suggest switching to tomlkit, which supports the current toml spec (officially up to 1.0.0rc1 but nothing has materially changed since then).
I'd be happy to put together a PR if this approach is deemed acceptable in principle.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C: configurationCLI and configurationCLI and configurationC: dependenciesC: packagingInstallation and packaging of BlackInstallation and packaging of Black