-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
241 lines (212 loc) · 5.95 KB
/
pyproject.toml
File metadata and controls
241 lines (212 loc) · 5.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
[project]
name = "forging-blocks"
version = "0.3.22"
description = "Composable toolkit for clean, testable, and maintainable Python applications"
authors = [
{ name = "ForgingBlocks Org", email = "forging-blocks-org@proton.me" }
]
license = "MIT"
readme = "README.md"
requires-python = ">=3.14"
dynamic = ["dependencies"]
keywords = [
"clean-architecture",
"hexagonal-architecture",
"foundation",
"ddd",
"domain-driven-design",
"architecture",
"result-type",
"dependency-inversion",
"ports-and-adapters",
"python",
"toolkit",
"framework-agnostic",
"testable",
"maintainable"
]
[project.urls]
homepage = "https://forging-blocks-org.github.io"
repository = "https://github.com/forging-blocks-org/forging-blocks"
[project.scripts]
repl = "IPython:start_ipython"
[tool.poetry]
packages = [{ include = "forging_blocks", from = "src" }]
[tool.poetry.group.dev.dependencies]
ruff = "^0.14.3"
mypy = "^1.16.1"
pytest = "^8.3.3"
pytest-cov = "^5.0.0"
pytest-asyncio = "^1.0.0"
bandit = "^1.7.10"
pre-commit = "^4.2.0"
pyright = "^1.1.404"
poethepoet = "^0.37.0"
libcst = "^1.8.6"
rich = "^14.2.0"
ipython = "^9.8.0"
pytest-git = "^1.8.0"
types-pyyaml = "^6.0.12.20250915"
pyyaml = "^6.0.3"
[tool.poetry.group.docs.dependencies]
mkdocs = "^1.6.1"
mkdocs-material = "^9.6.23"
mkdocstrings = { extras = ["python"], version = "^0.30.1" }
mkdocs-gen-files = "^0.5.0"
mkdocs-literate-nav = "^0.6.2"
mkdocs-autorefs = "^1.4.3"
mkdocs-mermaid2-plugin = "^1.2.3"
mkdocs-section-index = "^0.3.10"
mike = "^2.1.3"
pygments = "^2.19.2"
[[tool.poetry.source]]
name = "testpypi"
url = "https://test.pypi.org/simple/"
priority = "explicit"
[build-system]
requires = ["poetry-core>=1.9.0"]
build-backend = "poetry.core.masonry.api"
[tool.pyright]
venvPath = "."
venv = ".venv"
include = ["src", "tests", "scripts"]
extraPaths = ["src", "scripts"]
exclude = [
"**/site",
"**/__pycache__",
"**/.venv",
"**/build",
"**/dist",
"**/.mypy_cache",
"**/.ruff_cache",
"**/node_modules",
]
typeCheckingMode = "standard"
reportMissingImports = true
reportMissingTypeStubs = false
[tool.ruff]
target-version = "py314"
line-length = 100
src = ["src", "tests", "scripts"]
fix = true
[tool.ruff.lint]
select = ["E", "W", "F", "I", "B", "C4"]
ignore = ["B008"] # Only ignore function calls in argument defaults
per-file-ignores = {"tests/**" = ["E501", "B011"]} # Allow long lines and assert False in tests
[tool.ruff.lint.isort]
known-first-party = ["forging_blocks"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
docstring-code-format = true
[tool.coverage.run]
omit = [
"**/__init__.py",
"*/foundation/debuggable.py",
"*/foundation/mapper.py",
"*/foundation/result.py",
"*/foundation/result_mapper.py",
"*/foundation/ports.py",
"*/application/ports/outbound/notifier.py",
"*/application/ports/outbound/repository.py",
"**/inbound.py",
"**/outbound.py",
]
[tool.coverage.report]
exclude_lines = [
"# pragma: no cover",
"if TYPE_CHECKING:",
"class .*\\(.*Protocol.*\\):",
"raise NotImplementedError",
"@abstractmethod",
"\\.\\.\\.",
"pass",
"TypeVar\\(",
"Generic\\(",
"Protocol\\(",
]
[tool.mypy]
python_version = "3.14"
disallow_untyped_defs = true
warn_unused_ignores = true
strict_equality = true
show_error_codes = true
mypy_path = "src"
exclude = ["tests/*"]
[tool.pytest.ini_options]
testpaths = ["tests"]
pythonpath = ["src", "scripts", "scripts/release"]
asyncio_mode = "auto"
addopts = [
"--strict-markers",
"--strict-config",
"--cov=forging_blocks",
"--cov=scripts/release",
"--cov-report=term-missing",
"--cov-fail-under=90",
]
markers = [
"unit: mark tests as unit tests",
"integration: mark tests as integration tests",
"e2e: mark tests as end-to-end tests",
]
[tool.poe.tasks]
type = "mypy ."
bandit = "bandit -r src -x tests"
test = { env = { "RUN_GITHUB_CLI_TESTS" = "1", "RUN_E2E_TESTS" = "1" }, cmd = "pytest" }
"test:unit" = "pytest -m unit"
"test:integration" = "pytest -m integration"
"test:e2e" = "pytest -m e2e"
"test:debug" = "pytest -x -vvv -s"
"docs:generate" = { cmd = "python scripts/generate_autodoc_pages.py" }
"docs:build".sequence = [
"docs:generate",
{ cmd = "poetry run mkdocs build --strict" }
]
"docs:serve" = { cmd = "poetry run mkdocs serve" }
"ci:check".sequence = [
"lint:shell",
"lint:contracts",
"lint",
"type",
"test",
"bandit",
]
"ci:simulate".sequence = [
"ci:check",
"docs:build"
]
"ci:release".sequence = [
"ci:simulate",
{ cmd = "poetry build" },
{ shell = "VERSION=$(poetry version -s)" },
{ shell = "echo 'Release candidate validated for version $VERSION'" }
]
"ci:release:validate".sequence = [
"ci:check",
{ cmd = "poetry build" }
]
lint = { cmd = "ruff check ." }
"lint:fix" = { cmd = "ruff check . --fix" }
"lint:shell" = { cmd = "shellcheck --external-sources scripts/pipeline/*.sh" }
"lint:contracts" = { cmd = "python scripts/pipeline/validate_env_contracts.py" }
"release:validate".sequence = [
{ shell = "echo 'Validating release readiness...'" },
{ shell = "git rev-parse --abbrev-ref HEAD | grep -qx main || (echo 'ERROR: must start from main' && exit 1)" },
{ shell = "git diff --quiet || (echo 'ERROR: working tree not clean' && exit 1)" },
{ cmd = "git fetch origin --tags" },
{ shell = "git diff --quiet origin/main...HEAD || (echo 'ERROR: local main differs from origin/main' && exit 1)" },
"ci:release:validate",
{ shell = "echo 'OK: release validated'" }
]
"release:validate:remote".sequence = [
{ shell = "bash scripts/validate_release_remote.sh" }
]
"release:validate:github".shell = """
echo 'Validating GitHub workflow without publishing...'
BRANCH=$(git branch --show-current)
gh workflow run validate-release.yml -f release_branch="$BRANCH"
echo 'Validation workflow triggered. Check status with:'
echo ' gh run list --workflow validate-release.yml'
"""
release = { cmd = "python -m scripts.release.presentation", env = { "PYTHONPATH" = "src:scripts:scripts/release" } }