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

Fix stubs #11

Merged
merged 3 commits into from
Dec 5, 2024
Merged

Fix stubs #11

merged 3 commits into from
Dec 5, 2024

Conversation

kmurphy4
Copy link
Collaborator

I noticed some incorrect annotations while working on https://github.com/Everlaw/servers/pull/37520.

@kmurphy4 kmurphy4 marked this pull request as ready for review November 27, 2024 07:29
@@ -66,7 +66,7 @@ class item:
Retrieves the number of sub items.
"""

def get_receipients(self) -> item:
def get_recipients(self) -> item:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Comment on lines +94 to +95
def get_size(self) -> int: ...
def read_buffer(self, n: int) -> bytes: ...
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@@ -89,3 +89,7 @@ class item:
"""
Retrieves a specific attachment
"""

def get_embedded_attachment(self, attachment_index: int) -> attachment: ...
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@@ -6,5 +6,5 @@ build-backend = "setuptools.build_meta"
name = "pypff-stubs"
# The major version should match the version in `configure.ac`'s `AC_INIT`
# with the minor version incremented as needed for new changes.
version = "20240608.0"
version = "20240608.1rc1"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Once this is reviewed, I can change this to

Suggested change
version = "20240608.1rc1"
version = "20240608.1"

and bump the version in https://github.com/Everlaw/servers/pull/37520.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I checked that using these new stubs produces what I'd expect:

$ mypy src/tools/pst/
src/tools/pst/handler/impls/attachment.py:158: error: Unused "type: ignore" comment  [unused-ignore]
                get_size = ty.cast(ty.Callable[[], int], attach.get_size)  # type: ignore[attr-defined]
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/tools/pst/handler/impls/attachment.py:159: error: Unused "type: ignore" comment  [unused-ignore]
                read_buffer = ty.cast(ty.Callable[[int], bytes], attach.read_buffer)  # type: ignore[attr-defined]
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/tools/pst/handler/impls/attachment.py:261: error: Unused "type: ignore" comment  [unused-ignore]
            item.get_embedded_attachment,  # type: ignore[attr-defined]
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/tools/pst/handler/impls/appt.py:284: error: Unused "type: ignore" comment  [unused-ignore]
                    item.get_recipients(),  # type: ignore[attr-defined]
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/tools/pst/handler/impls/eml.py:71: error: Unused "type: ignore" comment  [unused-ignore]
                    item.get_recipients(),  # type: ignore[attr-defined]
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Found 5 errors in 3 files (checked 15 source files)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

255b8f7 - force-pushing that in..

@ztravis
Copy link

ztravis commented Dec 4, 2024

LGTM! Go ahead and update/merge whenever you're ready.

@kmurphy4 kmurphy4 merged commit c4a027f into master Dec 5, 2024
1 check passed
@kmurphy4 kmurphy4 deleted the fix/stubs branch December 5, 2024 01:01
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