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 (#562) #581

Merged
merged 12 commits into from
May 27, 2024
Merged

Add type hints (#562) #581

merged 12 commits into from
May 27, 2024

Conversation

Crozzers
Copy link
Contributor

@Crozzers Crozzers commented May 27, 2024

This PR closes #562 by adding type hints to the library, dropping Python 3.6 and 3.7 support in the process.

3.6 and 3.7 were recently dropped from the test suite after Github removed them from CICD. It doesn't make sense to claim support for versions we don't test so I dropped them completely.

I've added type hints to pretty much every function. The Markdown object should be covered and most of the extras should either be explicitly covered or inferred through the type hints attached to the Extra base class.

All of the public API and a decent amount of the internal functions should be covered. The main gaping hole at the moment is the extras dict/param for the Markdown object. It's currently annotated as Dict[str, any] (after it's been massaged in the constructor), which is quite broad. Hopefully this can be improved over time as more extras are converted to the new format and their options can be better documented/annotated.

@Crozzers Crozzers changed the title Add type hints Add type hints (#562) May 27, 2024
@nicholasserra
Copy link
Collaborator

Awesome! Thank you for the work on this!

@nicholasserra nicholasserra merged commit 5aae144 into trentm:master May 27, 2024
15 checks passed
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.

Add typing to package
2 participants