itw-python-builder 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- itw_python_builder-0.1.0/LICENSE +21 -0
- itw_python_builder-0.1.0/PKG-INFO +164 -0
- itw_python_builder-0.1.0/README.md +137 -0
- itw_python_builder-0.1.0/itw_python_builder/.pylintrc +743 -0
- itw_python_builder-0.1.0/itw_python_builder/__init__.py +6 -0
- itw_python_builder-0.1.0/itw_python_builder/cli.py +9 -0
- itw_python_builder-0.1.0/itw_python_builder/tasks.py +429 -0
- itw_python_builder-0.1.0/itw_python_builder/version.py +84 -0
- itw_python_builder-0.1.0/itw_python_builder.egg-info/PKG-INFO +164 -0
- itw_python_builder-0.1.0/itw_python_builder.egg-info/SOURCES.txt +14 -0
- itw_python_builder-0.1.0/itw_python_builder.egg-info/dependency_links.txt +1 -0
- itw_python_builder-0.1.0/itw_python_builder.egg-info/entry_points.txt +2 -0
- itw_python_builder-0.1.0/itw_python_builder.egg-info/requires.txt +3 -0
- itw_python_builder-0.1.0/itw_python_builder.egg-info/top_level.txt +1 -0
- itw_python_builder-0.1.0/pyproject.toml +45 -0
- itw_python_builder-0.1.0/setup.cfg +4 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 ITWorks
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: itw_python_builder
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Standardized Django deployment pipeline with Docker, testing, and SonarQube integration
|
|
5
|
+
Author-email: IT-Works <contact@it-works.io>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://git.it-works.io/
|
|
8
|
+
Project-URL: Repository, https://git.it-works.io/
|
|
9
|
+
Project-URL: Issues, https://git.it-works.io/
|
|
10
|
+
Keywords: django,deployment,docker,ci-cd,sonarqube
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Topic :: Software Development :: Build Tools
|
|
20
|
+
Requires-Python: >=3.10
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Requires-Dist: invoke>=2.0.0
|
|
24
|
+
Requires-Dist: pylint>=3.0.0
|
|
25
|
+
Requires-Dist: pylint-django>=2.5.0
|
|
26
|
+
Dynamic: license-file
|
|
27
|
+
|
|
28
|
+
# ITW Python Builder
|
|
29
|
+
|
|
30
|
+
Standardized Django deployment pipeline with Docker, testing, SonarQube integration, automatic changelog generation, and code quality enforcement.
|
|
31
|
+
|
|
32
|
+
## Features
|
|
33
|
+
|
|
34
|
+
- Automated deployment with semantic versioning
|
|
35
|
+
- Docker/Podman-based build and push pipeline
|
|
36
|
+
- Automated testing with coverage
|
|
37
|
+
- SonarQube static code analysis
|
|
38
|
+
- Pylint linting with SonarQube integration
|
|
39
|
+
- Quality gates - deploy only when tests pass
|
|
40
|
+
- Automatic changelog generation from commit trailers
|
|
41
|
+
- Support for local and production pipelines
|
|
42
|
+
- Global CLI tool
|
|
43
|
+
- Automatic venv detection per project
|
|
44
|
+
|
|
45
|
+
## Installation
|
|
46
|
+
```bash
|
|
47
|
+
pip install itw_python_builder
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Install globally (outside any project venv). The `itw` command becomes available system-wide.
|
|
51
|
+
|
|
52
|
+
## Quick Start
|
|
53
|
+
|
|
54
|
+
1. Navigate to your Django project directory (must have a `.venv` or `venv`):
|
|
55
|
+
|
|
56
|
+
2. Initialize versioning:
|
|
57
|
+
```bash
|
|
58
|
+
itw tag-init
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
3. Run local pipeline:
|
|
62
|
+
```bash
|
|
63
|
+
itw pipelinelocal
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
4. Deploy to staging:
|
|
67
|
+
```bash
|
|
68
|
+
itw incrementrc
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
5. Deploy to production:
|
|
72
|
+
```bash
|
|
73
|
+
itw incrementpatch
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Available Commands
|
|
77
|
+
|
|
78
|
+
### Deployment Commands
|
|
79
|
+
|
|
80
|
+
- `itw incrementpatch` — Increment patch version and deploy
|
|
81
|
+
- `itw incrementminor` — Increment minor version and deploy
|
|
82
|
+
- `itw incrementmajor` — Increment major version and deploy
|
|
83
|
+
- `itw incrementrc` — Increment release candidate (staging)
|
|
84
|
+
- `itw release` — Promote RC to stable release (master)
|
|
85
|
+
|
|
86
|
+
### Local Development Commands
|
|
87
|
+
|
|
88
|
+
- `itw pipelinelocal` — Run full local pipeline (lint → test → analyze → build)
|
|
89
|
+
- `itw lintlocal` — Run pylint with human-readable output
|
|
90
|
+
- `itw lint` — Run pylint and generate SonarQube report files
|
|
91
|
+
- `itw buildlocal` — Build Docker image locally
|
|
92
|
+
- `itw testlocal` — Run tests locally
|
|
93
|
+
- `itw analyzelocal` — Run SonarQube analysis locally
|
|
94
|
+
- `itw changelog` — Generate changelog manually
|
|
95
|
+
- `itw tag-init` — Initialize version tagging
|
|
96
|
+
|
|
97
|
+
### Skip Pipeline
|
|
98
|
+
```bash
|
|
99
|
+
itw incrementpatch --skip-pipeline
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Virtual Environment Detection
|
|
103
|
+
|
|
104
|
+
`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.
|
|
105
|
+
|
|
106
|
+
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.
|
|
107
|
+
|
|
108
|
+
## Linting
|
|
109
|
+
|
|
110
|
+
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.
|
|
111
|
+
```bash
|
|
112
|
+
# Review issues with human-readable output
|
|
113
|
+
itw lintlocal
|
|
114
|
+
|
|
115
|
+
# Generate report files for SonarQube
|
|
116
|
+
itw lint
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Add this to your `sonar-project.properties`:
|
|
120
|
+
```properties
|
|
121
|
+
sonar.python.pylint.reportPaths=pylint-report.txt
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Changelog Generation
|
|
125
|
+
|
|
126
|
+
Changelog entries are generated automatically on every deployment based on commit messages. To categorize a commit, add a `Changelog:` trailer to the commit body:
|
|
127
|
+
```
|
|
128
|
+
add user authentication
|
|
129
|
+
|
|
130
|
+
Changelog: added
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Available categories: `added`, `fixed`, `changed`, `deprecated`, `removed`, `security`, `performance`, `tests`, `docs`, `refactor`
|
|
134
|
+
|
|
135
|
+
Commits without a trailer appear under `Other Changes`. The `CHANGELOG.md` file is committed and pushed automatically with each deployment.
|
|
136
|
+
|
|
137
|
+
## Requirements
|
|
138
|
+
|
|
139
|
+
- Python 3.10+
|
|
140
|
+
- Podman
|
|
141
|
+
- Git
|
|
142
|
+
- SonarQube server
|
|
143
|
+
|
|
144
|
+
## Configuration
|
|
145
|
+
|
|
146
|
+
### Environment Variables
|
|
147
|
+
|
|
148
|
+
Add to your project `.env`:
|
|
149
|
+
```
|
|
150
|
+
SONAR_HOST_URL=https://your-sonar-server
|
|
151
|
+
SONAR_TOKEN=your-token
|
|
152
|
+
GIT_DEPTH=0
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Project Files Required
|
|
156
|
+
|
|
157
|
+
- Git repository with `develop`, `staging`, and `master` branches
|
|
158
|
+
- `VERSION` file in project root
|
|
159
|
+
- `Dockerfile`
|
|
160
|
+
- `sonar-project.properties`
|
|
161
|
+
|
|
162
|
+
## License
|
|
163
|
+
|
|
164
|
+
MIT
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# ITW Python Builder
|
|
2
|
+
|
|
3
|
+
Standardized Django deployment pipeline with Docker, testing, SonarQube integration, automatic changelog generation, and code quality enforcement.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- Automated deployment with semantic versioning
|
|
8
|
+
- Docker/Podman-based build and push pipeline
|
|
9
|
+
- Automated testing with coverage
|
|
10
|
+
- SonarQube static code analysis
|
|
11
|
+
- Pylint linting with SonarQube integration
|
|
12
|
+
- Quality gates - deploy only when tests pass
|
|
13
|
+
- Automatic changelog generation from commit trailers
|
|
14
|
+
- Support for local and production pipelines
|
|
15
|
+
- Global CLI tool
|
|
16
|
+
- Automatic venv detection per project
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
```bash
|
|
20
|
+
pip install itw_python_builder
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Install globally (outside any project venv). The `itw` command becomes available system-wide.
|
|
24
|
+
|
|
25
|
+
## Quick Start
|
|
26
|
+
|
|
27
|
+
1. Navigate to your Django project directory (must have a `.venv` or `venv`):
|
|
28
|
+
|
|
29
|
+
2. Initialize versioning:
|
|
30
|
+
```bash
|
|
31
|
+
itw tag-init
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
3. Run local pipeline:
|
|
35
|
+
```bash
|
|
36
|
+
itw pipelinelocal
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
4. Deploy to staging:
|
|
40
|
+
```bash
|
|
41
|
+
itw incrementrc
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
5. Deploy to production:
|
|
45
|
+
```bash
|
|
46
|
+
itw incrementpatch
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Available Commands
|
|
50
|
+
|
|
51
|
+
### Deployment Commands
|
|
52
|
+
|
|
53
|
+
- `itw incrementpatch` — Increment patch version and deploy
|
|
54
|
+
- `itw incrementminor` — Increment minor version and deploy
|
|
55
|
+
- `itw incrementmajor` — Increment major version and deploy
|
|
56
|
+
- `itw incrementrc` — Increment release candidate (staging)
|
|
57
|
+
- `itw release` — Promote RC to stable release (master)
|
|
58
|
+
|
|
59
|
+
### Local Development Commands
|
|
60
|
+
|
|
61
|
+
- `itw pipelinelocal` — Run full local pipeline (lint → test → analyze → build)
|
|
62
|
+
- `itw lintlocal` — Run pylint with human-readable output
|
|
63
|
+
- `itw lint` — Run pylint and generate SonarQube report files
|
|
64
|
+
- `itw buildlocal` — Build Docker image locally
|
|
65
|
+
- `itw testlocal` — Run tests locally
|
|
66
|
+
- `itw analyzelocal` — Run SonarQube analysis locally
|
|
67
|
+
- `itw changelog` — Generate changelog manually
|
|
68
|
+
- `itw tag-init` — Initialize version tagging
|
|
69
|
+
|
|
70
|
+
### Skip Pipeline
|
|
71
|
+
```bash
|
|
72
|
+
itw incrementpatch --skip-pipeline
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Virtual Environment Detection
|
|
76
|
+
|
|
77
|
+
`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.
|
|
78
|
+
|
|
79
|
+
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.
|
|
80
|
+
|
|
81
|
+
## Linting
|
|
82
|
+
|
|
83
|
+
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.
|
|
84
|
+
```bash
|
|
85
|
+
# Review issues with human-readable output
|
|
86
|
+
itw lintlocal
|
|
87
|
+
|
|
88
|
+
# Generate report files for SonarQube
|
|
89
|
+
itw lint
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Add this to your `sonar-project.properties`:
|
|
93
|
+
```properties
|
|
94
|
+
sonar.python.pylint.reportPaths=pylint-report.txt
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Changelog Generation
|
|
98
|
+
|
|
99
|
+
Changelog entries are generated automatically on every deployment based on commit messages. To categorize a commit, add a `Changelog:` trailer to the commit body:
|
|
100
|
+
```
|
|
101
|
+
add user authentication
|
|
102
|
+
|
|
103
|
+
Changelog: added
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Available categories: `added`, `fixed`, `changed`, `deprecated`, `removed`, `security`, `performance`, `tests`, `docs`, `refactor`
|
|
107
|
+
|
|
108
|
+
Commits without a trailer appear under `Other Changes`. The `CHANGELOG.md` file is committed and pushed automatically with each deployment.
|
|
109
|
+
|
|
110
|
+
## Requirements
|
|
111
|
+
|
|
112
|
+
- Python 3.10+
|
|
113
|
+
- Podman
|
|
114
|
+
- Git
|
|
115
|
+
- SonarQube server
|
|
116
|
+
|
|
117
|
+
## Configuration
|
|
118
|
+
|
|
119
|
+
### Environment Variables
|
|
120
|
+
|
|
121
|
+
Add to your project `.env`:
|
|
122
|
+
```
|
|
123
|
+
SONAR_HOST_URL=https://your-sonar-server
|
|
124
|
+
SONAR_TOKEN=your-token
|
|
125
|
+
GIT_DEPTH=0
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Project Files Required
|
|
129
|
+
|
|
130
|
+
- Git repository with `develop`, `staging`, and `master` branches
|
|
131
|
+
- `VERSION` file in project root
|
|
132
|
+
- `Dockerfile`
|
|
133
|
+
- `sonar-project.properties`
|
|
134
|
+
|
|
135
|
+
## License
|
|
136
|
+
|
|
137
|
+
MIT
|