Add typing support and enhance testing for runtime features#19310
Draft
Josverl wants to merge 13 commits into
Draft
Add typing support and enhance testing for runtime features#19310Josverl wants to merge 13 commits into
Josverl wants to merge 13 commits into
Conversation
See PR: micropython/micropython-lib#1115 Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
metaclasses, user-defined generics, get_args, get_origin, runtime_checkable, and TypedDict Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
Parse the expected failures (xfail) and unexpected passes (xpass) if they are returned by MicroPython unitest. An expected failure is treated as a pass and Unexpected pass is a failure This allows tests to specify more details on test outcomes. Based on : https://docs.python.org/3/library/unittest.html Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com> #skipping-tests-and-expected-failures
Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
2 tasks
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #19310 +/- ##
=======================================
Coverage 98.47% 98.47%
=======================================
Files 176 176
Lines 22845 22845
=======================================
Hits 22497 22497
Misses 348 348 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Code size report: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This is a companion Draft-PR to micropython/micropython-lib#1051
The goal is to Introduce typing modules to MicroPython, to enabling support for various static typing features.
This PR manly consists of test for both supported an unsupported typing functionalities
It also includes:
tests/run-tests.pyto supportunittest@0.11.0tools/make-report.pytypingmodules to theunix-coveragevariant.unix-typing_XXvariants to help gauge the size impact of freezing typing modulesPYBV11-typing_XXvariants to help gauge the size impact of freezing typing modulesI expect that this PR may be split and changed
Testing
The main part of this PR are tests , and test tools.
Tests were added to verify the runtime behavior of type annotations across various features. These tests were executed on the Unix port, and against multiple raw-iron boards.
Trade-offs and Alternatives
Inclusion of typing modules may increase code size, but it significantly enhances the functionality and usability of MicroPython for type hinting and static analysis.
Generative AI
I used generative AI tools when creating this PR, but a human has checked and corrected the
code and is responsible for the code and the description above.