Pull requests are welcome! By participating in this project, you agree to abide by our code of conduct.
Fork and then clone the repository:
# replace <USER> with your username
git clone git@github.com:<USER>/python-package-template.gitcd python-package-templateInstall uv:
curl -LsSf https://astral.sh/uv/install.sh | shInstall with development dependencies:
uv sync --all-extrasInstall pre-commit into your git hooks:
uv run pre-commit installMake your changes, add tests/documentation, and ensure tests pass.
Write a commit message that follows the Conventional Commits specification:
- feat: A new feature
- fix: A bug fix
- perf: A code change that improves performance
- refactor: A code change that neither fixes a bug nor adds a feature
- test: Add missing tests or correct existing tests
- build: Changes that affect the build system or external dependencies
- ci: Updates configuration files and scripts for continuous integration
- docs: Documentation only changes
Push to your fork and create a pull request.
At this point, wait for us to review your pull request. We'll try to review pull requests within 1-3 business days. We may suggest changes, improvements, and/or alternatives.
Things that will improve the chance that your pull request will be accepted:
- Write tests that pass CI.
- Write solid documentation.
- Write a good commit message.
Run the tests:
uv run pytestRun the tests with coverage:
uv run coverage run -m pytestGenerate a coverage report:
uv run coverage reportuv run coverage htmlUpdate pre-commit hooks to the latest version:
uv run pre-commit autoupdateRun all pre-commit hooks:
uv run pre-commit run --all-filesLint all files in the current directory:
uv run ruff check --fixFormat all files in the current directory:
uv run ruff formatGenerate distribution packages:
uv buildUpload all of the archives under dist:
uv publish --publish-url https://test.pypi.org/legacy/Install the package:
uv add --index-url https://test.pypi.org/simple/ --no-deps python-package-templateGenerate the docs with pdoc:
uv run pdoc src/python_package_template/Release and publish are automated with Release Please.