Skip to content

Prerequisites#

Git Asdf Python Version Copier Hatch GitHub

Git#

Git is a free and open source distributed version control system.

Install#

OS Package Manager Command
linux Aptitude apt install git
linux DNF dnf install git
linux Pacman pacman -S git
linux Zypper zypper install git
macOS Homebrew brew install coreutils git
macOS Spack spack install coreutils git

Note

Check if git is already installed by running git -v before installing.

Asdf#

Asdf is a multiple runtime version manager.

Install Asdf#

Visit the asdf getting started page for detailed instructions.

Python 3#

Python is an interpreted, object-oriented, high-level programming language with dynamic semantics.

Install Asdf Python Plugin#

asdf plugin add python
Note

To list all installed plugins run asdf plugin list. To list all available plugins run asdf plugin list all.

Install Python Version#

asdf install python latest

or

asdf install python 3.12.2
Note

To list all installed python versions run asdf list python. To list all available python versions run asdf list all python.

Set a Default Python Version#

asdf global python latest

or

asdf global python 3.12.2

Set a Python Version for Your Project#

cd PATH/TO/PROJECT && asdf local python latest

or

cd PATH/TO/PROJECT && asdf local python 3.12.2
Note

The local Python version will be set in a .tool-versions file within the current directory. .tool-versions

python 3.12.2

Copier#

Copier is a library and CLI app for rendering project templates.

Install Copier#

Requirement

If you haven’t already, install pipx first: pip install --user pipx.

pipx install copier

Inject Copier Templates Extensions#

pipx inject copier copier-templates-extensions

Hatch#

Hatch is a modern, PEP 621 compliant, extensible Python project manager.

Install Hatch#

pipx install hatch

Configure Hatch#

Store virtual environments in a directory named .hatch in each project directory.

hatch config set dirs.env.virtual .hatch
Note

This adds the following to the configuration:

[dirs.env]
virtual = ".hatch"
The Configuration for Hatch is stored in a config.toml file at i.e. ~/Library/Application Support/hatch on macOS.

GitHub#

You will need a GitHub account for the GitHub Actions workflow.