Skip to content

Commit

Permalink
Enforce ruff/pyupgrade rule UP036
Browse files Browse the repository at this point in the history
UP036 Version block is outdated for minimum Python version
  • Loading branch information
DimitriPapadopoulos committed May 22, 2024
1 parent b10ba38 commit 8201266
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 5 additions & 3 deletions pkg_resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

import sys

if sys.version_info < (3, 8):
if sys.version_info < (3, 8): # noqa: UP036
raise RuntimeError("Python 3.8 or later is required")

import os
Expand Down Expand Up @@ -2858,7 +2858,7 @@ def version(self):
version = self._get_version()
if version is None:
path = self._get_metadata_path_for_display(self.PKG_INFO)
msg = f"Missing 'Version:' header and/or {self.PKG_INFO} file at path: {path}"
msg = (f"Missing 'Version:' header and/or {self.PKG_INFO} file at path: {path}")
raise ValueError(msg, self) from e

return version
Expand Down Expand Up @@ -2912,7 +2912,9 @@ def requires(self, extras: Iterable[str] = ()):
try:
deps.extend(dm[safe_extra(ext)])
except KeyError as e:
raise UnknownExtra(f"{self} has no such extra feature {ext!r}") from e
raise UnknownExtra(
f"{self} has no such extra feature {ext!r}"
) from e
return deps

def _get_metadata_path_for_display(self, name):
Expand Down
1 change: 0 additions & 1 deletion ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ ignore = [
]
extend-ignore = [
"UP015", # redundant-open-modes, explicit is preferred
"UP036", # temporarily disabled
]
exclude = [
"**/_vendor",
Expand Down

0 comments on commit 8201266

Please sign in to comment.