PDF to Markdown conversion for Wagtail, powered by AI
- Python 3.10+
- Docker and Docker Compose, if you want to quickly set up a Postgres DB to work with
- With your preferred virtualenv activated, install the dependencies
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"You can also use flit:
python -m pip install flit
flit install- If you're using Postgres:
Spin up the postgres container:
inv upCopy .env.example to .env:
cp -v .env.example .envThe DATABASE_URL in .env will be automatically picked up by the test settings. If no .env file exists, the project will use SQLite by default.
And you should be good to go
The simplest is to just run pytest.
If you wanna run the full tox suite, then run tox (You need to ensure you have all the different versions of python on your system, and tox should know about them). You can speed things up by running all envs in parallel, via tox -p auto.
or, you can run them for a specific environment tox -e python3.14-django5.2-wagtail7.2 or specific test
tox -e python3.14-django5.2-wagtail7.2-sqlite wagtail_pdf_converter.tests.test_file.TestClass.test_method
To run the test app interactively, use tox -e interactive, visit http://127.0.0.1:8020/admin/ and log in with admin/changeme.
Note that this project uses pre-commit. It is included in the project testing requirements. To set up locally, run the following in project root:
# initialize pre-commit
pre-commit install
# Optional, run all checks once for this, then the checks will run only on the changed files
git ls-files --others --cached --exclude-standard | xargs pre-commit run --files