From fabf93a39d17a0b5adcf988684b54a106c312eb3 Mon Sep 17 00:00:00 2001
From: leadnaut
Date: Fri, 13 Sep 2024 08:24:50 +1000
Subject: [PATCH] Removed hackiness for picamera on python3.10
---
bootstrap/apt_packages.txt | 8 --------
bootstrap/bootstrap.sh | 5 ++---
bootstrap/install_libcamera.sh | 10 ----------
poetry.lock | 17 ++++++++++++++++-
pyproject.toml | 1 +
requirements_uvonly.in | 4 ----
6 files changed, 19 insertions(+), 26 deletions(-)
delete mode 100644 bootstrap/apt_packages.txt
delete mode 100644 bootstrap/install_libcamera.sh
delete mode 100644 requirements_uvonly.in
diff --git a/bootstrap/apt_packages.txt b/bootstrap/apt_packages.txt
deleted file mode 100644
index c8c88c1..0000000
--- a/bootstrap/apt_packages.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-libcap-dev
-libcamera-dev
-libatlas-base-dev
-ffmpeg
-libopenjp2-7
-libkms++-dev
-libfmt-dev
-libdrm-dev
\ No newline at end of file
diff --git a/bootstrap/bootstrap.sh b/bootstrap/bootstrap.sh
index 6beac39..3900acf 100755
--- a/bootstrap/bootstrap.sh
+++ b/bootstrap/bootstrap.sh
@@ -52,10 +52,9 @@ else
fi
echo -e $INFO Copying Dependency Data
-$SSH_PREFIX scp ../{pyproject.toml,requirements_uvonly.in,README.md} ./apt_packages.txt $SSHUSER@$SSHTARGET:~/
+$SSH_PREFIX scp ../{pyproject.toml,README.md} ./apt_packages.txt $SSHUSER@$SSHTARGET:~/
echo -e $INFO Installing apt packages
-$SSH_GO "xargs -a apt_packages.txt sudo apt-get install -y"
echo -e $INFO Compiling dependencies
-$SSH_GO "~/.cargo/bin/uv pip compile pyproject.toml requirements_uvonly.in -o requirements.txt"
+$SSH_GO "~/.cargo/bin/uv pip compile pyproject.toml -o requirements.txt"
echo -e $INFO Installing dependencies
$SSH_GO "sudo ~/.cargo/bin/uv pip install --system --python 3.10 -r requirements.txt"
diff --git a/bootstrap/install_libcamera.sh b/bootstrap/install_libcamera.sh
deleted file mode 100644
index bbf8b79..0000000
--- a/bootstrap/install_libcamera.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#! /bin/bash
-#I'm running on the Pi and I assume I can see pyproject.toml, requirements_uvonly.in
-# and apt_packages.txt
-
-sudo swapoff -a
-sudo fallocate -l 4G /swapfile
-sudo mkswap /swapfile
-sudo swapon /swapfile
-
-sudo python3.10 -m pip install rpi-libcamera -C setup-args="-Dversion=unknown"
\ No newline at end of file
diff --git a/poetry.lock b/poetry.lock
index 98ef56f..2723ef3 100644
--- a/poetry.lock
+++ b/poetry.lock
@@ -2560,6 +2560,21 @@ pygments = ">=2.13.0,<3.0.0"
[package.extras]
jupyter = ["ipywidgets (>=7.5.1,<9)"]
+[[package]]
+name = "rpi-gpio"
+version = "0.7.1"
+description = "A module to control Raspberry Pi GPIO channels"
+optional = false
+python-versions = "*"
+files = [
+ {file = "RPi.GPIO-0.7.1-cp27-cp27mu-linux_armv6l.whl", hash = "sha256:b86b66dc02faa5461b443a1e1f0c1d209d64ab5229696f32fb3b0215e0600c8c"},
+ {file = "RPi.GPIO-0.7.1-cp310-cp310-linux_armv6l.whl", hash = "sha256:57b6c044ef5375a78c8dda27cdfadf329e76aa6943cd6cffbbbd345a9adf9ca5"},
+ {file = "RPi.GPIO-0.7.1-cp37-cp37m-linux_armv6l.whl", hash = "sha256:77afb817b81331ce3049a4b8f94a85e41b7c404d8e56b61ac0f1eb75c3120868"},
+ {file = "RPi.GPIO-0.7.1-cp38-cp38-linux_armv6l.whl", hash = "sha256:29226823da8b5ccb9001d795a944f2e00924eeae583490f0bc7317581172c624"},
+ {file = "RPi.GPIO-0.7.1-cp39-cp39-linux_armv6l.whl", hash = "sha256:15311d3b063b71dee738cd26570effc9985a952454d162937c34e08c0fc99902"},
+ {file = "RPi.GPIO-0.7.1.tar.gz", hash = "sha256:cd61c4b03c37b62bba4a5acfea9862749c33c618e0295e7e90aa4713fb373b70"},
+]
+
[[package]]
name = "scipy"
version = "1.14.1"
@@ -3496,4 +3511,4 @@ files = [
[metadata]
lock-version = "2.0"
python-versions = ">=3.10,<3.11"
-content-hash = "cfa573d23e10a422af08bcb559dc813f376dc10687a594f5155b19bdb8b0abe7"
+content-hash = "522fc6bbe247a2246802fe79ffdce379f57606f45d683110eb2ee3b615dc7738"
diff --git a/pyproject.toml b/pyproject.toml
index 8ba0975..b6ce3b6 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -18,6 +18,7 @@ deepface = "^0.0.93"
tensorflow-io-gcs-filesystem = "0.27.0"
tf-keras = "^2.17.0"
h5py = "3.10.0"
+rpi-gpio = "^0.7.1"
[tool.poetry.group.dev.dependencies]
pytest = "^8.3.2"
diff --git a/requirements_uvonly.in b/requirements_uvonly.in
deleted file mode 100644
index 6cc2bd6..0000000
--- a/requirements_uvonly.in
+++ /dev/null
@@ -1,4 +0,0 @@
-rpi-kms
-rpi-libcamera
-picamera2
-RPi.GPIO
\ No newline at end of file