-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpyproject.toml
More file actions
225 lines (202 loc) · 7.79 KB
/
Copy pathpyproject.toml
File metadata and controls
225 lines (202 loc) · 7.79 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
[project]
name = "integrify"
version = "3.0.0"
description = "Umbrella package for the Integrify family of API-integration libraries. Install only the integrations you need via extras, e.g. `pip install integrify[epoint]`."
readme = "README.md"
requires-python = ">=3.10"
license = "MIT"
authors = [{ name = "mmzeynalli", email = "miradil.zeynalli@gmail.com" }]
keywords = ["integrify", "api", "integration", "azerbaijan", "payment", "sms"]
classifiers = [
"Intended Audience :: Information Technology",
"Intended Audience :: System Administrators",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python",
"Topic :: Internet",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development",
"Typing :: Typed",
"Environment :: Web Environment",
"Framework :: AsyncIO",
"Framework :: Pydantic",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Internet :: WWW/HTTP :: HTTP Servers",
"Topic :: Internet :: WWW/HTTP",
]
# A bare `pip install integrify` pulls in only the shared core.
# Each integration is a separate distribution, opted into via an extra below.
dependencies = ["integrify-core"]
[project.urls]
Homepage = "https://integrify.mmzeynalli.dev"
Repository = "https://github.com/Integrify-SDK/integrify-python"
Documentation = "https://integrify.mmzeynalli.dev"
[project.optional-dependencies]
azericard = ["integrify-azericard"]
clopos = ["integrify-clopos"]
epoint = ["integrify-epoint"]
kapitalbank = ["integrify-kapitalbank"]
lsim = ["integrify-lsim"]
postaguvercini = ["integrify-postaguvercini"]
# Convenience: pull in every integration at once.
all = [
"integrify-azericard",
"integrify-clopos",
"integrify-epoint",
"integrify-kapitalbank",
"integrify-lsim",
"integrify-postaguvercini",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
# The umbrella distribution ships no importable code of its own — it only
# aggregates the member distributions through extras. The `integrify` import
# namespace itself is a PEP 420 namespace provided by `integrify-core` and by
# each integration package.
[tool.hatch.build.targets.wheel]
bypass-selection = true
# --------------------------------------------------------------------------- #
# uv workspace #
# #
# Every distribution under packages/* is a workspace member, developed and #
# locked together but PUBLISHED INDEPENDENTLY to PyPI. Bring an existing #
# repo in with `git subtree` (see MIGRATION.md) and it becomes a member #
# automatically because it has its own pyproject.toml. #
# --------------------------------------------------------------------------- #
[tool.uv.workspace]
members = ["packages/*"]
# During local development, resolve the member distributions from the
# workspace instead of PyPI. On a published `pip install`, these names resolve
# to the real PyPI distributions.
[tool.uv.sources]
integrify-core = { workspace = true }
integrify-azericard = { workspace = true }
integrify-clopos = { workspace = true }
integrify-epoint = { workspace = true }
integrify-kapitalbank = { workspace = true }
integrify-lsim = { workspace = true }
integrify-postaguvercini = { workspace = true }
[dependency-groups]
gh = [
"pytest>=8.1.1,<10",
"pytest-mock>=3.14.0,<4",
"smokeshow>=0.5.0,<0.6",
"coverage>=7.6.3,<8",
"time-machine>=2.16.0",
]
dev = [
"pytest>=8.1.1,<10",
"pytest-mock>=3.14.0,<4",
"ty>=0.0.71",
"ruff>=0.9",
"pre-commit>=4.6.2,<5",
"bandit>=1.7.10,<2",
"coverage>=7.6.3,<8",
"time-machine>=2.16.0",
]
docs = [
"zensical>=0.0.53",
"mkdocstrings[python]>=1.0.6,<2.0.0",
"mkdocs-panzoom-plugin>=0.5.2,<0.6",
"griffe-pydantic>=1.3.1,<2",
]
[tool.uv]
default-groups = ["gh", "dev", "docs"]
[tool.ruff]
target-version = "py310"
line-length = 100
src = ["packages"]
[tool.ruff.lint]
select = [
"F", # Pyflakes
"E", # Pycodestyle
"W", # Warnings
"I", # isort
"T", # Ban print statements (T201)
"UP", # pyupgrade
"PL", # Pylint
]
ignore-init-module-imports = true
[tool.ruff.format]
quote-style = "single"
[tool.pytest.ini_options]
testpaths = ["packages"]
filterwarnings = ["ignore::UserWarning"]
[tool.coverage.report]
exclude_also = [
"def __repr__",
"raise AssertionError",
"raise NotImplementedError",
"if TYPE_CHECKING:",
"class .*\\bProtocol\\):",
"@(abc\\.)?abstractmethod",
]
fail_under = 95
[tool.coverage.run]
source = ["packages"]
branch = true
relative_files = true
context = "${CONTEXT}"
[tool.bandit]
exclude_dirs = ["tests"]
skips = ["B101"]
[tool.ruff.lint.per-file-ignores]
"scripts/**" = ["T201"] # CLI-style helper scripts may print
"**/tests/**" = ["PLC0415", "PLR2004"] # in-function imports & literal expected values are idiomatic in tests
"**/handlers.py" = ["PLR2004"] # HTTP status-code comparisons (200/404/500)
"packages/core/src/integrify/api.py" = ["PLR0913", "PLR0917"] # APIClient.__init__ config args
"packages/clopos/src/integrify/clopos/client.py" = ["PLR0915"] # long client __init__
# --------------------------------------------------------------------------- #
# ty (static type checker) — https://docs.astral.sh/ty/ #
# #
# ty 0.0.71 is pre-1.0 and has known gaps around pydantic Field defaults, #
# generic-variance narrowing, sentinel Literal types and **kwargs splat. #
# The rules below silence the false positives those produce on this #
# pydantic-heavy codebase; every other ty rule stays on. Tests deliberately #
# pass invalid values (os.getenv() -> str | None, None) to exercise error #
# paths, so they are not type-checked. #
# --------------------------------------------------------------------------- #
[tool.ty.environment]
python-version = "3.10"
[tool.ty.src]
exclude = ["**/tests/**"]
[tool.ty.rules]
# Optional env-vars (str | None) are used as parameter/Field defaults, validated
# at runtime via requires_env(). The default-vs-annotation mismatch is intended.
invalid-parameter-default = "ignore"
invalid-assignment = "ignore"
# Handlers narrow the generic base return (APIResponse[Unknown] | Response) to a
# concrete schema — a generic-variance gap in ty, not a real defect.
invalid-return-type = "ignore"
[[tool.ty.overrides]]
# core/utils.py models an "unset" sentinel as Union[T, Literal[UNSET]]; ty cannot
# express Literal[<instance>]. Downstream schemas subscript the resulting alias.
include = ["**/utils.py", "**/schemas/**"]
[tool.ty.overrides.rules]
invalid-type-form = "ignore"
not-subscriptable = "ignore"
[[tool.ty.overrides]]
# APIClient exposes req_model/resp_model/dry as class config that instances may
# override; httpx .request(**request_kwds) can't be verified through a dict splat.
include = ["**/api.py"]
[tool.ty.overrides.rules]
invalid-attribute-access = "ignore"
invalid-argument-type = "ignore"
[[tool.ty.overrides]]
# logfire / loguru are optional logging backends, guarded by try/except import.
include = ["**/logger.py"]
[tool.ty.overrides.rules]
unresolved-import = "ignore"
[[tool.ty.overrides]]
# integrify/test.py: pytest helper; skipif signature quirk under ty.
include = ["**/integrify/test.py"]
[tool.ty.overrides.rules]
unknown-argument = "ignore"