Build and test
Build prerequisites
A source build requires uv, CMake 3.15 or later, a C++17 compiler, and development headers for the selected Python interpreter. The build reads the Open Babel headers and libraries from the installed Python package. See the platform-specific build dependencies.
From the repository root, install the development dependencies, build the editable extension against that environment, and check that Python can load it.
uv sync --dev --no-install-project
uv pip install -e . --no-build-isolation
uv run --no-sync python -c "import molgr._core"
Repeat the second command after editing C++ or pybind11 code. Run make stubs when binding signatures change.
Run tests
For routine changes, run the standard GitHub CI checks below. Run uv run --no-sync python -m pytest for the complete suite, including exhaustive fixtures, stress tests, and coverage.
uv run ruff check src
uv run ruff format --check src
uv run --no-sync python -m pytest --no-cov -m "not exhaustive and not stress"
For changes to candidate generation, scoring, or parallel execution, see backend validation.
Build and preview the documentation site
From the repository root, run the following command. uv installs the locked documentation dependencies in an isolated Python 3.11 environment. The site uses the existing figures.
uv run --isolated --locked --only-group docs --python 3.11 mkdocs serve
Open the address printed in the terminal. For a new page, add the English file to nav in mkdocs.yml and place its translation alongside it as name.zh-CN.md. Before submitting, run uv run --isolated --locked --only-group docs --python 3.11 mkdocs build --strict to check navigation and links.
Publish the documentation
Pull requests targeting main or develop run a strict build of both languages. Use the version selector in the header to switch versions and the language menu to switch languages within a version.
| Path | Contents | Updated when |
|---|---|---|
baseline/ |
Earliest site snapshot, from the commit that introduced these bilingual docs on main |
Archived once |
dev/ |
Development documentation from main |
Documentation or build inputs change on main |
vX.Y.Z/ |
English and Chinese snapshot from the exact release tag | Its stable package has been published to PyPI |
latest/ |
Highest archived stable version | A higher stable version is archived |
Select Baseline in the version menu for the original bilingual documentation. The menu shows the short commit ID. The site’s root versions.json records the full Git SHA in properties.commit. A delayed deployment or retry uses the same original commit.
The site root opens dev/ until the first stable release snapshot, then opens latest/. Cite the baseline API at baseline/docs/reference/api.html. For a stable release, replace baseline with the full tag. Source links point to the commit used for each build. For software releases predating the baseline, see the Git tags.
For initial setup, select GitHub Actions under Settings → Pages → Build and deployment → Source. If the github-pages environment restricts deployments, allow main and stable release tags. To retry, open Actions → Documentation → Run workflow on main. Leave release_tag empty to refresh development docs, or enter a published stable tag to recover that deployment. Retries reuse the archived snapshot. Documentation workflow