Skip to content

Commit d149e5a

Browse files
committed
further update RUff and mypy
1 parent 2ec7d1d commit d149e5a

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

pkg_resources/tests/test_resources.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -861,9 +861,11 @@ def test_path_order(self, symlinked_tmpdir):
861861
(nspkg / '__init__.py').write_text(self.ns_str, encoding='utf-8')
862862
(subpkg / '__init__.py').write_text(vers_str % number, encoding='utf-8')
863863

864+
import nspkg # pyright: ignore[reportMissingImports] # Temporary package for test
865+
864866
with pytest.warns(DeprecationWarning, match="pkg_resources.declare_namespace"):
865-
import nspkg # pyright: ignore[reportMissingImports] # Temporary package for test
866867
import nspkg.subpkg # pyright: ignore[reportMissingImports] # Temporary package for test
868+
867869
expected = [str(site.realpath() / 'nspkg') for site in site_dirs]
868870
assert nspkg.__path__ == expected
869871
assert nspkg.subpkg.__version__ == 1

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ check = [
117117

118118
# local
119119

120-
# Get requires-python from pyproject.toml automatically astral-sh/ruff#16319
121-
"ruff >= 0.11.0; sys_platform != 'cygwin'",
120+
# Deprecated rules must now be selected by exact rule code
121+
"ruff >= 0.13.0; sys_platform != 'cygwin'",
122122
]
123123

124124
cover = [
@@ -138,7 +138,7 @@ type = [
138138
# pin mypy version so a new version doesn't suddenly cause the CI to fail,
139139
# until types-setuptools is removed from typeshed.
140140
# For help with static-typing issues, or mypy update, ping @Avasam
141-
"mypy==1.16.*",
141+
"mypy==1.18.*",
142142
# Typing fixes in version newer than we require at runtime
143143
"importlib_metadata>=7.0.2; python_version < '3.10'",
144144
# Imported unconditionally in tools/finalize.py

ruff.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ ignore = [
6363
"TRY003", # raise-vanilla-args, avoid multitude of exception classes
6464
"TRY301", # raise-within-try, it's handy
6565
"UP015", # redundant-open-modes, explicit is preferred
66-
"UP038", # Using `X | Y` in `isinstance` call is slower and more verbose https://github.com/astral-sh/ruff/issues/7871
6766
# Only enforcing return type annotations for public functions
6867
"ANN202", # missing-return-type-private-function
6968
"ANN204", # missing-return-type-special-method

setuptools/tests/config/test_pyprojecttoml_dynamic_deps.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ 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"]}})
106107
with pytest.warns(SetuptoolsWarning, match=".extras_require. overwritten"):
107-
dist = Distribution({"extras_require": {"hello": ["world"]}})
108108
dist = apply_configuration(dist, pyproject)
109-
assert dist.extras_require == {"docs": ["sphinx"]}
109+
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)