Skip to content

Commit

Permalink
Silence new MyPy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitriPapadopoulos authored and abravalheri committed Aug 8, 2024
1 parent 143df76 commit e9f45f8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/validate_pyproject/_tomllib.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
from tomli import TOMLDecodeError, loads
except ImportError: # pragma: no cover
try:
from toml import TomlDecodeError as TOMLDecodeError # type: ignore
from toml import loads # type: ignore
from toml import ( # type: ignore[no-redef,import-untyped]
TomlDecodeError as TOMLDecodeError,
)
from toml import loads # type: ignore[no-redef]
except ImportError as ex:
raise ImportError("Please install `tomli` (TOML parser)") from ex

Expand Down
4 changes: 3 additions & 1 deletion src/validate_pyproject/formats.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ def pep508_identifier(name: str) -> bool:
from packaging import requirements as _req
except ImportError: # pragma: no cover
# let's try setuptools vendored version
from setuptools._vendor.packaging import requirements as _req # type: ignore
from setuptools._vendor.packaging import ( # type: ignore[no-redef]
requirements as _req,
)

def pep508(value: str) -> bool:
"""See :ref:`PyPA's dependency specifiers <pypa:dependency-specifiers>`
Expand Down

0 comments on commit e9f45f8

Please sign in to comment.