diamond-setup 1.0.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.
@@ -0,0 +1,48 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main, master]
6
+ pull_request:
7
+
8
+ jobs:
9
+ test:
10
+ name: Test (Python ${{ matrix.python-version }})
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ fail-fast: false
14
+ matrix:
15
+ python-version: ["3.11", "3.12"]
16
+
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+
20
+ - name: Install uv
21
+ uses: astral-sh/setup-uv@v5
22
+ with:
23
+ version: "latest"
24
+
25
+ - name: Set up Python ${{ matrix.python-version }}
26
+ run: uv python install ${{ matrix.python-version }}
27
+
28
+ - name: Install dependencies
29
+ run: uv sync --extra dev
30
+
31
+ - name: Lint (ruff)
32
+ run: uv run ruff check .
33
+
34
+ - name: Format check (ruff)
35
+ run: uv run ruff format --check .
36
+
37
+ - name: Run tests
38
+ run: uv run pytest
39
+
40
+ docs:
41
+ name: Build docs
42
+ runs-on: ubuntu-latest
43
+ steps:
44
+ - uses: actions/checkout@v4
45
+ - uses: astral-sh/setup-uv@v5
46
+ - run: uv python install 3.11
47
+ - run: uv sync --extra docs
48
+ - run: uv run mkdocs build --strict
@@ -0,0 +1,22 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.egg-info/
5
+ .eggs/
6
+ dist/
7
+ build/
8
+ .venv/
9
+ .uv/
10
+
11
+ # Testing
12
+ .coverage
13
+ htmlcov/
14
+ .pytest_cache/
15
+
16
+ # Docs
17
+ site/
18
+
19
+ # Editors
20
+ .vscode/
21
+ .idea/
22
+ *.swp
@@ -0,0 +1,17 @@
1
+ repos:
2
+ - repo: https://github.com/astral-sh/ruff-pre-commit
3
+ rev: v0.6.0
4
+ hooks:
5
+ - id: ruff
6
+ args: [--fix]
7
+ - id: ruff-format
8
+
9
+ - repo: https://github.com/pre-commit/pre-commit-hooks
10
+ rev: v4.6.0
11
+ hooks:
12
+ - id: trailing-whitespace
13
+ - id: end-of-file-fixer
14
+ - id: check-yaml
15
+ - id: check-toml
16
+ - id: check-merge-conflict
17
+ - id: debug-statements
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 JohannRömer
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,117 @@
1
+ Metadata-Version: 2.4
2
+ Name: diamond-setup
3
+ Version: 1.0.0
4
+ Summary: Universal Python project scaffold — generate professional project skeletons in seconds
5
+ Project-URL: Repository, https://github.com/GenesisAeon/diamond-setup
6
+ Project-URL: Issues, https://github.com/GenesisAeon/diamond-setup/issues
7
+ Author: GenesisAeon
8
+ License: MIT
9
+ License-File: LICENSE
10
+ Keywords: cli,project-generator,scaffold,skeleton,template
11
+ Classifier: Development Status :: 5 - Production/Stable
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Topic :: Software Development :: Code Generators
19
+ Requires-Python: >=3.11
20
+ Requires-Dist: pydantic>=2.7
21
+ Requires-Dist: pyyaml>=6.0
22
+ Requires-Dist: rich>=13.7.0
23
+ Requires-Dist: typer>=0.12.0
24
+ Provides-Extra: dev
25
+ Requires-Dist: pre-commit>=3.7.0; extra == 'dev'
26
+ Requires-Dist: pytest-cov>=5.0.0; extra == 'dev'
27
+ Requires-Dist: pytest>=8.0.0; extra == 'dev'
28
+ Requires-Dist: ruff>=0.6.0; extra == 'dev'
29
+ Provides-Extra: docs
30
+ Requires-Dist: mkdocs-material>=9.5.0; extra == 'docs'
31
+ Requires-Dist: mkdocs>=1.6.0; extra == 'docs'
32
+ Description-Content-Type: text/markdown
33
+
34
+ # diamond-setup
35
+
36
+ **Universal Python project scaffold** — generate professional, CI-ready skeletons in seconds.
37
+
38
+ [![CI](https://github.com/GenesisAeon/diamond-setup/actions/workflows/ci.yml/badge.svg)](https://github.com/GenesisAeon/diamond-setup/actions/workflows/ci.yml)
39
+ [![Python 3.11+](https://img.shields.io/badge/python-3.11%2B-blue)](https://www.python.org)
40
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
41
+
42
+ No cookiecutter, no Jinja2, no magic. Just a clean CLI that produces a fully working project — `uv sync`, `pytest`, ruff, pre-commit and CI all wired up from second one.
43
+
44
+ ---
45
+
46
+ ## Install
47
+
48
+ ```bash
49
+ pip install diamond-setup
50
+ # or
51
+ uv tool install diamond-setup
52
+ ```
53
+
54
+ ## Usage
55
+
56
+ ```bash
57
+ # New project with the minimal template (default)
58
+ diamond scaffold my-lib
59
+
60
+ # GenesisAeon preset (adds domains.yaml + entropy-table bridge)
61
+ diamond scaffold my-physics-tool --template genesis --author "Ada Lovelace"
62
+
63
+ # Preview what would be generated (no files written)
64
+ diamond scaffold my-lib --dry-run
65
+
66
+ # See all templates
67
+ diamond list-templates
68
+
69
+ # Validate any project directory
70
+ diamond validate path/to/my-project
71
+ diamond validate # validates the current directory
72
+ ```
73
+
74
+ ## What you get
75
+
76
+ Running `diamond scaffold my-lib` produces:
77
+
78
+ ```
79
+ my-lib/
80
+ ├── src/
81
+ │ └── my_lib/
82
+ │ └── __init__.py # __version__ = "0.1.0"
83
+ ├── tests/
84
+ │ ├── __init__.py
85
+ │ └── test_main.py
86
+ ├── .github/
87
+ │ └── workflows/
88
+ │ └── ci.yml # matrix: 3.11 + 3.12
89
+ ├── pyproject.toml # hatchling, ruff, pytest configured
90
+ ├── README.md
91
+ ├── .gitignore
92
+ └── .pre-commit-config.yaml # ruff + standard hooks
93
+ ```
94
+
95
+ Then just:
96
+
97
+ ```bash
98
+ cd my-lib
99
+ uv sync --dev
100
+ pre-commit install
101
+ uv run pytest
102
+ ```
103
+
104
+ ## Templates
105
+
106
+ | Template | Description |
107
+ |----------|-------------|
108
+ | `minimal` | Clean Python package for everyone |
109
+ | `genesis` | Adds `domains.yaml` + entropy-table bridge (GenesisAeon preset) |
110
+
111
+ ## Extending
112
+
113
+ Adding a new template is one Python file. See [docs/templates.md](docs/templates.md).
114
+
115
+ ---
116
+
117
+ Built with [uv](https://docs.astral.sh/uv/) · [Typer](https://typer.tiangolo.com/) · [Rich](https://rich.readthedocs.io/)
@@ -0,0 +1,84 @@
1
+ # diamond-setup
2
+
3
+ **Universal Python project scaffold** — generate professional, CI-ready skeletons in seconds.
4
+
5
+ [![CI](https://github.com/GenesisAeon/diamond-setup/actions/workflows/ci.yml/badge.svg)](https://github.com/GenesisAeon/diamond-setup/actions/workflows/ci.yml)
6
+ [![Python 3.11+](https://img.shields.io/badge/python-3.11%2B-blue)](https://www.python.org)
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
8
+
9
+ No cookiecutter, no Jinja2, no magic. Just a clean CLI that produces a fully working project — `uv sync`, `pytest`, ruff, pre-commit and CI all wired up from second one.
10
+
11
+ ---
12
+
13
+ ## Install
14
+
15
+ ```bash
16
+ pip install diamond-setup
17
+ # or
18
+ uv tool install diamond-setup
19
+ ```
20
+
21
+ ## Usage
22
+
23
+ ```bash
24
+ # New project with the minimal template (default)
25
+ diamond scaffold my-lib
26
+
27
+ # GenesisAeon preset (adds domains.yaml + entropy-table bridge)
28
+ diamond scaffold my-physics-tool --template genesis --author "Ada Lovelace"
29
+
30
+ # Preview what would be generated (no files written)
31
+ diamond scaffold my-lib --dry-run
32
+
33
+ # See all templates
34
+ diamond list-templates
35
+
36
+ # Validate any project directory
37
+ diamond validate path/to/my-project
38
+ diamond validate # validates the current directory
39
+ ```
40
+
41
+ ## What you get
42
+
43
+ Running `diamond scaffold my-lib` produces:
44
+
45
+ ```
46
+ my-lib/
47
+ ├── src/
48
+ │ └── my_lib/
49
+ │ └── __init__.py # __version__ = "0.1.0"
50
+ ├── tests/
51
+ │ ├── __init__.py
52
+ │ └── test_main.py
53
+ ├── .github/
54
+ │ └── workflows/
55
+ │ └── ci.yml # matrix: 3.11 + 3.12
56
+ ├── pyproject.toml # hatchling, ruff, pytest configured
57
+ ├── README.md
58
+ ├── .gitignore
59
+ └── .pre-commit-config.yaml # ruff + standard hooks
60
+ ```
61
+
62
+ Then just:
63
+
64
+ ```bash
65
+ cd my-lib
66
+ uv sync --dev
67
+ pre-commit install
68
+ uv run pytest
69
+ ```
70
+
71
+ ## Templates
72
+
73
+ | Template | Description |
74
+ |----------|-------------|
75
+ | `minimal` | Clean Python package for everyone |
76
+ | `genesis` | Adds `domains.yaml` + entropy-table bridge (GenesisAeon preset) |
77
+
78
+ ## Extending
79
+
80
+ Adding a new template is one Python file. See [docs/templates.md](docs/templates.md).
81
+
82
+ ---
83
+
84
+ Built with [uv](https://docs.astral.sh/uv/) · [Typer](https://typer.tiangolo.com/) · [Rich](https://rich.readthedocs.io/)
@@ -0,0 +1,88 @@
1
+ # CLI Reference
2
+
3
+ ## `diamond scaffold`
4
+
5
+ Create a new project from a template.
6
+
7
+ ```
8
+ Usage: diamond scaffold [OPTIONS] PROJECT_NAME
9
+
10
+ Arguments:
11
+ PROJECT_NAME Name of the new project (kebab-case recommended)
12
+
13
+ Options:
14
+ -t, --template TEXT Template to use [default: minimal]
15
+ -o, --output-dir PATH Parent directory for the new project
16
+ --author TEXT Author name
17
+ --description TEXT Short project description
18
+ --python-version TEXT Minimum Python version (e.g. 3.11)
19
+ --dry-run Preview files without writing them
20
+ ```
21
+
22
+ **Examples**
23
+
24
+ ```bash
25
+ # Minimal project in the current directory
26
+ diamond scaffold my-lib
27
+
28
+ # Genesis preset with custom author
29
+ diamond scaffold my-physics-tool --template genesis --author "Ada Lovelace"
30
+
31
+ # Preview what would be created
32
+ diamond scaffold my-lib --dry-run
33
+
34
+ # Output to a specific directory
35
+ diamond scaffold my-lib --output-dir ~/projects
36
+ ```
37
+
38
+ ---
39
+
40
+ ## `diamond list-templates`
41
+
42
+ List all available templates with their descriptions.
43
+
44
+ ```bash
45
+ diamond list-templates
46
+ ```
47
+
48
+ ---
49
+
50
+ ## `diamond validate`
51
+
52
+ Validate a project directory against diamond-setup best practices.
53
+
54
+ ```
55
+ Usage: diamond validate [PATH]
56
+
57
+ Arguments:
58
+ PATH Project directory to validate [default: current directory]
59
+ ```
60
+
61
+ Checks performed:
62
+
63
+ | Check | Level |
64
+ |-------|-------|
65
+ | `pyproject.toml` present | **Error** |
66
+ | `src/` layout present | Warning |
67
+ | `tests/` directory present | Warning |
68
+ | `.github/workflows/` present | Warning |
69
+ | `README.md` present | Warning |
70
+ | `.gitignore` present | Warning |
71
+
72
+ ```bash
73
+ # Validate the current directory
74
+ diamond validate
75
+
76
+ # Validate a specific project
77
+ diamond validate path/to/my-project
78
+ ```
79
+
80
+ ---
81
+
82
+ ## `diamond version`
83
+
84
+ Print the installed version.
85
+
86
+ ```bash
87
+ diamond version
88
+ ```
@@ -0,0 +1,37 @@
1
+ # Diamond Setup
2
+
3
+ **Universal Python project scaffold** — generate professional, CI-ready project skeletons in seconds.
4
+
5
+ No cookiecutter, no Jinja2, no magic. Just a clean CLI, sensible templates, and a validator that keeps your projects healthy.
6
+
7
+ ## Quickstart
8
+
9
+ ```bash
10
+ pip install diamond-setup
11
+ # or with uv:
12
+ uv tool install diamond-setup
13
+ ```
14
+
15
+ ```bash
16
+ diamond scaffold my-new-tool
17
+ cd my-new-tool && uv sync --dev && uv run pytest
18
+ ```
19
+
20
+ ## Why Diamond Setup?
21
+
22
+ | Feature | diamond-setup | cookiecutter | copier |
23
+ |---------|:---:|:---:|:---:|
24
+ | Zero config needed | ✅ | ❌ | ❌ |
25
+ | Built-in validator | ✅ | ❌ | ❌ |
26
+ | Pure Python templates | ✅ | ❌ | ❌ |
27
+ | `--dry-run` support | ✅ | ❌ | ✅ |
28
+ | Extensible presets | ✅ | ✅ | ✅ |
29
+
30
+ ## Commands
31
+
32
+ | Command | Description |
33
+ |---------|-------------|
34
+ | `diamond scaffold <name>` | Create a new project |
35
+ | `diamond list-templates` | Show available templates |
36
+ | `diamond validate [path]` | Check a project's health |
37
+ | `diamond version` | Show version |
@@ -0,0 +1,111 @@
1
+ # Templates
2
+
3
+ Diamond Setup ships two built-in templates. Adding your own is a single Python file.
4
+
5
+ ---
6
+
7
+ ## `minimal`
8
+
9
+ **The default.** A clean, modern Python project with everything you need and nothing you don't.
10
+
11
+ ```bash
12
+ diamond scaffold my-lib
13
+ diamond scaffold my-lib --template minimal
14
+ ```
15
+
16
+ ### Files generated
17
+
18
+ ```
19
+ my-lib/
20
+ ├── src/
21
+ │ └── my_lib/
22
+ │ └── __init__.py
23
+ ├── tests/
24
+ │ ├── __init__.py
25
+ │ └── test_main.py
26
+ ├── .github/
27
+ │ └── workflows/
28
+ │ └── ci.yml
29
+ ├── pyproject.toml
30
+ ├── README.md
31
+ ├── .gitignore
32
+ └── .pre-commit-config.yaml
33
+ ```
34
+
35
+ ### Variables
36
+
37
+ | Variable | Default | Description |
38
+ |----------|---------|-------------|
39
+ | `name` | *(required)* | Project name |
40
+ | `description` | `"A Python project"` | Short description |
41
+ | `author` | `"Your Name"` | Author name |
42
+ | `python_version` | `"3.11"` | Minimum Python version |
43
+
44
+ ---
45
+
46
+ ## `genesis`
47
+
48
+ A superset of `minimal` — adds a `domains.yaml` for domain/metric configuration and an `entropy-table` YAML bridge module.
49
+
50
+ ```bash
51
+ diamond scaffold my-physics-tool --template genesis
52
+ ```
53
+
54
+ ### Extra files
55
+
56
+ ```
57
+ my-physics-tool/
58
+ ├── domains.yaml ← domain/metric configuration
59
+ ├── config/
60
+ │ └── entropy.yaml ← entropy-table bridge config
61
+ └── src/
62
+ └── my_physics_tool/
63
+ ├── __init__.py
64
+ └── bridge.py ← entropy-table export function
65
+ ```
66
+
67
+ ### Extra variables
68
+
69
+ | Variable | Default | Description |
70
+ |----------|---------|-------------|
71
+ | `metrics` | `"crep"` | Default metrics identifier |
72
+
73
+ ---
74
+
75
+ ## Adding a Custom Template
76
+
77
+ 1. Create `src/diamond_setup/templates/my_template.py`:
78
+
79
+ ```python
80
+ TEMPLATE = {
81
+ "name": "my_template",
82
+ "description": "My custom template",
83
+ "variables": ["name", "description", "author", "python_version"],
84
+ "defaults": {
85
+ "description": "My project",
86
+ "author": "Your Name",
87
+ "python_version": "3.11",
88
+ },
89
+ "files": {
90
+ "README.md": "# ${name}\n\n${description}\n",
91
+ "pyproject.toml": "...",
92
+ # keys are relative paths, values are template strings
93
+ # use ${variable} for substitution
94
+ # use $$ for a literal dollar sign
95
+ },
96
+ }
97
+ ```
98
+
99
+ 2. Register it in `src/diamond_setup/templates/__init__.py`:
100
+
101
+ ```python
102
+ from .my_template import TEMPLATE as MY_TEMPLATE
103
+
104
+ REGISTRY: dict[str, dict] = {
105
+ "minimal": MINIMAL_TEMPLATE,
106
+ "genesis": GENESIS_TEMPLATE,
107
+ "my_template": MY_TEMPLATE, # ← add this
108
+ }
109
+ ```
110
+
111
+ That's it. `diamond list-templates` will immediately show it.
@@ -0,0 +1,43 @@
1
+ site_name: Diamond Setup
2
+ site_description: Universal Python project scaffold — generate professional project skeletons in seconds
3
+ site_author: GenesisAeon
4
+ repo_url: https://github.com/GenesisAeon/diamond-setup
5
+ repo_name: GenesisAeon/diamond-setup
6
+
7
+ theme:
8
+ name: material
9
+ palette:
10
+ - media: "(prefers-color-scheme: light)"
11
+ scheme: default
12
+ primary: indigo
13
+ accent: indigo
14
+ toggle:
15
+ icon: material/brightness-7
16
+ name: Switch to dark mode
17
+ - media: "(prefers-color-scheme: dark)"
18
+ scheme: slate
19
+ primary: indigo
20
+ accent: indigo
21
+ toggle:
22
+ icon: material/brightness-4
23
+ name: Switch to light mode
24
+ features:
25
+ - navigation.tabs
26
+ - navigation.sections
27
+ - navigation.top
28
+ - content.code.annotate
29
+ - content.code.copy
30
+ - search.highlight
31
+
32
+ markdown_extensions:
33
+ - admonition
34
+ - pymdownx.highlight:
35
+ anchor_linenums: true
36
+ - pymdownx.superfences
37
+ - pymdownx.tabbed:
38
+ alternate_style: true
39
+
40
+ nav:
41
+ - Home: index.md
42
+ - CLI Reference: cli.md
43
+ - Templates: templates.md
@@ -0,0 +1,70 @@
1
+ [project]
2
+ name = "diamond-setup"
3
+ version = "1.0.0"
4
+ description = "Universal Python project scaffold — generate professional project skeletons in seconds"
5
+ readme = "README.md"
6
+ license = { text = "MIT" }
7
+ authors = [{ name = "GenesisAeon" }]
8
+ requires-python = ">=3.11"
9
+ keywords = ["scaffold", "template", "cli", "project-generator", "skeleton"]
10
+ classifiers = [
11
+ "Development Status :: 5 - Production/Stable",
12
+ "Environment :: Console",
13
+ "Intended Audience :: Developers",
14
+ "License :: OSI Approved :: MIT License",
15
+ "Programming Language :: Python :: 3",
16
+ "Programming Language :: Python :: 3.11",
17
+ "Programming Language :: Python :: 3.12",
18
+ "Topic :: Software Development :: Code Generators",
19
+ ]
20
+ dependencies = [
21
+ "typer>=0.12.0",
22
+ "rich>=13.7.0",
23
+ "pyyaml>=6.0",
24
+ "pydantic>=2.7",
25
+ ]
26
+
27
+ [project.optional-dependencies]
28
+ docs = [
29
+ "mkdocs>=1.6.0",
30
+ "mkdocs-material>=9.5.0",
31
+ ]
32
+ dev = [
33
+ "ruff>=0.6.0",
34
+ "pre-commit>=3.7.0",
35
+ "pytest>=8.0.0",
36
+ "pytest-cov>=5.0.0",
37
+ ]
38
+
39
+ [project.scripts]
40
+ diamond = "diamond_setup.cli:app"
41
+
42
+ [project.urls]
43
+ Repository = "https://github.com/GenesisAeon/diamond-setup"
44
+ Issues = "https://github.com/GenesisAeon/diamond-setup/issues"
45
+
46
+ [build-system]
47
+ requires = ["hatchling"]
48
+ build-backend = "hatchling.build"
49
+
50
+ [tool.hatch.build.targets.wheel]
51
+ packages = ["src/diamond_setup"]
52
+
53
+ [tool.ruff]
54
+ line-length = 100
55
+ target-version = "py311"
56
+
57
+ [tool.ruff.lint]
58
+ select = ["E", "F", "B", "I", "W", "UP", "C4", "SIM"]
59
+ ignore = ["B008"] # typer uses function calls in defaults
60
+
61
+ [tool.ruff.lint.per-file-ignores]
62
+ "tests/**" = ["S101"] # allow assert in tests
63
+
64
+ [tool.pytest.ini_options]
65
+ testpaths = ["tests"]
66
+ addopts = "--cov=diamond_setup --cov-report=term-missing -v"
67
+
68
+ [tool.coverage.run]
69
+ source = ["src"]
70
+ omit = ["tests/*"]
@@ -0,0 +1,4 @@
1
+ """Diamond Setup — universal Python project scaffold."""
2
+
3
+ __version__ = "1.0.0"
4
+ __author__ = "GenesisAeon"