A template project for a pyproject/PDM based Python application.
The recommended way is to use the provided Dev Container, which will set up everything for you. This includes installing all the necessary dependencies, installing pre-commit hooks, and setting up the development environment with recommended tools and extensions, as well as environment variables. All source code will be mounted into the container automatically on start and config files such as .gitconfig
will be inherited. You are up and running in no time. For more info see the dev container configuration file .devcontainer/devcontainer.json
and the Dev Container documentation.
Required tools include:
If on Windows, you will also need to install the Windows Subsystem for Linux 2 and a Linux distribution such as Ubuntu. It is recommended to clone the repository directly into WSL since this will increase the performance of the dev container. After cloning and cd'ing into the project folder, you can open the project in VS Code by running code .
in the WSL terminal.
Open VS Code and you will be prompted with a notification in the bottom right corner of the window to reopen the project in a dev container.
Alternatively you can open the command palette (Ctrl+Shift+P) and run the Dev Containers: Reopen in Container
or Dev Containers: Rebuild and Reopen in Container
command.
Required tools include:
If you want to develop directly on your machine without depending on either Visual Studio Code or Docker you can straight up install PDM, the development dependencies and setup pre-commit by running the following command:
# git clone
# cd into the project folder
pdm sync -G dev && pdm run pre-commit install
To run testing, linting and building of the project you can run the following command:
pdm run all