-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
170 lines (157 loc) · 5.33 KB
/
pyproject.toml
File metadata and controls
170 lines (157 loc) · 5.33 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
[project]
name = "nene2-python"
version = "1.8.97"
description = "NENE2 Python — minimal API framework following NENE2's design philosophy"
readme = "README.md"
license = {text = "MIT"}
authors = [{name = "hideyukiMORI", email = "info.xion.cc@gmail.com"}]
requires-python = ">=3.12"
keywords = ["fastapi", "pydantic", "sqlalchemy", "mcp", "api", "framework", "clean-architecture"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Framework :: FastAPI",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Internet :: WWW/HTTP :: HTTP Servers",
"Topic :: Software Development :: Libraries :: Application Frameworks",
"Typing :: Typed",
]
dependencies = [
"fastapi>=0.115",
"uvicorn[standard]>=0.32",
"pydantic>=2.9",
"pydantic-settings>=2.6",
"python-multipart>=0.0.12",
"sqlalchemy>=2.0.49",
"alembic>=1.18.4",
"structlog>=24.0",
"mcp>=1.0",
"pyyaml>=6.0",
"httpx>=0.27",
]
[project.urls]
Homepage = "https://github.com/hideyukiMORI/nene2-python"
Repository = "https://github.com/hideyukiMORI/nene2-python"
Documentation = "https://hideyukimori.github.io/nene2-python/"
"Bug Tracker" = "https://github.com/hideyukiMORI/nene2-python/issues"
[project.optional-dependencies]
dev = [
"pytest>=8.3",
"pytest-asyncio>=0.24",
"pytest-cov>=6.0",
"httpx>=0.27",
"mypy>=1.13",
"ruff>=0.9",
"pip-audit>=2.7",
]
[dependency-groups]
dev = [
"pytest>=8.3",
"pytest-asyncio>=0.24",
"pytest-cov>=6.0",
"httpx>=0.27",
"mypy>=1.13",
"ruff>=0.9",
"pip-audit>=2.7",
"psycopg2-binary>=2.9.12",
]
# ---------------------------------------------------------------------------
# pytest
# ---------------------------------------------------------------------------
[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = ["tests"]
addopts = "--cov=src --cov-report=term-missing --cov-fail-under=80"
filterwarnings = [
# StaticPool keeps one connection alive by design; dispose() does not fully close it.
# Fires only during interpreter shutdown on the module-level app singleton.
"ignore:unclosed database:ResourceWarning",
]
# ---------------------------------------------------------------------------
# coverage
# ---------------------------------------------------------------------------
[tool.coverage.run]
source = ["src"]
branch = true
[tool.coverage.report]
fail_under = 80
show_missing = true
exclude_lines = [
"pragma: no cover",
"if TYPE_CHECKING:",
"raise NotImplementedError",
"@(abc\\.)?abstractmethod",
"def __repr__",
]
# ---------------------------------------------------------------------------
# mypy — strict + unreachable detection
# ---------------------------------------------------------------------------
[tool.mypy]
python_version = "3.12"
strict = true
warn_unreachable = true
files = ["src"]
# ---------------------------------------------------------------------------
# ruff — lint + format
# ---------------------------------------------------------------------------
[tool.ruff]
target-version = "py312"
line-length = 100
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"UP", # pyupgrade — enforce modern Python syntax
"ANN", # flake8-annotations — all functions must be typed
"N", # pep8-naming
"B", # flake8-bugbear — likely bugs and design problems
"SIM", # flake8-simplify
"S", # flake8-bandit — security anti-patterns
"T20", # flake8-print — no print() in production code
"PTH", # flake8-use-pathlib — pathlib over os.path
"RET", # flake8-return — consistent return patterns
"TRY", # tryceratops — try-except patterns
"PERF", # perflint — performance anti-patterns
"PL", # pylint
"LOG", # flake8-logging
"G", # flake8-logging-format
"DTZ", # flake8-datetimez — datetime.now() naive 呼び出し検出
]
ignore = [
# PHP NENE2 naming convention: Exception/Error suffix (not "Error"-only)
"N818",
# Allow long raise messages for clarity
"TRY003",
# Allow assert in non-test code when semantically appropriate
# (tests override this via per-file-ignores)
# Magic value comparisons are sometimes clearer than named constants
"PLR2004",
# Too many arguments/branches — enforce via code review, not hard limit
"PLR0913",
"PLR0912",
# TRY301: Abstract raise to an inner function — too verbose for most cases
"TRY301",
]
[tool.ruff.lint.per-file-ignores]
# Tests: relax annotations, allow assert, allow magic values
# DTZ: tests intentionally create naive datetimes to test parse_db_datetime conversion
"tests/**" = ["ANN", "S101", "PLR2004", "PLR0913", "DTZ"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
docstring-code-format = true
# ---------------------------------------------------------------------------
# build
# ---------------------------------------------------------------------------
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/nene2"]