Contributing¶
Contributions to py-dem-bones are welcome! Here’s how you can contribute:
Setting Up Development Environment¶
Clone the repository:
git clone https://github.com/loonghao/py-dem-bones.git cd py-dem-bones
Create a virtual environment and install development dependencies:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -e ".[dev]"
Install pre-commit hooks:
pre-commit install
Development Workflow¶
Create a new branch for your feature or bugfix:
git checkout -b feature/your-feature-name
Make your changes and write tests for them.
Run the tests to make sure everything works:
pytest
Build the documentation to ensure it’s correct:
cd docs make html
Commit your changes and push them to your fork:
git commit -m "Add your feature description" git push origin feature/your-feature-name
Create a pull request on GitHub.
Code Style¶
This project follows the Google Python Style Guide. We use ruff
for linting and formatting.
To check your code style:
ruff check .
To automatically fix style issues:
ruff format .
Building the Documentation¶
The documentation is built using Sphinx. To build it locally:
cd docs
make html
The built documentation will be in docs/_build/html
.
Running Tests¶
We use pytest for testing. To run the tests:
pytest
To run tests with coverage:
pytest --cov=py_dem_bones
Releasing¶
Update the version number in
pyproject.toml
andsrc/py_dem_bones/__init__.py
.Update the changelog.
Commit the changes:
git commit -m "Bump version to x.y.z"
Tag the release:
git tag -a vx.y.z -m "Version x.y.z"
Push the changes and tag:
git push origin main --tags
The GitHub Actions workflow will automatically build and publish the release to PyPI.