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 type hints to _convert and lowlevel; add type-checking infrastructure #281

Merged
merged 5 commits into from
Oct 18, 2024

Conversation

bgilbert
Copy link
Member

@bgilbert bgilbert commented Oct 18, 2024

Only support type-checking on Python 3.10+, at least for now.

Prep for #260. I'll rebase that PR after this lands.

When importing items for the purpose of re-exporting them, use
"from X import Y as Y" syntax so type checkers know that re-export is
intended.

Signed-off-by: Benjamin Gilbert <[email protected]>
This seems slightly cleaner, especially once typechecking is added.

Signed-off-by: Benjamin Gilbert <[email protected]>
Run mypy during pre-commit.  For now, only type-check setup.py and
_version.py.

We will support type checking on Python >= 3.10.  3.9 has too many
limitations to be worth supporting.

Signed-off-by: Benjamin Gilbert <[email protected]>
Because of the underscore, _convert is (correctly) not part of the
external API, so this is for internal typechecking purposes only.  The
.pyi file will still be installed though.

Signed-off-by: Benjamin Gilbert <[email protected]>
Signed-off-by: Benjamin Gilbert <[email protected]>
@openslide-bot
Copy link

DCO signed off ✔️

All commits have been signed off. You have certified to the terms of the Developer Certificate of Origin, version 1.1. In particular, you certify that this contribution has not been developed using information obtained under a non-disclosure agreement or other license terms that forbid you from contributing it under the GNU Lesser General Public License, version 2.1.

@bgilbert bgilbert merged commit 08a7236 into openslide:main Oct 18, 2024
52 checks passed
@bgilbert bgilbert deleted the lowlevel branch October 18, 2024 05:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants