Contributing¶
Prerequisites: Git, uv, and a clone of https://github.com/vexyart/vexy-marktripy. The default branch is master.
Set up the environment¶
This creates .venv/, installs the package in editable mode and adds the dev dependency group (pytest, pytest-benchmark, pytest-cov, hypothesis, mypy, ruff, black, twine, hatch).
Run the tests¶
The suite lives in tests/:
| File | Covers |
|---|---|
test_basic.py |
Parser registration, HTML rendering, AST methods |
test_roundtrip.py |
Markdown → AST → Markdown |
test_transformers.py |
Heading, ID and TOC transformers |
test_gfm_extensions.py |
Strikethrough, task lists, the GFM bundle |
test_kbd_extension.py |
++key++ parsing and rendering |
test_hypothesis.py |
Property-based tests with hypothesis |
test_benchmark.py |
Timing benchmarks with pytest-benchmark |
Skip the benchmarks for a faster run. -k matches test and file names, so this deselects everything in test_benchmark.py:
hatch environments are also configured. uvx hatch test runs the suite in hatch's test environment, and hatch run test:no-benchmark runs pytest -k 'not benchmark'.
Lint and type-check¶
ruff and black use a line length of 100. mypy is configured with strict = true.
Build the package¶
This removes dist/, runs uv build and checks the result with twine check. The version comes from the latest Git tag through hatch-vcs; the build writes it to src/marktripy/_version.py, which is ignored by Git. Between tags the version has a development suffix such as 1.0.5.dev1+g<commit>.
Build the documentation¶
The documentation sources are the Markdown files in src_docs/md/. The configuration is src_docs/mkdocs.yml. The site is built with ProperDocs and the MaterialX theme into docs/, which GitHub Pages serves at https://vexy.dev/vexy-marktripy/.
- Edit or add pages in
src_docs/md/. Add new pages tonavinsrc_docs/mkdocs.yml. -
Preview the site while you edit:
The preview runs at
http://127.0.0.1:8000. -
Run the strict build. It fails on any warning, such as a broken link or a page missing from
nav: -
Commit both
src_docs/and the regenerateddocs/.
On every push to master that touches src_docs/, the Docs workflow (.github/workflows/docs.yml) rebuilds docs/ and commits the result.
Release¶
./publish.sh releases to PyPI:
uvx gitnextvercommits pending changes, creates the nextvX.Y.Ztag and pushes.- The script stops if
HEADhas novX.Y.Ztag. ./build.sh packagebuilds and checksdist/.uv publish dist/*uploads. It needs a credential such asUV_PUBLISH_TOKENin the environment.
Pushing the tag also starts the Release workflow (.github/workflows/release.yml). It builds the package, creates a GitHub release with the files, and uploads to PyPI with twine upload --skip-existing, so it does not fail when publish.sh already uploaded that version.
Where to help¶
The Known limitations page lists confirmed defects, each with a reproduction. Fixing one of them, with a test, is the most useful contribution.