Skip to content
/ python-try Public template

try strongly opinionated python blueprint

License

Notifications You must be signed in to change notification settings

vkuehn/python-try

Repository files navigation

python-try

CI Release Build status codecov License

This is a template repository for Python projects that use UV for their dependency management. It is based on standard best practices for modern Python development.

Project Structure

Uses standard src-layout:

python-try/
├── src/python_try/     # Package source code
├── tests/              # Test files
└── pyproject.toml

Getting started with your project

To start a new project using this template:

  1. Clone the repository (or download and extract the ZIP):

    git clone [https://github.com/vkuehn/python-try.git](https://github.com/vkuehn/python-try.git) my-new-project
    cd my-new-project
  2. Install dependencies:

    make install
  3. Initialize your new project: This command will remove the template's git history, initialize a new git repository, and optionally link it to your new remote origin.

    make init-project
  4. Rename and Configure:

    • Rename the package folder src/python_try to your project name.
    • Update pyproject.toml with your project's name, version, and authors.
    • Update mkdocs.yml with your project name and repository URL.
    • Push your first commit: git push -u origin main

Make sure:

  • that GitHub pages is enabled for your repo in Settings > Pages.
  • that you give the GITHUB_TOKEN write permission. Go to Settings > Actions > General > Workflow Permissions and select Read and write permissions.

You are now ready to start development on your project! The CI/CD pipeline will be triggered when you open a pull request, merge to main, or when you create a new release.

Features

  • Makefile with handy options during development (make help)
  • MkDocs for source code documentation (see mkdocs.yml)
  • Pre-commit hooks for code quality (see .pre-commit-config.yaml)
  • Ruff for linting and formatting
  • Docker with optimized Dockerfile and docker-compose setup
  • Scripts folder collecting helper functions
  • Pipelines:
    • on-release-main:
      • Publishes documentation on GitHub Pages
      • Uses python-semantic-release to create new releases automatically

ToDo

  • remove all python_try left overs in code and documentation and config files
  • rename complete folder and subfolder
  • recreate .venv folder
  • Ensure pipelines are stable in all situations
  • Refine release scripts

Devcontainer

VS Code: Reopen in Container

Docker Compose:

docker-compose up dev

Podman:

podman run -it --rm -v "$(pwd):/workspaces/python-try:Z" -w /workspaces/python-try mcr.microsoft.com/devcontainers/python:3.14-bookworm bash

About

try strongly opinionated python blueprint

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published