(Closes #2837) update python versions used in testing#3034
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3034 +/- ##
==========================================
- Coverage 99.91% 99.91% -0.01%
==========================================
Files 365 364 -1
Lines 52066 51697 -369
==========================================
- Hits 52022 51652 -370
- Misses 44 45 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Ready for review from @TeranIvy, @LonelyCat124, @hiker or @sergisiso. Updates the CI so that we only test with Python 3.10 and 3.13 (i.e. drops 3.7 and 3.8). |
There was a problem hiding this comment.
Hi @arporter
The changes here look fine.
I was searching through the code - there is a comment
Note: This test failed with Python >3,<3.7 before explicit codecs
were defined in the open(filename, ...) call.
in parse/utils_test.py that we can probably remove now as well.
In psyGen.py, there is a comment about "older versions" of python in a try/except w.r.t type checking of types like Union[int, bool]. This is now out-of-date, and the reason for this functionality is whe things are defined like Union[None, List[str]] (or even I think List[str] might be sufficient), we can't check the type still (we get a TypeError with the message Subscripted generics cannot be used with class and instance checks) - can you update this comment to reflect the continued need for this try/except (swapping to None | list[str] is also not enough to be able to do the type checking automatically. Its possible we can improve this behaviour by diving into the type further, but that is quite complex, or potentially require some other library - you can open an issue and add a TODO if you think this is something worth us spending time on, but I'm not sure1).
There is also discussion in a few places about more modern type hints (e.g. int | str instead of Union[int, str] and list[...] instead of List[...]. As we're moving to 3.10 this is now an option, so can you open an issue about changing to this - I think its a file-touch style improvement again, but at least the comments in src/psyclone/psyir/frontend/fparser2.py and src/psyclone/psyir/symbols/datatypes.py about pre-3.10 type hints could have a TODO regarding that as well.
|
Thanks @LonelyCat124 for finding those other things. I've updated all of them and created #3035 as a reminder to people to fix other type hints as and when they touch them. |
|
CI-happiness permitting, this is ready for another look now. |
|
Happy with changes, going to run the integration tests to ensure everything is ok before merging. |
LonelyCat124
left a comment
There was a problem hiding this comment.
@arporter looks good now, I'm happy with this and will merge it
Drops 3.7 and 3.8 from GHA. Just test on 3.10 and 3.13.