Skip to content

Commit

Permalink
Bump mypy to 1.12 and pyright to 1.1.385
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam committed Oct 17, 2024
1 parent 89b4401 commit b959d9f
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/pyright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ env:
# For help with static-typing issues, or pyright update, ping @Avasam
#
# An exact version from https://github.com/microsoft/pyright/releases or "latest"
PYRIGHT_VERSION: "1.1.377"
PYRIGHT_VERSION: "1.1.385"

# Environment variable to support color support (jaraco/skeleton#66)
FORCE_COLOR: 1
Expand Down Expand Up @@ -73,4 +73,5 @@ jobs:
uses: jakebailey/pyright-action@v2
with:
version: ${{ env.PYRIGHT_VERSION }}
python-version: ${{ matrix.python }}
extra-args: --threads
3 changes: 2 additions & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,15 @@ disable_error_code = import-not-found
# for setuptools to import `_distutils` directly
# - or non-stdlib distutils typings are exposed
# - The following are not marked as py.typed:
# - jaraco: Since mypy 1.12, the root name of the untyped namespace package gets called-out too
# - jaraco.develop: https://github.com/jaraco/jaraco.develop/issues/22
# - jaraco.envs: https://github.com/jaraco/jaraco.envs/issues/7
# - jaraco.packaging: https://github.com/jaraco/jaraco.packaging/issues/20
# - jaraco.path: https://github.com/jaraco/jaraco.path/issues/2
# - jaraco.test: https://github.com/jaraco/jaraco.test/issues/7
# - jaraco.text: https://github.com/jaraco/jaraco.text/issues/17
# - wheel: does not intend on exposing a programmatic API https://github.com/pypa/wheel/pull/610#issuecomment-2081687671
[mypy-distutils.*,jaraco.develop,jaraco.envs,jaraco.packaging.*,jaraco.path,jaraco.test.*,jaraco.text,wheel.*]
[mypy-distutils.*,jaraco,jaraco.develop,jaraco.envs,jaraco.packaging.*,jaraco.path,jaraco.test.*,jaraco.text,wheel.*]
ignore_missing_imports = True

# Even when excluding a module, import issues can show up due to following import
Expand Down
2 changes: 1 addition & 1 deletion pkg_resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2648,7 +2648,7 @@ def _cygwin_patch(filename: StrOrBytesPath): # pragma: nocover
would probably better, in Cygwin even more so, except
that this seems to be by design...
"""
return os.path.abspath(filename) if sys.platform == 'cygwin' else filename
return os.path.abspath(filename) if sys.platform == 'cygwin' else filename # type: ignore[type-var] # python/mypy#17952


if TYPE_CHECKING:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ type = [
# pin mypy version so a new version doesn't suddenly cause the CI to fail,
# until types-setuptools is removed from typeshed.
# For help with static-typing issues, or mypy update, ping @Avasam
"mypy==1.11.*",
"mypy==1.12.*",
# Typing fixes in version newer than we require at runtime
"importlib_metadata>=7.0.2; python_version < '3.10'",
# Imported unconditionally in tools/finalize.py
Expand Down
6 changes: 4 additions & 2 deletions setuptools/command/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@

if 'egg' not in bdist.format_commands:
try:
bdist.format_commands['egg'] = ('bdist_egg', "Python .egg file")
# format_commands is a dict in vendored distutils
# It used to be a list in older (stdlib) distutils
# We support both for backwards compatibility
bdist.format_commands['egg'] = ('bdist_egg', "Python .egg file") # type: ignore[call-overload]
except TypeError:
# For backward compatibility with older distutils (stdlib)
bdist.format_command['egg'] = ('bdist_egg', "Python .egg file")
bdist.format_commands.append('egg')

Expand Down
3 changes: 2 additions & 1 deletion setuptools/command/sdist.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import os
import re
from itertools import chain
from typing import ClassVar

from .._importlib import metadata
from ..dist import Distribution
Expand Down Expand Up @@ -49,7 +50,7 @@ class sdist(orig.sdist):
]

distribution: Distribution # override distutils.dist.Distribution with setuptools.dist.Distribution
negative_opt: dict[str, str] = {}
negative_opt: ClassVar[dict[str, str]] = {}

README_EXTENSIONS = ['', '.rst', '.txt', '.md']
READMES = tuple('README{0}'.format(ext) for ext in README_EXTENSIONS)
Expand Down

0 comments on commit b959d9f

Please sign in to comment.