Development and releases¶
Contributions are welcome. The contributor guide, CONTRIBUTING.md, covers coding standards, how to add a criterion, an LS-DYNA reader, an example or a test, the licensing rules and the pull request checklist. This page covers the set-up, the checks and the release process.
Set up¶
git clone https://github.com/vsk1729/crashmetrics.git
cd crashmetrics
python -m pip install -e ".[dev,docs]"
Checks (the same as CI)¶
python -m pytest # tests, including every example's output
ruff check . # lint
mypy # type check
mkdocs build --strict # documentation
Examples and their expected output¶
Each numbered script in examples/ has its expected output in
examples/expected/, and tests/test_examples.py checks it. The
documentation includes both files directly, so they cannot drift apart.
After an intended change to an example or to a result, regenerate the
expected files and review the difference:
Documentation¶
The site is built with MkDocs Material; the API reference is generated from the NumPy-style docstrings with mkdocstrings.
The Docs workflow builds the site on every pull request (strict mode,
so broken links and docstring problems fail the build) and publishes it
to GitHub Pages when main changes.
Releasing¶
Releases are published by .github/workflows/release.yml with PyPI
Trusted Publishing, so no API tokens are stored in the repository.
- Bump
__version__insrc/crashmetrics/__init__.py, theversionanddate-releasedinCITATION.cff(a test checks they match), and add the CHANGELOG entry; merge tomain. - Optional dry run: run the Release workflow manually from the Actions tab to publish to TestPyPI.
- Publish a GitHub release with tag
v<version>(for examplev0.10.0) onmain. The workflow checks that the tag matches__version__, builds and checks the sdist and wheel, and publishes to PyPI.
A version can be uploaded to PyPI only once; fix mistakes with a new version.