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
-
Navigate to your Django project directory (must have a
.venvorvenv): -
Initialize versioning:
itw tag-init
- Run local pipeline:
itw pipelinelocal
- Deploy to staging:
itw incrementrc
- Deploy to production:
itw incrementpatch
Available Commands
Deployment Commands
itw incrementpatch— Increment patch version and deployitw incrementminor— Increment minor version and deployitw incrementmajor— Increment major version and deployitw 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 outputitw lint— Run pylint and generate SonarQube report filesitw buildlocal— Build Docker image locallyitw testlocal— Run tests locallyitw analyzelocal— Run SonarQube analysis locallyitw changelog— Generate changelog manuallyitw 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, andmasterbranches VERSIONfile in project rootDockerfilesonar-project.properties
License
MIT
Metadata
Release files for itw-python-builder 0.2.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| itw_python_builder-0.2.9.tar.gz | 37.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| itw_python_builder-0.2.9-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 78.3 kB
Release files / itw_python_builder-0.2.9.tar.gz
| Download URL | itw_python_builder-0.2.9.tar.gz |
|---|---|
| Size | 37.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7f5c5d2576ce8013253fe968bfcd911f781a2b54ffe360a92d73c50cda493c46
|
|
BLAKE2b-256 checksum How to use checksums |
0ae08e518c67752eda47fee04ec0dd918b2b8084700dd1475cabe88d4752f1eb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / itw_python_builder-0.2.9-py3-none-any.whl
| Download URL | itw_python_builder-0.2.9-py3-none-any.whl |
|---|---|
| Size | 40.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bed0affdc547acd39fb1890fe588b6e549c82fce55035a143dc8c3dde4ee5f98
|
|
BLAKE2b-256 checksum How to use checksums |
982d5fa7f216b6a7fac5b568d817d8cc77fc6c50f4ad0529a5b81c39e83e2ce1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|