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

darkgraylib.config.ConfigurationError: Invalid [tool.darker] keys in pyproject.toml: flynt #745

Open
okuuva opened this issue Sep 18, 2024 · 0 comments · May be fixed by #746
Open

darkgraylib.config.ConfigurationError: Invalid [tool.darker] keys in pyproject.toml: flynt #745

okuuva opened this issue Sep 18, 2024 · 0 comments · May be fixed by #746

Comments

@okuuva
Copy link
Collaborator

okuuva commented Sep 18, 2024

Describe the bug
Like the title says, [tool.darker] configuration does not pass validation if it includes flynt = true. I verified this problem all the way to 1.7 which is odd since I've had that configuration option in my pyproject.toml for ages and I don't remember having problems with it until recently. Here's the whole stacktrace:

oula-custobar-mbp in ☸ production-fi in darker-bug-repros.git/main on  flynt-not-working-in-pyproject (871e84d) [!] is 📦 v0.1.0 via 🐍 v3.12.1 (main)
🐠 ❯ rye show
project: darker-bug-repro
path: /Users/oula/gits/darker-bug-repros.git/main
venv: /Users/oula/gits/darker-bug-repros.git/main/.venv
target python: 3.8
venv python: [email protected]
virtual: false
configured sources:
  default (index: https://pypi.org/simple/)
oula-custobar-mbp in ☸ production-fi in darker-bug-repros.git/main on  flynt-not-working-in-pyproject (871e84d) [!] is 📦 v0.1.0 via 🐍 v3.12.1 (main)
🐠 ❯ rye list
astor==0.8.1
black==24.8.0
click==8.1.7
darker==2.1.1
-e file:///Users/oula/gits/darker-bug-repros.git/main
darkgraylib==1.2.1
flynt==1.0.1
graylint==1.1.1
isort==5.13.2
mypy-extensions==1.0.0
packaging==24.1
pathspec==0.12.1
platformdirs==4.3.6
toml==0.10.2
oula-custobar-mbp in ☸ production-fi in darker-bug-repros.git/main on  flynt-not-working-in-pyproject (871e84d) [!] is 📦 v0.1.0 via 🐍 v3.12.1 (main)
🐠 ❯ rye run darker src/
Traceback (most recent call last):
  File "/Users/oula/gits/darker-bug-repros.git/main/.venv/bin/darker", line 8, in <module>
    sys.exit(main_with_error_handling())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/oula/gits/darker-bug-repros.git/main/.venv/lib/python3.12/site-packages/darker/__main__.py", line 633, in main_with_error_handling
    return main()
           ^^^^^^
  File "/Users/oula/gits/darker-bug-repros.git/main/.venv/lib/python3.12/site-packages/darker/__main__.py", line 482, in main
    args, config, config_nondefault = parse_command_line(argv)
                                      ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/oula/gits/darker-bug-repros.git/main/.venv/lib/python3.12/site-packages/darker/command_line.py", line 110, in parse_command_line
    args, effective_cfg, modified_cfg = darkgraylib.command_line.parse_command_line(
                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/oula/gits/darker-bug-repros.git/main/.venv/lib/python3.12/site-packages/darkgraylib/command_line.py", line 159, in parse_command_line
    pyproject_config = load_config(args.config, args.src, section_name, config_type)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/oula/gits/darker-bug-repros.git/main/.venv/lib/python3.12/site-packages/darkgraylib/config.py", line 178, in load_config
    validate_config_keys(pyproject_tool_config, section_name, config_type)
  File "/Users/oula/gits/darker-bug-repros.git/main/.venv/lib/python3.12/site-packages/darkgraylib/config.py", line 93, in validate_config_keys
    raise ConfigurationError(
darkgraylib.config.ConfigurationError: Invalid [tool.darker] keys in pyproject.toml: flynt

To Reproduce
Steps to reproduce the behavior:

  1. Clone this repository: https://github.com/okuuva/darker-bug-repros/tree/flynt-not-working-in-pyproject
  2. Follow instructions in repo README.md

Expected behavior
darker should use flynt when flynt = true is included under [tool.darker] in pyproject.toml.

Environment (please complete the following information):

  • OS: macOS
  • Python version 3.12.1
  • Git version 2.46.0
  • Darker version 2.1.1
  • Black version 24.8.0
  • rye list output:
astor==0.8.1
black==24.8.0
click==8.1.7
darker==2.1.1
-e file:///Users/oula/gits/darker-bug-repros.git/main
darkgraylib==1.2.1
flynt==1.0.1
graylint==1.1.1
isort==5.13.2
mypy-extensions==1.0.0
packaging==24.1
pathspec==0.12.1
platformdirs==4.3.6
toml==0.10.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant