This repository provides utilities to simplify developing MaMMoS.
- bash
- git
- pixi, at least version 0.50.2 (older versions have a bug breaking editable installation)
- pre-commit (optional, but highly recommended; install e.g. with your package manager or pipx)
- an SSH key connected to your github account to clone repositories via SSH
(done by default in the
prepare.shscript)
To clone all mammos software suite repositories into a new subdirectory
packages run:
bash prepare.shNote: this cannot be done with pixi because the default pixi environment
contains requirements dependencies, which will only be available after the
repositories have been cloned. Pixi tries to resolve these in the prepare
environment even though it is configured such that it does not use the default
solve group.
The following tasks are available to simplify development, execute them with
pixi run <task>:
| task | description |
|---|---|
| docs-browse | Open sphinx documentation in default browser (calls docs-build internally) |
| docs-build | Build sphinx documentation using the local version of the packages |
| docs-clean | Remove sphinx output |
| examples | Start jupyter lab in the packages directory |
| update-repos | In all repositories: switch to main and pull latest changes (ignores failures) |
Note: some of the optional dependencies used in the workflows of the metapackage
mammos can only be installed on Linux.
Prerequisites (must be in PATH):
For clarity, let us assume we want to create a mammos framework component for x, so the package should be called mammos-x.
-
Reserve the name
mammos-xon PyPI- go to
mammosorganisation -> Projects - create package
- go to
managenew project ->publishingowner:MaMMoS-projectrepository name:mammos-xworkflow name:publish.ymlenivironment name:pypi
- go to
-
Create GitHub repository
- owner: MaMMos-project
- enter description
- make it public
- do not initialise this repository with anything
-
Create package
cookiecutter gh:MaMMoS-project/cookiecutterThis creates a subdirectory
mammos-xwith the template content, and in it initialises an empty git repository, sets the origin to git@github.com:MaMMoS-project/mammos-x.git, and activate pre-commit hooks. -
Search for
TODOstrings in the files, and work through them. -
Commit all files with
git add . && git commit -m "Initial commit".
cdinto<repo>root- Pull latest main:
git checkout main && git pull --rebase - [optional] Run tests
pixi run test-all - Update version in
pyproject.tomland.binder/environment.yml - [optional] Check that the new changelog highlight looks good:
pixi run towncrier build --draft - Run
towncrierwithpixi run towncrier build(usepixi run ...instead of being in apixi shellto ensure that the updated version number is used) - Confirm remove of changes: type
Ywhen asked - Towncrier stages the changes it makes, but the updated
pyproject.tomland.binder/environment.ymlneed to be staged:git add pyproject.toml .binder/environment.yml - Commit all changes:
git commit -m "Bump version" - [optional] Squash commits
- Push changes:
git push - Tag
git tag <version> - Push tag
git push origin <version>
cdintomammosroot- Pull latest main:
git checkout main && git pull --rebase - Update versions for all dependencies in
pyproject.toml - Run tests with updated dependencies:
pixi run test-all - Update version of metapackage in
pyproject.tomland.binder/environment.yml - Run
towncrierwithpixi run towncrier build(usepixi run ...instead of being in apixi shellto ensure that the updated version number is used)- Confirm remove of changes: type
Ywhen asked. - Keep towncrier's default output if there are not changelog fragments.
- Confirm remove of changes: type
- Update changelog in
docs/source/changelog.rst- Copy and paste (translate md to rst) changes from individual CHANGELOG.md files from the framework components
- Towncrier stages the changes it makes, but the updated
pyproject.toml,.binder/environment.ymlanddocs/source/changelog.rstneed to be staged:git add pyproject.toml .binder/environment.yml docs/source/changelog.rst - Commit all changes:
git commit -m "Bump version" - [optional] Squash commits
- Tag
git tag <version> - Push changes:
git push && git push origin <version>