Skip to content

Commit a0099bb

Browse files
committed
Removed type annotations from enum members in accordance with a new mypy rule
1 parent 6783884 commit a0099bb

File tree

6 files changed

+17
-15
lines changed

6 files changed

+17
-15
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
99
### Added
1010
- A new method `shutdown` to gracefully quit internal tasks
1111

12+
### Changed
13+
- Removed type annotations from enum members in accordance with a new mypy rule
14+
1215
## [1.2.0] - 15th of October, 2024
1316

1417
### Changed

examples/btbv_session_manager.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ class BTBVTrustLevel(enum.Enum):
1919
Trust levels modeling Blind Trust Before Verification (BTBV).
2020
"""
2121

22-
TRUSTED: str = "TRUSTED"
23-
BLINDLY_TRUSTED: str = "BLINDLY_TRUSTED"
24-
UNDECIDED: str = "UNDECIDED"
25-
DISTRUSTED: str = "DISTRUSTED"
22+
TRUSTED = "TRUSTED"
23+
BLINDLY_TRUSTED = "BLINDLY_TRUSTED"
24+
UNDECIDED = "UNDECIDED"
25+
DISTRUSTED = "DISTRUSTED"
2626

2727

2828
# Note that while this is an "example", it is fully functional and can be used as-is.

omemo/session.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ class Initiation(enum.Enum):
1717
Enumeration identifying whether a session was built through active or passive session initiation.
1818
"""
1919

20-
ACTIVE: str = "ACTIVE"
21-
PASSIVE: str = "PASSIVE"
20+
ACTIVE = "ACTIVE"
21+
PASSIVE = "PASSIVE"
2222

2323

2424
class Session(ABC):

omemo/types.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ class AsyncFramework(enum.Enum):
2020
Frameworks for asynchronous code supported by python-omemo.
2121
"""
2222

23-
ASYNCIO: str = "ASYNCIO"
24-
TWISTED: str = "TWISTED"
23+
ASYNCIO = "ASYNCIO"
24+
TWISTED = "TWISTED"
2525

2626

2727
class OMEMOException(Exception):
@@ -51,9 +51,9 @@ class TrustLevel(enum.Enum):
5151
The three core trust levels.
5252
"""
5353

54-
TRUSTED: str = "TRUSTED"
55-
DISTRUSTED: str = "DISTRUSTED"
56-
UNDECIDED: str = "UNDECIDED"
54+
TRUSTED = "TRUSTED"
55+
DISTRUSTED = "DISTRUSTED"
56+
UNDECIDED = "UNDECIDED"
5757

5858

5959
# # Thanks @vanburgerberg - https://github.com/python/typing/issues/182

tests/session_manager_impl.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ class TrustLevel(enum.Enum):
2323
Trust levels modeling simple manual trust.
2424
"""
2525

26-
TRUSTED: str = "TRUSTED"
27-
UNDECIDED: str = "UNDECIDED"
28-
DISTRUSTED: str = "DISTRUSTED"
26+
TRUSTED = "TRUSTED"
27+
UNDECIDED = "UNDECIDED"
28+
DISTRUSTED = "DISTRUSTED"
2929

3030

3131
class BundleStorageKey(NamedTuple):

tests/test_session_manager.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ async def test_regression0() -> None:
168168
plaintext, _, _ = await alice_session_manager.decrypt(next(iter(messages.keys())))
169169
assert plaintext == b"Hello back, Alice!"
170170

171-
172171
await alice_session_manager.shutdown()
173172
await bob_session_manager.shutdown()
174173

0 commit comments

Comments
 (0)