Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (scikit-build#1016)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.0.278 → v0.0.281](astral-sh/ruff-pre-commit@v0.0.278...v0.0.281)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Apply suggestions from code review

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
  • Loading branch information
pre-commit-ci[bot] and henryiii authored Aug 2, 2023
1 parent 08aa7ca commit c2025f2
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ repos:
- black==23.7.0 # keep in sync with black hook

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.278
rev: v0.0.281
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
Expand Down
4 changes: 2 additions & 2 deletions skbuild/cmaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -750,8 +750,8 @@ def install(self) -> list[str]:
def _parse_manifests(self) -> list[str]:
paths = glob.glob(os.path.join(CMAKE_BUILD_DIR(), "install_manifest*.txt"))
try:
return [self._parse_manifest(path) for path in paths][0]
except IndexError:
return next(self._parse_manifest(path) for path in paths)
except StopIteration:
return []

@staticmethod
Expand Down
4 changes: 2 additions & 2 deletions skbuild/command/egg_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ def finalize_options(self, *args: Any, **kwargs: Any) -> None:
# using `package_dir={'':<egg_base>}`
# This is required to successfully update the python path when
# running the test command.
package_name = list(self.distribution.package_dir.keys())[0]
egg_base = to_unix_path(list(self.distribution.package_dir.values())[0])
package_name = next(iter(self.distribution.package_dir.keys()))
egg_base = to_unix_path(next(iter(self.distribution.package_dir.values())))
cmake_install_dir = to_unix_path(CMAKE_INSTALL_DIR())
if egg_base.startswith(cmake_install_dir):
egg_base = egg_base[len(cmake_install_dir) + 1 :]
Expand Down
28 changes: 15 additions & 13 deletions tests/test_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -775,21 +775,23 @@ def test_setup_inputs(

# List path types: 'c', 'cm', 'h', 'p' or 'pm'
try:
path_types = list(
zip(
*filter(
lambda i: i[1],
[
("c", has_cmake_package),
("cm", has_cmake_module),
("h", has_hybrid_package),
("p", has_pure_package),
("pm", has_pure_module),
],
path_types = next(
iter(
zip(
*filter(
lambda i: i[1],
[
("c", has_cmake_package),
("cm", has_cmake_module),
("h", has_hybrid_package),
("p", has_pure_package),
("pm", has_pure_module),
],
)
)
)
)[0]
except IndexError:
)
except StopIteration:
path_types = []

def select_paths(annotated_paths):
Expand Down

0 comments on commit c2025f2

Please sign in to comment.