Skip to content

Commit 17e5296

Browse files
peterpeter
authored andcommitted
update and test Makefile, revert easyhid-ng to easyhid, fix udev instructions, rebuild docs
1 parent 85aa005 commit 17e5296

File tree

7 files changed

+37
-35
lines changed

7 files changed

+37
-35
lines changed

.github/FUNDING.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

Makefile

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ build-clean:
1212
hatch clean
1313
hatch build
1414

15-
install: build
16-
python3 -m pip install --no-deps --force dist/*.whl
17-
1815
# Publishing (using Hatch)
1916
publish: build
2017
hatch publish
@@ -46,8 +43,7 @@ clean:
4643

4744
# Development
4845
install-dev:
49-
hatch env create
50-
python3 -m pip install --editable ".[dev]"
46+
hatch run pip install --editable ".[dev]"
5147

5248
# Code Quality
5349
lint:
@@ -60,14 +56,14 @@ format-check:
6056
hatch run ruff format --check .
6157

6258
# Testing
63-
test:
59+
test: # FIXME!
6460
hatch run test:pytest
6561

66-
test-cov:
62+
test-cov: # FIXME!
6763
hatch run test:pytest --cov-report=html
6864

6965
run-demo:
70-
python3 ./examples/01_basic.py
66+
hatch run python ./examples/01_basic.py
7167

7268
# Pre-commit
7369
pre-commit-install:
@@ -77,21 +73,24 @@ pre-commit-run:
7773
pre-commit run --all-files
7874

7975

76+
# Documentation, using mkdocs and mkdoxy
77+
install-doxygen:
78+
@command -v doxygen >/dev/null || (echo "Please install doxygen (apt/dnf/brew)" && exit 1)
8079

8180
fixRelativeLinkDocs:
8281
sed 's/\.\/docs/\./g' README.md > docs/README.md
8382
sed 's/\.\/docs/\./g' CONTRIBUTING.md > docs/CONTRIBUTING.md
8483
sed 's/\.\/docs/\./g' troubleshooting.md > docs/troubleshooting.md
8584

8685
# Docs
87-
docs-build: fixRelativeLinkDocs
86+
docs-build: install-doxygen fixRelativeLinkDocs
8887
@echo "Building docs..."
89-
mkdocs build
88+
hatch run dev:mkdocs build
9089

91-
docs-serve: fixRelativeLinkDocs
90+
docs-serve: install-doxygen fixRelativeLinkDocs
9291
@echo "Serving docs..."
93-
mkdocs serve
92+
hatch run dev:mkdocs serve
9493

95-
docs-deploy: fixRelativeLinkDocs
94+
docs-deploy: install-doxygen fixRelativeLinkDocs
9695
@echo "Deploying docs..."
97-
mkdocs gh-deploy --force
96+
hatch run dev:mkdocs gh-deploy

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ See the [examples/](https://github.com/JakubAndrysek/PySpaceMouse/tree/master/ex
203203
### Linux permissions
204204

205205
```bash
206-
sudo echo 'KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0664", GROUP="plugdev"' > /etc/udev/rules.d/99-hidraw-permissions.rules
206+
echo 'KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0664", GROUP="plugdev"' | sudo tee /etc/udev/rules.d/99-hidraw-permissions.rules
207207
sudo usermod -aG plugdev $USER
208208
newgrp plugdev
209209
```
@@ -231,6 +231,8 @@ pipx install hatch==1.15.1 pre-commit
231231

232232
If you're not familiar with pipx, it lets you install python tools into isolated environments in `~/.local`.
233233

234+
For building the documentation locally, you will also need `doxygen` installed and on the path.
235+
234236
## Used In
235237

236238
- [TeleMoMa](https://github.com/UT-Austin-RobIn/telemoma) - A Modular and Versatile Teleoperation System for Mobile Manipulation

docs/README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ See the [examples/](https://github.com/JakubAndrysek/PySpaceMouse/tree/master/ex
203203
### Linux permissions
204204

205205
```bash
206-
sudo echo 'KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0664", GROUP="plugdev"' > /etc/udev/rules.d/99-hidraw-permissions.rules
206+
echo 'KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0664", GROUP="plugdev"' | sudo tee /etc/udev/rules.d/99-hidraw-permissions.rules
207207
sudo usermod -aG plugdev $USER
208208
newgrp plugdev
209209
```
@@ -218,8 +218,20 @@ export DYLD_LIBRARY_PATH=/opt/homebrew/Cellar/hidapi/<VERSION>/lib:$DYLD_LIBRARY
218218

219219
See [troubleshooting.md](./troubleshooting.md) for help with common issues.
220220

221-
## Used In
221+
## Developing / Contributing
222+
223+
This project includes a `Makefile` with commands for creating a virtual environment (using hatch), and publishing to pypi.
224+
225+
You will need `hatch` and `pre-commit` for this.
226+
You can get these by using
227+
228+
```
229+
pipx install hatch==1.15.1 pre-commit
230+
```
222231

232+
If you're not familiar with pipx, it lets you install python tools into isolated environments in `~/.local`.
233+
234+
## Used In
223235

224236
- [TeleMoMa](https://github.com/UT-Austin-RobIn/telemoma) - A Modular and Versatile Teleoperation System for Mobile Manipulation
225237
- [SERL](https://github.com/rail-berkeley/serl) - SERL: A Software Suite for Sample-Efficient Robotic Reinforcement Learning

docs/troubleshooting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ See [Custom Device Configuration](https://spacemouse.kubaandrysek.cz/mouseApi#cu
3535

3636
### ModuleNotFoundError: No module named 'easyhid'
3737

38-
- Install `easyhid` by `pip install easyhid-ng`.
38+
- Install `easyhid` by `pip install easyhid`.
3939

4040
### AttributeError: function/symbol 'hid_enumerate' not found in library '<None>': python3: undefined symbol: hid_enumerate
4141

pyproject.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ name = "pyspacemouse"
77
dynamic = ["version"]
88
description = "Multiplatform Python interface to the 3DConnexion Space Mouse - forked from pyspacenavigator"
99
readme = "README.md"
10-
authors = [{ name = "Jakub Andrýsek", email = "email@kubaandrysek.cz" }]
10+
authors = [
11+
{ name = "Jakub Andrýsek", email = "email@kubaandrysek.cz" },
12+
{ name = "Peter Mitrano", email = "mitranopeter@gmail.com" }
13+
]
1114
license = "MIT"
1215
keywords = [
1316
"pyspacemouse",
@@ -36,7 +39,7 @@ classifiers = [
3639
"Operating System :: OS Independent",
3740
"Topic :: System :: Hardware :: Universal Serial Bus (USB) :: Human Interface Device (HID)",
3841
]
39-
dependencies = ["easyhid-ng", "tomli; python_version < '3.11'"]
42+
dependencies = ["easyhid", "tomli; python_version < '3.11'"]
4043

4144
[project.urls]
4245
Documentation = "https://spacemouse.kubaandrysek.cz"
@@ -46,7 +49,6 @@ Source = "https://github.com/JakubAndrysek/pyspacemouse"
4649
[project.optional-dependencies]
4750
dev = [
4851
"build",
49-
"twine",
5052
"ruff>=0.12.0",
5153
"pytest>=7.0",
5254
"pytest-cov>=4.0",

troubleshooting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ See [Custom Device Configuration](https://spacemouse.kubaandrysek.cz/mouseApi#cu
3535

3636
### ModuleNotFoundError: No module named 'easyhid'
3737

38-
- Install `easyhid` by `pip install easyhid-ng`.
38+
- Install `easyhid` by `pip install easyhid`.
3939

4040
### AttributeError: function/symbol 'hid_enumerate' not found in library '<None>': python3: undefined symbol: hid_enumerate
4141

0 commit comments

Comments
 (0)