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

Add python-gnupg stubs #13465

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Add python-gnupg stubs #13465

wants to merge 2 commits into from

Conversation

lovetox
Copy link
Contributor

@lovetox lovetox commented Feb 5, 2025

No description provided.

This comment has been minimized.

Copy link
Collaborator

@srittau srittau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, notes below. Also:

  • Please add a comment for each Any explaining the valid types.
  • Instance variables initialized in __init__ should be added to all classes.
  • Default values should be the actual default values, not ... (unless they are complex).

__author__: str = ...
__date__: str = ...

from typing import Protocol
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be combined with the imports above.

logger: logging.Logger = ...
fsencoding: str = ...

UNSAFE: re.Pattern[Any] = ...
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering this is only defined on some platforms, I would just add gnupg.UNSAFE to @tests/stubtest_allowlist.txt.

Comment on lines +84 to +85
UID_INDEX: int = ...
FIELDS: list[str] = ...
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above.

FIELDS: list[str] = ...
def __init__(self, gpg: GPG) -> None: ...
def key(self, args: Any) -> None: ...
sec: Any = ...
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
sec: Any = ...
pub = key
sec = key

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

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.

2 participants