Skip to content

Commit aa0fd77

Browse files
committed
ruff format
1 parent d320e6c commit aa0fd77

2 files changed

Lines changed: 16 additions & 5 deletions

File tree

.control/hooks/cca_inline.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ def binder_config_file(self, source: Literal["conda", "apt", "bash"]) -> str:
108108
dir_depth = len(env_path.removesuffix("/").split("/")) - 1
109109
path_to_root = f"{'../' * dir_depth}" if dir_depth else "./"
110110
pip_specs = [
111-
f"-e {path_to_root}{package_data[package_key]["path"]["root"]}" for package_key in package_keys
111+
f"-e {path_to_root}{package_data[package_key]['path']['root']}"
112+
for package_key in package_keys
112113
]
113114
install = _import_module_from_path(self.repo_path / ".dev/install.py")
114115
_, self._binder_files = install.DependencyInstaller(package_data).run(

.dev/install.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,9 @@ def run(
292292
) -> tuple[dict[SourceName, list[dict]], dict[SourceName, str]]:
293293
"""Install dependencies for the given configuration."""
294294
resolved_packages = self._resolve_packages(packages)
295-
resolved_python_version = _resolve_python_version([pkg["pkg"] for pkg in resolved_packages], python_version)
295+
resolved_python_version = _resolve_python_version(
296+
[pkg["pkg"] for pkg in resolved_packages], python_version
297+
)
296298
dependencies = {}
297299
for pkg in resolved_packages:
298300
deps = _resolve_dependencies(
@@ -433,7 +435,13 @@ def _resolve_dependencies(
433435
if not target_platform:
434436
target_platform = build_platform
435437
selector_vars = (
436-
{"build_platform": build_platform, "target_platform": target_platform, "py": python_version, "py3k": python_version[0] == "3", "py2k": python_version[0] == "2"}
438+
{
439+
"build_platform": build_platform,
440+
"target_platform": target_platform,
441+
"py": python_version,
442+
"py3k": python_version[0] == "3",
443+
"py2k": python_version[0] == "2",
444+
}
437445
| {key: key in _CONDA_SUBDIR_TO_OS_ARCH[target_platform] for key in _CONDA_SELECTOR_VARS}
438446
| _resolve_variants(pkg=pkg, pyver=python_version, input_variants=variants)
439447
)
@@ -500,7 +508,6 @@ def _collect_dependencies(
500508
return _copy.deepcopy(deps)
501509

502510

503-
504511
def _resolve_variants(
505512
pkg: dict, pyver: str, input_variants: dict[str, str | int | bool] | None = None
506513
) -> dict:
@@ -793,7 +800,10 @@ def parse_extras(value):
793800
parser = _argparse.ArgumentParser(description="Install package and/or test-suite dependencies.")
794801
parser.add_argument("--filepath", type=str, default=".github/.repodynamics/metadata.json")
795802
parser.add_argument(
796-
"--packages", type=_json.loads, default='["main", "test"]', help="JSON string of package specifications."
803+
"--packages",
804+
type=_json.loads,
805+
default='["main", "test"]',
806+
help="JSON string of package specifications.",
797807
)
798808
parser.add_argument("--python-version", type=str, default=None)
799809
parser.add_argument(

0 commit comments

Comments
 (0)