forked from mhdadk/stack-exchange-backup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
139 lines (128 loc) · 3.67 KB
/
pyproject.toml
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
[build-system]
requires = ["setuptools >= 70.0.0"]
build-backend = "setuptools.build_meta"
[project]
name = "stack-exchange-backup"
version = "2024.09.15"
description = "Download all your posts on the Stack Exchange network as Markdown files."
readme = "README.md"
requires-python = ">= 3.12"
authors = [{ name = "Wei Cheng", email = "[email protected]" }]
keywords = ["Stack Exchange"]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: End Users/Desktop",
"License :: OSI Approved :: MIT License",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: System :: Archiving :: Backup",
]
urls.Source = "https://github.com/9ao9ai9ar/stack-exchange-backup"
dependencies = [
"niquests >= 3, < 4",
"pydantic >= 2.8.0, < 3",
]
optional-dependencies.dev = [
"datamodel-code-generator >= 0.26.0, < 1",
"pytest >= 8, < 9",
"bumpver",
"devtools",
"openapi-spec-validator",
"pylint",
"ruff",
]
[tool.bumpver]
current_version = "2024.09.15"
version_pattern = "YYYY.0M.0D[-PATCH]"
commit = false
[tool.bumpver.file_patterns]
"pyproject.toml" = [
'^current_version = "{version}"',
'^version = "{version}"',
]
[tool.datamodel-codegen]
input = "./resources/openapi/openapi.yaml"
input-file-type = "openapi"
output = "./src/stackexchange/generated/_model_openapi.py"
output-model-type = "pydantic_v2.BaseModel"
## Typing customization:
base-class = "stackexchange._model_base.MyBaseModel"
enum-field-as-literal = "all"
#strict-types = ["str", "bytes", "int", "float", "bool"] # https://github.com/koxudaxi/datamodel-code-generator/issues/1884
use-annotated = true
use-standard-collections = true
use-union-operator = true
## Field customization:
use-default-kwarg = true
use-field-description = true
## Model customization:
collapse-root-models = true
disable-timestamp = true
keep-model-order = true
reuse-model = true
use-exact-imports = true
use-schema-description = true
## Template customization:
use-double-quotes = true
## OpenAPI-only options:
openapi-scopes = [
"schemas",
"parameters",
"paths",
]
use-operation-id-as-name = true
# https://pylint.readthedocs.io/en/latest/user_guide/messages/messages_overview.html
[tool.pylint.main]
disable = [
"missing-class-docstring",
"missing-function-docstring",
"missing-module-docstring",
"no-else-return",
"redefined-outer-name",
"unused-argument",
"unused-wildcard-import",
"wildcard-import",
]
enable = [
"useless-suppression",
]
fail-under = 9
ignore-paths = "./src/stackexchange/generated/_model_openapi.py"
jobs = 0
output-format = "colorized"
[tool.pylint.format]
max-line-length = 99
# https://microsoft.github.io/pyright/#/configuration?id=type-check-diagnostics-settings
[tool.pyright]
typeCheckingMode = "basic"
deprecateTypingAliases = true
reportArgumentType = "warning"
reportAttributeAccessIssue = "warning"
reportGeneralTypeIssues = "warning"
reportUndefinedVariable = "warning"
[tool.ruff]
line-length = 79
exclude = ["./**/generated/*.py"]
# https://docs.astral.sh/ruff/rules/
[tool.ruff.lint]
ignore = [
"F403", # undefined-local-with-import-star
"F405", # undefined-local-with-import-star-usage
"F722", # forward-annotation-syntax-error
]
[tool.uv]
native-tls = true
[tool.uv.pip]
emit-index-url = true
generate-hashes = true
link-mode = "copy"
no-binary = ["stack-exchange-backup"]
no-build = true
reinstall = true
#require-hashes = true # Doesn't work for editable installs: https://github.com/pypa/pip/issues/4995
strict = true
universal = true
upgrade = true
verify-hashes = true