Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions .github/FUNDING.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/deploy-web.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ jobs:
pip install -e ".[docs]"
sudo apt-get install -y doxygen
- name: Deploy docs
run: make docs-deploy
run: make docs-deploy
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ release.sh
html
.DS_Store
.mkdoxy
site/
site/
2 changes: 1 addition & 1 deletion .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/pyspacemouse.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ repos:
- id: check-merge-conflict

default_language_version:
python: python3.8
python: python3.12
2 changes: 1 addition & 1 deletion .sourcery.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
refactor:
skip:
- use-named-expression # Python 3.8+
- use-named-expression # Python 3.8+
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,4 @@ To update documentation from root to `/docs` use macro `make fixRelativeLinkDocs
The documentation is built using [mkdocs](https://www.mkdocs.org/). To test the documentation locally, run `make docs-serve` and open [http://localhost:8000](http://localhost:8000) in your browser.

### Deploying the documentation
The documentation is deployed automatically using GitHub Actions. Just push to the `master` branch and the documentation will be updated automatically.
The documentation is deployed automatically using GitHub Actions. Just push to the `master` branch and the documentation will be updated automatically.
1 change: 0 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

34 changes: 13 additions & 21 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,13 @@ build-clean:
hatch clean
hatch build

install: build
python3 -m pip install --no-deps --force dist/*.whl

# Publishing (using Hatch)
publish: build
hatch publish

publish-test: build
hatch publish --repo test

# Legacy twine commands (deprecated, use publish/publish-test)
release: build
twine upload --repository pypi dist/*

release-test: build
twine upload --repository testpypi dist/*

# Version management (using Hatch)
version:
hatch version
Expand All @@ -53,8 +43,7 @@ clean:

# Development
install-dev:
hatch env create
python3 -m pip install --editable ".[dev]"
hatch run pip install --editable ".[dev]"

# Code Quality
lint:
Expand All @@ -67,14 +56,14 @@ format-check:
hatch run ruff format --check .

# Testing
test:
test: # FIXME!
hatch run test:pytest

test-cov:
test-cov: # FIXME!
hatch run test:pytest --cov-report=html

run-demo:
python3 ./examples/basicExample.py
hatch run python ./examples/01_basic.py

# Pre-commit
pre-commit-install:
Expand All @@ -84,21 +73,24 @@ pre-commit-run:
pre-commit run --all-files


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

fixRelativeLinkDocs:
sed 's/\.\/docs/\./g' README.md > docs/README.md
sed 's/\.\/docs/\./g' CONTRIBUTING.md > docs/CONTRIBUTING.md
sed 's/\.\/docs/\./g' troubleshooting.md > docs/troubleshooting.md

# Docs
docs-build: fixRelativeLinkDocs
docs-build: install-doxygen fixRelativeLinkDocs
@echo "Building docs..."
mkdocs build
hatch run dev:mkdocs build

docs-serve: fixRelativeLinkDocs
docs-serve: install-doxygen fixRelativeLinkDocs
@echo "Serving docs..."
mkdocs serve
hatch run dev:mkdocs serve

docs-deploy: fixRelativeLinkDocs
docs-deploy: install-doxygen fixRelativeLinkDocs
@echo "Deploying docs..."
mkdocs gh-deploy --force
hatch run dev:mkdocs gh-deploy
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ See the [examples/](https://github.com/JakubAndrysek/PySpaceMouse/tree/master/ex
### Linux permissions

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

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

## Used In
## Developing / Contributing

This project includes a `Makefile` with commands for creating a virtual environment (using hatch), and publishing to pypi.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (typo): Use the correct capitalization for PyPI.

Change pypi to PyPI in this sentence.

Suggested change
This project includes a `Makefile` with commands for creating a virtual environment (using hatch), and publishing to pypi.
This project includes a `Makefile` with commands for creating a virtual environment (using hatch), and publishing to PyPI.


You will need `hatch` and `pre-commit` for this.
You can get these by using

```
pipx install hatch==1.15.1 pre-commit
```

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick (typo): Capitalize “Python” when referring to the language.

Change python tools to Python tools for correct capitalization.

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


For building the documentation locally, you will also need `doxygen` installed and on the path.

## Used In

- [TeleMoMa](https://github.com/UT-Austin-RobIn/telemoma) - A Modular and Versatile Teleoperation System for Mobile Manipulation
- [SERL](https://github.com/rail-berkeley/serl) - SERL: A Software Suite for Sample-Efficient Robotic Reinforcement Learning
Expand Down
2 changes: 1 addition & 1 deletion docs/CNAME
Original file line number Diff line number Diff line change
@@ -1 +1 @@
spacemouse.kubaandrysek.cz
spacemouse.kubaandrysek.cz
2 changes: 1 addition & 1 deletion docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,4 @@ To update documentation from root to `/docs` use macro `make fixRelativeLinkDocs
The documentation is built using [mkdocs](https://www.mkdocs.org/). To test the documentation locally, run `make docs-serve` and open [http://localhost:8000](http://localhost:8000) in your browser.

### Deploying the documentation
The documentation is deployed automatically using GitHub Actions. Just push to the `master` branch and the documentation will be updated automatically.
The documentation is deployed automatically using GitHub Actions. Just push to the `master` branch and the documentation will be updated automatically.
16 changes: 14 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ See the [examples/](https://github.com/JakubAndrysek/PySpaceMouse/tree/master/ex
### Linux permissions

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

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

## Used In
## Developing / Contributing

This project includes a `Makefile` with commands for creating a virtual environment (using hatch), and publishing to pypi.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (typo): Use the correct capitalization for PyPI.

In this sentence, update pypi to PyPI to match the official capitalization.

Suggested change
This project includes a `Makefile` with commands for creating a virtual environment (using hatch), and publishing to pypi.
This project includes a `Makefile` with commands for creating a virtual environment (using hatch), and publishing to PyPI.


You will need `hatch` and `pre-commit` for this.
You can get these by using

```
pipx install hatch==1.15.1 pre-commit
```

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick (typo): Capitalize “Python” when referring to the language.

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


## Used In

- [TeleMoMa](https://github.com/UT-Austin-RobIn/telemoma) - A Modular and Versatile Teleoperation System for Mobile Manipulation
- [SERL](https://github.com/rail-berkeley/serl) - SERL: A Software Suite for Sample-Efficient Robotic Reinforcement Learning
Expand Down
2 changes: 1 addition & 1 deletion docs/mouseApi/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,4 @@ with pyspacemouse.open(device_spec=ros_spec) as device:
print(f"x={state.x:.2f} y={state.y:.2f} z={state.z:.2f}")
````

See also: `create_device_info()` for creating completely custom device specs.
See also: `create_device_info()` for creating completely custom device specs.
2 changes: 1 addition & 1 deletion docs/mouseApi/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,4 @@ Pass the custom spec to `open()` or `open_by_path()`:
```python
with pyspacemouse.open(device_spec=ros_spec) as device:
state = device.read()
```
```
2 changes: 1 addition & 1 deletion docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ See [Custom Device Configuration](https://spacemouse.kubaandrysek.cz/mouseApi#cu

### ModuleNotFoundError: No module named 'easyhid'

- Install `easyhid` by `pip install easyhid-ng`.
- Install `easyhid` by `pip install easyhid`.

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

Expand Down
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,4 @@ nav:
- 'Functions': 'mouseApi/functions.md'
- 'Variables': 'mouseApi/variables.md'
- 'Macros': 'mouseApi/macros.md'
- 'Files': 'mouseApi/files.md'
- 'Files': 'mouseApi/files.md'
8 changes: 5 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ name = "pyspacemouse"
dynamic = ["version"]
description = "Multiplatform Python interface to the 3DConnexion Space Mouse - forked from pyspacenavigator"
readme = "README.md"
authors = [{ name = "Jakub Andrýsek", email = "email@kubaandrysek.cz" }]
authors = [
{ name = "Jakub Andrýsek", email = "email@kubaandrysek.cz" },
{ name = "Peter Mitrano", email = "mitranopeter@gmail.com" }
]
license = "MIT"
keywords = [
"pyspacemouse",
Expand Down Expand Up @@ -36,7 +39,7 @@ classifiers = [
"Operating System :: OS Independent",
"Topic :: System :: Hardware :: Universal Serial Bus (USB) :: Human Interface Device (HID)",
]
dependencies = ["easyhid-ng", "tomli; python_version < '3.11'"]
dependencies = ["easyhid", "tomli; python_version < '3.11'"]

[project.urls]
Documentation = "https://spacemouse.kubaandrysek.cz"
Expand All @@ -46,7 +49,6 @@ Source = "https://github.com/JakubAndrysek/pyspacemouse"
[project.optional-dependencies]
dev = [
"build",
"twine",
"ruff>=0.12.0",
"pytest>=7.0",
"pytest-cov>=4.0",
Expand Down
2 changes: 1 addition & 1 deletion troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ See [Custom Device Configuration](https://spacemouse.kubaandrysek.cz/mouseApi#cu

### ModuleNotFoundError: No module named 'easyhid'

- Install `easyhid` by `pip install easyhid-ng`.
- Install `easyhid` by `pip install easyhid`.

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

Expand Down