Skip to content

Make gramps.gen.lib.primaryobj typed #2018

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bartfeenstra
Copy link
Contributor

@bartfeenstra bartfeenstra commented Mar 14, 2025

This PR:

  • Adds type hints to everything in gramps.gen.lib.primaryobj, as well as any methods overridden in subclasses
  • Uses typing.override to help mypy ensure subclasses override methods correctly, and for them to inherit the parents' docstrings (hence the large number of removals).

@Nick-Hall
Copy link
Member

This is a Python 3.12 feature so we may need to install typing_extensions for this to work in older versions.

Yes. The code should run on python 3.10 in the master branch.

@bartfeenstra
Copy link
Contributor Author

This is a Python 3.12 feature so we may need to install typing_extensions for this to work in older versions.

Yes. The code should run on python 3.10 in the master branch.

Do we want CI builds for that so that people like me don't accidentally break things?

@bartfeenstra bartfeenstra force-pushed the typed-primaryobj branch 2 times, most recently from b06d8d1 to 4117589 Compare March 14, 2025 18:25
@Nick-Hall
Copy link
Member

The CI is running 3.10 in the master branch and I run 3.13 locally.

@bartfeenstra
Copy link
Contributor Author

Oh right, I confused the linter action (which passed) with the CI one which is the one that actually runs mypy (soz!). I updated the PR to use typing_extensions so this should pass on 3.10 now.

@bartfeenstra bartfeenstra force-pushed the typed-primaryobj branch 3 times, most recently from 96c8d60 to e2464be Compare March 14, 2025 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants