-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
138 lines (114 loc) · 4.4 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
[tool.poetry]
name = "secret-santa"
version = "0.1.0"
description = "A Secret Santa game which randomly assigns and notifies people to whom they should give a gift using Twilio's messaging API"
license = "Unlicense"
authors = ["Fawzi Abo Shkara <fawzi.aboshkara@gmail.com>"]
readme = "README.md"
homepage = "https://github.com/faboshka/secret-santa"
repository = "https://github.com/faboshka/secret-santa.git"
[tool.poetry.dependencies]
python = "^3.12"
python-dotenv = "^1.0.1"
twilio = "^9.2.3"
pyfiglet = "^1.0.2"
typer-slim = { version = "^0.12.3", extras = ["standard"] }
[tool.poetry.group.dev.dependencies]
taskipy = "^1.13.0"
mypy = "^1.11.1"
ruff = "^0.5.5"
[tool.poetry.group.test.dependencies]
pytest = "^8.3.2"
pytest-mock = "^3.14.0"
pytest-xdist = "^3.6.1"
pytest-lazy-fixtures = "^1.1.1"
[build-system]
requires = ["poetry-core>=1.8.0"]
build-backend = "poetry.core.masonry.api"
[tool.poetry.scripts]
secret_santa = "secret_santa.client.app:secret_santa_app"
[tool.ruff]
line-length = 120
[tool.ruff.lint]
select = [
# Pyflakes
"F",
# pycodestyle
"E",
"W",
# isort
"I",
# pydocstyle
"D",
# mccabe
"C90",
# pep8-naming
"N",
# pyupgrade
"UP",
# ruff
"RUF",
# Perflint
"PERF",
# tryceratops
"TRY",
# flynt
"FLY",
# pylint
"PL",
# pyflakes
"YTT", "ANN", "ASYNC", "BLE", "B", "A", "C4", "DTZ", "T10", "EM", "EXE", "ICN", "PTH", "ARG", "TCH", "TID",
"SIM", "SLOT", "SLF", "RET", "RSE", "Q", "PT", "PYI", "T20", "PIE", "INP", "G", # TODO: "S", "FBT", "FA",
]
ignore = ["ANN101", "G004"]
# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []
[tool.ruff.lint.per-file-ignores]
"**/{tests}/*.py" = ["D", "S"]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.mypy]
pretty = true
show_error_context = true
check_untyped_defs = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
disallow_untyped_decorators = true
disallow_any_unimported = true
disallow_subclassing_any = true
warn_return_any = true
warn_unused_ignores = true
warn_unused_configs = true
[[tool.mypy.overrides]]
module = ["pyfiglet", "twilio.rest.*"]
ignore_missing_imports = true
[tool.taskipy.variables]
all_paths = "secret_santa/ tests/"
sources_only = "secret_santa/"
tests_only = "tests/"
[tool.taskipy.tasks]
pre_format_check = { cmd = "echo 'Running the \"format_check\" task...'" }
format_check = { cmd = "ruff format {all_paths} --check", use_vars = true, help = "run ruff format on sources and tests in check mode." }
post_format_check = { cmd = "echo 'Done running the \"format_check\" task!'" }
pre_ruff_lint = { cmd = "echo 'Running the \"ruff_lint\" task...'" }
ruff_lint = { cmd = "ruff check {all_paths}", use_vars = true, help = "run ruff linter on sources and tests." }
post_ruff_lint = { cmd = "echo 'Done running the \"ruff_lint\" task!'" }
pre_ruff_lint_fix = { cmd = "echo 'Running the \"ruff_lint_fix\" task...'" }
ruff_lint_fix = { cmd = "ruff check {all_paths} --fix", use_vars = true, help = "[changes code] run ruff linter and fix fixable issues on sources and tests." }
post_ruff_lint_fix = { cmd = "echo 'Done running the \"ruff_lint_fix\" task!'" }
pre_mypy = { cmd = "echo 'Running the \"mypy\" task...'" }
mypy = { cmd = "mypy {all_paths}", use_vars = true, help = "run mypy on sources and tests." }
post_mypy = { cmd = "echo 'Done running the \"mypy\" task!'" }
pre_test = { cmd = "echo 'Running the \"test\" task...'" }
test = { cmd = "pytest -v {tests_only} -n auto", use_vars = true, help = "run all tests." }
post_test = { cmd = "echo 'Done running the \"test\" task!'" }
pre_format = { cmd = "echo 'Running the \"format\" task...'" }
format = { cmd = "ruff format {all_paths}", use_vars = true, help = "[changes code] run ruff format on sources and tests." }
post_format = { cmd = "echo 'Done running the \"format\" task!'" }
pre_lint = { cmd = "echo 'Linting the whole codebase...'" }
lint = { cmd = "task format_check && task ruff_lint && task mypy", help = "check code formatting and rules violations." }
post_lint = { cmd = "echo 'Done linting the whole codebase!'" }
pre_fix = { cmd = "echo 'Formating code and fixing fixable issues accross the whole codebase...'" }
fix = { cmd = "task format && task ruff_lint_fix", help = "[changes code] reformat code and fix fixable linting issues." }
post_fix = { cmd = "echo 'Done formating code and fixing fixable issues accross the whole codebase!'" }