-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
170 lines (155 loc) · 4.65 KB
/
pyproject.toml
File metadata and controls
170 lines (155 loc) · 4.65 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 = "flask-postgres-otel"
version = "1.0.0"
description = "Flask REST API with PostgreSQL and OpenTelemetry instrumentation"
readme = "README.md"
license = { text = "MIT" }
requires-python = ">=3.14"
authors = [{ name = "base14", email = "[email protected]" }]
keywords = ["flask", "postgresql", "opentelemetry", "observability", "celery"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Framework :: Flask",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.14",
"Topic :: Internet :: WWW/HTTP :: WSGI :: Application",
"Topic :: System :: Monitoring",
"Typing :: Typed",
]
dependencies = [
"flask>=3.1,<4.0",
"flask-sqlalchemy>=3.1,<4.0",
"sqlalchemy>=2.0,<3.0",
"psycopg[binary]>=3.2",
"marshmallow>=4.1,<5.0",
"flask-marshmallow>=1.3,<2.0",
"celery>=5.6,<6.0",
"redis>=5.2,<6.0",
"PyJWT>=2.10,<3.0",
"python-dotenv>=1.0",
"gunicorn>=23.0",
"opentelemetry-sdk>=1.39",
"opentelemetry-exporter-otlp>=1.39",
"opentelemetry-instrumentation-flask>=0.60b1",
"opentelemetry-instrumentation-sqlalchemy>=0.60b1",
"opentelemetry-instrumentation-celery>=0.60b1",
"opentelemetry-instrumentation-redis>=0.60b1",
"opentelemetry-instrumentation-logging>=0.60b1",
]
[project.optional-dependencies]
dev = [
"pytest>=8.0",
"pytest-cov>=6.0",
"ruff>=0.9",
"mypy>=1.14",
]
[project.urls]
Homepage = "https://github.com/base-14/examples"
Documentation = "https://docs.base14.io"
Repository = "https://github.com/base-14/examples"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["app"]
# Ruff - Python 3.14 compatible linter/formatter (Dec 2025)
[tool.ruff]
target-version = "py314"
line-length = 100
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # Pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
"ARG", # flake8-unused-arguments
"SIM", # flake8-simplify
"TCH", # flake8-type-checking
"PTH", # flake8-use-pathlib
"ERA", # eradicate (commented code)
"PL", # Pylint
"RUF", # Ruff-specific rules
]
ignore = [
"E501", # line too long (handled by formatter)
"PLR0913", # too many arguments
"PLR2004", # magic value comparison
"PLC0415", # non-top-level imports (Flask app factory pattern)
"ARG001", # unused function argument (Flask handlers, pytest fixtures)
"ARG002", # unused method argument (pytest fixtures as method params)
"PLW0603", # global statement (telemetry module init)
"RUF012", # mutable class attribute default (Flask/Django config pattern)
"TC001", # move app import to TYPE_CHECKING (used at runtime)
"TC002", # move third-party import to TYPE_CHECKING (used at runtime)
"TC003", # move stdlib import to TYPE_CHECKING (used at runtime)
"UP047", # PEP 695 type parameters (keep ParamSpec/TypeVar for clarity)
"SIM108", # ternary operator (readability preference)
]
[tool.ruff.lint.isort]
known-first-party = ["app"]
force-single-line = false
lines-after-imports = 2
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
# MyPy - type checking for Python 3.14 (non-strict: Flask-SQLAlchemy/Celery lack stubs)
[tool.mypy]
python_version = "3.14"
warn_unused_configs = true
warn_redundant_casts = true
warn_unused_ignores = true
check_untyped_defs = true
show_error_codes = true
show_column_numbers = true
pretty = true
# Per-module overrides for third-party libraries
[[tool.mypy.overrides]]
module = [
"flask_sqlalchemy.*",
"flask_marshmallow.*",
"marshmallow.*",
"celery.*",
"redis.*",
"opentelemetry.*",
"psycopg.*",
"slugify.*",
]
ignore_missing_imports = true
# Flask-SQLAlchemy models use dynamic base class (db.Model)
[[tool.mypy.overrides]]
module = ["app.models.*"]
ignore_errors = true
# Pytest configuration
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_functions = ["test_*"]
addopts = [
"-v",
"--tb=short",
"--strict-markers",
]
filterwarnings = [
"ignore::DeprecationWarning",
]
# Coverage configuration
[tool.coverage.run]
source = ["app"]
branch = true
omit = ["*/tests/*", "*/__pycache__/*"]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise NotImplementedError",
"if TYPE_CHECKING:",
"if __name__ == .__main__.:",
]
show_missing = true