Skip to content

Latest commit

 

History

History
145 lines (95 loc) · 3.07 KB

File metadata and controls

145 lines (95 loc) · 3.07 KB

Contributing

Pull requests are welcome! By participating in this project, you agree to abide by our code of conduct.

Fork

Fork and then clone the repository:

# replace <USER> with your username
git clone git@github.com:<USER>/python-package-template.git
cd python-package-template

Install

Install uv:

curl -LsSf https://astral.sh/uv/install.sh | sh

Install with development dependencies:

uv sync --all-extras

Install pre-commit into your git hooks:

uv run pre-commit install

Develop

Make 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.

Test

Run the tests:

uv run pytest

Run the tests with coverage:

uv run coverage run -m pytest

Generate a coverage report:

uv run coverage report
uv run coverage html

Lint

Update pre-commit hooks to the latest version:

uv run pre-commit autoupdate

Run all pre-commit hooks:

uv run pre-commit run --all-files

Lint all files in the current directory:

uv run ruff check --fix

Format all files in the current directory:

uv run ruff format

Build

Generate distribution packages:

uv build

Upload 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-template

Docs

Generate the docs with pdoc:

uv run pdoc src/python_package_template/

Release

Release and publish are automated with Release Please.

Add a new pending publisher to PyPI.