Development and Release¶
Source Tree¶
- package code:
bff/ - documentation:
docs/ - worked example:
examples/acetate/ - GitHub Actions:
.github/workflows/
Repository Environment¶
From the repository root:
mamba env create -f environment.yaml
mamba activate bfflearn
That shared environment installs the package in editable mode together with the
developer, notebook, and docs extras. Install PyTorch separately afterward if
you want to run bff train, bff learn, or the posterior notebooks.
Local Quality Checks¶
Suggested checks from the repository root:
python -m compileall bff
python -m py_compile $(find bff -name '*.py')
python -m build
mkdocs build --strict
If ruff is installed in your environment, also run:
ruff check bff
GitHub Actions¶
Recommended repository workflows:
docs.ymlbuilds and deploys the MkDocs site to GitHub Pages.checks.ymlruns fast quality checks such as Python compilation, Ruff, package build, and docs build on pushes and pull requests.publish.ymlbuilds and publishes wheels and sdists to PyPI through trusted publishing.
Trusted PyPI Publishing¶
The clean GitHub-to-PyPI setup is:
- Create a PyPI project for
bfflearn. - In PyPI, add a trusted publisher for this repository and the
.github/workflows/publish.ymlworkflow. - In GitHub, keep the publishing workflow protected by tags or release
publication instead of every push to
main.
The publishing workflow should:
- build the sdist and wheel with
python -m build - upload them as workflow artifacts
- publish them with
pypa/gh-action-pypi-publish - use
permissions: id-token: write
Versioning Strategy¶
Associated publication: Bayesian Learning for Accurate and Robust Biomolecular Force Fields
For the paper snapshot you want to archive as 0.0.1, the clean approach is:
- Identify the exact commit that produced the paper data.
- Set the package version on that commit to
0.0.1if it is not already. - Create an annotated tag such as
v0.0.1on that exact commit. - Create a GitHub release from the tag and include the paper DOI and URL in the release notes.
- Switch the repository default branch to
develop. - Protect
mainagainst direct pushes so it becomes the frozen paper branch.
That keeps main aligned with the publication snapshot while active
development continues on develop.
Notes On Main Branch Releases¶
If you want main itself to be the archived paper branch, freeze it after the
paper tag and move day-to-day development to develop. The important GitHub
steps are:
- set
developas the default branch - protect
main - create a release from the paper tag
- keep the paper DOI in the release notes and repository citation metadata