Python Project Blueprint

Blueprint/Boilerplate For Python Projects
Alternatives To Python Project Blueprint
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Netdata63,274
21 hours ago321gpl-3.0C
Real-time performance monitoring, done right! https://www.netdata.cloud
Devops Exercises43,460
6 days ago14otherPython
Linux, Jenkins, AWS, SRE, Prometheus, Docker, Python, Ansible, Git, Kubernetes, Terraform, OpenStack, SQL, NoSQL, Azure, GCP, DNS, Elastic, Network, Virtualization. DevOps Interview Questions
Traefik43,27318a day ago160September 16, 2022621mitGo
The Cloud Native Application Proxy
Kong34,961
17 hours ago235apache-2.0Lua
🦍 The Cloud-Native API Gateway
Awesome Cheatsheets33,674
3 days ago83mitJavaScript
👩‍💻👨‍💻 Awesome cheatsheets for popular programming languages, frameworks and development tools. They include everything you should know in one single file.
Portainer25,67712 days ago78April 21, 20211,128zlibGo
Making Docker and Kubernetes management easy.
Dokku24,6532a day ago77April 22, 202140mitShell
A docker-powered PaaS that helps you build and manage the lifecycle of applications
Faas23,11093 days ago31April 12, 202130mitGo
OpenFaaS - Serverless Functions Made Simple
Docker_practice22,409
10 days ago9December 01, 20217Go
Learn and understand Docker&Container technologies, with real DevOps practice!
Rancher21,0992012 hours ago207April 25, 20212,471apache-2.0Go
Complete container management platform
Alternatives To Python Project Blueprint
Select To Compare


Alternative Project Comparisons
Readme

Blueprint/Boilerplate For Python Projects

Build, Test and Lint Action Push Action Test Coverage Maintainability Quality Gate Status


If you find this useful, you can support me on Ko-Fi (Donations are always appreciated, but never required):

ko-fi

Blog Posts - More Information About This Repo

You can find more information about this project/repository and how to use it in following blog post:

Quick Start

To use this repository as starter for your project you can run configure_project.sh script, which sets up all variables and file names. This way you can avoid configuring and renaming things yourself:

./configure_project.sh MODULE="coolproject" REGISTRY="docker.pkg.github.com/martinheinz/repo-name"

Running

Using Python Interpreter

~ $ make run

Using Docker

Development image:

~ $ make build-dev
~ $ docker images --filter "label=name=blueprint"
REPOSITORY                                                             TAG                 IMAGE ID            CREATED             SIZE
docker.pkg.github.com/martinheinz/python-project-blueprint/blueprint   3492a40-dirty       acf8d09acce4        28 seconds ago      967MB
~ $ docker run acf8d09acce4
Hello World...

Production (Distroless) image:

~ $ make build-prod VERSION=0.0.5
~ $ docker images --filter "label=version=0.0.5"
REPOSITORY                                                             TAG                 IMAGE ID            CREATED             SIZE
docker.pkg.github.com/martinheinz/python-project-blueprint/blueprint   0.0.5               65e6690d9edd        5 seconds ago       86.1MB
~ $ docker run 65e6690d9edd
Hello World...

Testing

Test are ran every time you build dev or prod image. You can also run tests using:

~ $ make test

Pushing to GitHub Package Registry

~ $ docker login docker.pkg.github.com --username MartinHeinz
Password: ...
...
Login Succeeded
~ $ make push VERSION=0.0.5

Cleaning

Clean Pytest and coverage cache/files:

~ $ make clean

Clean Docker images:

~ $ make docker-clean

Kubernetes

Application can be easily deployed on k8s using KinD.

To create cluster and/or view status:

~ $ make cluster

To deploy application to local cluster:

~ $ make deploy-local

To get debugging information of running application:

~ $ make cluster-debug

To get remote shell into application pod:

~ $ make cluster-rsh

To apply/update Kubernetes manifest stored in k8s directory:

~ $ make manifest-update

Setting Up Sonar Cloud

  • Navigate to https://sonarcloud.io/projects
  • Click plus in top right corner -> analyze new project
  • Setup with other CI tool -> other -> Linux
  • Copy -Dsonar.projectKey= and -Dsonar.organization=
    • These 2 values go to sonar-project.properties file
  • Click pencil at bottom of sonar-scanner command
  • Generate token and save it
  • Go to repo -> Settings tab -> Secrets -> Add a new secret
    • name: SONAR_TOKEN
    • value: Previously copied token

Creating Secret Tokens

Token is needed for example for GitHub Package Registry. To create one:

  • Go to Settings tab
  • Click Secrets
  • Click Add a new secret
    • Name: name that will be accessible in GitHub Actions as secrets.NAME
    • Value: value

Resources

Popular Docker Projects
Popular Kubernetes Projects
Popular Virtualization Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Python
Docker
Kubernetes
Makefile
Secret