Skip to content
This repository was archived by the owner on Apr 10, 2025. It is now read-only.

Commit 45b6c5e

Browse files
committed
Simplify dependencies
1 parent 1d1af01 commit 45b6c5e

File tree

11 files changed

+725
-321
lines changed

11 files changed

+725
-321
lines changed

.github/workflows/control-build.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- uses: actions/checkout@v4
3131

3232
- name: Install poetry
33-
run: pipx install poetry==1.7.1
33+
run: pipx install poetry==2.1.2
3434

3535
- name: Set up Python
3636
uses: actions/setup-python@v5
@@ -43,7 +43,8 @@ jobs:
4343
- name: Install build dependencies
4444
run: |
4545
sudo apt-get install -y libcap-dev
46-
poetry -C ./control/ install --with dev,hw-dev --no-root
46+
poetry -C ./control/ install --with dev --no-root
4747
4848
- name: Run checks
49-
run: poetry -C ./control/ run poe --root ./control/ check
49+
working-directory: ./control
50+
run: poetry run poe check

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ This repository contains the PlanktoScope's backend software services implementi
1515
- Data processing: transforms raw data into processed data for downstream analysis and quantification. Currently, data processing functionality consists of:
1616
- [Object isolation and segmentation](./processing/segmenter/README.md): detects objects from camera frames and creates an image for each isolated object, with the background removed.
1717

18-
## Usage
19-
20-
TBD
21-
2218
## Licensing
2319

2420
Except where otherwise indicated, source code provided here is covered by the following information:

control/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@ However, the organization of the source code does not yet reflect the organizati
1919

2020
Currently the hardware controller can only be deployed as part of the distro setup scripts at [github.com/PlanktoScope/PlanktoScope](https://github.com/PlanktoScope/PlanktoScope).
2121

22+
Please note that for camera we rely on the Raspberry OS packages `python3-picamera2` and `python3-libcamera`.
23+
2224
### Development
2325

2426
To install all dependencies including development tooling, run:
2527
```
26-
poetry install --with dev,hw-dev --no-root
28+
poetry install --with dev --no-root
2729
```
2830

2931
Then you can run the code auto-formatter on the project by running:
@@ -51,8 +53,8 @@ needed.
5153

5254
To use this project, you'll need:
5355

54-
- Python 3.9
55-
- Poetry 1.4.2
56+
- Python >= 3.9
57+
- Poetry 2.1.2
5658

5759
## Licensing
5860

control/planktoscopehat/planktoscope/light.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class Register(enum.IntEnum):
4141

4242
def __init__(self):
4343
# The led is controlled by LM36011
44-
# but on version < 2 of the PlanktoScope hat (for example PlanktoScope v2.6)
44+
# but on version 1.2 of the PlanktoScope HAT (PlanktoScope v2.6)
4545
# the circuit is connected to that pin so it needs to be high
4646
# pin is assigned to self to prevent gpiozero from immediately releasing it
4747
self.__pin = DigitalOutputDevice(pin=18, initial_value=True)

control/poetry.lock

Lines changed: 603 additions & 259 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

control/poetry.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[virtualenvs.options]
2+
system-site-packages = true

control/pyproject.toml

Lines changed: 12 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -33,42 +33,20 @@ build-backend = "poetry.core.masonry.api"
3333

3434
[tool.poetry.dependencies]
3535
python = ">=3.9.2"
36-
paho-mqtt = "~1.6.1"
37-
loguru = "~0.5.3"
38-
readerwriterlock = "~1.0.9"
36+
paho-mqtt = "^1.6.1"
37+
loguru = "^0.5.3"
38+
readerwriterlock = "^1.0.9"
3939

4040
[tool.poetry.group.hw.dependencies]
41-
rpi-gpio = "~0.7.0"
42-
adafruit-blinka = "~8.19.0"
43-
adafruit-circuitpython-motorkit = "~1.6.3"
44-
adafruit-circuitpython-motor = "~3.3.1"
45-
adafruit-ssd1306 = "~1.6.2"
46-
adafruit-platformdetect = "~3.45.2"
47-
smbus2 = "~0.4.1"
48-
spidev = "~3.5"
41+
rpi-gpio = "^0.7.0"
42+
adafruit-blinka = "^8.19.0"
43+
adafruit-circuitpython-motorkit = "^1.6.3"
44+
adafruit-circuitpython-motor = "^3.3.1"
45+
adafruit-ssd1306 = "^1.6.2"
46+
adafruit-platformdetect = "^3.45.2"
47+
smbus2 = "^0.4.1"
48+
spidev = "^3.5"
4949
gpiozero = "^2.0.1"
50-
# Note: the following packages are only indirect dependencies, but we need to download wheels from
51-
# the appropriate sources, so we must explicitly select them here
52-
rpi-ws281x = "~5.0.0"
53-
sysv-ipc = "~1.1.0"
54-
55-
[tool.poetry.group.hw-dev]
56-
optional = true
57-
58-
# Note: the following packages are only indirect dependencies of picamera2, and on the RPi we use
59-
# the system's installation of them (managed by apt-get) because poetry tries to build them from
60-
# source instead of installing the armv7l wheels. Maybe poetry is messing up at detecting the
61-
# machine platform or something.
62-
[tool.poetry.group.hw-dev.dependencies]
63-
# v1.19.5 (the version from the RPi on bullseye) fails to install in GitHub Actions, so we just use
64-
# the latest version and hope that the differences won't be significant enough to cause a mismatch
65-
# between CI and the production environment (i.e. the RPi):
66-
picamera2 = "==0.3.12"
67-
numpy = "~1.26.4"
68-
pidng = "~4.0.9"
69-
simplejpeg = "~1.6.4"
70-
pillow = "~10.2.0"
71-
av = "~10.0.0"
7250

7351
[tool.poetry.group.dev]
7452
optional = true
@@ -84,6 +62,7 @@ flake8-import-restrictions = "^2.0.1"
8462
pylint = "^3.1.0"
8563
pylint-google-style-guide-imports-enforcing = "^1.3.0"
8664
types-paho-mqtt = "^1.6.0.20240106"
65+
picamera2 = "^0.3.25"
8766

8867
[tool.black]
8968
# We are gradually introducing standard formatting as we rewrite each module; we haven't rewritten

processing/segmenter/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ WORKDIR /home/pi/device-backend/processing/segmenter
2424
COPY --chown=pi:pi pyproject.toml poetry.lock ./
2525
RUN \
2626
export PATH="/home/pi/.local/bin:$PATH" && \
27-
pip install --no-cache-dir cryptography==43.0.3 poetry==1.7.1 \
27+
pip install --no-cache-dir cryptography==43.0.3 poetry==2.1.2 \
2828
--extra-index-url https://www.piwheels.org/simple && \
2929
poetry install --no-root --only main --compile && \
3030
poetry --no-interaction cache list && \

processing/segmenter/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ Currently, the simplest way to deploy the segmenter on any computer is using the
1818

1919
TBD
2020

21+
### Prerequisites
22+
23+
To use this project, you'll need:
24+
25+
- Python >= 3.9
26+
- Poetry 2.1.2
27+
2128
## Licensing
2229

2330
Except where otherwise indicated, source code provided here is covered by the following information:

0 commit comments

Comments
 (0)