pygenkit 0.2.0__tar.gz → 0.2.4__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.
- {pygenkit-0.2.0/src/pygenkit.egg-info → pygenkit-0.2.4}/PKG-INFO +94 -53
- {pygenkit-0.2.0 → pygenkit-0.2.4}/README.md +93 -52
- {pygenkit-0.2.0 → pygenkit-0.2.4}/pyproject.toml +1 -1
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/__init__.py +1 -1
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/health/checks.py +3 -3
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/inspector/api.py +3 -3
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/inspector/detect.py +63 -11
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/models/config.py +3 -3
- {pygenkit-0.2.0 → pygenkit-0.2.4/src/pygenkit.egg-info}/PKG-INFO +94 -53
- {pygenkit-0.2.0 → pygenkit-0.2.4}/tests/test_cli.py +1 -1
- {pygenkit-0.2.0 → pygenkit-0.2.4}/tests/test_health.py +34 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/tests/test_inspector.py +46 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/LICENSE +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/setup.cfg +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/ai/__init__.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/ai/prompts.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/ai/provider.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/ai/review.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/cli/__init__.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/cli/app.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/cli/commands/__init__.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/cli/commands/build.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/cli/commands/doctor.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/cli/commands/generate.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/cli/commands/health.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/cli/commands/init.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/cli/commands/inspect.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/cli/commands/new.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/cli/commands/publish.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/cli/commands/release.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/cli/commands/release_check.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/cli/commands/review.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/cli/commands/validate.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/cli.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/config/__init__.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/generators/__init__.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/generators/base.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/generators/deploy.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/generators/docker.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/generators/github_actions.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/generators/orchestrator.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/generators/project.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/health/__init__.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/health/api.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/inspector/__init__.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/inspector/debian.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/inspector/git.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/inspector/pyproject.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/models/__init__.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/models/health.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/models/inspection.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/render/__init__.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/render/engine.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/services/__init__.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/templates/deploy/Procfile.j2 +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/templates/deploy/fly.toml.j2 +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/templates/deploy/railway.json.j2 +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/templates/docker/Dockerfile.j2 +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/templates/docker/docker-compose.yml.j2 +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/templates/github/workflows/ci.yml.j2 +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/templates/github/workflows/publish-launchpad.yml.j2 +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/templates/github/workflows/publish-pypi.yml.j2 +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/templates/github/workflows/release.yml.j2 +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/templates/project/LICENSE.j2 +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/templates/project/README.md.j2 +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/templates/project/pyproject.toml.j2 +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/templates/project/src/__init__.py.j2 +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/templates/project/src/cli.py.j2 +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/templates/project/tests/__init__.py.j2 +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/templates/project/tests/test_cli.py.j2 +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/templates/python-cli/CHANGELOG.md.jinja +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/templates/python-cli/LICENSE.jinja +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/templates/python-cli/Makefile.jinja +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/templates/python-cli/README.md.jinja +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/templates/python-cli/debian/changelog.jinja +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/templates/python-cli/debian/control.jinja +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/templates/python-cli/debian/copyright.jinja +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/templates/python-cli/debian/install.jinja +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/templates/python-cli/debian/links.jinja +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/templates/python-cli/debian/postinst.jinja +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/templates/python-cli/debian/prerm.jinja +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/templates/python-cli/debian/rules.jinja +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/templates/python-cli/debian/source/options.jinja +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/templates/python-cli/debian/{{module_name}}.service.jinja +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/templates/python-cli/pygenkit.yaml.jinja +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/templates/python-cli/pyproject.toml.jinja +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/templates/python-cli/src/{{module_name}}/__init__.py.jinja +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/templates/python-cli/src/{{module_name}}/cli.py.jinja +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/templates/python-cli/tests/__init__.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/templates/python-cli/tests/test_cli.py.jinja +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/utils/__init__.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/utils/files.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/utils/filters.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/validators/__init__.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/validators/api.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/validators/security.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/validators/version.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit/validators/workflow.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit.egg-info/SOURCES.txt +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit.egg-info/dependency_links.txt +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit.egg-info/entry_points.txt +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit.egg-info/requires.txt +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/src/pygenkit.egg-info/top_level.txt +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/tests/test_ai.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/tests/test_config.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/tests/test_filters.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/tests/test_generators.py +0 -0
- {pygenkit-0.2.0 → pygenkit-0.2.4}/tests/test_validators.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pygenkit
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.4
|
|
4
4
|
Summary: Professional Python project generator — PyPI, APT, and Launchpad ready
|
|
5
5
|
Author-email: Alan Santos <alan.profissional.dev@gmail.com>
|
|
6
6
|
License-Expression: GPL-3.0-only
|
|
@@ -17,10 +17,33 @@ Dynamic: license-file
|
|
|
17
17
|
|
|
18
18
|
# PyGenKit
|
|
19
19
|
|
|
20
|
+
[](https://github.com/alan-n7x/pygenkit/actions/workflows/ci.yml)
|
|
21
|
+
[](https://www.python.org/)
|
|
22
|
+
[](LICENSE)
|
|
23
|
+
[](https://docs.astral.sh/ruff/)
|
|
24
|
+
[](https://mypy-lang.org/)
|
|
25
|
+
|
|
20
26
|
Professional Python project generator -- **PyPI**, **APT**, and **Launchpad** ready.
|
|
21
27
|
|
|
22
|
-
|
|
23
|
-
|
|
28
|
+
PyGenKit helps you bootstrap, inspect, validate, and release Python projects with a production-oriented workflow. It can analyze an existing codebase, check version consistency and CI/CD security, and generate GitHub Actions pipelines, Dockerfiles, and deploy configuration files.
|
|
29
|
+
|
|
30
|
+
<p align="center">
|
|
31
|
+
<img src="docs/demo.svg" alt="PyGenKit terminal demo" width="900">
|
|
32
|
+
</p>
|
|
33
|
+
|
|
34
|
+
## Why PyGenKit?
|
|
35
|
+
|
|
36
|
+
Modern Python projects often need more than just source code: packaging metadata, CI, linting, type checking, tests, release automation, Docker, and deployment files. PyGenKit brings those pieces together in a repeatable CLI workflow so new projects start with a professional foundation.
|
|
37
|
+
|
|
38
|
+
## Features
|
|
39
|
+
|
|
40
|
+
- Scaffold Python projects with a `src/` layout and CI/CD-ready defaults
|
|
41
|
+
- Inspect existing projects for metadata, packaging, versioning, and workflow state
|
|
42
|
+
- Validate version consistency across project files, git tags, and Debian packaging files
|
|
43
|
+
- Detect risky CI/CD patterns, outdated actions, missing permissions, and potential secrets
|
|
44
|
+
- Generate GitHub Actions workflows for CI, releases, PyPI, and Launchpad publishing
|
|
45
|
+
- Generate Docker and deployment configuration for common platforms
|
|
46
|
+
- Check local development requirements with a `doctor` command
|
|
24
47
|
|
|
25
48
|
## Installation
|
|
26
49
|
|
|
@@ -44,28 +67,40 @@ cd my-app
|
|
|
44
67
|
# Inspect project structure
|
|
45
68
|
pygenkit inspect
|
|
46
69
|
|
|
47
|
-
# Validate versions, workflows, security
|
|
70
|
+
# Validate versions, workflows, and security
|
|
48
71
|
pygenkit validate
|
|
49
72
|
|
|
50
|
-
# Generate CI/CD pipelines, Docker, deploy configs
|
|
73
|
+
# Generate CI/CD pipelines, Docker, and deploy configs
|
|
51
74
|
pygenkit generate
|
|
52
75
|
|
|
53
76
|
# Check system requirements
|
|
54
77
|
pygenkit doctor
|
|
55
78
|
```
|
|
56
79
|
|
|
80
|
+
## Example Output
|
|
81
|
+
|
|
82
|
+
```text
|
|
83
|
+
Project: my-app
|
|
84
|
+
Version: 0.1.0
|
|
85
|
+
Python: >=3.12
|
|
86
|
+
Build backend: setuptools
|
|
87
|
+
License: MIT
|
|
88
|
+
CI/CD: GitHub Actions detected
|
|
89
|
+
Status: ready for validation
|
|
90
|
+
```
|
|
91
|
+
|
|
57
92
|
## Commands
|
|
58
93
|
|
|
59
94
|
| Command | Description |
|
|
60
95
|
|-----------------|------------------------------------------------|
|
|
61
96
|
| `new` | Scaffold a complete Python project with CI/CD |
|
|
62
|
-
| `init` | Create `pygenkit.toml` in an existing project
|
|
97
|
+
| `init` | Create `pygenkit.toml` in an existing project |
|
|
63
98
|
| `inspect` | Analyze project structure, versions, metadata |
|
|
64
99
|
| `validate` | Check version consistency, workflows, security |
|
|
65
100
|
| `generate` | Generate CI/CD, Docker, and deploy files |
|
|
66
101
|
| `health` | Assess project health across 7 categories |
|
|
67
102
|
| `review` | Review a GitHub PR diff using AI |
|
|
68
|
-
| `release-check` | Verify release readiness
|
|
103
|
+
| `release-check` | Verify release readiness before tagging |
|
|
69
104
|
| `doctor` | Check system for required tools |
|
|
70
105
|
|
|
71
106
|
## Usage
|
|
@@ -77,7 +112,7 @@ pygenkit init my-project
|
|
|
77
112
|
# Inspect project
|
|
78
113
|
pygenkit inspect
|
|
79
114
|
|
|
80
|
-
# Validate
|
|
115
|
+
# Validate project metadata, workflows, and security
|
|
81
116
|
pygenkit validate
|
|
82
117
|
|
|
83
118
|
# Generate GitHub Actions CI/CD pipelines
|
|
@@ -107,9 +142,9 @@ pygenkit generate --force
|
|
|
107
142
|
Scans your project and reports:
|
|
108
143
|
|
|
109
144
|
- Project name, version, module
|
|
110
|
-
- Build backend
|
|
145
|
+
- Build backend: setuptools, hatchling, poetry, etc.
|
|
111
146
|
- Python version requirement
|
|
112
|
-
- License type
|
|
147
|
+
- License type: MIT, Apache, GPL, etc.
|
|
113
148
|
- Version consistency between `pyproject.toml`, `__init__.py`, `debian/changelog`, and git tags
|
|
114
149
|
- CI/CD workflow detection
|
|
115
150
|
- Debian packaging status
|
|
@@ -118,37 +153,37 @@ Scans your project and reports:
|
|
|
118
153
|
|
|
119
154
|
Runs three categories of checks:
|
|
120
155
|
|
|
121
|
-
- **Version**: consistency across `pyproject.toml`, `__init__.py`, `debian/changelog`, git tags
|
|
122
|
-
- **Workflow**: YAML validity, missing metadata, outdated actions
|
|
123
|
-
- **Security**: missing permissions blocks, hardcoded secrets, PyPI
|
|
156
|
+
- **Version**: consistency across `pyproject.toml`, `__init__.py`, `debian/changelog`, and git tags
|
|
157
|
+
- **Workflow**: YAML validity, missing metadata, outdated actions, SHA pin warnings, and script injection risks
|
|
158
|
+
- **Security**: missing permissions blocks, hardcoded secrets, and PyPI publishing without a protected environment
|
|
124
159
|
|
|
125
160
|
## Generate
|
|
126
161
|
|
|
127
|
-
Generates files from Jinja2 templates based on `pygenkit.toml
|
|
162
|
+
Generates files from Jinja2 templates based on `pygenkit.toml`.
|
|
128
163
|
|
|
129
164
|
### GitHub Actions
|
|
130
165
|
|
|
131
|
-
| File
|
|
132
|
-
|
|
133
|
-
| `.github/workflows/ci.yml`
|
|
134
|
-
| `.github/workflows/release.yml`
|
|
135
|
-
| `.github/workflows/publish-pypi.yml`
|
|
136
|
-
| `.github/workflows/publish-launchpad.yml` | dput to Launchpad PPA
|
|
166
|
+
| File | Description |
|
|
167
|
+
|-------------------------------------------|--------------------------------------|
|
|
168
|
+
| `.github/workflows/ci.yml` | Ruff lint, MyPy type-check, Pytest |
|
|
169
|
+
| `.github/workflows/release.yml` | Build wheel and create GitHub Release |
|
|
170
|
+
| `.github/workflows/publish-pypi.yml` | Trusted PyPI publishing |
|
|
171
|
+
| `.github/workflows/publish-launchpad.yml` | dput to Launchpad PPA |
|
|
137
172
|
|
|
138
173
|
### Docker
|
|
139
174
|
|
|
140
|
-
| File | Description
|
|
141
|
-
|
|
142
|
-
| `Dockerfile` | Multi-stage build
|
|
143
|
-
| `docker-compose.yml` | Service configuration
|
|
175
|
+
| File | Description |
|
|
176
|
+
|----------------------|-----------------------|
|
|
177
|
+
| `Dockerfile` | Multi-stage build |
|
|
178
|
+
| `docker-compose.yml` | Service configuration |
|
|
144
179
|
|
|
145
180
|
### Deploy
|
|
146
181
|
|
|
147
|
-
| File
|
|
148
|
-
|
|
149
|
-
| `fly.toml`
|
|
150
|
-
| `Procfile`
|
|
151
|
-
| `railway.json`
|
|
182
|
+
| File | Platform |
|
|
183
|
+
|----------------|----------|
|
|
184
|
+
| `fly.toml` | Fly.io |
|
|
185
|
+
| `Procfile` | Heroku |
|
|
186
|
+
| `railway.json` | Railway |
|
|
152
187
|
|
|
153
188
|
## Configuration (`pygenkit.toml`)
|
|
154
189
|
|
|
@@ -214,9 +249,10 @@ pygenkit doctor
|
|
|
214
249
|
```
|
|
215
250
|
|
|
216
251
|
Checks for:
|
|
252
|
+
|
|
217
253
|
- Python 3.12+
|
|
218
254
|
- Git
|
|
219
|
-
- GitHub CLI (gh)
|
|
255
|
+
- GitHub CLI (`gh`)
|
|
220
256
|
- GPG
|
|
221
257
|
- dput
|
|
222
258
|
- debhelper
|
|
@@ -225,13 +261,9 @@ Checks for:
|
|
|
225
261
|
|
|
226
262
|
## Publishing setup
|
|
227
263
|
|
|
228
|
-
PyPI publishing uses Trusted Publishing (OIDC), so it does not require a long-lived API
|
|
229
|
-
token. Configure the `pypi` environment on GitHub and authorize `release.yml` as a
|
|
230
|
-
Trusted Publisher for the `pygenkit` project on PyPI. Set the repository variable
|
|
231
|
-
`PYPI_ENABLED=true` to enable the publish step.
|
|
264
|
+
PyPI publishing uses Trusted Publishing (OIDC), so it does not require a long-lived API token. Configure the `pypi` environment on GitHub and authorize `release.yml` as a Trusted Publisher for the `pygenkit` project on PyPI. Set the repository variable `PYPI_ENABLED=true` to enable the publish step.
|
|
232
265
|
|
|
233
|
-
Launchpad publishing requires a PPA and an OpenPGP key registered with the Launchpad
|
|
234
|
-
account. Add these secrets to the `launchpad` GitHub environment:
|
|
266
|
+
Launchpad publishing requires a PPA and an OpenPGP key registered with the Launchpad account. Add these secrets to the `launchpad` GitHub environment:
|
|
235
267
|
|
|
236
268
|
- `GPG_PRIVATE_KEY`
|
|
237
269
|
- `GPG_PASSPHRASE`
|
|
@@ -239,7 +271,7 @@ account. Add these secrets to the `launchpad` GitHub environment:
|
|
|
239
271
|
|
|
240
272
|
## Architecture
|
|
241
273
|
|
|
242
|
-
```
|
|
274
|
+
```text
|
|
243
275
|
src/pygenkit/
|
|
244
276
|
├── cli/ # CLI commands (Typer)
|
|
245
277
|
│ └── commands/ # init, inspect, validate, generate, release-check, doctor
|
|
@@ -275,7 +307,7 @@ src/pygenkit/
|
|
|
275
307
|
|
|
276
308
|
PyGenKit itself follows the professional workflow it generates for other projects.
|
|
277
309
|
|
|
278
|
-
```
|
|
310
|
+
```text
|
|
279
311
|
feature branch → Pull Request → CI checks → merge to main → tag → release
|
|
280
312
|
```
|
|
281
313
|
|
|
@@ -305,33 +337,33 @@ git push origin v0.x.x # triggers Release workflow
|
|
|
305
337
|
|
|
306
338
|
### Branch naming
|
|
307
339
|
|
|
308
|
-
| Prefix
|
|
309
|
-
|
|
310
|
-
| `feat/*`
|
|
311
|
-
| `fix/*`
|
|
312
|
-
| `refactor/*` | Code improvements
|
|
313
|
-
| `docs/*`
|
|
314
|
-
| `ci/*`
|
|
340
|
+
| Prefix | Purpose |
|
|
341
|
+
|--------------|--------------------|
|
|
342
|
+
| `feat/*` | New features |
|
|
343
|
+
| `fix/*` | Bug fixes |
|
|
344
|
+
| `refactor/*` | Code improvements |
|
|
345
|
+
| `docs/*` | Documentation |
|
|
346
|
+
| `ci/*` | CI/CD changes |
|
|
315
347
|
|
|
316
348
|
## Branch Protection
|
|
317
349
|
|
|
318
|
-
The `main` branch
|
|
350
|
+
The `main` branch should be protected in the GitHub repository settings.
|
|
319
351
|
|
|
320
352
|
### Required settings
|
|
321
353
|
|
|
322
|
-
| Setting
|
|
323
|
-
|
|
324
|
-
| Require pull request before merging | Yes
|
|
325
|
-
| Require status checks to pass
|
|
326
|
-
| Block force pushes
|
|
327
|
-
| Restrict deletions
|
|
354
|
+
| Setting | Solo | Team |
|
|
355
|
+
|-------------------------------------|------|------|
|
|
356
|
+
| Require pull request before merging | Yes | Yes |
|
|
357
|
+
| Require status checks to pass | Yes | Yes |
|
|
358
|
+
| Block force pushes | Yes | Yes |
|
|
359
|
+
| Restrict deletions | Yes | Yes |
|
|
328
360
|
| Required approvals | 0 | 1 |
|
|
329
361
|
|
|
330
362
|
When working alone, skip approval requirements. When adding maintainers, set **Required approvals: 1**.
|
|
331
363
|
|
|
332
364
|
### How to configure
|
|
333
365
|
|
|
334
|
-
```
|
|
366
|
+
```text
|
|
335
367
|
GitHub repo → Settings → Branches → Add branch protection rule
|
|
336
368
|
Branch name pattern: main
|
|
337
369
|
☑ Require a pull request before merging
|
|
@@ -341,6 +373,15 @@ GitHub repo → Settings → Branches → Add branch protection rule
|
|
|
341
373
|
☑ Restrict deletions
|
|
342
374
|
```
|
|
343
375
|
|
|
376
|
+
## Roadmap
|
|
377
|
+
|
|
378
|
+
- Add richer CLI examples and screenshots
|
|
379
|
+
- Add code coverage reporting
|
|
380
|
+
- Add project templates for FastAPI, CLI tools, and libraries
|
|
381
|
+
- Add semantic versioning helpers
|
|
382
|
+
- Add optional plugin support for custom generators
|
|
383
|
+
- Expand release checks for PyPI, Debian, and Launchpad workflows
|
|
384
|
+
|
|
344
385
|
## Requirements
|
|
345
386
|
|
|
346
387
|
- Python 3.12+
|
|
@@ -1,9 +1,32 @@
|
|
|
1
1
|
# PyGenKit
|
|
2
2
|
|
|
3
|
+
[](https://github.com/alan-n7x/pygenkit/actions/workflows/ci.yml)
|
|
4
|
+
[](https://www.python.org/)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
[](https://docs.astral.sh/ruff/)
|
|
7
|
+
[](https://mypy-lang.org/)
|
|
8
|
+
|
|
3
9
|
Professional Python project generator -- **PyPI**, **APT**, and **Launchpad** ready.
|
|
4
10
|
|
|
5
|
-
|
|
6
|
-
|
|
11
|
+
PyGenKit helps you bootstrap, inspect, validate, and release Python projects with a production-oriented workflow. It can analyze an existing codebase, check version consistency and CI/CD security, and generate GitHub Actions pipelines, Dockerfiles, and deploy configuration files.
|
|
12
|
+
|
|
13
|
+
<p align="center">
|
|
14
|
+
<img src="docs/demo.svg" alt="PyGenKit terminal demo" width="900">
|
|
15
|
+
</p>
|
|
16
|
+
|
|
17
|
+
## Why PyGenKit?
|
|
18
|
+
|
|
19
|
+
Modern Python projects often need more than just source code: packaging metadata, CI, linting, type checking, tests, release automation, Docker, and deployment files. PyGenKit brings those pieces together in a repeatable CLI workflow so new projects start with a professional foundation.
|
|
20
|
+
|
|
21
|
+
## Features
|
|
22
|
+
|
|
23
|
+
- Scaffold Python projects with a `src/` layout and CI/CD-ready defaults
|
|
24
|
+
- Inspect existing projects for metadata, packaging, versioning, and workflow state
|
|
25
|
+
- Validate version consistency across project files, git tags, and Debian packaging files
|
|
26
|
+
- Detect risky CI/CD patterns, outdated actions, missing permissions, and potential secrets
|
|
27
|
+
- Generate GitHub Actions workflows for CI, releases, PyPI, and Launchpad publishing
|
|
28
|
+
- Generate Docker and deployment configuration for common platforms
|
|
29
|
+
- Check local development requirements with a `doctor` command
|
|
7
30
|
|
|
8
31
|
## Installation
|
|
9
32
|
|
|
@@ -27,28 +50,40 @@ cd my-app
|
|
|
27
50
|
# Inspect project structure
|
|
28
51
|
pygenkit inspect
|
|
29
52
|
|
|
30
|
-
# Validate versions, workflows, security
|
|
53
|
+
# Validate versions, workflows, and security
|
|
31
54
|
pygenkit validate
|
|
32
55
|
|
|
33
|
-
# Generate CI/CD pipelines, Docker, deploy configs
|
|
56
|
+
# Generate CI/CD pipelines, Docker, and deploy configs
|
|
34
57
|
pygenkit generate
|
|
35
58
|
|
|
36
59
|
# Check system requirements
|
|
37
60
|
pygenkit doctor
|
|
38
61
|
```
|
|
39
62
|
|
|
63
|
+
## Example Output
|
|
64
|
+
|
|
65
|
+
```text
|
|
66
|
+
Project: my-app
|
|
67
|
+
Version: 0.1.0
|
|
68
|
+
Python: >=3.12
|
|
69
|
+
Build backend: setuptools
|
|
70
|
+
License: MIT
|
|
71
|
+
CI/CD: GitHub Actions detected
|
|
72
|
+
Status: ready for validation
|
|
73
|
+
```
|
|
74
|
+
|
|
40
75
|
## Commands
|
|
41
76
|
|
|
42
77
|
| Command | Description |
|
|
43
78
|
|-----------------|------------------------------------------------|
|
|
44
79
|
| `new` | Scaffold a complete Python project with CI/CD |
|
|
45
|
-
| `init` | Create `pygenkit.toml` in an existing project
|
|
80
|
+
| `init` | Create `pygenkit.toml` in an existing project |
|
|
46
81
|
| `inspect` | Analyze project structure, versions, metadata |
|
|
47
82
|
| `validate` | Check version consistency, workflows, security |
|
|
48
83
|
| `generate` | Generate CI/CD, Docker, and deploy files |
|
|
49
84
|
| `health` | Assess project health across 7 categories |
|
|
50
85
|
| `review` | Review a GitHub PR diff using AI |
|
|
51
|
-
| `release-check` | Verify release readiness
|
|
86
|
+
| `release-check` | Verify release readiness before tagging |
|
|
52
87
|
| `doctor` | Check system for required tools |
|
|
53
88
|
|
|
54
89
|
## Usage
|
|
@@ -60,7 +95,7 @@ pygenkit init my-project
|
|
|
60
95
|
# Inspect project
|
|
61
96
|
pygenkit inspect
|
|
62
97
|
|
|
63
|
-
# Validate
|
|
98
|
+
# Validate project metadata, workflows, and security
|
|
64
99
|
pygenkit validate
|
|
65
100
|
|
|
66
101
|
# Generate GitHub Actions CI/CD pipelines
|
|
@@ -90,9 +125,9 @@ pygenkit generate --force
|
|
|
90
125
|
Scans your project and reports:
|
|
91
126
|
|
|
92
127
|
- Project name, version, module
|
|
93
|
-
- Build backend
|
|
128
|
+
- Build backend: setuptools, hatchling, poetry, etc.
|
|
94
129
|
- Python version requirement
|
|
95
|
-
- License type
|
|
130
|
+
- License type: MIT, Apache, GPL, etc.
|
|
96
131
|
- Version consistency between `pyproject.toml`, `__init__.py`, `debian/changelog`, and git tags
|
|
97
132
|
- CI/CD workflow detection
|
|
98
133
|
- Debian packaging status
|
|
@@ -101,37 +136,37 @@ Scans your project and reports:
|
|
|
101
136
|
|
|
102
137
|
Runs three categories of checks:
|
|
103
138
|
|
|
104
|
-
- **Version**: consistency across `pyproject.toml`, `__init__.py`, `debian/changelog`, git tags
|
|
105
|
-
- **Workflow**: YAML validity, missing metadata, outdated actions
|
|
106
|
-
- **Security**: missing permissions blocks, hardcoded secrets, PyPI
|
|
139
|
+
- **Version**: consistency across `pyproject.toml`, `__init__.py`, `debian/changelog`, and git tags
|
|
140
|
+
- **Workflow**: YAML validity, missing metadata, outdated actions, SHA pin warnings, and script injection risks
|
|
141
|
+
- **Security**: missing permissions blocks, hardcoded secrets, and PyPI publishing without a protected environment
|
|
107
142
|
|
|
108
143
|
## Generate
|
|
109
144
|
|
|
110
|
-
Generates files from Jinja2 templates based on `pygenkit.toml
|
|
145
|
+
Generates files from Jinja2 templates based on `pygenkit.toml`.
|
|
111
146
|
|
|
112
147
|
### GitHub Actions
|
|
113
148
|
|
|
114
|
-
| File
|
|
115
|
-
|
|
116
|
-
| `.github/workflows/ci.yml`
|
|
117
|
-
| `.github/workflows/release.yml`
|
|
118
|
-
| `.github/workflows/publish-pypi.yml`
|
|
119
|
-
| `.github/workflows/publish-launchpad.yml` | dput to Launchpad PPA
|
|
149
|
+
| File | Description |
|
|
150
|
+
|-------------------------------------------|--------------------------------------|
|
|
151
|
+
| `.github/workflows/ci.yml` | Ruff lint, MyPy type-check, Pytest |
|
|
152
|
+
| `.github/workflows/release.yml` | Build wheel and create GitHub Release |
|
|
153
|
+
| `.github/workflows/publish-pypi.yml` | Trusted PyPI publishing |
|
|
154
|
+
| `.github/workflows/publish-launchpad.yml` | dput to Launchpad PPA |
|
|
120
155
|
|
|
121
156
|
### Docker
|
|
122
157
|
|
|
123
|
-
| File | Description
|
|
124
|
-
|
|
125
|
-
| `Dockerfile` | Multi-stage build
|
|
126
|
-
| `docker-compose.yml` | Service configuration
|
|
158
|
+
| File | Description |
|
|
159
|
+
|----------------------|-----------------------|
|
|
160
|
+
| `Dockerfile` | Multi-stage build |
|
|
161
|
+
| `docker-compose.yml` | Service configuration |
|
|
127
162
|
|
|
128
163
|
### Deploy
|
|
129
164
|
|
|
130
|
-
| File
|
|
131
|
-
|
|
132
|
-
| `fly.toml`
|
|
133
|
-
| `Procfile`
|
|
134
|
-
| `railway.json`
|
|
165
|
+
| File | Platform |
|
|
166
|
+
|----------------|----------|
|
|
167
|
+
| `fly.toml` | Fly.io |
|
|
168
|
+
| `Procfile` | Heroku |
|
|
169
|
+
| `railway.json` | Railway |
|
|
135
170
|
|
|
136
171
|
## Configuration (`pygenkit.toml`)
|
|
137
172
|
|
|
@@ -197,9 +232,10 @@ pygenkit doctor
|
|
|
197
232
|
```
|
|
198
233
|
|
|
199
234
|
Checks for:
|
|
235
|
+
|
|
200
236
|
- Python 3.12+
|
|
201
237
|
- Git
|
|
202
|
-
- GitHub CLI (gh)
|
|
238
|
+
- GitHub CLI (`gh`)
|
|
203
239
|
- GPG
|
|
204
240
|
- dput
|
|
205
241
|
- debhelper
|
|
@@ -208,13 +244,9 @@ Checks for:
|
|
|
208
244
|
|
|
209
245
|
## Publishing setup
|
|
210
246
|
|
|
211
|
-
PyPI publishing uses Trusted Publishing (OIDC), so it does not require a long-lived API
|
|
212
|
-
token. Configure the `pypi` environment on GitHub and authorize `release.yml` as a
|
|
213
|
-
Trusted Publisher for the `pygenkit` project on PyPI. Set the repository variable
|
|
214
|
-
`PYPI_ENABLED=true` to enable the publish step.
|
|
247
|
+
PyPI publishing uses Trusted Publishing (OIDC), so it does not require a long-lived API token. Configure the `pypi` environment on GitHub and authorize `release.yml` as a Trusted Publisher for the `pygenkit` project on PyPI. Set the repository variable `PYPI_ENABLED=true` to enable the publish step.
|
|
215
248
|
|
|
216
|
-
Launchpad publishing requires a PPA and an OpenPGP key registered with the Launchpad
|
|
217
|
-
account. Add these secrets to the `launchpad` GitHub environment:
|
|
249
|
+
Launchpad publishing requires a PPA and an OpenPGP key registered with the Launchpad account. Add these secrets to the `launchpad` GitHub environment:
|
|
218
250
|
|
|
219
251
|
- `GPG_PRIVATE_KEY`
|
|
220
252
|
- `GPG_PASSPHRASE`
|
|
@@ -222,7 +254,7 @@ account. Add these secrets to the `launchpad` GitHub environment:
|
|
|
222
254
|
|
|
223
255
|
## Architecture
|
|
224
256
|
|
|
225
|
-
```
|
|
257
|
+
```text
|
|
226
258
|
src/pygenkit/
|
|
227
259
|
├── cli/ # CLI commands (Typer)
|
|
228
260
|
│ └── commands/ # init, inspect, validate, generate, release-check, doctor
|
|
@@ -258,7 +290,7 @@ src/pygenkit/
|
|
|
258
290
|
|
|
259
291
|
PyGenKit itself follows the professional workflow it generates for other projects.
|
|
260
292
|
|
|
261
|
-
```
|
|
293
|
+
```text
|
|
262
294
|
feature branch → Pull Request → CI checks → merge to main → tag → release
|
|
263
295
|
```
|
|
264
296
|
|
|
@@ -288,33 +320,33 @@ git push origin v0.x.x # triggers Release workflow
|
|
|
288
320
|
|
|
289
321
|
### Branch naming
|
|
290
322
|
|
|
291
|
-
| Prefix
|
|
292
|
-
|
|
293
|
-
| `feat/*`
|
|
294
|
-
| `fix/*`
|
|
295
|
-
| `refactor/*` | Code improvements
|
|
296
|
-
| `docs/*`
|
|
297
|
-
| `ci/*`
|
|
323
|
+
| Prefix | Purpose |
|
|
324
|
+
|--------------|--------------------|
|
|
325
|
+
| `feat/*` | New features |
|
|
326
|
+
| `fix/*` | Bug fixes |
|
|
327
|
+
| `refactor/*` | Code improvements |
|
|
328
|
+
| `docs/*` | Documentation |
|
|
329
|
+
| `ci/*` | CI/CD changes |
|
|
298
330
|
|
|
299
331
|
## Branch Protection
|
|
300
332
|
|
|
301
|
-
The `main` branch
|
|
333
|
+
The `main` branch should be protected in the GitHub repository settings.
|
|
302
334
|
|
|
303
335
|
### Required settings
|
|
304
336
|
|
|
305
|
-
| Setting
|
|
306
|
-
|
|
307
|
-
| Require pull request before merging | Yes
|
|
308
|
-
| Require status checks to pass
|
|
309
|
-
| Block force pushes
|
|
310
|
-
| Restrict deletions
|
|
337
|
+
| Setting | Solo | Team |
|
|
338
|
+
|-------------------------------------|------|------|
|
|
339
|
+
| Require pull request before merging | Yes | Yes |
|
|
340
|
+
| Require status checks to pass | Yes | Yes |
|
|
341
|
+
| Block force pushes | Yes | Yes |
|
|
342
|
+
| Restrict deletions | Yes | Yes |
|
|
311
343
|
| Required approvals | 0 | 1 |
|
|
312
344
|
|
|
313
345
|
When working alone, skip approval requirements. When adding maintainers, set **Required approvals: 1**.
|
|
314
346
|
|
|
315
347
|
### How to configure
|
|
316
348
|
|
|
317
|
-
```
|
|
349
|
+
```text
|
|
318
350
|
GitHub repo → Settings → Branches → Add branch protection rule
|
|
319
351
|
Branch name pattern: main
|
|
320
352
|
☑ Require a pull request before merging
|
|
@@ -324,6 +356,15 @@ GitHub repo → Settings → Branches → Add branch protection rule
|
|
|
324
356
|
☑ Restrict deletions
|
|
325
357
|
```
|
|
326
358
|
|
|
359
|
+
## Roadmap
|
|
360
|
+
|
|
361
|
+
- Add richer CLI examples and screenshots
|
|
362
|
+
- Add code coverage reporting
|
|
363
|
+
- Add project templates for FastAPI, CLI tools, and libraries
|
|
364
|
+
- Add semantic versioning helpers
|
|
365
|
+
- Add optional plugin support for custom generators
|
|
366
|
+
- Expand release checks for PyPI, Debian, and Launchpad workflows
|
|
367
|
+
|
|
327
368
|
## Requirements
|
|
328
369
|
|
|
329
370
|
- Python 3.12+
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
__all__ = ["__version__"]
|
|
2
|
-
__version__ = "0.2.
|
|
2
|
+
__version__ = "0.2.4"
|
|
@@ -131,7 +131,7 @@ def check_cicd(root: Path) -> CategoryScore:
|
|
|
131
131
|
|
|
132
132
|
wf_dir = root / ".github" / "workflows"
|
|
133
133
|
if wf_dir.is_dir():
|
|
134
|
-
wf_files =
|
|
134
|
+
wf_files = detect_inspector.workflow_files(root)
|
|
135
135
|
score.details.append(f"{len(wf_files)} workflow file(s)")
|
|
136
136
|
if wf_files:
|
|
137
137
|
score.passed += 1
|
|
@@ -139,7 +139,7 @@ def check_cicd(root: Path) -> CategoryScore:
|
|
|
139
139
|
|
|
140
140
|
has_ci = any("ci" in f.name.lower() for f in wf_files)
|
|
141
141
|
has_release = any("release" in f.name.lower() for f in wf_files)
|
|
142
|
-
has_pypi =
|
|
142
|
+
has_pypi = detect_inspector.has_pypi_publish_workflow(root)
|
|
143
143
|
|
|
144
144
|
if has_ci:
|
|
145
145
|
score.passed += 1
|
|
@@ -210,7 +210,7 @@ def check_security(root: Path) -> CategoryScore:
|
|
|
210
210
|
wf_dir = root / ".github" / "workflows"
|
|
211
211
|
has_permissions = False
|
|
212
212
|
if wf_dir.is_dir():
|
|
213
|
-
for f in
|
|
213
|
+
for f in detect_inspector.workflow_files(root):
|
|
214
214
|
content = f.read_text(encoding="utf-8", errors="replace")
|
|
215
215
|
if "permissions:" in content:
|
|
216
216
|
has_permissions = True
|
|
@@ -83,16 +83,16 @@ def _inspect_workflows(root: Path) -> WorkflowInspection:
|
|
|
83
83
|
if not wf_dir.is_dir():
|
|
84
84
|
return wf
|
|
85
85
|
|
|
86
|
-
for f in
|
|
86
|
+
for f in detect_inspector.workflow_files(root):
|
|
87
87
|
wf.files.append(f.name)
|
|
88
88
|
content = f.read_text(encoding="utf-8", errors="replace")
|
|
89
|
-
if "pypi" in content.lower() or "publish" in content.lower():
|
|
90
|
-
wf.has_pypi_publish = True
|
|
91
89
|
if "launchpad" in content.lower() or "ppa" in content.lower():
|
|
92
90
|
wf.has_launchpad = True
|
|
93
91
|
if "test" in content.lower() or "lint" in content.lower():
|
|
94
92
|
wf.has_ci = True
|
|
95
93
|
|
|
94
|
+
wf.has_pypi_publish = detect_inspector.has_pypi_publish_workflow(root)
|
|
95
|
+
|
|
96
96
|
return wf
|
|
97
97
|
|
|
98
98
|
|