-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
164 lines (147 loc) · 6.39 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
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
[project]
name = "memer"
version = "0.5.0"
description = "A CLI tool to generate memes!"
readme = "README.md"
requires-python = ">=3.10"
dependencies = [
"pillow>=10.4.0",
"platformdirs>=4.3.6",
"pydantic>=2.9.2",
"pytz>=2024.2",
"pyyaml>=6.0.2",
"requests>=2.32.3",
"typer>=0.12.5",
]
[project.scripts]
memer = "memer.main:app"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/memer"]
[tool.uv]
dev-dependencies = [
"pre-commit>=3.8.0",
"ruff>=0.7.4",
]
[tool.ruff]
# General settings
fix = true
indent-width = 4
line-length = 100
output-format = "concise"
required-version = ">=0.6.5"
show-fixes = false
target-version = "py312"
[tool.ruff.format]
docstring-code-format = true
quote-style = "double"
[tool.ruff.lint]
select = [
"F", # https://docs.astral.sh/ruff/rules/#pyflakes-f
"E", # https://docs.astral.sh/ruff/rules/#error-e
"W", # https://docs.astral.sh/ruff/rules/#warning-w
"C90", # https://docs.astral.sh/ruff/rules/#mccabe-c90
"I", # https://docs.astral.sh/ruff/rules/#isort-i
"N", # https://docs.astral.sh/ruff/rules/#pep8-naming-n
"UP", # https://docs.astral.sh/ruff/rules/#pyupgrade-up
"YTT", # https://docs.astral.sh/ruff/rules/#flake8-2020-ytt
"ANN", # https://docs.astral.sh/ruff/rules/#flake8-annotations-ann
"ASYNC", # https://docs.astral.sh/ruff/rules/#flake8-annotations-ann
"S", # https://docs.astral.sh/ruff/rules/#flake8-bandit-s
"BLE", # https://docs.astral.sh/ruff/rules/#flake8-blind-except-ble
"FBT", # https://docs.astral.sh/ruff/rules/#flake8-boolean-trap-fbt
"B", # https://docs.astral.sh/ruff/rules/#flake8-bugbear-b
"A", # https://docs.astral.sh/ruff/rules/#flake8-builtins-a
"COM", # https://docs.astral.sh/ruff/rules/#flake8-commas-com
"C4", # https://docs.astral.sh/ruff/rules/#flake8-comprehensions-c4
"DTZ", # https://docs.astral.sh/ruff/rules/#flake8-datetimez-dtz
"T10", # https://docs.astral.sh/ruff/rules/#flake8-debugger-t10
"DJ", # https://docs.astral.sh/ruff/rules/#flake8-django-dj
"EXE", # https://docs.astral.sh/ruff/rules/#flake8-executable-exe
"FA", # https://docs.astral.sh/ruff/rules/#flake8-future-annotations-fa
"ISC", # https://docs.astral.sh/ruff/rules/#flake8-implicit-str-concat-isc
"ICN", # https://docs.astral.sh/ruff/rules/#flake8-import-conventions-icn
"LOG", # https://docs.astral.sh/ruff/rules/#flake8-logging-log
"G", # https://docs.astral.sh/ruff/rules/#flake8-logging-format-g
"PIE", # https://docs.astral.sh/ruff/rules/#flake8-pie-pie
"T20", # https://docs.astral.sh/ruff/rules/#flake8-print-t20
"PYI", # https://docs.astral.sh/ruff/rules/#flake8-pyi-pyi
"PT", # https://docs.astral.sh/ruff/rules/#flake8-pytest-style-pt
"RSE", # https://docs.astral.sh/ruff/rules/#flake8-raise-rse
"RET", # https://docs.astral.sh/ruff/rules/#flake8-return-ret
"SLF", # https://docs.astral.sh/ruff/rules/#flake8-self-slf
"SIM", # https://docs.astral.sh/ruff/rules/#flake8-simplify-sim
"TID", # https://docs.astral.sh/ruff/rules/relative-imports/
"TCH", # https://docs.astral.sh/ruff/rules/#flake8-type-checking-tch
"INT", # https://docs.astral.sh/ruff/rules/#flake8-gettext-int
"ARG", # https://docs.astral.sh/ruff/rules/#flake8-unused-arguments-arg
"PTH", # https://docs.astral.sh/ruff/rules/#flake8-use-pathlib-pth
"PD", # https://docs.astral.sh/ruff/rules/#pandas-vet-pd
"PLC", # https://docs.astral.sh/ruff/rules/#convention-c
"PLE", # https://docs.astral.sh/ruff/rules/#error-e_1
"TRY", # https://docs.astral.sh/ruff/rules/#tryceratops-try
"FLY", # https://docs.astral.sh/ruff/rules/#flynt-fly
"PERF", # https://docs.astral.sh/ruff/rules/#perflint-perf
"RUF", # https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf
]
extend-select = [
"D", # https://docs.astral.sh/ruff/rules/#pydocstyle-d
"EM", # https://docs.astral.sh/ruff/rules/#flake8-errmsg-em
"INP", # https://docs.astral.sh/ruff/rules/#flake8-no-pep420-inp
"Q", # https://docs.astral.sh/ruff/rules/#flake8-quotes-q
"SLOT", # https://docs.astral.sh/ruff/rules/#flake8-slots-slot
"TD", # https://docs.astral.sh/ruff/rules/#flake8-todos-td
"FIX", # https://docs.astral.sh/ruff/rules/#flake8-fixme-fix
"ERA", # https://docs.astral.sh/ruff/rules/#eradicate-era
"PGH", # https://docs.astral.sh/ruff/rules/#pandas-vet-pd
"PLR", # https://docs.astral.sh/ruff/rules/#refactor-r
"PLW", # https://docs.astral.sh/ruff/rules/#warning-w_1
"NPY", # https://docs.astral.sh/ruff/rules/#numpy-specific-rules-npy
"AIR", # https://docs.astral.sh/ruff/rules/#airflow-air
]
ignore = [
"D100", # https://docs.astral.sh/ruff/rules/undocumented-public-module/
"D104", # https://docs.astral.sh/ruff/rules/undocumented-public-package/
"COM812", # https://docs.astral.sh/ruff/rules/missing-trailing-comma/
"ANN101", # https://docs.astral.sh/ruff/rules/missing-type-self/
"TD003", # https://docs.astral.sh/ruff/rules/missing-todo-link/
"ISC001", # https://docs.astral.sh/ruff/rules/single-line-implicit-string-concatenation/
"FIX002", # https://docs.astral.sh/ruff/rules/line-contains-todo/
]
fixable = ["ALL"]
unfixable = ["ISC001"]
task-tags = ["TODO", "FIXME", "XXX", "NOTE"]
[tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = ["ANN", "D", "INP", "S101", "SLF"]
[tool.ruff.lint.flake8-annotations]
# ignore-fully-untyped = true # Can be useful for projects that are not fully typed yet.
[tool.ruff.lint.flake8-bugbear]
extend-immutable-calls = ["fastapi.Depends", "fastapi.Query"]
[tool.ruff.lint.flake8-type-checking]
runtime-evaluated-base-classes = [
"pydantic.BaseModel",
"sqlalchemy.orm.DeclarativeBase",
]
runtime-evaluated-decorators = ["pydantic.validate_call", "attrs.define"]
[tool.ruff.lint.isort]
detect-same-package = true
force-single-line = true # NOTE: Simplifies git diff appearance.
known-first-party = ["src"]
# required-imports = ["from __future__ import annotations"] # For Python < 3.10
[tool.ruff.lint.mccabe]
max-complexity = 10
[tool.ruff.lint.pep8-naming]
classmethod-decorators = [
"pydantic.validator",
"classmethod",
"declared_attr",
"expression",
"comparator",
]
[tool.ruff.lint.pydocstyle]
convention = "google"
ignore-decorators = ["typing.overload"]
[tool.ruff.lint.pylint]
allow-dunder-method-names = ["__tablename__", "__table_args__"]