Skip to content

Commit f33b8d7

Browse files
committed
Add CI and fix setuptools requirement for editable installs
- Add GitHub Actions CI testing install on Ubuntu 22.04/24.04 with Python 3.8/3.10/3.12 - Bump setuptools minimum from >=61.0 to >=64.0 (PEP 660 editable install support) - Add upgrade step in install instructions and troubleshooting section in README
1 parent 6ff43ba commit f33b8d7

3 files changed

Lines changed: 75 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
install:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [ubuntu-22.04, ubuntu-24.04]
15+
python-version: ["3.8", "3.10", "3.12"]
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
25+
- name: Upgrade pip and setuptools
26+
run: pip install --upgrade pip setuptools wheel
27+
28+
- name: Install package (editable)
29+
run: pip install -e .
30+
31+
- name: Verify import
32+
run: python -c "from sensx import SensX; print('import OK')"
33+
34+
- name: Install package (non-editable)
35+
run: |
36+
pip uninstall -y sensx
37+
pip install .
38+
39+
- name: Verify import (non-editable)
40+
run: python -c "from sensx import SensX; print('import OK')"

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Python driver for TouchTronix tactile sensors.
66

77
```bash
88
cd sensx_python
9+
pip install --upgrade pip setuptools wheel
910
pip install -e .
1011
```
1112

@@ -89,3 +90,36 @@ with SensX(port="/dev/ttyUSB0") as sensor:
8990
| `latest_frame` | Thread-safe copy of the most recent frame |
9091
| `latest_timestamp` | `time.perf_counter()` of the most recent frame |
9192
| `on_frame` | Callback: `fn(frame: np.ndarray, ts: float)` |
93+
94+
## Troubleshooting
95+
96+
### `build_editable` error on `pip install -e .`
97+
98+
```
99+
ERROR: Project ... has a 'pyproject.toml' and its build backend is missing the 'build_editable' hook.
100+
```
101+
102+
Your `setuptools` is too old. Editable installs require **setuptools >= 64.0** (PEP 660). Fix:
103+
104+
```bash
105+
pip install --upgrade pip setuptools wheel
106+
pip install -e .
107+
```
108+
109+
If you still can't use editable mode, a regular install also works:
110+
111+
```bash
112+
pip install .
113+
```
114+
115+
### `ModuleNotFoundError: No module named 'sensx'`
116+
117+
The install step above likely failed. Check the install output and retry.
118+
119+
### `command 'python' not found`
120+
121+
On Ubuntu 22.04+, use `python3` instead of `python`, or install the compatibility package:
122+
123+
```bash
124+
sudo apt install python-is-python3
125+
```

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[build-system]
2-
requires = ["setuptools>=61.0", "wheel"]
2+
requires = ["setuptools>=64.0", "wheel"]
33
build-backend = "setuptools.build_meta"
44

55
[project]

0 commit comments

Comments
 (0)