Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
105 lines (92 loc) · 3.36 KB
/
Copy pathpyproject.toml
File metadata and controls
105 lines (92 loc) · 3.36 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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "cubemarspycan"
version = "0.1.0.dev0"
description = "Correct, tested CAN control for CubeMars AK-series actuators (MIT and servo modes)"
readme = "README.md"
requires-python = ">=3.10"
license = "MIT"
license-files = ["LICENSE"]
authors = [{ name = "Hector Azpurua" }]
keywords = ["cubemars", "tmotor", "ak40-10", "can", "robotics", "actuator", "motor"]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering",
"Typing :: Typed",
]
# Runtime dependency is python-can ONLY.
# NumPy is deliberately absent: its 2.0 out-of-range integer behaviour is what broke
# the decoder in TMotorCANControl (see PLAN.md 2.2).
dependencies = ["python-can>=4.0.0"]
[project.optional-dependencies]
slcan = ["pyserial>=3.5"]
gs-usb = ["gs-usb>=0.3.0"]
dev = [
"pytest>=8.0",
"pytest-cov>=5.0",
"hypothesis>=6.100",
"ruff>=0.6",
"mypy>=1.11",
]
docs = [
# >=7.4 rather than >=8.1: requires-python is >=3.10 and Sphinx 8.2 dropped it, so a
# developer on 3.10 would otherwise get an unhelpful resolution error. <9 caps the
# major so a routine bump cannot turn the warnings-as-errors build red.
"sphinx>=7.4,<9",
"myst-parser>=4.0,<5",
"furo>=2024.8.6",
"linkify-it-py>=2.0",
"sphinx-copybutton>=0.5.2",
]
[project.scripts]
cubemars = "cubemarspycan.cli:main"
[project.urls]
Homepage = "https://github.com/verlab/cubemarsPyCAN"
Documentation = "https://verlab.github.io/cubemarsPyCAN/"
Source = "https://github.com/verlab/cubemarsPyCAN"
Issues = "https://github.com/verlab/cubemarsPyCAN/issues"
[tool.hatch.build.targets.wheel]
packages = ["src/cubemarspycan"]
[tool.ruff]
line-length = 100
target-version = "py310"
src = ["src", "tests"]
# TMotorCANControl-master/ is the GPLv3 reference library, kept read-only for comparison
# during development. It is not ours to lint and will be removed before release.
extend-exclude = ["TMotorCANControl-master", ".venv"]
[tool.ruff.lint]
select = ["E", "F", "W", "I", "N", "UP", "B", "A", "C4", "SIM", "RUF", "PTH", "RET"]
ignore = ["RUF002", "RUF003"] # ambiguous unicode in docstrings (we use degree/mu signs)
[tool.ruff.lint.per-file-ignores]
"tests/*" = ["E501"]
[tool.mypy]
python_version = "3.10"
strict = true
warn_unreachable = true
files = ["src", "tests", "examples"]
# examples/ is on the path so `from _common import ...` resolves the way the scripts
# themselves run. It is checked because the two bugs it hid - a None dereference one line
# above its own guard, and `object` parameters that accepted anything - were both type
# errors CI could not see.
mypy_path = "examples"
exclude = ["TMotorCANControl-master", "\\.venv"]
[[tool.mypy.overrides]]
module = ["can.*", "serial.*"]
ignore_missing_imports = true
[tool.pytest.ini_options]
testpaths = ["tests"]
markers = [
"hardware: needs a real motor on a real bus (never runs in CI)",
"socketcan: needs a Linux socketcan/vcan interface",
]
addopts = "-m 'not hardware' --strict-markers"
[tool.coverage.report]
exclude_lines = ["pragma: no cover", "if TYPE_CHECKING:", "\\.\\.\\."]