Python project repository template for developing python package. This template includes a basic structure for developing a python package, including a license, documentation, testing, and continuous integration. It is based on the Scientific Python Library Development Guide and Cookiecutter.
This repository contains a template for developing a python project. To start, click on the green Use this template in the top right. This will allow you to create a new project using this base template.
This template contains the following:
- Python package setup files for building python package to a distribution. See PyPA packaging user guide for more info.
- Basic license file (currently BSD 3-Clause License, but can be modified to specific project). See choose a license for more licenses.
- Starter Jupyter Book based documentation structure.
- Single test example to demonstrate the use of pytest.
- GitHub workflow config to run tests.
- Pre-commit config to enable code style checks before committing.
- Read The Docs config to enable free hosting of documentation.
- Code coverage analysis with
coverage.pyviapytest-cov. - Pixi workspace configured in
pyproject.toml, with a committedpixi.lockfor reproducible environments across Linux, macOS, and Windows.
Install pixi, then run tasks from the repository root. Pixi creates and caches the environments on first use.
pixi run test # run the test suite (default environment)
pixi run test-cov # run tests with coverage
pixi run lint # run all pre-commit hooks
pixi run -e docs docs # build the Jupyter Book documentation
pixi run -e build build # build the sdist and wheel
pixi run -e py311 test # run tests against a specific Python (py311 to py315)
pixi task list # show every available taskDependencies are declared once in [project] and
[project.optional-dependencies]. Pixi reads them from there, so pip install
and pixi stay in sync. After changing dependencies, run pixi lock and commit
the updated pixi.lock.
We encourage that any software that is built upon this template to be licensed with an OSI Approved Licenses