Skip to content

Commit

Permalink
A round of ruff format after ruff check --fix
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitriPapadopoulos committed Aug 3, 2024
1 parent ee4aa16 commit 548f6d0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 3 additions & 1 deletion pkg_resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,9 @@ class _ZipLoaderModule(Protocol):
__loader__: zipimport.zipimporter


_PEP440_FALLBACK = re.compile(r"^v?(?P<safe>(?:[0-9]+!)?[0-9]+(?:\.[0-9]+)*)", re.IGNORECASE)
_PEP440_FALLBACK = re.compile(
r"^v?(?P<safe>(?:[0-9]+!)?[0-9]+(?:\.[0-9]+)*)", re.IGNORECASE
)


class PEP440Warning(RuntimeWarning):
Expand Down
4 changes: 3 additions & 1 deletion setuptools/_normalization.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
_VALID_NAME = re.compile(r"^([A-Z0-9]|[A-Z0-9][A-Z0-9._-]*[A-Z0-9])$", re.IGNORECASE)
_UNSAFE_NAME_CHARS = re.compile(r"[^A-Z0-9._-]+", re.IGNORECASE)
_NON_ALPHANUMERIC = re.compile(r"[^A-Z0-9]+", re.IGNORECASE)
_PEP440_FALLBACK = re.compile(r"^v?(?P<safe>(?:[0-9]+!)?[0-9]+(?:\.[0-9]+)*)", re.IGNORECASE)
_PEP440_FALLBACK = re.compile(
r"^v?(?P<safe>(?:[0-9]+!)?[0-9]+(?:\.[0-9]+)*)", re.IGNORECASE
)


def safe_identifier(name: str) -> str:
Expand Down
4 changes: 3 additions & 1 deletion setuptools/package_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,9 @@ def wrapper(*args, **kwargs):
return wrapper


REL = re.compile(r"""<([^>]*\srel\s{0,10}=\s{0,10}['"]?([^'" >]+)[^>]*)>""", re.IGNORECASE)
REL = re.compile(
r"""<([^>]*\srel\s{0,10}=\s{0,10}['"]?([^'" >]+)[^>]*)>""", re.IGNORECASE
)
"""
Regex for an HTML tag with 'rel="val"' attributes.
"""
Expand Down
4 changes: 3 additions & 1 deletion setuptools/tests/config/test_pyprojecttoml.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,9 @@ def test_invalid_example(tmp_path, example, error_msg):
pyproject = tmp_path / "pyproject.toml"
pyproject.write_text(cleandoc(example), encoding="utf-8")

pattern = re.compile(f"invalid pyproject.toml.*{error_msg}.*", re.MULTILINE | re.DOTALL)
pattern = re.compile(
f"invalid pyproject.toml.*{error_msg}.*", re.MULTILINE | re.DOTALL
)
with pytest.raises(ValueError, match=pattern):
read_configuration(pyproject)

Expand Down

0 comments on commit 548f6d0

Please sign in to comment.