Skip to content

Commit 0bb35fa

Browse files
petercorkeclaude
andauthored
fix: pre-commit is a development tool, not a runtime dependency (#250)
`pre-commit` was added to `[project].dependencies` in #98, alongside the black hook. Nothing in spatialmath imports it, but every `pip install spatialmath-python` has installed it, and its dependency tree (virtualenv, identify, cfgv, nodeenv, ...), ever since. The hook config was later removed (#153) and restored, but the runtime dependency stayed. **Why it matters beyond bloat:** it makes the install fail wherever a transitive pin conflicts. `virtualenv` 21.14.7 now requires `packaging>=26.3`, and Pyodide ships `packaging` 24.2, so in JupyterLite / in-browser notebooks `micropip.install("spatialmath-python")` raises `ValueError: Requested 'packaging>=26.3', but packaging==24.2 is already installed`. That breaks the in-browser demos of the Robotics, Machine Vision and bdsim toolboxes, and it will break again whenever any dev tool in that tree raises a floor. **Change:** move `pre-commit` to the `dev` extra (CI already installs `.[dev]`) and make the README's contributor instructions install it. **Verified:** built the wheel and installed it with `micropip.install` in Pyodide 0.27.6. Dependencies resolve, and `import spatialmath` and `SE3.Rx(...)` work. Before the change the same install fails with the error above. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
1 parent 5bd2e34 commit 0bb35fa

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

‎README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ git clone https://github.com/rai-opensource/spatialmath-python.git
137137
cd spatialmath-python
138138
pip install -e .
139139
# Optional: if you would like to contribute and commit code changes to the repository,
140+
# install the development tools (including pre-commit) and set up the git hooks
141+
# pip install -e .[dev]
140142
# pre-commit install
141143
```
142144

‎pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ dependencies = [
4040
"matplotlib",
4141
"ansitable",
4242
"typing_extensions>=4.0.0",
43-
"pre-commit",
4443
]
4544

4645
[project.urls]
@@ -52,6 +51,7 @@ dependencies = [
5251
[project.optional-dependencies]
5352

5453
dev = [
54+
"pre-commit",
5555
"sympy",
5656
"pytest",
5757
"pytest-timeout",

0 commit comments

Comments
 (0)