From c9f31421af24a3e4033fc3c5cbc8f64882cfad47 Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Fri, 28 Jun 2024 19:07:13 +0200 Subject: [PATCH] A round of `ruff format` after `ruff check --fix` --- pkg_resources/__init__.py | 4 +++- setuptools/_normalization.py | 4 +++- setuptools/package_index.py | 4 +++- setuptools/tests/config/test_pyprojecttoml.py | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/pkg_resources/__init__.py b/pkg_resources/__init__.py index cf20aefccfd..88216e06315 100644 --- a/pkg_resources/__init__.py +++ b/pkg_resources/__init__.py @@ -141,7 +141,9 @@ class _ZipLoaderModule(Protocol): __loader__: zipimport.zipimporter -_PEP440_FALLBACK = re.compile(r"^v?(?P(?:[0-9]+!)?[0-9]+(?:\.[0-9]+)*)", re.IGNORECASE) +_PEP440_FALLBACK = re.compile( + r"^v?(?P(?:[0-9]+!)?[0-9]+(?:\.[0-9]+)*)", re.IGNORECASE +) class PEP440Warning(RuntimeWarning): diff --git a/setuptools/_normalization.py b/setuptools/_normalization.py index e2e75e6200f..3fb298c5436 100644 --- a/setuptools/_normalization.py +++ b/setuptools/_normalization.py @@ -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(?:[0-9]+!)?[0-9]+(?:\.[0-9]+)*)", re.IGNORECASE) +_PEP440_FALLBACK = re.compile( + r"^v?(?P(?:[0-9]+!)?[0-9]+(?:\.[0-9]+)*)", re.IGNORECASE +) def safe_identifier(name: str) -> str: diff --git a/setuptools/package_index.py b/setuptools/package_index.py index c26ff77ea81..902052b78ae 100644 --- a/setuptools/package_index.py +++ b/setuptools/package_index.py @@ -213,7 +213,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. """ diff --git a/setuptools/tests/config/test_pyprojecttoml.py b/setuptools/tests/config/test_pyprojecttoml.py index 0be018604bc..9833ae4dc5e 100644 --- a/setuptools/tests/config/test_pyprojecttoml.py +++ b/setuptools/tests/config/test_pyprojecttoml.py @@ -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)