-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpyproject.toml
161 lines (136 loc) · 4.29 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
# ### Linting Rules ###
[tool.ruff]
target-version = "py39"
line-length = 95
lint.select = [
"D", # pydocstyle
"E", # pycodestyle error
"F", # pyflakes
"I", # isort
"W", # pycodestyle warning
"RUF", # ruff-specific
"B006", # mutable default argument
"B021", # f-string docstring
"COM818", # warn about implicitly creating a tuple
"SLF001", # warn about accessing private members, these can be noqa'd when necessary
]
lint.preview = true # Enable preview to get the rest of pycodestyle errors
lint.ignore = [
"D104", # Ignore missing docstring in public package
"D105", # Ignore missing docstring in magic method
"D107", # Ignore missing docstring in __init__
"D401", # Ignore first line of docstring should be in imperative mood
"D203", # Ignore 1 blank line required before class docstring
"D212", # Ignore Multi-line docstring summary should start at the first line
"RUF005", # Allow alternate iterable unpacking
"RUF015", # Allow + concatenation
]
# ### Formatting Rules ###
[tool.mypy]
mypy_path = "stubs"
warn_unused_ignores = true
warn_return_any = true
show_error_codes = true
strict_optional = true
implicit_optional = true
disallow_any_unimported = true
disallow_subclassing_any = true
#disallow_any_generics = true
disallow_untyped_calls = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
disallow_untyped_decorators = true
check_untyped_defs = true
[[tool.mypy.overrides]]
# Ignore type checking for the tests
module = ["tests.*"]
ignore_errors = true
[tool.isort]
atomic = true
balanced_wrapping = true
known_first_party = "sbot"
# hanging grid grouped indent style wrapping
multi_line_output = 5
include_trailing_comma = true
[tool.pytest.ini_options]
markers = [
"hardware: mark a test that requires hardware to be connected",
]
[build-system]
requires = ["setuptools>=45", "wheel", "setuptools_scm>=6.2"]
build-backend = "setuptools.build_meta"
[tool.setuptools_scm]
write_to = "sbot/_version.py"
[tool.setuptools]
packages = ["sbot"]
[project]
name = "sbot"
description = "The robot API for the Smallpeice summer school"
authors = [{name = "SourceBots", email = "[email protected]"}]
readme = "README.md"
license = {file = "LICENSE"}
dynamic = ["version"]
requires-python = ">=3.9"
dependencies = [
"pyserial >=3,<4",
"april_vision==2.2.0",
"typing-extensions; python_version<'3.10'",
"python-dotenv==1.0.1",
]
classifiers = [
"Topic :: Software Development :: Libraries :: Python Modules",
"Operating System :: OS Independent",
"Development Status :: 5 - Production/Stable",
"Typing :: Typed",
"Topic :: Education",
]
[project.urls]
Repository = "https://github.com/sourcebots/sbot"
Homepage = "https://sourcebots.co.uk"
Documentation = "https://docs.sourcebots.co.uk"
[project.optional-dependencies]
dev = [
"poethepoet >=0.0.1,<1",
"ruff==0.9.8",
"mypy==1.10.0; python_version<'3.9'",
"mypy>=1.7,<2; python_version>='3.9'",
"build",
"types-pyserial",
"pytest",
"pytest-cov",
"paho-mqtt >=2,<3"
]
vision = ["opencv-python-headless >=4,<5"]
mqtt = ["paho-mqtt >=2,<3"]
# ### Tasks ###
[tool.poe.env]
PYMODULE = "sbot"
PYFOLDERS = "sbot tests"
[tool.poe.tasks.lint]
help = "Run ruff against the project to check for linting errors."
cmd = "ruff check $PYFOLDERS"
[tool.poe.tasks.type]
help = "Run mypy against the project to check for type errors."
cmd = "python -m mypy $PYMODULE"
[tool.poe.tasks.test]
help = "Run pytest against the project to check for test errors."
cmd = "python -m pytest --cov=$PYMODULE --cov-report=term --cov-report=xml tests"
[tool.poe.tasks.test-html]
help = "Run pytest against the project to check for test errors."
cmd = "python -m pytest --cov=$PYMODULE --cov-report=html tests"
[tool.poe.tasks.check]
help = "Check the project for linting, type and test errors."
sequence = ["lint", "type", "test"]
[tool.poe.tasks.fix]
help = "Use ruff to fix any auto-fixable linting errors."
cmd = "ruff check --fix-only $PYFOLDERS"
[tool.poe.tasks.build]
help = "Build the wheel and source distributions."
cmd = "python -m build"
[tool.poe.tasks.clean]
help = "Clean the project of any build artifacts."
sequence = [
"shutil:rmtree('dist', ignore_errors=1)",
"shutil:rmtree('build', ignore_errors=1)",
]
default_item_type = "script"