Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Aug 17, 2024
1 parent 0f05054 commit 04c6f79
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/installer/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
__all__ = ["install"]


def _process_WHEEL_file(source: WheelSource) -> Scheme: # noqa: N802
def _process_WHEEL_file(source: WheelSource) -> Scheme: # noqa: N802
"""Process the WHEEL file, from ``source``.
Returns the scheme that the archive root should go in.
Expand Down
2 changes: 1 addition & 1 deletion src/installer/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ class InstallerError(Exception):
"""All exceptions raised from this package's code."""


class InvalidWheelSource(InstallerError): # noqa: N818
class InvalidWheelSource(InstallerError): # noqa: N818
"""When a wheel source violates a contract, or is not supported."""
2 changes: 1 addition & 1 deletion src/installer/records.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
]


class InvalidRecordEntry(Exception): # noqa: N818
class InvalidRecordEntry(Exception): # noqa: N818
"""Raised when a RecordEntry is not valid, due to improper element values or count."""

def __init__( # noqa: D107
Expand Down
2 changes: 1 addition & 1 deletion src/installer/scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def _build_shebang(executable: str, forlauncher: bool) -> bytes:
return b"#!/bin/sh\n'''exec' " + quoted + b' "$0" "$@"\n' + b"' '''"


class InvalidScript(ValueError): # noqa: N818
class InvalidScript(ValueError): # noqa: N818
"""Raised if the user provides incorrect script section or kind."""


Expand Down
2 changes: 1 addition & 1 deletion src/installer/sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def __repr__(self) -> str:
return f"WheelFileValidationError(issues={self.issues!r})"


class _WheelFileBadDistInfo(ValueError, InstallerError): # noqa: N818
class _WheelFileBadDistInfo(ValueError, InstallerError): # noqa: N818
"""Raised when a wheel file has issues around `.dist-info`."""

def __init__(self, *, reason: str, filename: Optional[str], dist_info: str) -> None:
Expand Down
8 changes: 6 additions & 2 deletions tests/test_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ def test_rejects_not_okay_name(self, tmp_path):
with zipfile.ZipFile(str(path), "w"):
pass

with pytest.raises(ValueError, match="Not a valid wheel filename: .+"), WheelFile.open(str(path)):
with pytest.raises(
ValueError, match="Not a valid wheel filename: .+"
), WheelFile.open(str(path)):
pass

def test_provides_correct_dist_info_filenames(self, fancy_wheel):
Expand Down Expand Up @@ -149,7 +151,9 @@ def test_enforces_single_dist_info(self, fancy_wheel):
b"This is a random file.",
)

with pytest.raises(InstallerError) as ctx, WheelFile.open(fancy_wheel) as source:
with pytest.raises(InstallerError) as ctx, WheelFile.open(
fancy_wheel
) as source:
_ = source.dist_info_filenames

error = ctx.value
Expand Down

0 comments on commit 04c6f79

Please sign in to comment.