This is a boilerplate designed for Python developments, and it is supposed to ease the start of a project and standardize practices.
Gather the pieces of information below before starting:
- Application name
- Application description (optional, ideally in a couple of sentences)
- Customer name (optional)
- AzureDevOps User ID (optional)
- AzureDevOps User Story ID (optional)
- Remote repository URL (optional)
Ensure you have installed the tools listed below:
- uv - extremely fast package and project manager.
Rust - Using Homebrew
- gitleaks - tool for detecting secrets like passwords, API keys, and tokens in git repos.
Go - hadolint - Dockerfile linter, validate inline bash.
Haskell - ls-lint - directory and filename linter, bring some structure to the project filesystem.
Go - tokei - count your code, quickly.
Rust - varlock - .env files built for sharing powered by @env-spec decorator comments.
TypeScriptJavaScript
- gitleaks - tool for detecting secrets like passwords, API keys, and tokens in git repos.
- Using NPM
- readme-generator-for-helm - auto generate READMEs for Helm Charts.
JavaScript
- readme-generator-for-helm - auto generate READMEs for Helm Charts.
Or run the command below:
make pre-requisites-
Clone the repository.
-
Run the script
init.shand follow the instructions throughout the different prompts. -
This script will perform the following steps:
- Check that
find,git,sed, anduvare installed and available - Get user input on information listed in the Requirements section
- Create the target directory and copy the files
- Perform replacements of application name & description, customer name in all files
- Rename files and directories based on the same replacement rules
- Update renovate configuration
- Create and initialize a virtual environment using uv
- Initialize a Git repository on the branch
mainand add the remote (if any) - Stage the files for the initial commit
- Install & run pre-commit hooks (using prek)
- Check that
-
Once done, run the commands below:
cd ../app-name
code app-name.code-workspace- Makefile
- update the (build|pull|push)-image tasks based on your application's requirements
- update the (create|run)-container tasks based on your application's requirements
- pyproject.toml
project.classifiers: review based on the official list of classifiers- Switch to Windows if needed:
tool.pyright.pythonPlatformtool.ty.environment.python-platformtool.uv.environmentstool.uv.required-environments
Python versioning scheme is: {MAJOR}.{MINOR}.{PATCH}
-
For a PATCH version bump, here are the steps:
- update the full version (e.g. 3.11.13) in the files
- Run the commands below
rm -f .python-version || true
rm -rf .venv
uv python install ${PYTHON_TARGET_VERSION}
uv sync --frozenNote: It is also possible to just update the Makefile and run
make python-bump-patch.
-
For a MINOR version bump, here are the steps:
- update the
requires-pythonstring in the pyproject.toml - update the full version (e.g. 3.11.13) in the files
- update the shorten version (e.g. 3.11) in the files
- update the shorten version without dot (e.g. 311) in the files
- Run the commands below
- update the
rm -f .python-version || true
rm -rf .venv
uv python install ${PYTHON_TARGET_VERSION}
uv sync --frozenNote: It is also possible to just update the
requires-pythonstring in the pyproject.toml, the Makefile, and runmake python-bump-minor.