Skip to content

policyrep.pyi: Update enum annotations.#146

Merged
pebenito merged 1 commit intoSELinuxProject:mainfrom
pebenito:mypy-fix-enum-members-policyrep
Jan 8, 2025
Merged

policyrep.pyi: Update enum annotations.#146
pebenito merged 1 commit intoSELinuxProject:mainfrom
pebenito:mypy-fix-enum-members-policyrep

Conversation

@pebenito
Copy link
Member

@pebenito pebenito commented Jan 8, 2025

Update Enum member annotation to address mypy issues like the following:

setools/policyrep.pyi:57: error: Detected enum "setools.policyrep.PolicyEnum" in a type stub with zero members. There is a chance this is due to a recent change in the semantics of enum membership. If so, use member = value to mark an enum member, instead of member: type [misc]
class PolicyEnum(enum.Enum):
^
setools/policyrep.pyi:57: note: See https://typing.readthedocs.io/en/latest/spec/enums.html#defining-members setools/policyrep.pyi:117: error: Enum members must be left unannotated [misc]
typebounds: int = ...
^

Update Enum member annotation to address mypy issues like the following:

setools/policyrep.pyi:57: error: Detected enum "setools.policyrep.PolicyEnum"
in a type stub with zero members. There is a chance this is due to a recent
change in the semantics of enum membership. If so, use `member = value` to mark
an enum member, instead of `member: type`  [misc]
    class PolicyEnum(enum.Enum):
    ^
setools/policyrep.pyi:57: note: See https://typing.readthedocs.io/en/latest/spec/enums.html#defining-members
setools/policyrep.pyi:117: error: Enum members must be left unannotated  [misc]
        typebounds: int = ...
        ^

Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
@pebenito pebenito merged commit 69a22ed into SELinuxProject:main Jan 8, 2025
9 checks passed
@pebenito pebenito deleted the mypy-fix-enum-members-policyrep branch January 8, 2025 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant