Usage#
Quickstart#
There are two ways to use this project:
Use Copier to create a project to your local machine directly
Inject [Hyperfast Python Template] into an existing project
I. Use Copier#
Install Copier
pipx install copier
Run
copier copy --trust gh:entelecheia/hyperfast-python-template path/to/destination
Do your work
II. Inject the template#
Install Copier
pipx install copier
From the root of your project, run
copier copy --trust gh:entelecheia/hyperfast-python-template .
Do your work
Managing Actions Secrets and Variables in Your Project#
When using the HyFI-Template for your project, there are several GitHub Actions secrets and variables that you need to add to ensure proper functioning of the release action and optional JupyterBook deployment.
Adding PYPI_API_TOKEN and TEST_PYPI_API_TOKEN#
To automate the release process of your project to PyPI, you need to provide two tokens: PYPI_API_TOKEN
and TEST_PYPI_API_TOKEN
. These tokens will be used by the GitHub Actions workflow to authenticate with PyPI and TestPyPI, respectively.
Generate an API token for your PyPI account by following the instructions in the official PyPI documentation.
Generate an API token for your TestPyPI account by following the instructions in the official TestPyPI documentation.
In your GitHub repository, go to the “Settings” tab and click on “Secrets” in the left sidebar.
Click the “New repository secret” button.
Add the
PYPI_API_TOKEN
secret with the value set to the token generated for your PyPI account.Add the
TEST_PYPI_API_TOKEN
secret with the value set to the token generated for your TestPyPI account.
By providing these tokens, your project’s release action will have the necessary permissions to publish your package to PyPI and TestPyPI.
Optionally Adding CNAME for JupyterBook Deployment#
If you plan to deploy the JupyterBook documentation to a custom domain, you’ll need to add a CNAME
variable to your GitHub repository.
In your GitHub repository, go to the “Settings” tab and click on “Pages” in the left sidebar.
Follow the instructions to configure your custom domain.
In your GitHub repository, go to the “Settings” tab and click on “Repository Variables” in the left sidebar.
Click the “New repository variable” button.
Add a new variable with the key
CNAME
and set the value to your custom domain (e.g.,your-custom-domain.com
).
By adding the CNAME
variable, the GitHub Pages action in your deploy-docs.yaml
workflow will properly configure the deployment to use your custom domain.
With the CNAME
repository variable properly configured, your project will be set up to handle JupyterBook deployment to your custom domain effectively.
Features#
Automated changelog with Conventional Commits and Python Semantic Release
Automated dependency updates with Dependabot
Automated semantic versioning with Python Semantic Release
Code coverage with Pytest-Cov
Continuous integration with GitHub Actions
Coverage reporting with Codecov
Documentation with MkDocs, Jupyter Book, and Read the Docs
Hyperfast rendering of the template into a new project with Copier
Import sorting with isort
Linting with pre-commit and Flake8
Managing project labels with GitHub Labeler
Managing projects with Make
Packaging and dependency management with Poetry
Static type-checking with mypy
Support for Conventional Commits
Support for Semantic Versioning
Testing with pytest
Automated Python syntax upgrades with pyupgrade
Automatic documentation from sources for MkDocs with mkdocstrings
Check documentation examples with xdoctest
Runtime type-checking with Typeguard
Test automation with Nox
The template supports Python 3.9, 3.10, 3.11 and 3.12.