-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathpyproject.toml
More file actions
148 lines (133 loc) · 4.94 KB
/
Copy pathpyproject.toml
File metadata and controls
148 lines (133 loc) · 4.94 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
[project]
name = "pyramid_openapi3"
version = "0.22.0"
description = "Pyramid addon for OpenAPI3 validation of requests and responses."
readme = "README.md"
requires-python = ">=3.11,<4"
license = "MIT"
license-files = ["LICENSE"]
authors = [{ name = "Neyts Zupan" }, { name = "Domen Kozar" }]
keywords = ["openapi", "openapi3", "pyramid", "rest", "restful"]
classifiers = [
"Development Status :: 4 - Beta",
"Framework :: Pyramid",
"Intended Audience :: Developers",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = [
"openapi-core>=0.23.0,<0.24",
"pyramid>=1.10.7",
]
[project.urls]
Repository = "https://github.com/Pylons/pyramid_openapi3"
[dependency-groups]
# Lower bounds keep the lowest-direct resolution (run by `make lock` to generate
# uv-oldest.lock) on working tool versions while it pins openapi-core/pyramid to
# floors.
dev = [
"pytest>=8",
"pytest-cov>=5",
"pytest-instafail>=0.5",
"pytest-randomly>=3.15",
"pytest-socket>=0.7",
"waitress>=3",
"webtest>=3",
]
[build-system]
requires = ["uv_build>=0.11,<0.12"]
build-backend = "uv_build"
[tool.coverage.run]
branch = true
[tool.coverage.report]
exclude_also = ['if __name__ == "__main__":']
[tool.pytest.ini_options]
testpaths = ["pyramid_openapi3"]
[tool.ruff]
target-version = "py311"
exclude = [".git", ".venv"]
line-length = 88
[tool.ruff.lint]
select = ["ALL"]
ignore = [
"ANN401", # typing.Any disallowed in **kw
"ARG001", # Unused function argument
"ARG002", # Unused method argument
"COM812", # Missing trailing comma (conflicts with formatter)
"D107", # Missing docstring in __init__ (matches the pre-uv .flake8 config)
"E501", # line too long
"EM101", # Exception must not use string literal
"EM102", # Exception must not use string literal
"ERA001", # Found commented out code
"FBT001", # Boolean-typed argument
"N818", # Exception name should end in Error (public API name, can't rename)
"PLR0913", # Too many arguments (public config directives need them)
"TD002", # TODO comments must have an author
"TD003", # TODO comments must have a ticket reference
"TRY003", # Avoid specifying long messages outside the exception class
]
[tool.ruff.lint.per-file-ignores]
"**/tests/**" = [
"ANN002", # Missing type annotation for *args
"ARG001", # Unused function argument
"ARG005", # Unused lambda argument (test view stubs)
"B018", # Useless expression (deliberate attribute access to trigger errors)
"DTZ001", # Naive datetime usage
"FBT002", # Boolean default positional argument
"G004", # Logging statement uses f-string
"N802", # Function name should be lowercase
"N803", # Argument name should be lowercase
"PLC0415", # `import` should be at the top-level of a file
"PLR2004", # Magic value comparisons
"PT006", # pytest parametrize names type
"PT007", # pytest parametrize values type
"PT009", # Use assert instead of unittest assertion (TestCase-based suite)
"PT027", # Use pytest.raises instead of unittest assertRaises
"PTH118", # os.path.join (tempfile-based tests)
"PTH123", # builtin open
"RET504", # Unnecessary assign before return
"RUF043", # pytest.raises match is a regex
"S101", # Use of `assert` detected
"SIM117", # Multiple with statements
"SLF001", # Private member accessed
"TRY002", # Create your own exception
]
"examples/**" = [
"ANN001", # Missing type annotation for argument
"ANN201", # Missing return type annotation
"B904", # raise ... from (demo brevity)
"INP001", # Add an `__init__.py`
"N802", # Function name should be lowercase
"PLC0415", # `import` should be at the top-level of a file
"PLR2004", # Magic value comparisons
"PT009", # Use assert instead of unittest assertion (TestCase-based examples)
"PTH118", # os.path.join
"PTH120", # os.path.dirname
"RSE102", # Unnecessary parens on raise
"S101", # Use of `assert` detected
"S104", # Hardcoded bind to all interfaces (demo servers)
]
[tool.ruff.lint.pydocstyle]
convention = "pep257"
[tool.ruff.lint.isort]
force-single-line = true
no-sections = true
from-first = true
lines-between-types = 1
[tool.ty.rules]
# Pyramid extends Request/Response with reified attributes (registry, environ,
# matched_route, openapi_validated, ...) and ships incomplete type information,
# so ty cannot resolve them. The pre-uv mypy config silenced this via
# `ignore_missing_imports` for pyramid.*; this is the ty equivalent.
unresolved-attribute = "ignore"
[tool.uv]
# Setuptools dropped pkg_resources, but the oldest supported Pyramid (1.10.7,
# exercised by the lowest-direct CI job) still imports it at module load.
constraint-dependencies = ["setuptools<81"]
# Only consider releases at least 7 days old. Project-local so `make lock` is
# reproducible regardless of each dev's global ~/.config/uv/uv.toml.
exclude-newer = "7 days"
[tool.uv.build-backend]
module-name = "pyramid_openapi3"
module-root = ""
source-exclude = ["pyramid_openapi3/tests"]