Remove type annotations from enum value definitions
Marco Ricci

Marco Ricci commited on 2025-01-31 15:18:20
Zeige 3 geänderte Dateien mit 32 Einfügungen und 32 Löschungen.


Apparently type checkers have always internally assigned new Literal
types to those enum names, and are now also instructed to flag explicit
type annotations as errors.

For Griffe/mkdocstrings-python, this means we'll need to fill the
attribute table manually.  *sigh*
... ...
@@ -571,11 +571,11 @@ class ORIGIN(enum.Enum):
571 571
     """The origin of a setting, if not from the user configuration file.
572 572
 
573 573
     Attributes:
574
-        INTERACTIVE: interactive input
574
+        INTERACTIVE (str): interactive input
575 575
 
576 576
     """
577 577
 
578
-    INTERACTIVE: str = 'interactive input'
578
+    INTERACTIVE = 'interactive input'
579 579
     """"""
580 580
 
581 581
 
... ...
@@ -635,18 +635,18 @@ class SSH_AGENTC(enum.Enum):  # noqa: N801
635 635
     """SSH agent protocol numbers: client requests.
636 636
 
637 637
     Attributes:
638
-        REQUEST_IDENTITIES:
638
+        REQUEST_IDENTITIES (int):
639 639
             List identities.  Expecting
640 640
             [`SSH_AGENT.IDENTITIES_ANSWER`][].
641
-        SIGN_REQUEST:
641
+        SIGN_REQUEST (int):
642 642
             Sign data.  Expecting [`SSH_AGENT.SIGN_RESPONSE`][].
643
-        ADD_IDENTITY:
643
+        ADD_IDENTITY (int):
644 644
             Add an (SSH2) identity.
645
-        REMOVE_IDENTITY:
645
+        REMOVE_IDENTITY (int):
646 646
             Remove an (SSH2) identity.
647
-        ADD_ID_CONSTRAINED:
647
+        ADD_ID_CONSTRAINED (int):
648 648
             Add an (SSH2) identity, including key constraints.
649
-        EXTENSION:
649
+        EXTENSION (int):
650 650
             Issue a named request that isn't part of the core agent
651 651
             protocol.  Expecting [`SSH_AGENT.EXTENSION_RESPONSE`][] or
652 652
             [`SSH_AGENT.EXTENSION_FAILURE`][] if the named request is
... ...
@@ -654,17 +654,17 @@ class SSH_AGENTC(enum.Enum):  # noqa: N801
654 654
 
655 655
     """
656 656
 
657
-    REQUEST_IDENTITIES: int = 11
657
+    REQUEST_IDENTITIES = 11
658 658
     """"""
659
-    SIGN_REQUEST: int = 13
659
+    SIGN_REQUEST = 13
660 660
     """"""
661
-    ADD_IDENTITY: int = 17
661
+    ADD_IDENTITY = 17
662 662
     """"""
663
-    REMOVE_IDENTITY: int = 18
663
+    REMOVE_IDENTITY = 18
664 664
     """"""
665
-    ADD_ID_CONSTRAINED: int = 25
665
+    ADD_ID_CONSTRAINED = 25
666 666
     """"""
667
-    EXTENSION: int = 27
667
+    EXTENSION = 27
668 668
     """"""
669 669
 
670 670
 
... ...
@@ -672,32 +672,32 @@ class SSH_AGENT(enum.Enum):  # noqa: N801
672 672
     """SSH agent protocol numbers: server replies.
673 673
 
674 674
     Attributes:
675
-        FAILURE:
675
+        FAILURE (int):
676 676
             Generic failure code.
677
-        SUCCESS:
677
+        SUCCESS (int):
678 678
             Generic success code.
679
-        IDENTITIES_ANSWER:
679
+        IDENTITIES_ANSWER (int):
680 680
             Successful answer to [`SSH_AGENTC.REQUEST_IDENTITIES`][].
681
-        SIGN_RESPONSE:
681
+        SIGN_RESPONSE (int):
682 682
             Successful answer to [`SSH_AGENTC.SIGN_REQUEST`][].
683
-        EXTENSION_FAILURE:
683
+        EXTENSION_FAILURE (int):
684 684
             Unsuccessful answer to [`SSH_AGENTC.EXTENSION`][].
685
-        EXTENSION_RESPONSE:
685
+        EXTENSION_RESPONSE (int):
686 686
             Successful answer to [`SSH_AGENTC.EXTENSION`][].
687 687
 
688 688
     """
689 689
 
690
-    FAILURE: int = 5
690
+    FAILURE = 5
691 691
     """"""
692
-    SUCCESS: int = 6
692
+    SUCCESS = 6
693 693
     """"""
694
-    IDENTITIES_ANSWER: int = 12
694
+    IDENTITIES_ANSWER = 12
695 695
     """"""
696
-    SIGN_RESPONSE: int = 14
696
+    SIGN_RESPONSE = 14
697 697
     """"""
698
-    EXTENSION_FAILURE: int = 28
698
+    EXTENSION_FAILURE = 28
699 699
     """"""
700
-    EXTENSION_RESPONSE: int = 29
700
+    EXTENSION_RESPONSE = 29
701 701
     """"""
702 702
 
703 703
 
... ...
@@ -542,20 +542,20 @@ class KnownSSHAgent(str, enum.Enum):
542 542
     """Known SSH agents.
543 543
 
544 544
     Attributes:
545
-        UNKNOWN:
545
+        UNKNOWN (str):
546 546
             Not a known agent, or not known statically.
547
-        Pageant:
547
+        Pageant (str):
548 548
             The agent from Simon Tatham's PuTTY suite.
549
-        OpenSSHAgent:
549
+        OpenSSHAgent (str):
550 550
             The agent from OpenBSD's OpenSSH suite.
551 551
 
552 552
     """
553 553
 
554
-    UNKNOWN: str = '(unknown)'
554
+    UNKNOWN = '(unknown)'
555 555
     """"""
556
-    Pageant: str = 'Pageant'
556
+    Pageant = 'Pageant'
557 557
     """"""
558
-    OpenSSHAgent: str = 'OpenSSHAgent'
558
+    OpenSSHAgent = 'OpenSSHAgent'
559 559
     """"""
560 560
 
561 561
 
562 562