Skip to main content

Standardized Django deployment pipeline with Docker, testing, and SonarQube integration

Project description

ITW Python Builder

Standardized Django deployment pipeline with Docker, testing, SonarQube integration, automatic changelog generation, and code quality enforcement.

Features

  • Automated deployment with semantic versioning
  • Docker/Podman-based build and push pipeline
  • Automated testing with coverage
  • SonarQube static code analysis
  • Pylint linting with SonarQube integration
  • Quality gates - deploy only when tests pass
  • Automatic changelog generation from commit trailers
  • Support for local and production pipelines
  • Global CLI tool
  • Automatic venv detection per project

Installation

pip install itw-python-builder

Install globally (outside any project venv). The itw command becomes available system-wide.

Quick Start

  1. Navigate to your Django project directory (must have a .venv or venv):

  2. Initialize versioning:

itw tag-init
  1. Run local pipeline:
itw pipelinelocal
  1. Deploy to staging:
itw incrementrc
  1. Deploy to production:
itw incrementpatch

Available Commands

Deployment Commands

  • itw incrementpatch — Increment patch version and deploy
  • itw incrementminor — Increment minor version and deploy
  • itw incrementmajor — Increment major version and deploy
  • itw incrementrc — Increment release candidate (staging)
  • itw release — Promote RC to stable release (master)

Local Development Commands

  • itw pipelinelocal — Run full local pipeline (lint → test → analyze → build)
  • itw lintlocal — Run pylint with human-readable output
  • itw lint — Run pylint and generate SonarQube report files
  • itw buildlocal — Build Docker image locally
  • itw testlocal — Run tests locally
  • itw analyzelocal — Run SonarQube analysis locally
  • itw changelog — Generate changelog manually
  • itw tag-init — Initialize version tagging

Skip Pipeline

itw incrementpatch --skip-pipeline

Virtual Environment Detection

itw is installed globally but automatically detects the project's virtual environment (.venv or venv) in the current directory. Tasks that need Python/Django dependencies (test, lint, analyze) activate the venv automatically — no need to manually activate it.

If no venv is found, those tasks will error with a clear message. Tasks that only use git (like changelog, tag-init, buildlocal) work without a venv.

Linting

The pipeline runs pylint automatically on every deployment and generates report files for SonarQube. The .pylintrc configuration is shipped with the package — no config files needed in your project.

# Review issues with human-readable output
itw lintlocal

# Generate report files for SonarQube
itw lint

Add this to your sonar-project.properties:

sonar.python.pylint.reportPaths=pylint-report.txt

Changelog Generation

Changelog entries are generated automatically on every deployment based on commit messages. To categorize a commit, add a Changelog: trailer to the commit body:

add user authentication

Changelog: added

Available categories: added, fixed, changed, deprecated, removed, security, performance, tests, docs, refactor

Commits without a trailer appear under Other Changes. The CHANGELOG.md file is committed and pushed automatically with each deployment.

Requirements

  • Python 3.10+
  • Podman
  • Git
  • SonarQube server

Configuration

Environment Variables

Add to your project .env:

SONAR_HOST_URL=https://your-sonar-server
SONAR_TOKEN=your-token
GIT_DEPTH=0

Project Files Required

  • Git repository with develop, staging, and master branches
  • VERSION file in project root
  • Dockerfile
  • sonar-project.properties

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

itw_python_builder-0.1.28.tar.gz (23.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

itw_python_builder-0.1.28-py3-none-any.whl (25.0 kB view details)

Uploaded Python 3

File details

Details for the file itw_python_builder-0.1.28.tar.gz.

File metadata

  • Download URL: itw_python_builder-0.1.28.tar.gz
  • Upload date:
  • Size: 23.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for itw_python_builder-0.1.28.tar.gz
Algorithm Hash digest
SHA256 8fe3d9d0b539ab2bee9bb9f597d2be5c0022750886f52ac6c60994c1c0ca1755
MD5 ccec91eb41a61a478a4fb178388cd4f7
BLAKE2b-256 9f4dff361eee161aca0a53e4c4b65437b0aa97611ba66a85078d6449209ef83d

See more details on using hashes here.

File details

Details for the file itw_python_builder-0.1.28-py3-none-any.whl.

File metadata

File hashes

Hashes for itw_python_builder-0.1.28-py3-none-any.whl
Algorithm Hash digest
SHA256 39f754e61cf3b9c09f1c5ebf12ff179457663a2e3e8484aa47e69c52bbf056bf
MD5 5d308913a1dfc5d6b8b56ab5a479c595
BLAKE2b-256 48118350ae508013ee6876f46f3ed927e5705a8b93ab90831c8db369a68d13b8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page