apply black v25.1.0 (#49076)
This commit is contained in:
parent
b11578ed7c
commit
754a64d1fe
@ -269,7 +269,7 @@ def __init__(
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _poll_interval_generator(
|
def _poll_interval_generator(
|
||||||
_wait_times: Optional[Tuple[float, float, float]] = None
|
_wait_times: Optional[Tuple[float, float, float]] = None,
|
||||||
) -> Generator[float, None, None]:
|
) -> Generator[float, None, None]:
|
||||||
"""This implements a backoff scheme for polling a contended resource
|
"""This implements a backoff scheme for polling a contended resource
|
||||||
by suggesting a succession of wait times between polls.
|
by suggesting a succession of wait times between polls.
|
||||||
|
@ -2,8 +2,7 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
"""Utility classes for logging the output of blocks of code.
|
"""Utility classes for logging the output of blocks of code."""
|
||||||
"""
|
|
||||||
import atexit
|
import atexit
|
||||||
import ctypes
|
import ctypes
|
||||||
import errno
|
import errno
|
||||||
|
@ -923,7 +923,7 @@ class FileTypes:
|
|||||||
UNKNOWN = 2
|
UNKNOWN = 2
|
||||||
|
|
||||||
|
|
||||||
NOT_ISO8859_1_TEXT = re.compile(b"[\x00\x7F-\x9F]")
|
NOT_ISO8859_1_TEXT = re.compile(b"[\x00\x7f-\x9f]")
|
||||||
|
|
||||||
|
|
||||||
def file_type(f: IO[bytes]) -> int:
|
def file_type(f: IO[bytes]) -> int:
|
||||||
|
@ -310,7 +310,7 @@ def find_windows_kit_roots() -> List[str]:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def find_windows_kit_bin_paths(
|
def find_windows_kit_bin_paths(
|
||||||
kit_base: Union[Optional[str], Optional[list]] = None
|
kit_base: Union[Optional[str], Optional[list]] = None,
|
||||||
) -> List[str]:
|
) -> List[str]:
|
||||||
"""Returns Windows kit bin directory per version"""
|
"""Returns Windows kit bin directory per version"""
|
||||||
kit_base = WindowsKitExternalPaths.find_windows_kit_roots() if not kit_base else kit_base
|
kit_base = WindowsKitExternalPaths.find_windows_kit_roots() if not kit_base else kit_base
|
||||||
@ -325,7 +325,7 @@ def find_windows_kit_bin_paths(
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def find_windows_kit_lib_paths(
|
def find_windows_kit_lib_paths(
|
||||||
kit_base: Union[Optional[str], Optional[list]] = None
|
kit_base: Union[Optional[str], Optional[list]] = None,
|
||||||
) -> List[str]:
|
) -> List[str]:
|
||||||
"""Returns Windows kit lib directory per version"""
|
"""Returns Windows kit lib directory per version"""
|
||||||
kit_base = WindowsKitExternalPaths.find_windows_kit_roots() if not kit_base else kit_base
|
kit_base = WindowsKitExternalPaths.find_windows_kit_roots() if not kit_base else kit_base
|
||||||
|
@ -568,7 +568,7 @@ def patch(
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
def _execute_patch(
|
def _execute_patch(
|
||||||
pkg_or_dep: Union[Type[spack.package_base.PackageBase], Dependency]
|
pkg_or_dep: Union[Type[spack.package_base.PackageBase], Dependency],
|
||||||
) -> None:
|
) -> None:
|
||||||
pkg = pkg_or_dep.pkg if isinstance(pkg_or_dep, Dependency) else pkg_or_dep
|
pkg = pkg_or_dep.pkg if isinstance(pkg_or_dep, Dependency) else pkg_or_dep
|
||||||
|
|
||||||
|
@ -283,21 +283,21 @@ def relocate_text_bin(binaries: Iterable[str], prefix_to_prefix: PrefixToPrefix)
|
|||||||
def is_macho_magic(magic: bytes) -> bool:
|
def is_macho_magic(magic: bytes) -> bool:
|
||||||
return (
|
return (
|
||||||
# In order of popularity: 64-bit mach-o le/be, 32-bit mach-o le/be.
|
# In order of popularity: 64-bit mach-o le/be, 32-bit mach-o le/be.
|
||||||
magic.startswith(b"\xCF\xFA\xED\xFE")
|
magic.startswith(b"\xcf\xfa\xed\xfe")
|
||||||
or magic.startswith(b"\xFE\xED\xFA\xCF")
|
or magic.startswith(b"\xfe\xed\xfa\xcf")
|
||||||
or magic.startswith(b"\xCE\xFA\xED\xFE")
|
or magic.startswith(b"\xce\xfa\xed\xfe")
|
||||||
or magic.startswith(b"\xFE\xED\xFA\xCE")
|
or magic.startswith(b"\xfe\xed\xfa\xce")
|
||||||
# universal binaries: 0xcafebabe be (most common?) or 0xbebafeca le (not sure if exists).
|
# universal binaries: 0xcafebabe be (most common?) or 0xbebafeca le (not sure if exists).
|
||||||
# Here we need to disambiguate mach-o and JVM class files. In mach-o the next 4 bytes are
|
# Here we need to disambiguate mach-o and JVM class files. In mach-o the next 4 bytes are
|
||||||
# the number of binaries; in JVM class files it's the java version number. We assume there
|
# the number of binaries; in JVM class files it's the java version number. We assume there
|
||||||
# are less than 10 binaries in a universal binary.
|
# are less than 10 binaries in a universal binary.
|
||||||
or (magic.startswith(b"\xCA\xFE\xBA\xBE") and int.from_bytes(magic[4:8], "big") < 10)
|
or (magic.startswith(b"\xca\xfe\xba\xbe") and int.from_bytes(magic[4:8], "big") < 10)
|
||||||
or (magic.startswith(b"\xBE\xBA\xFE\xCA") and int.from_bytes(magic[4:8], "little") < 10)
|
or (magic.startswith(b"\xbe\xba\xfe\xca") and int.from_bytes(magic[4:8], "little") < 10)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def is_elf_magic(magic: bytes) -> bool:
|
def is_elf_magic(magic: bytes) -> bool:
|
||||||
return magic.startswith(b"\x7FELF")
|
return magic.startswith(b"\x7fELF")
|
||||||
|
|
||||||
|
|
||||||
def is_binary(filename: str) -> bool:
|
def is_binary(filename: str) -> bool:
|
||||||
|
@ -3,12 +3,12 @@
|
|||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
"""Schema for Cray descriptive manifest: this describes a set of
|
"""Schema for Cray descriptive manifest: this describes a set of
|
||||||
installed packages on the system and also specifies dependency
|
installed packages on the system and also specifies dependency
|
||||||
relationships between them (so this provides more information than
|
relationships between them (so this provides more information than
|
||||||
external entries in packages configuration).
|
external entries in packages configuration).
|
||||||
|
|
||||||
This does not specify a configuration - it is an input format
|
This does not specify a configuration - it is an input format
|
||||||
that is consumed and transformed into Spack DB records.
|
that is consumed and transformed into Spack DB records.
|
||||||
"""
|
"""
|
||||||
from typing import Any, Dict
|
from typing import Any, Dict
|
||||||
|
|
||||||
|
@ -2706,7 +2706,7 @@ def name_and_dependency_types(s: str) -> Tuple[str, dt.DepFlag]:
|
|||||||
return name, depflag
|
return name, depflag
|
||||||
|
|
||||||
def spec_and_dependency_types(
|
def spec_and_dependency_types(
|
||||||
s: Union[Spec, Tuple[Spec, str]]
|
s: Union[Spec, Tuple[Spec, str]],
|
||||||
) -> Tuple[Spec, dt.DepFlag]:
|
) -> Tuple[Spec, dt.DepFlag]:
|
||||||
"""Given a non-string key in the literal, extracts the spec
|
"""Given a non-string key in the literal, extracts the spec
|
||||||
and its dependency types.
|
and its dependency types.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# Copyright Spack Project Developers. See COPYRIGHT file for details.
|
# Copyright Spack Project Developers. See COPYRIGHT file for details.
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
""" Test ABI-based splicing of dependencies """
|
"""Test ABI-based splicing of dependencies"""
|
||||||
|
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
|
@ -190,8 +190,7 @@ def test_environment_cant_modify_environments_root(tmpdir):
|
|||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
"original_content",
|
"original_content",
|
||||||
[
|
[
|
||||||
(
|
"""\
|
||||||
"""\
|
|
||||||
spack:
|
spack:
|
||||||
specs:
|
specs:
|
||||||
- matrix:
|
- matrix:
|
||||||
@ -199,7 +198,6 @@ def test_environment_cant_modify_environments_root(tmpdir):
|
|||||||
- - a
|
- - a
|
||||||
concretizer:
|
concretizer:
|
||||||
unify: false"""
|
unify: false"""
|
||||||
)
|
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
def test_roundtrip_spack_yaml_with_comments(original_content, mock_packages, config, tmp_path):
|
def test_roundtrip_spack_yaml_with_comments(original_content, mock_packages, config, tmp_path):
|
||||||
|
@ -557,7 +557,7 @@ def test_combine_phase_logs(tmpdir):
|
|||||||
|
|
||||||
def test_combine_phase_logs_does_not_care_about_encoding(tmpdir):
|
def test_combine_phase_logs_does_not_care_about_encoding(tmpdir):
|
||||||
# this is invalid utf-8 at a minimum
|
# this is invalid utf-8 at a minimum
|
||||||
data = b"\x00\xF4\xBF\x00\xBF\xBF"
|
data = b"\x00\xf4\xbf\x00\xbf\xbf"
|
||||||
input = [str(tmpdir.join("a")), str(tmpdir.join("b"))]
|
input = [str(tmpdir.join("a")), str(tmpdir.join("b"))]
|
||||||
output = str(tmpdir.join("c"))
|
output = str(tmpdir.join("c"))
|
||||||
|
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
import spack.concretize
|
import spack.concretize
|
||||||
import spack.directives
|
|
||||||
import spack.directives_meta
|
import spack.directives_meta
|
||||||
import spack.paths
|
import spack.paths
|
||||||
import spack.repo
|
import spack.repo
|
||||||
|
@ -2,8 +2,7 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
"""Non-fixture utilities for test code. Must be imported.
|
"""Non-fixture utilities for test code. Must be imported."""
|
||||||
"""
|
|
||||||
from spack.main import make_argument_parser
|
from spack.main import make_argument_parser
|
||||||
|
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
"""Simple wrapper around JSON to guarantee consistent use of load/dump. """
|
"""Simple wrapper around JSON to guarantee consistent use of load/dump."""
|
||||||
import json
|
import json
|
||||||
from typing import Any, Dict, Optional
|
from typing import Any, Dict, Optional
|
||||||
|
|
||||||
|
@ -33,5 +33,5 @@ class LibpressioNvcomp(CMakePackage, CudaPackage):
|
|||||||
|
|
||||||
def cmake_args(self):
|
def cmake_args(self):
|
||||||
cuda_arch = self.spec.variants["cuda_arch"].value
|
cuda_arch = self.spec.variants["cuda_arch"].value
|
||||||
args = [("-DCMAKE_CUDA_ARCHITECTURES=%s" % cuda_arch)]
|
args = ["-DCMAKE_CUDA_ARCHITECTURES=%s" % cuda_arch]
|
||||||
return args
|
return args
|
||||||
|
Loading…
Reference in New Issue
Block a user