Skip to content

Commit e704a1f

Browse files
authored
Adequate to newly introduced Ruff checks (#5042)
2 parents 8923875 + b28b106 commit e704a1f

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.9.9
3+
rev: v0.12.0
44
hooks:
55
- id: ruff
66
args: [--fix, --unsafe-fixes]

ruff.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ ignore = [
7373
# Suppress nuisance warnings about module-import-not-at-top-of-file (E402) due to workaround for #4476
7474
"setuptools/__init__.py" = ["E402"]
7575
"pkg_resources/__init__.py" = ["E402", "ANN204"]
76+
"pkg_resources/tests/test_resources.py" = ["PT031"]
7677

7778
[lint.isort]
7879
combine-as-imports = true

setuptools/tests/config/test_pyprojecttoml_dynamic_deps.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ def test_mixed_extras_require_optional_dependencies(tmp_path):
103103
path.build(files, prefix=tmp_path)
104104
pyproject = tmp_path / "pyproject.toml"
105105

106+
dist = Distribution({"extras_require": {"hello": ["world"]}})
107+
106108
with pytest.warns(SetuptoolsWarning, match=".extras_require. overwritten"):
107-
dist = Distribution({"extras_require": {"hello": ["world"]}})
108109
dist = apply_configuration(dist, pyproject)
109-
assert dist.extras_require == {"docs": ["sphinx"]}
110+
111+
assert dist.extras_require == {"docs": ["sphinx"]}

setuptools/tests/test_build_py.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def test_excluded_subpackages(tmpdir_cwd):
165165
build_py = dist.get_command_obj("build_py")
166166

167167
msg = r"Python recognizes 'mypkg\.tests' as an importable package"
168-
with pytest.warns(SetuptoolsDeprecationWarning, match=msg):
168+
with pytest.warns(SetuptoolsDeprecationWarning, match=msg): # noqa: PT031
169169
# TODO: To fix #3260 we need some transition period to deprecate the
170170
# existing behavior of `include_package_data`. After the transition, we
171171
# should remove the warning and fix the behavior.

0 commit comments

Comments
 (0)