Skip to content

Commit

Permalink
de-glob mypy whitelist (python-poetry#272)
Browse files Browse the repository at this point in the history
  • Loading branch information
danieleades authored Jan 28, 2022
1 parent c86c602 commit 3bdd0cf
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 15 deletions.
17 changes: 13 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,23 @@ ignore_missing_imports = true
[[tool.mypy.overrides]]
module = [
# src modules
'poetry.core.masonry.builders.*',
'poetry.core.masonry.builders.builder',
'poetry.core.masonry.builders.sdist',
'poetry.core.masonry.builders.wheel',
'poetry.core.packages.utils.utils',
'poetry.core.packages.dependency',
'poetry.core.packages.package',
'poetry.core.packages.project_package',
'poetry.core.semver.*',
'poetry.core.toml.*',
'poetry.core.version.*',
'poetry.core.semver.helpers',
'poetry.core.semver.version',
'poetry.core.semver.version_range',
'poetry.core.semver.version_union',
'poetry.core.toml.exceptions',
'poetry.core.toml.file',
'poetry.core.version.markers',
'poetry.core.version.pep440.parser',
'poetry.core.version.pep440.segments',
'poetry.core.version.pep440.version',
# test modules
'tests.conftest',
'tests.integration.test_pep517',
Expand Down
11 changes: 5 additions & 6 deletions src/poetry/core/semver/empty_constraint.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


if TYPE_CHECKING:
from poetry.core.semver import VersionTypes
from poetry.core.semver.version import Version


Expand All @@ -18,19 +17,19 @@ def is_any(self) -> bool:
def allows(self, version: "Version") -> bool:
return False

def allows_all(self, other: "VersionTypes") -> bool:
def allows_all(self, other: VersionConstraint) -> bool:
return other.is_empty()

def allows_any(self, other: "VersionTypes") -> bool:
def allows_any(self, other: VersionConstraint) -> bool:
return False

def intersect(self, other: "VersionTypes") -> "EmptyConstraint":
def intersect(self, other: VersionConstraint) -> "EmptyConstraint":
return self

def union(self, other: "VersionTypes") -> "VersionTypes":
def union(self, other: VersionConstraint) -> VersionConstraint:
return other

def difference(self, other: "VersionTypes") -> "EmptyConstraint":
def difference(self, other: VersionConstraint) -> "EmptyConstraint":
return self

def __str__(self) -> str:
Expand Down
10 changes: 5 additions & 5 deletions src/poetry/core/version/markers.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def __repr__(self) -> str:
def __hash__(self) -> int:
return hash(("<any>", "<any>"))

def __eq__(self, other: MarkerTypes) -> bool:
def __eq__(self, other: object) -> bool:
if not isinstance(other, BaseMarker):
return NotImplemented

Expand Down Expand Up @@ -167,7 +167,7 @@ def __repr__(self) -> str:
def __hash__(self) -> int:
return hash(("<empty>", "<empty>"))

def __eq__(self, other: MarkerTypes) -> bool:
def __eq__(self, other: object) -> bool:
if not isinstance(other, BaseMarker):
return NotImplemented

Expand Down Expand Up @@ -362,7 +362,7 @@ def invert(self) -> MarkerTypes:

return parse_marker(f"{self._name} {operator} '{self._value}'")

def __eq__(self, other: MarkerTypes) -> bool:
def __eq__(self, other: object) -> bool:
if not isinstance(other, SingleMarker):
return False

Expand Down Expand Up @@ -516,7 +516,7 @@ def invert(self) -> MarkerTypes:

return MarkerUnion.of(*markers)

def __eq__(self, other: MarkerTypes) -> bool:
def __eq__(self, other: object) -> bool:
if not isinstance(other, MultiMarker):
return False

Expand Down Expand Up @@ -674,7 +674,7 @@ def invert(self) -> MarkerTypes:

return MultiMarker.of(*markers)

def __eq__(self, other: MarkerTypes) -> bool:
def __eq__(self, other: object) -> bool:
if not isinstance(other, MarkerUnion):
return False

Expand Down

0 comments on commit 3bdd0cf

Please sign in to comment.