Skip to content

Commit

Permalink
Add support for black >= 22.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Mystic-Mirage committed Feb 1, 2022
1 parent cc9453a commit 278810f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
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

0 comments on commit 278810f

Please sign in to comment.