Convert to PEP 695 type parameters and deprecate removed TypeVars + type aliases #8096
Open
jenshnielsen wants to merge 7 commits intomicrosoft:mainfrom
Open
Convert to PEP 695 type parameters and deprecate removed TypeVars + type aliases #8096jenshnielsen wants to merge 7 commits intomicrosoft:mainfrom
jenshnielsen wants to merge 7 commits intomicrosoft:mainfrom
Conversation
Collaborator
jenshnielsen
commented
May 4, 2026
- Convert 22 classes/functions to PEP 695 type parameter syntax (UP046/UP047)
- Add noqa: UP046 with comments for 14 cases that require PEP 696 (TypeVar defaults), which needs Python 3.13+
- Fix ruff autofix bug in Base_SPDT.py (TINSTR vs _TINSTR mismatch)
- Clean up unused TypeVar definitions and imports across ~13 files
- Add _make_deprecated_typevars_getattr helper in deprecate.py for module-level getattr deprecation warnings
- Add deprecation warnings (QCoDeSDeprecationWarning) for 9 modules with removed public TypeVars, guarded by if not TYPE_CHECKING so type checkers still flag removed imports as errors
- Add tests for the deprecation helper
jenshnielsen
added a commit
to jenshnielsen/Qcodes
that referenced
this pull request
May 4, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8096 +/- ##
==========================================
+ Coverage 70.80% 70.86% +0.06%
==========================================
Files 302 302
Lines 31911 31983 +72
==========================================
+ Hits 22593 22665 +72
Misses 9318 9318 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
jenshnielsen
added a commit
to jenshnielsen/Qcodes
that referenced
this pull request
May 4, 2026
Also deprecate 3 additional pre-existing unused TypeVars in field_vector.py, threading.py, and channel.py. Fix pyright errors in test_deprecate.py. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
db3bba8 to
d64b470
Compare
jenshnielsen
added a commit
to jenshnielsen/Qcodes
that referenced
this pull request
May 4, 2026
Also deprecate 3 additional pre-existing unused TypeVars in field_vector.py, threading.py, and channel.py. Fix pyright errors in test_deprecate.py. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
d64b470 to
1e4f850
Compare
- Convert 22 classes/functions to PEP 695 type parameter syntax (UP046/UP047) - Add noqa: UP046 with comments for 14 cases that require PEP 696 (TypeVar defaults), which needs Python 3.13+ - Fix ruff autofix bug in Base_SPDT.py (TINSTR vs _TINSTR mismatch) - Clean up unused TypeVar definitions and imports across ~13 files - Add _make_deprecated_typevars_getattr helper in deprecate.py for module-level __getattr__ deprecation warnings - Add deprecation warnings (QCoDeSDeprecationWarning) for 9 modules with removed public TypeVars, guarded by if not TYPE_CHECKING so type checkers still flag removed imports as errors - Add tests for the deprecation helper Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Also deprecate 3 additional pre-existing unused TypeVars in field_vector.py, threading.py, and channel.py. Fix pyright errors in test_deprecate.py. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
f6e2d14 to
0876454
Compare
Deprecate soft-deprecated type aliases in data_set_protocol.py (scalar_res_types, values_type, res_type, setpoints_type, array_like_types) and ats_api.py (int_or_param) using the same __getattr__-based deprecation pattern used for TypeVars. Also update the deprecation warning message to say 'name' instead of 'TypeVar' since the helper is now used for type aliases too. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jenshnielsen
commented
May 5, 2026
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.