Skip to content

py(3.15): Fix the formatter tests, default to Python 3.15 - #581

Merged
tony merged 7 commits into
masterfrom
python-3.15
Oct 24, 2026
Merged

tony merged 7 commits into
masterfrom
python-3.15

Conversation

@tony

@tony tony commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

vcspull's test suite passes on Python 3.15, which becomes the default
interpreter and the version CI tests. The formatter tests assigned to
HelpFormatter._theme, which argparse 3.15 turned into a read-only
property, so every test that built a formatter with a mock theme
failed (#580). vcspull itself already ran on 3.15: vcspull sync --help printed the same colored examples there as on 3.14.

  • Formatter: VcspullHelpFormatter._example_theme() returns
    argparse's theme, or None below 3.14, and _fill_text() reads it
    through that method. Help output is unchanged.

  • Tests: the _fill_text and example-colorizing tests pin a mock
    theme by overriding _example_theme() on a subclass instead of
    writing _theme.

  • Python 3.15 default: .tool-versions lists
    python 3.15 3.14 3.13 3.12 3.11 3.10, .python-version is 3.15,
    the test matrix runs 3.15 in place of 3.14, and the release job
    builds on 3.15.

  • Packaging: the trove classifiers add Python 3.15, so PyPI lists
    it as supported.

  • Changelog: a What's new entry, "Python 3.15 support".

Fixes #580

tony added 4 commits October 17, 2026 10:15
why: CPython 3.15.0 was released on 2026-10-09. mise resolves the bare
`3.15` to the newest installed 3.15.x, so the pin needs no patch bumps.
mise now uses Python 3.15 first, with 3.14 through 3.10 still installed.

See also:
- https://www.python.org/downloads/release/python-3150/
- https://docs.python.org/3.15/whatsnew/3.15.html
why: uv uses this as the default interpreter for `uv sync` and
`uv run`.

See also:
- https://docs.python.org/3.15/whatsnew/3.15.html
why: Run the test job on the current CPython release.

what:
- replace 3.14 with 3.15 in the `build` job matrix of tests.yml
- leave the `release` job on 3.14

The suite does not pass on 3.15 yet: `uv run py.test` reports 14
failures in tests/cli/test_formatter.py.

See also: https://devguide.python.org/versions/
why: Python 3.15 made `argparse.HelpFormatter._theme` a read-only
property (cpython#148827). The formatter tests injected their mock
theme with `fmt._theme = ...`, so all 14 failed with "property
'_theme' ... has no setter" (#580). The formatter itself only reads
`_theme` and renders the same help on 3.14 and 3.15.

what:
- Read argparse's theme through a new `_example_theme()`, the one
  place that resolves it
- Supply the tests' mock theme by overriding `_example_theme()` in a
  test subclass instead of assigning `_theme`
- Correct the docstring: with `NO_COLOR` argparse's theme is empty
  strings, not None; None only happens below Python 3.14
@codecov

codecov Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.72%. Comparing base (8a430c6) to head (d2336b1).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #581   +/-   ##
=======================================
  Coverage   83.72%   83.72%           
=======================================
  Files          32       32           
  Lines        4595     4595           
  Branches      928      928           
=======================================
  Hits         3847     3847           
  Misses        497      497           
  Partials      251      251           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tony tony changed the title Python 3.15: default to 3.15 and test it in CI Python 3.15: fix the formatter tests, default to 3.15 Oct 24, 2026
@tony
tony marked this pull request as ready for review October 24, 2026 02:02
tony added 3 commits October 24, 2026 04:58
why: The release job pinned Python 3.14, but `uv sync` follows
`.python-version`, which is 3.15, so the pin installed an interpreter
the build never used.
@tony tony changed the title Python 3.15: fix the formatter tests, default to 3.15 py(3.15): Fix the formatter tests, default to Python 3.15 Oct 24, 2026
@tony
tony merged commit e428045 into master Oct 24, 2026
8 checks passed
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.

tests/cli/test_formatter.py fails on Python 3.15: _theme has no setter

1 participant