Skip to content

Commit 78849a0

Browse files
committed
Adapt to new mypy version
A false positive was fixed. Properties setters are now properly consulted when setting a property.
1 parent 584058d commit 78849a0

2 files changed

Lines changed: 4 additions & 10 deletions

File tree

cookiecutter/ci/{{ cookiecutter.__project_name }}/lint_requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ black==25.1.0
33
flake8==7.2.0
44
flake8-pyproject==1.2.3
55
isort==6.0.1
6-
mypy==1.15.0
6+
mypy==1.16.0
77
shellcheck-py==0.10.0.1
88

99
# Type annotation stubs

pulp-glue/pulp_glue/common/context.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,9 +1023,7 @@ def create(
10231023
except (KeyError, StopIteration):
10241024
raise PulpException(_("No suitable resource got created."))
10251025
else:
1026-
# Properties with different types on setters and getters are not accepted by mypy.
1027-
# https://github.com/python/mypy/issues/3004
1028-
self.entity = None # type: ignore[assignment]
1026+
self.entity = None
10291027
else:
10301028
self._entity = result
10311029
self._entity_lookup = {}
@@ -1087,17 +1085,13 @@ def delete(self, non_blocking: bool = False) -> t.Any:
10871085
The record of the delete task.
10881086
"""
10891087
if self.pulp_ctx.fake_mode:
1090-
# Properties with different types on setters and getters are not accepted by mypy.
1091-
# https://github.com/python/mypy/issues/3004
1092-
self.entity = None # type: ignore[assignment]
1088+
self.entity = None
10931089
return None
10941090

10951091
result = self.call(
10961092
"delete", parameters={self.HREF: self.pulp_href}, non_blocking=non_blocking
10971093
)
1098-
# Properties with different types on setters and getters are not accepted by mypy.
1099-
# https://github.com/python/mypy/issues/3004
1100-
self.entity = None # type: ignore[assignment]
1094+
self.entity = None
11011095
return result
11021096

11031097
def set_label(self, key: str, value: str, non_blocking: bool = False) -> t.Any:

0 commit comments

Comments
 (0)