This package uses modern Python packaging with pyproject.toml and setuptools_scm for version management.
To install the package in development mode:
pip install -e .This will install the package in editable mode, allowing you to make changes to the code and see them reflected immediately without reinstalling.
The package uses setuptools_scm to automatically generate version numbers from git tags and commits. The version is written to pydelmod/_version.py during installation.
Version format:
- If you're on a tagged commit (e.g., v0.4.0), the version will be just that tag (e.g., "0.4.0")
- If you're on a commit after a tag, the version will include dev information and git hash (e.g., "0.4.1.dev17+gca7a018.d20250520")
- Make sure all tests pass:
pytest - Update HISTORY.rst with the latest changes
- Commit all changes
- Tag the release:
git tag v0.x.x - Push the tag:
git push --tags - Create a new release on GitHub using the tag
- This will trigger the GitHub Actions workflow to publish to PyPI
- The conda package will be built and published by the push event
Alternatively, you can manually build and upload:
- Build the package:
python -m build - Upload to PyPI:
python -m twine upload dist/* - Build conda package:
./conda_build.sh
pydelmod/- Main package codetests/- Test filesexamples/- Example scripts and notebooksdocsrc/- Documentation source filesdocs/- Generated documentation
To run the tests:
pytestTo build the documentation:
cd docsrc
make htmlThe generated documentation will be in the docs/ directory.
For development, you can use the provided conda environment:
conda env create -f environment_dev.yml
conda activate dev_pydelmodTo build the conda package:
# Use the helper script to automatically extract version from git
./conda_build.sh
# Or build directly with conda build
conda build conda.recipe/Note: The conda recipe uses git tags for versioning. If no tag exists, it will use the git commit hash.
This package uses GitHub Actions for continuous integration:
python-package-conda.yml- Builds the conda package and uploads to Anaconda.org when triggeredpython-package-pip.yml- Tests the package installation with pip across different Python versionspython-publish.yml- Publishes the package to PyPI when a new release is created
You can also manually trigger these workflows from the GitHub Actions tab in the repository.