Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

policyrep.pyi: Update enum annotations. #146

Merged

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 <[email protected]>
@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