-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
231 lines (205 loc) · 6.37 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
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
226
227
228
229
230
231
[tool.poetry]
name = "setup-selenium-testing"
version = "0.1.6"
description = "Setup Selenium for automation testing"
authors = ["Marcel Wilson <[email protected]>"]
license = "MIT"
repository = "https://github.com/bandophahita/setup_selenium"
#documentation = ""
readme = "README.md"
classifiers = [
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Intended Audience :: Developers",
"Natural Language :: English",
]
packages = [{include = "setup_selenium"}]
[tool.poetry.dependencies]
python = "^3.8"
selenium = ">=4.7.0"
semantic-version = "*"
typing-extensions = "*"
# extras
pytest = {version="*", optional = true}
black = {version="*", optional = true}
mypy = {version="*", optional = true}
ruff = {version = ">=0.2.0", optional = true}
tox = {version="*", optional = true}
[tool.poetry.extras]
dev = [
"pytest",
"black",
"mypy",
"ruff",
"tox",
]
test = [
"pytest",
"tox",
]
[build-system]
requires = ["poetry-core>=1.2.0"]
build-backend = "poetry.core.masonry.api"
# LINTER CONFIGURATION & GUIDELINES
# There is no rule that says linter configurations MUST be put in the pyproject.toml
# This is partially because not all tools support it. That said with the move to ruff,
# this file felt like the logical place to keep any documentations regarding how or why
# configurations are the way they are.
# The general rule:
# "Linters should help, not hinder."
# If the inclination on a rule is to add a whole bunch of exceptions in various places,
# perhaps that rule should not be run regularly.
[tool.ruff]
target-version = "py38"
line-length = 88
extend-exclude = [
".github",
".pytest_cache",
".venv",
"venv",
"dockerfiles",
"docs",
".coverage",
".coveragerc",
".env",
".env.example",
".flake8",
".gitignore",
"alembic.ini",
"bandit.yaml",
"docker-compose-dev.yaml",
"docker-compose-pro.yaml",
"Makefile",
"mkdocks.yml",
"mypy.ini",
"poetry.lock",
"pyproject.toml",
"pytest.ini",
"README.md",
".idea",
]
[tool.ruff.lint]
select = [
"A", # flake8-builtins
"ANN", # flake8-annotations # coming back to this one later to compare against mypy
"ARG", # flake8-unused-arguments
"B", # flake8-bugbear
"BLE", # flake8-blind-except
"C4", # flake8-comprehensions
"D", # pydocstyle
"E", # pycodestyle error
"EM", # flake8-errmsg
"ERA", # eradicate
"F", # Pyflakes
"FA", # flake8-future-annotations
# "FBT", # flake8-boolean-trap
"FIX", # flake8-fixme
"FLY", # flynt
"I", # isort
"ICN", # flake8-import-conventions
"ISC", # flake8-implicit-str-concat
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PL", # pylint
"PT", # flake8-pytest-style
"Q", # flake8-quotes
"RET", # flake8-return
"RSE", # flake8-raise
"RUF", # ruff specific
"SIM", # flake8-simplify
"T10", # flake8-debugger
"TCH", # flake8-type-checking
"TD", #TODOs
"TRY", # tryceratops
"UP", # python upgrade
"W", # pycodestyle warning
"YTT", # flake8-2020
# may eventually use but for now these are not helpful
# "FURB", # refurb # needs --preview flag to run
]
ignore = [
"ANN101", # missing-type-self
"ANN102", # cls
"E501", # line too long -- black will take care of this for us
"SIM115", # use context handler for open -- situationally useful
# "SIM300", # yoda conditions -- meh
"PERF203", # `try`-`except` within a loop incurs performance overhead
"PERF401", # use list comp
# NOT OPTIONAL. MUST REMAIN AS SET
# these are all completely unnecessary
"D101", # Missing docstring in public class
"D104", # Missing docstring in public package
"D105", # Missing docstring in magic method
"D106", # Missing docstring in public nested class
"D107", # Missing docstring in `__init__`
"D202", # no blank lines after docstring
"D203", # one-blank-line-before-class
"D204", # blank line required after docstring
"D205", # blank line between summary and description
"D212", # Multi-line summary should start at the first line
"D400", # First line should end with a period
"D401", # imperative mood
"D404", # First word of the docstring should not be "This"
"D405", # Section name should be properly capitalized
"D406", # Section name should end with a newline
"D407", # Missing dashed underline after section
"D411", # Missing blank line before section
"D412", # No blank lines allowed between a section header and its content
"D415", # First line should end with punctuation
"PLC0414", # useless-import-alias
"PLR0911", # too-many-return-statements
"PLR0912", # too-many-branches
"PLR0913", # too-many-arguments
"PLR0915", # too-many-statements
# 3.8 & 3.9 compatibility
"UP007", # Use `X | Y` for type annotations
"UP035", # Import from `typing` instead: `TypeAlias`
"UP038", # Use `X | Y` in `isinstance` call instead of `(X, Y)`
]
extend-safe-fixes = [
"EM101", "EM102",
"TCH001", "TCH002", "TCH003", "TCH004",
"C419",
"D200", "D205",
"PT003", "PT006", "PT018",
"RET504",
"UP007",
]
[tool.ruff.lint.flake8-pytest-style]
mark-parentheses = false
[tool.ruff.lint.pycodestyle]
ignore-overlong-task-comments = true
[tool.ruff.lint.isort]
combine-as-imports = true
split-on-trailing-comma = false
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]
"tests/**" = [
"D", # we don't need public-API-polished docstrings in tests.
"FBT", # using a boolean as a test object is useful!
"PLR", # likewise using specific numbers and strings in tests.
]
[tool.ruff.lint.flake8-annotations]
# ignore returns types for functions that implicity or explicitly only return None
suppress-none-returning = true
allow-star-arg-any = true
#mypy-init-return = true
[tool.black]
line-length = 88
target-version = ['py311']
# 'extend-exclude' excludes files or directories in addition to the defaults
extend-exclude = '''
# A regex preceded with ^/ will apply only to files and directories
# in the root of the project.
(
\.idea
| \.git
| \.mypy_cache
| \.tox
)
'''