Skip to content

Commit d8181d3

Browse files
authored
lint: enable unreachable code detection (#18486)
1 parent b575e09 commit d8181d3

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ known_first_party = ['warehouse', 'tests']
5454

5555
[tool.mypy]
5656
python_version = "3.12"
57+
warn_unreachable = true
5758
warn_unused_configs = true
5859
warn_unused_ignores = true
5960
plugins = ["mypy_zope:plugin"]

warehouse/macaroons/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def caveats(self, caveats: list[Caveat]):
106106

107107
# Intentionally not using a back references here, since we express
108108
# relationships in terms of the "other" side of the relationship.
109-
user: Mapped["User"] = orm.relationship(lazy=True, viewonly=True)
109+
user: Mapped[User | None] = orm.relationship(lazy=True, viewonly=True)
110110
# TODO: Can't annotate this as "OIDCPublisher" because that would create a
111111
# circular import.
112112
oidc_publisher = orm.relationship("OIDCPublisher", lazy=True, viewonly=True)

0 commit comments

Comments
 (0)