Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Darker fails with Type Error, exit code 1 after MacOS update #394

Closed
zachnorton4C opened this issue Sep 15, 2022 · 2 comments
Closed

Darker fails with Type Error, exit code 1 after MacOS update #394

zachnorton4C opened this issue Sep 15, 2022 · 2 comments
Assignees
Labels
maybe invalid? Can't reproduce, or seems already fixed, or need more information question Further information is requested

Comments

@zachnorton4C
Copy link

zachnorton4C commented Sep 15, 2022

Describe the bug
After upgrading to MacOS Monterey 12.5.1, I am unable to get darker to run on pre-commit -- it fails with a TypeError.

To Reproduce
Steps to reproduce the behavior:

  1. Attempt to create a new commit
  2. Darker exits with code: 1
  3. See traceback error:
Traceback (most recent call last):
  File "bin/darker", line 8, in <module>
    sys.exit(main())
  File "darker/__main__.py", line 196, in main
    args, config, config_nondefault = parse_command_line(argv)
  File "darker/command_line.py", line 163, in parse_command_line
    config = load_config(args.src)
  File "darker/config.py", line 37, in load_config
    path = find_project_root(tuple(srcs or ["."])) / "pyproject.toml"
TypeError: unsupported operand type(s) for /: 'tuple' and 'str'

Expected behavior
Until recent MasOS update, darker was running without issue.

Environment:

  • OS: MacOS Monterey 12.5.1
  • Python version 3.8.9
  • Git version 2.37.3
  • Darker version 1.5.0
  • Black version 22.8.0
  • other reformatter and linter versions isort==5.10.1

Additional context
I attempted with several earlier versions of black and darker and saw the same result.

@akaihola
Copy link
Owner

akaihola commented Sep 17, 2022

 File "darker/config.py", line 37, in load_config
   path = find_project_root(tuple(srcs or ["."])) / "pyproject.toml"
  • Darker version 1.5.0

Hi @zachnorton4C, thanks for the issue report!

You don't seem to be running Darker 1.5.0 in the pre-commit environment, but version 1.2.x instead, since versions 1.2.0–1.2.4 are the only ones which had the find_project_root() call on line darker/config.py:37.

How did you initialize pre-commit? What does your .pre-commit-config.yaml look like?

@akaihola akaihola added question Further information is requested maybe invalid? Can't reproduce, or seems already fixed, or need more information labels Sep 17, 2022
@akaihola akaihola self-assigned this Sep 17, 2022
@zachnorton4C
Copy link
Author

Hi @akaihola Thank you for the follow up! Your question enlightened another path for me and my team and I were able to resolve this. Thanks!

Repository owner locked and limited conversation to collaborators Sep 20, 2022
@akaihola akaihola converted this issue into discussion #396 Sep 20, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
maybe invalid? Can't reproduce, or seems already fixed, or need more information question Further information is requested
Projects
Development

No branches or pull requests

2 participants