From 52829676980ba40878189ff456f1429d87938639 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2025 00:06:39 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.8.1 → v0.9.4](https://github.com/astral-sh/ruff-pre-commit/compare/v0.8.1...v0.9.4) - [github.com/pre-commit/mirrors-mypy: v1.13.0 → v1.14.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.13.0...v1.14.1) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index dc46606..2137b10 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,14 +4,14 @@ ci: exclude: ^src/pdm/backend/_vendor repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: 'v0.8.1' + rev: 'v0.9.4' hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix, --show-fixes] - id: ruff-format - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.13.0 + rev: v1.14.1 hooks: - id: mypy exclude: ^(src/pdm/backend/_vendor|tests|scripts) From 048ec29c63fcf18c703fdee596d2f15917ff9053 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2025 00:06:59 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/pdm/backend/utils.py | 2 +- tests/test_api.py | 42 ++++++++++++++++++++-------------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/pdm/backend/utils.py b/src/pdm/backend/utils.py index 3893011..9b4b54a 100644 --- a/src/pdm/backend/utils.py +++ b/src/pdm/backend/utils.py @@ -200,7 +200,7 @@ def evaluate_module_attribute( matched = _attr_regex.match(expression) if matched is None: raise ConfigError( - "Invalid expression, must be in the format of " "`module:attribute`." + "Invalid expression, must be in the format of `module:attribute`." ) with cm: module = importlib.import_module(matched.group(1)) diff --git a/tests/test_api.py b/tests/test_api.py index 3109c6b..91d5a90 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -254,20 +254,20 @@ def test_build_with_cextension(dist: Path) -> None: zip_names = get_wheel_names(dist / wheel_name) assert "my_package/__init__.py" in zip_names - assert ( - "my_package/hellomodule.c" not in zip_names - ), "Not collect c files while building wheel" + assert "my_package/hellomodule.c" not in zip_names, ( + "Not collect c files while building wheel" + ) extension_suffix = ".pyd" if sys.platform == "win32" else ".so" assert any(name.endswith(extension_suffix) for name in zip_names) tar_names = get_tarball_names(dist / sdist_name) assert "demo_package-0.1.0/my_package/__init__.py" in tar_names - assert ( - "demo_package-0.1.0/my_package/hellomodule.c" in tar_names - ), "Collect c files while building sdist" - assert not any( - path.startswith("build") for path in tar_names - ), 'Not collect c files in temporary directory "./build"' + assert "demo_package-0.1.0/my_package/hellomodule.c" in tar_names, ( + "Collect c files while building sdist" + ) + assert not any(path.startswith("build") for path in tar_names), ( + 'Not collect c files in temporary directory "./build"' + ) @pytest.mark.parametrize("name", ["demo-cextension-in-src"]) @@ -277,20 +277,20 @@ def test_build_with_cextension_in_src(dist: Path) -> None: zip_names = get_wheel_names(dist / wheel_name) assert "my_package/__init__.py" in zip_names - assert ( - "my_package/hellomodule.c" not in zip_names - ), "Not collect c files while building wheel" + assert "my_package/hellomodule.c" not in zip_names, ( + "Not collect c files while building wheel" + ) extension_suffix = ".pyd" if sys.platform == "win32" else ".so" assert any(name.endswith(extension_suffix) for name in zip_names) tar_names = get_tarball_names(dist / sdist_name) assert "demo_package-0.1.0/src/my_package/__init__.py" in tar_names - assert ( - "demo_package-0.1.0/src/my_package/hellomodule.c" in tar_names - ), "Collect c files while building sdist" - assert not any( - path.startswith("build") for path in tar_names - ), 'Not collect c files in temporary directory "./build"' + assert "demo_package-0.1.0/src/my_package/hellomodule.c" in tar_names, ( + "Collect c files while building sdist" + ) + assert not any(path.startswith("build") for path in tar_names), ( + 'Not collect c files in temporary directory "./build"' + ) @pytest.mark.parametrize("name", ["demo-package"]) @@ -329,9 +329,9 @@ def test_build_editable_src(dist: Path, fixture_project: Path) -> None: namelist = zf.namelist() assert "demo_package.pth" in namelist assert "_editable_impl_demo_package.py" in namelist - assert ( - "my_package/data.json" not in namelist - ), "data files in proxy modules are excluded" + assert "my_package/data.json" not in namelist, ( + "data files in proxy modules are excluded" + ) assert "data_out.json" in namelist pth_content = zf.read("demo_package.pth").decode("utf-8").strip()