diff --git a/CHANGELOG.md b/CHANGELOG.md index 8fe152fe..e574b3cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +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, 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..51747a8b 100644 --- a/docs/performance.md +++ b/docs/performance.md @@ -15,7 +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 | 0.9.1 | 300.403 | 9.706 | +| 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 | @@ -26,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. diff --git a/pyproject.toml b/pyproject.toml index df44491f..de6a855f 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",