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

Add support for black >= 22.1.0 #269

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ package_dir =
=src
packages = find:
install_requires =
black>=21.5b1
black>=22.1.0
toml
typing-extensions ; python_version < "3.8"
dataclasses ; python_version < "3.7"
Expand Down
6 changes: 3 additions & 3 deletions src/darker/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from typing import Iterable, List, cast

import toml
from black import find_project_root
from black import find_pyproject_toml

if sys.version_info >= (3, 8):
from typing import TypedDict
Expand Down Expand Up @@ -104,8 +104,8 @@ def load_config(srcs: Iterable[str]) -> DarkerConfig:
are used to look for the ``pyproject.toml`` configuration file.

"""
path = find_project_root(tuple(srcs or ["."])) / "pyproject.toml"
if path.is_file():
path = find_pyproject_toml(tuple(srcs or ["."]))
if path is not None:
pyproject_toml = toml.load(path)
config = cast(
DarkerConfig, pyproject_toml.get("tool", {}).get("darker", {}) or {}
Expand Down
2 changes: 1 addition & 1 deletion src/darker/import_sorting.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def apply_isort(
if config:
isort_args["settings_file"] = config
else:
isort_args["settings_path"] = str(find_project_root((str(src),)))
isort_args["settings_path"] = str(find_project_root((str(src),))[0])
if line_length:
isort_args["line_length"] = line_length

Expand Down