-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
166 lines (152 loc) · 4.92 KB
/
pyproject.toml
File metadata and controls
166 lines (152 loc) · 4.92 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
[project]
name = "techcable.orderedset"
description = "A simple and efficient OrderedSet implementation"
authors = [{ name = "Techcable" }]
license = "MIT OR APACHE-2.0"
keywords = ["orderedset", "ordereddict", "set"]
readme = "README.md"
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python :: 3",
"Typing :: Typed",
"Topic :: Utilities",
]
requires-python = ">=3.9"
dependencies = []
dynamic = ["version"]
[project.optional-dependencies]
pydantic = [
"pydantic~=2.11",
# needed for improved get_args
'typing_extensions>=4.12; python_version<="3.9"',
]
[dependency-groups]
mypy = ["mypy~=1.0", { include-group = "typing" }]
# keep in sync with [tool.hatch.envs] until hatch supports PEP 754
test = [
"pytest~=8.3",
"pytest-asyncio>=0.26",
"pytest-sugar~=1.0",
"techcable.orderedset[pydantic]",
]
typing = ["typing-extensions~=4.12", "techcable.orderedset[pydantic]"]
dev = [{ include-group = "mypy" }, { include-group = "test" }]
[project.urls]
Source = "https://github.com/Techcable/orderedset.py"
[build-system]
requires = [
"hatchling",
"hatch-vcs",
]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
# needed to actually include the sources in the wheel
only-include = ["src"]
sources = ["src"]
[tool.hatch.version]
source = "vcs"
[tool.hatch.envs.hatch-test]
# use uv instead of venv/pip
installer = "uv"
# Keep in sync with dependency-groups until hatch supports PEP 754
# See pypa/hatch#1852
dependencies = [
"pytest~=8.3",
"pytest-asyncio>=0.26",
"pytest-sugar~=1.0",
]
extra-dependencies = ["pydantic"]
[[tool.hatch.envs.hatch-test.matrix]]
python = ["3.9", "3.10", "3.11", "3.12", "3.13"]
[tool.hatch.build.hooks.vcs]
# NOTE: Using a version file avoids some overhead
#
# This file is explicitly ignored by version control.
version-file = "src/techcable/orderedset/_version.py"
[tool.isort]
profile = "black"
[tool.ruff]
line-length = 120
exclude = [
# this is in .gitignore - but for some reason its still triggering `UP` lints
"src/techcable/orderedset/_version.py",
]
[tool.ruff.lint]
preview = true
extend-select = [
"RUF", # ruff
"B", # flake8-bugbear
# probable bugs
"DTZ", # flake8-datetimez - timezone issues
"EXE", # issues with shebang
"RET", # return statements
"SLOT", # require __slots__ for subclasses of immutable types
"T10", # use of breakpoint()
"FBT", # boolean flags should not be positional args
# possible bugs
"BLE", # prevent over-broad `catch` statements
"PIE", # flake8-pie - misc lints
"PYI", # lint pyi files
"PLE", # pylint[error]
"PLR", # pylint[refactor]
"LOG", # flake8-logging
"PT", # flake8-pytest-style
"ASYNC", # flake8-async
# lints for legacy code
"UP", # pyupgrade
"YTT", # flake8-2020
"C4", # flake8-comprehensions
"FA", # flake-future-annotations
"PLR", # pylint[refactor]
"FURB", # refurb
# style
"Q002", # avoid single-quote docstrings
"Q003", # change outer quotes to avoid escaping inner quotes
"Q004", # unecessary quote escape
"TD", # checks todo statements are well-formed
"PTH", # prefer use of pathlib.Path
"FLY", # prefer fstring to str.json
"W", # pycodestyle
"G", # flake8-logging-format
"N", # pep8-naming
# pedantic
"SIM", # flake8-simplify
"A", # falke8-builtins - prevent shadowing builtins
"T20", # flake8-print - prevent use of `print` statement
"TC", # flake8-type-checking - guard imports needed only for type-checking
"TID252", # forbid relative imports
"D", # pydocstyle - lint docstrings and require for all public methods
"PLW", # pylint[warning]
"PLC", # pylint[convention]
"F", # pyflakes
"TRY", # tryceratops
"ERA", # eradicate - forbid commented out code
# "FIX", # prevent use of todo comments
# buggy lints
# "SLF", # flake8-self - doesn't consider isinstance
# "CPY", # flake8-copyright - require copyright header - doesn't support SPDX tags
]
ignore = [
# moderately pedantic
# "E741", # ambiguous variable names
"PLW3201", # allow dunder methods with 'no special meaning'
# extremely pedantic
"PLR2004", # allow use of 'magic values' - `if x == 3` is fine
"PYI025", # collections.abc.Set is not confusing with `set`
"UP015", # allow passing redundant modes to `open()` - explicit is better than implicit
"TRY003", # allow long error messages 'outside of exception class'
"SIM105", # allow try/except/pass instead of contextlib.suppress
"RET505", # use of return statement in `if` does not make `else` unecessary
"PLR0904", # too many public methods
]
[tool.ruff.lint.pydocstyle]
convention = "pep257"
[tool.ruff.lint.per-file-ignores]
"tests/**" = [
# excessively pedantic
"D", # pydocstyle
"E741", # ambigous variable names
"TC", # flake8-type-checking - import guards are useless here
# moderately pedantic
"CPY", # test files don't need copyright
]