Skip to content

Commit a5950ca

Browse files
🔧 Remove optional dependency on the unmaintained commonmark package (#427)
## Summary Supersedes #401 by @nikolas, whose fork does not allow maintainer pushes; their commit is carried here verbatim with authorship preserved (thank you!). The `commonmark` PyPI package was deprecated in 2022 (last release 2019). #401 dropped it from the `compare` extra but left `benchmarking/bench_packages.py::test_commonmark_py` importing it unguarded, so `tox -e py311-bench-packages` (which installs `benchmarking,compare`) would have errored. This PR removes that benchmark too. The `commonmark-py` row in `docs/performance.md` is **kept**, with a footnote explaining that the package is deprecated, has been removed from the benchmark suite, and that the figures are from the last run that included it. The historical comparison is still informative. A changelog line with the rationale is added. ## Commits 1. `Remove optional dependency on commonmark` — the contributor's commit, unchanged. 2. `🔧 MAINTAIN: Remove remaining commonmark references` — drops the orphaned benchmark, adds the changelog line. 3. `📚 DOCS: Keep the commonmark-py benchmark row, with a deprecation footnote`, plus a changelog wording tweak. ## Verification - All tests pass; all pre-commit hooks pass under the new pins. - Local docs build renders the footnote and adds no warnings over master. - Remaining `commonmark` mentions in `pyproject.toml`, `tox.ini` and `benchmarking/` refer to the CommonMark spec or the `commonmark` preset, none to the package. --------- Co-authored-by: Nikolas Nyby <nikolas@gnu.org>
1 parent 2700cc3 commit a5950ca

4 files changed

Lines changed: 3 additions & 10 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* ✨ Add `--enable-tables` to the CLI for file, standard input and interactive parsing in [#422](https://github.com/executablebooks/markdown-it-py/pull/422)
66
* 🐛 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)
77
* 📚 Document the Python renderer constructor contract.
8+
* 🔧 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)
89

910
## 4.2.0 - 2026-05-07
1011

benchmarking/bench_packages.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,6 @@ def test_mistune(benchmark, spec_text):
3535
benchmark(mistune.markdown, spec_text)
3636

3737

38-
@pytest.mark.benchmark(group="packages")
39-
def test_commonmark_py(benchmark, spec_text):
40-
import commonmark
41-
42-
benchmark.extra_info["version"] = "0.9.1"
43-
benchmark(commonmark.commonmark, spec_text)
44-
45-
4638
@pytest.mark.benchmark(group="packages")
4739
def test_pymarkdown(benchmark, spec_text):
4840
import markdown

docs/performance.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ tox -e py311-bench-packages -- --benchmark-columns mean,stddev
1515
| mistune[^2] | 3.0.1 | 80.409 | 2.335 |
1616
| **markdown-it-py** | 3.0.0 | 97.242 | 4.427 |
1717
| mistletoe | 1.1.0 | 99.633 | 4.628 |
18-
| commonmark-py | 0.9.1 | 300.403 | 9.706 |
18+
| commonmark-py[^3] | 0.9.1 | 300.403 | 9.706 |
1919
| pymarkdown | 3.4.3 | 387.775 | 10.394 |
2020
| pymarkdown (+extras) | 3.4.3 | 646.564 | 11.316 |
2121
| 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.
2626
[^2]: `mistune` is not CommonMark compliant, which is what allows for its
2727
faster parsing, at the expense of issues, for example, with nested inline parsing.
2828
See [mistletoe's explanation](https://github.com/miyuchina/mistletoe/blob/master/performance.md) for further details.
29+
[^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.

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ Documentation = "https://markdown-it-py.readthedocs.io"
3535

3636
[project.optional-dependencies]
3737
compare = [
38-
"commonmark~=0.9",
3938
"markdown~=3.4",
4039
"mistletoe~=1.0",
4140
"mistune~=3.0",

0 commit comments

Comments
 (0)