Skip to content

🔧 MAINTAIN: require markdown-it-py >= 3.0, test the floor and Python 3.14 - #170

Merged
chrisjsewell merged 1 commit into
masterfrom
maint/floor-and-py314
Nov 10, 2026
Merged

chrisjsewell merged 1 commit into
masterfrom
maint/floor-and-py314

Conversation

@chrisjsewell

Copy link
Copy Markdown
Member

The package declares markdown-it-py>=2.0.0,<5.0.0, but that floor is not true:
with markdown-it-py 2.x, import mdit_py_plugins.subscript fails (ImportError: cannot import name 'EnvType').
This raises the floor to 3.0.0 and adds a CI job that tests it, so it stays true.

Changes

  • pyproject.toml: markdown-it-py>=3.0.0,<5.0.0, and classifiers for Python 3.10 to 3.14
    (3.8 and 3.9 were already excluded by requires-python = ">=3.10").
  • CI: a Python 3.14 cell in the tests matrix,
    and a tests-floor job that installs markdown-it-py==3.0.0 on Python 3.10 and runs the suite.
    It is a separate job rather than a matrix entry so that the existing tests (…) check names do not change;
    allgood and publish both need it.
  • Tests: gfm, gfm_autolink and section_ref need markdown-it-py >= 4.1.0 and raise RuntimeError on older versions,
    so test_gfm.py, test_gfm_autolink.py and test_section_ref.py now skip below 4.1.0 (pytest.importorskip(..., minversion="4.1.0")).
    The version guards are tested in a new test_mdit_version_guard.py, which runs on every version:
    below 4.1.0 it checks that each of the three plugins raises its RuntimeError,
    and the existing simulated section_ref guard test moved there unchanged.
  • pre-commit: mypy type-checks against markdown-it-py~=4.2 (was ~=3.0); no source changes were needed.
  • tox: a py314 environment.

Checks run

  • pytest on Python 3.14 with markdown-it-py 4.2.0: 728 passed, 3 skipped (the below-4.1 guard checks), 1 xfailed.
  • pytest on Python 3.10 with markdown-it-py 3.0.0: 648 passed, 3 skipped (the three modules above), 1 xfailed.
    Removing the skip from test_section_ref.py makes 44 tests fail with the RuntimeError, so the skip is what keeps that job green.
  • pre-commit run --all-files: clean.
  • python -m build and twine check --strict: both distributions pass;
    the wheel's metadata says Requires-Dist: markdown-it-py>=3.0.0,<5.0.0.

…3.14

The declared floor was markdown-it-py 2.0, but `subscript` has failed to
import on 2.x since 0.5.0 (`EnvType`). Raise it to 3.0.0 and test it:

- pyproject: `markdown-it-py>=3.0.0,<5.0.0`; classifiers for Python 3.10
  to 3.14 (3.8 and 3.9 were already excluded by `requires-python`).
- CI: a 3.14 cell, and a `tests-floor` job on Python 3.10 with
  markdown-it-py 3.0.0 (required by `allgood` and `publish`).
- tests: test_gfm, test_gfm_autolink and test_section_ref skip below
  markdown-it-py 4.1.0, which those plugins need. Their version guards
  move to test_mdit_version_guard.py, which runs on every version and,
  below 4.1.0, checks that each plugin raises its RuntimeError.
- pre-commit: mypy checks against markdown-it-py ~=4.2; tox gains py314.
@codecov

codecov Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.66%. Comparing base (d11bdaf) to head (9a5be73).
⚠️ Report is 36 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #170      +/-   ##
==========================================
+ Coverage   92.80%   94.66%   +1.86%     
==========================================
  Files          31       40       +9     
  Lines        1835     2325     +490     
==========================================
+ Hits         1703     2201     +498     
+ Misses        132      124       -8     
Flag Coverage Δ
pytests 94.66% <ø> (+1.86%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@chrisjsewell
chrisjsewell merged commit 1478f5b into master Nov 10, 2026
14 of 15 checks passed
@chrisjsewell
chrisjsewell deleted the maint/floor-and-py314 branch November 10, 2026 15:32
@chrisjsewell chrisjsewell mentioned this pull request Nov 10, 2026
11 tasks
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