Deprecate Python 3.6/3.7 and harden property API - #51
Merged
Conversation
This raises the supported floor to 3.8 and prove it in CI. The 3.6 claim was unverifiable: 3.6 (EOL 2021) and 3.7 (EOL 2023) are unavailable on GitHub-hosted runner. Update python_requires, classifiers, Ruff target, and the module/README docs in lockstep, and expand the selftest matrix to run 3.8, 3.10, 3.12, and 3.13 on Linux. Drop the pre-3.8 shims the bump makes dead: collapse the 4-way copy_fn ladder to os.replace (3.3+) vs copyfile for symlinks, and remove the hasattr(e, "msg") guards around bad-regex reporting (re.error.msg is 3.5+). Return namedtuples (Range, Default, Select, Imply) for the location-bearing Symbol/Choice property records instead of bare tuples. They are tuple subclasses, so positional unpacking and indexing are unchanged; the named fields add a safer access idiom than remembering positions. Wrap both the parse-time construction and the dependency-propagation reconstruction so the type survives. orig_* stay plain 2-/3-tuples as the stable compat surface. Add tests/test_ui_ranges.py covering the real _range_info() / _check_valid() range helpers in menuconfig and guiconfig against tests/Krange, guarding the sym.ranges tuple-arity regression that previously had no test.
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.
This raises the supported floor to 3.8 and prove it in CI. The 3.6 claim was unverifiable: 3.6 (EOL 2021) and 3.7 (EOL 2023) are unavailable on GitHub-hosted runner. Update python_requires, classifiers, Ruff target, and the module/README docs in lockstep, and expand the selftest matrix to run 3.8, 3.10, 3.12, and 3.13 on Linux.
Drop the pre-3.8 shims the bump makes dead: collapse the 4-way copy_fn ladder to os.replace (3.3+) vs copyfile for symlinks, and remove the hasattr(e, "msg") guards around bad-regex reporting (re.error.msg is 3.5+).
Return namedtuples (Range, Default, Select, Imply) for the location-bearing Symbol/Choice property records instead of bare tuples. They are tuple subclasses, so positional unpacking and indexing are unchanged; the named fields add a safer access idiom than remembering positions. Wrap both the parse-time construction and the dependency-propagation reconstruction so the type survives. orig_* stay plain 2-/3-tuples as the stable compat surface.
Add tests/test_ui_ranges.py covering the real _range_info() / _check_valid() range helpers in menuconfig and guiconfig against tests/Krange, guarding the sym.ranges tuple-arity regression that previously had no test.
Summary by cubic
Raises the minimum Python to 3.8 and switches location-bearing property records to namedtuples for safer access without breaking tuple unpacking. CI now verifies 3.8–3.13 on Linux; new tests cover range helpers to prevent regressions.
Refactors
python_requiresto 3.8+, update classifiers/docs, setrufftarget-versiontopy38.os.replacefor backups (symlinks still usecopyfile); show regex errors as "Bad regular expression: ".Range,Default,Select,Implynamedtuples; preserve types during dependency propagation; add assertions in tests.tests/test_ui_ranges.pyto exercise_range_info()and_check_valid()and guard tuple-arity issues.Migration
r.lowandd.cond.orig_*properties remain plain 2-/3-tuples and are unchanged.Written for commit cf64994. Summary will update on new commits.