Skip to content

Deprecate Python 3.6/3.7 and harden property API - #51

Merged
jserv merged 1 commit into
mainfrom
deprecate-python36
Jul 10, 2026
Merged

Deprecate Python 3.6/3.7 and harden property API#51
jserv merged 1 commit into
mainfrom
deprecate-python36

Conversation

@jserv

@jserv jserv commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

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

    • Set python_requires to 3.8+, update classifiers/docs, set ruff target-version to py38.
    • Expand CI: Linux 3.8/3.10/3.12/3.13; macOS/Windows on 3.12.
    • Replace pre-3.8 shims: use os.replace for backups (symlinks still use copyfile); show regex errors as "Bad regular expression: ".
    • Return Range, Default, Select, Imply namedtuples; preserve types during dependency propagation; add assertions in tests.
    • Add tests/test_ui_ranges.py to exercise _range_info() and _check_valid() and guard tuple-arity issues.
  • Migration

    • Requires Python 3.8+.
    • Code unpacking or indexing property records continues to work; you can now use attributes like r.low and d.cond.
    • orig_* properties remain plain 2-/3-tuples and are unchanged.

Written for commit cf64994. Summary will update on new commits.

Review in cubic

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.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 11 files

Re-trigger cubic

@jserv
jserv merged commit 578b2c9 into main Jul 10, 2026
20 checks passed
@jserv
jserv deleted the deprecate-python36 branch July 10, 2026 00:49
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.

1 participant