A collection of useful resources to reference when developing new features:
This package utilizes mise (installation guide) for dependency management, prek for fast pre-commit hooks, uv as the build engine, and tox for test automation.
To install the development dependencies:
brew install mise # or see the installation alternatives above
# Install dependencies from mist.toml
mise trust
mise install
# Configure prek
prek install -fTo run all tox environments:
toxor to run specific commands:
tox -e test
tox -e prek
tox -e hook-min
tox listTo run all pre-commit steps:
prek run --allpytest-watcher is configured in pyproject.toml for [tool.pytest-watcher] to continuously run tests
ptw .Run the local code with uv tool (requires uv installed globally and first in $PATH, e.g. brew install uv or mise use uv --global)
uv tool install 'mdformat>=0.7.19' --force --with=.
# Then navigate to a different directory and check that the editable version was installed
cd ~
mdformat --version
which mdformatOr with pipx:
pipx install . --include-deps --force --editableThis project uses PyPI Trusted Publishers for secure, token-free publishing from GitHub Actions, with uv for building packages.
Before publishing for the first time, you need to configure Trusted Publishing on PyPI:
- Go to your project's page on PyPI:
https://pypi.org/manage/project/mdformat_obsidian/settings/publishing/- If the project doesn't exist yet, go to PyPI's publishing page to add a "pending" publisher
- Add a new Trusted Publisher with these settings:
- PyPI Project Name:
mdformat_obsidian - Owner:
kyleking - Repository name:
mdformat-obsidian - Workflow name:
tests.yml(.github/workflows/tests.yml) - Environment name:
pypi
- PyPI Project Name:
- Configure the GitHub Environment:
- Go to your repository's
Settings→Environments - Create an environment named
pypi - (Recommended) Enable "Required reviewers" for production safety
- Go to your repository's
Use commitizen to automatically bump versions (in pyproject.toml and mdformat_obsidian/__init__.py) and create a commit with tag:
# Dry run to preview the version bump
tox -e cz -- --dry-run
# Automatically bump version based on conventional commits
tox -e cz
# Or manually specify the increment type
tox -e cz -- --increment PATCH # or MINOR or MAJOR
# Push the commit and tag
git push origin main --tagsThe GitHub Action will automatically build and publish to PyPI using Trusted Publishers (no API tokens needed!).