Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#662)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Nov 14, 2023
1 parent fffc891 commit 4e360e8
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 51 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ repos:
- id: check-docstring-first

- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.10.1
rev: 23.11.0
hooks:
- id: black

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.4
rev: v0.1.5
hooks:
- id: ruff
34 changes: 15 additions & 19 deletions src/poetry/core/masonry/builders/wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,27 +239,23 @@ def _copy_file_scripts(self, wheel: zipfile.ZipFile) -> None:

def _run_build_command(self, setup: Path) -> None:
if self._editable:
subprocess.check_call(
[
self.executable.as_posix(),
str(setup),
"build_ext",
"--inplace",
]
)
subprocess.check_call(
[
subprocess.check_call([
self.executable.as_posix(),
str(setup),
"build",
"-b",
str(self._path / "build"),
"--build-purelib",
str(self._get_build_purelib_dir()),
"--build-platlib",
str(self._get_build_platlib_dir()),
]
)
"build_ext",
"--inplace",
])
subprocess.check_call([
self.executable.as_posix(),
str(setup),
"build",
"-b",
str(self._path / "build"),
"--build-purelib",
str(self._get_build_purelib_dir()),
"--build-platlib",
str(self._get_build_platlib_dir()),
])

def _run_build_script(self, build_script: str) -> None:
logger.debug(f"Executing build script: {build_script}")
Expand Down
12 changes: 6 additions & 6 deletions src/poetry/core/version/markers.py
Original file line number Diff line number Diff line change
Expand Up @@ -927,9 +927,9 @@ def cnf(marker: BaseMarker) -> BaseMarker:
sub_marker_lists = [
m.markers if isinstance(m, MultiMarker) else [m] for m in cnf_markers
]
return MultiMarker.of(
*[MarkerUnion.of(*c) for c in itertools.product(*sub_marker_lists)]
)
return MultiMarker.of(*[
MarkerUnion.of(*c) for c in itertools.product(*sub_marker_lists)
])

if isinstance(marker, MultiMarker):
return MultiMarker.of(*[cnf(m) for m in marker.markers])
Expand All @@ -945,9 +945,9 @@ def dnf(marker: BaseMarker) -> BaseMarker:
sub_marker_lists = [
m.markers if isinstance(m, MarkerUnion) else [m] for m in dnf_markers
]
return MarkerUnion.of(
*[MultiMarker.of(*c) for c in itertools.product(*sub_marker_lists)]
)
return MarkerUnion.of(*[
MultiMarker.of(*c) for c in itertools.product(*sub_marker_lists)
])

if isinstance(marker, MarkerUnion):
return MarkerUnion.of(*[dnf(m) for m in marker.markers])
Expand Down
16 changes: 7 additions & 9 deletions src/poetry/core/version/pep440/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,16 +307,14 @@ def first_devrelease(self: T) -> T:
)

def replace(self: T, **kwargs: Any) -> T:
return self.__class__(
return self.__class__(**{
**{
**{
k: getattr(self, k)
for k in self.__dataclass_fields__
if k not in ("_compare_key", "text")
}, # setup defaults with current values, excluding compare keys and text
**kwargs, # keys to replace
}
)
k: getattr(self, k)
for k in self.__dataclass_fields__
if k not in ("_compare_key", "text")
}, # setup defaults with current values, excluding compare keys and text
**kwargs, # keys to replace
})

def without_local(self: T) -> T:
return self.replace(local=None)
Expand Down
16 changes: 7 additions & 9 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,13 @@ def temporary_directory() -> Iterator[Path]:
@pytest.fixture
def venv(temporary_directory: Path) -> Path:
venv_dir = temporary_directory / ".venv"
virtualenv.cli_run(
[
"--no-download",
"--no-periodic-update",
"--python",
sys.executable,
venv_dir.as_posix(),
]
)
virtualenv.cli_run([
"--no-download",
"--no-periodic-update",
"--python",
sys.executable,
venv_dir.as_posix(),
])
return venv_dir


Expand Down
10 changes: 4 additions & 6 deletions tests/vcs/test_vcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,12 +441,10 @@ def test_ensure_absolute_path_to_git(mocker: MockerFixture) -> None:

def checkout_output(cmd: list[str], *args: Any, **kwargs: Any) -> str | bytes:
if Path(cmd[0]).name == "where.exe":
return "\n".join(
[
str(Path.cwd().joinpath("git.exe")),
"C:\\Git\\cmd\\git.exe",
]
)
return "\n".join([
str(Path.cwd().joinpath("git.exe")),
"C:\\Git\\cmd\\git.exe",
])

return b""

Expand Down

0 comments on commit 4e360e8

Please sign in to comment.