From e8ed425a844ad735c31dacaa1759633a3b889266 Mon Sep 17 00:00:00 2001 From: Nikolas Nyby Date: Fri, 29 May 2026 09:36:12 -0400 Subject: [PATCH 1/4] Remove optional dependency on commonmark This library was deprecated in 2022. --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 5ddae880..fa209bcc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,7 +35,6 @@ Documentation = "https://markdown-it-py.readthedocs.io" [project.optional-dependencies] compare = [ - "commonmark~=0.9", "markdown~=3.4", "mistletoe~=1.0", "mistune~=3.0", From 61db663f3f247820cec0a9f0996077ceb93d2142 Mon Sep 17 00:00:00 2001 From: Chris Sewell Date: Wed, 9 Sep 2026 12:02:41 +0000 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=94=A7=20MAINTAIN:=20Remove=20remaini?= =?UTF-8?q?ng=20commonmark=20references?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `commonmark` package is no longer an optional dependency, so drop the benchmark that imports it (it would fail `tox -e py311-bench-packages`) and its row in the performance table, and note the change in the changelog. --- CHANGELOG.md | 1 + benchmarking/bench_packages.py | 8 -------- docs/performance.md | 1 - 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 033cf4fe..1622fa16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Unreleased * 📚 Document the Python renderer constructor contract. +* 🔧 Drop the optional dependency on the `commonmark` package, and its benchmark and performance table row, since the upstream package is unmaintained, in [#401](https://github.com/executablebooks/markdown-it-py/pull/401) ## 4.2.0 - 2026-05-07 diff --git a/benchmarking/bench_packages.py b/benchmarking/bench_packages.py index 084557a9..ea668a6e 100644 --- a/benchmarking/bench_packages.py +++ b/benchmarking/bench_packages.py @@ -35,14 +35,6 @@ def test_mistune(benchmark, spec_text): benchmark(mistune.markdown, spec_text) -@pytest.mark.benchmark(group="packages") -def test_commonmark_py(benchmark, spec_text): - import commonmark - - benchmark.extra_info["version"] = "0.9.1" - benchmark(commonmark.commonmark, spec_text) - - @pytest.mark.benchmark(group="packages") def test_pymarkdown(benchmark, spec_text): import markdown diff --git a/docs/performance.md b/docs/performance.md index f0291f4a..171141dc 100644 --- a/docs/performance.md +++ b/docs/performance.md @@ -15,7 +15,6 @@ tox -e py311-bench-packages -- --benchmark-columns mean,stddev | mistune[^2] | 3.0.1 | 80.409 | 2.335 | | **markdown-it-py** | 3.0.0 | 97.242 | 4.427 | | mistletoe | 1.1.0 | 99.633 | 4.628 | -| commonmark-py | 0.9.1 | 300.403 | 9.706 | | pymarkdown | 3.4.3 | 387.775 | 10.394 | | pymarkdown (+extras) | 3.4.3 | 646.564 | 11.316 | | panflute | 2.3.0 | 860.105 | 208.607 | From 186690b0f069214876cff7d100936f07ccad4f7f Mon Sep 17 00:00:00 2001 From: Chris Sewell Date: Wed, 9 Sep 2026 12:35:29 +0000 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=93=9A=20DOCS:=20Keep=20the=20commonm?= =?UTF-8?q?ark-py=20benchmark=20row,=20with=20a=20deprecation=20footnote?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/performance.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/performance.md b/docs/performance.md index 171141dc..51747a8b 100644 --- a/docs/performance.md +++ b/docs/performance.md @@ -15,6 +15,7 @@ tox -e py311-bench-packages -- --benchmark-columns mean,stddev | mistune[^2] | 3.0.1 | 80.409 | 2.335 | | **markdown-it-py** | 3.0.0 | 97.242 | 4.427 | | mistletoe | 1.1.0 | 99.633 | 4.628 | +| commonmark-py[^3] | 0.9.1 | 300.403 | 9.706 | | pymarkdown | 3.4.3 | 387.775 | 10.394 | | pymarkdown (+extras) | 3.4.3 | 646.564 | 11.316 | | panflute | 2.3.0 | 860.105 | 208.607 | @@ -25,3 +26,4 @@ As you can see, `markdown-it-py` doesn't pay with speed for its flexibility. [^2]: `mistune` is not CommonMark compliant, which is what allows for its faster parsing, at the expense of issues, for example, with nested inline parsing. See [mistletoe's explanation](https://github.com/miyuchina/mistletoe/blob/master/performance.md) for further details. +[^3]: `commonmark-py` is deprecated and no longer maintained (its last release was in 2019), so it has been removed from the benchmark suite; the figures shown are from the last run that included it. From 3ab7933219b3a16983c74716efac0c0e0f3d2cbe Mon Sep 17 00:00:00 2001 From: Chris Sewell Date: Wed, 9 Sep 2026 12:35:46 +0000 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=93=9A=20DOCS:=20Adjust=20changelog?= =?UTF-8?q?=20wording=20for=20the=20kept=20benchmark=20row?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c45a9d2..e574b3cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ * ✨ Add `--enable-tables` to the CLI for file, standard input and interactive parsing in [#422](https://github.com/executablebooks/markdown-it-py/pull/422) * 🐛 Fix CLI interactive mode joining input lines with an extra newline, which split every line into its own paragraph and broke hard line breaks, in [#172](https://github.com/executablebooks/markdown-it-py/issues/172) * 📚 Document the Python renderer constructor contract. -* 🔧 Drop the optional dependency on the `commonmark` package, and its benchmark and performance table row, since the upstream package is unmaintained, in [#401](https://github.com/executablebooks/markdown-it-py/pull/401) +* 🔧 Drop the optional dependency on the `commonmark` package and its benchmark, since the upstream package is unmaintained, in [#401](https://github.com/executablebooks/markdown-it-py/pull/401) ## 4.2.0 - 2026-05-07