Skip to content

Commit

Permalink
Update Python Libraries part 1
Browse files Browse the repository at this point in the history
  • Loading branch information
theyosh committed Feb 11, 2025
1 parent 361cbc7 commit 9067277
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 16 deletions.
26 changes: 14 additions & 12 deletions Dockerfile.buster
Original file line number Diff line number Diff line change
Expand Up @@ -40,28 +40,30 @@ COPY contrib/python3-voltcraft-sem6000.patch.diff .

# requirements are slightly different for docker
# overruling does not work here, pip will exit with non 0 which will stop the build
RUN sed -i 's/paho-mqtt==.*//g' requirements.txt \
&& sed -i 's/icalendar==.*//g' requirements.txt \
&& sed -i 's/requests==.*/requests==2.31.0/g' requirements.txt \
&& sed -i 's/numpy==.*/numpy==1.21.4/g' requirements.txt \
&& sed -i 's/wheel==.*/wheel==0.42.0/g' requirements.txt \
&& sed -i 's/pip==.*/pip==24.0/g' requirements.txt \
RUN sed -i 's/pip==.*/pip==24.0/g' requirements.txt \
&& sed -i 's/setuptools==.*/setuptools==68.0.0/g' requirements.txt \
&& sed -i 's/bcrypt==.*/bcrypt==4.1.3/g' requirements.txt \
&& sed -i 's/wheel==.*/wheel==0.42.0/g' requirements.txt \
&& sed -i 's/yoyo-migrations==.*/yoyo-migrations==8.2.0/g' requirements.txt \
&& sed -i 's/python-dotenv==.*/python-dotenv==0.21.1/g' requirements.txt \
&& sed -i 's/gevent==.*/gevent==22.10.2/g' requirements.txt \
&& sed -i 's/bcrypt==.*/bcrypt==4.1.3/g' requirements.txt \
&& sed -i 's/cryptography==.*/cryptography==44.0.1/g' requirements.txt \
&& sed -i 's/Pillow==.*/Pillow==9.5.0/g' requirements.txt \
&& sed -i 's/numpy==.*/numpy==1.21.4/g' requirements.txt \
&& sed -i 's/opencv-python-headless==.*/opencv-python-headless==4.6.0.66/g' requirements.txt \
&& sed -i 's/gpiozero==.*/gpiozero==1.6.2/g' requirements.txt \
&& sed -i 's/requests==.*/requests==2.31.0/g' requirements.txt \
&& sed -i 's/python-kasa==.*/python-kasa==0.5.1/g' requirements.txt \
&& sed -i 's/pywemo==.*/pywemo==0.9.2/g' requirements.txt \
&& sed -i 's/Pillow==.*/Pillow==9.5.0/g' requirements.txt \
&& sed -i 's/Adafruit-Blinka==.*/Adafruit-Blinka==8.43.0/g' requirements.txt \
&& sed -i 's/icalevents==.*/icalevents==0.1.25/g' requirements.txt \
&& sed -i 's/packaging==.*/packaging==24.0/g' requirements.txt \
&& sed -i 's/pyfiglet==.*/pyfiglet==0.8.post1/g' requirements.txt \
&& sed -i 's/python-telegram-bot\[socks,http2\]==.*/python-telegram-bot\[socks,http2\]==20.3/g' requirements.txt \
&& sed -i 's/pydantic==.*/pydantic==1.10.9/g' requirements.txt \
&& sed -i 's/gpiozero==.*/gpiozero==1.6.2/g' requirements.txt \
&& sed -i 's/Adafruit-Blinka==.*/Adafruit-Blinka==8.43.0/g' requirements.txt \
&& sed -i 's/adafruit-circuitpython-typing==.*/adafruit-circuitpython-typing==1.10.1/g' requirements.txt \
&& sed -i 's/yoyo-migrations==.*/yoyo-migrations==8.2.0/g' requirements.txt \
&& sed -i 's/pydantic==.*/pydantic==1.10.9/g' requirements.txt \
&& sed -i 's/paho-mqtt==.*//g' requirements.txt \
&& sed -i 's/icalendar==.*//g' requirements.txt \
&& pip install smbus==1.1.post2 --extra-index-url https://www.piwheels.org/simple \
&& pip install -r requirements.txt --extra-index-url https://www.piwheels.org/simple \
&& find /opt/venv -type d -name "test*" | xargs rm -rf \
Expand Down
11 changes: 10 additions & 1 deletion docs/_faq/known_errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,19 @@ list of known messages which you can ignore.

## Bottle

```
```text
/home/pi/TerrariumPI/venv/lib/python3.7/site-packages/bottle.py:3383: DeprecationWarning: Absolute template path names are deprecated.
fname = self.search(name, self.lookup)
```

This message is very old, and TerrariumPI does not use bottle template engines.
So this message can be ignored.

## Cryptography

```text
/home/pi/TerrariumPI/venv/lib/python3.7/site-packages/telegram/_passport/credentials.py:25: CryptographyDeprecationWarning: Python 3.7 is no longer supported by the Python core team and support for it is deprecated in cryptography. A future release of cryptography will remove support for Python 3.7.
from cryptography.hazmat.backends import default_backend
```

This is a warning that in the next update of Cryptography, python 3.7 is not supported anymore. This impacts only old buster OS. For now, we can still use it.
4 changes: 3 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@ if [ "${OS}" == "buster" ]; then

PIP_MODULES="${PIP_MODULES//gevent==+([^ ])/gevent==22.10.2}"
PIP_MODULES="${PIP_MODULES//bcrypt==+([^ ])/bcrypt==4.1.3}"
PIP_MODULES="${PIP_MODULES//cryptography==+([^ ])/cryptography==44.0.1}"

PIP_MODULES="${PIP_MODULES//Pillow==+([^ ])/Pillow==9.5.0}"
PIP_MODULES="${PIP_MODULES//numpy==+([^ ])/numpy==1.21.4}"
PIP_MODULES="${PIP_MODULES//opencv-python-headless==+([^ ])/opencv-python-headless==4.6.0.66}"

PIP_MODULES="${PIP_MODULES//gpiozero==+([^ ])/gpiozero==1.6.2}"
PIP_MODULES="${PIP_MODULES//requests==+([^ ])/requests==2.31.0}"
Expand All @@ -75,8 +77,8 @@ if [ "${OS}" == "buster" ]; then

PIP_MODULES="${PIP_MODULES//python-telegram-bot\[socks,http2\]==+([^ ])/python-telegram-bot\[socks,http2\]==20.3}"

PIP_MODULES="${PIP_MODULES//pydantic==+([^ ])/pydantic==1.10.9}"
PIP_MODULES="${PIP_MODULES//adafruit-circuitpython-typing==+([^ ])/adafruit-circuitpython-typing==1.10.1}"
PIP_MODULES="${PIP_MODULES//pydantic==+([^ ])/pydantic==1.10.9}"

OPENCV_PACKAGES="libopenexr23 libilmbase23 liblapack3 libatlas3-base"

Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ retry==0.9.2
# !! Check first: https://piwheels.org/project/bcrypt/ !!
bcrypt==4.2.1
# !! Check first: https://piwheels.org/project/cryptography/ !!
cryptography==42.0.8
cryptography==44.0.1

# Webcam packages
Pillow==10.4.0
# !! Check first: https://piwheels.org/project/numpy/ !!
# Version 2 needs to be supported for all sub projects. Do not upgrade !!
numpy==1.26.4
# !! Check first: https://piwheels.org/project/opencv-python-headless/ !!
opencv-python-headless==4.6.0.66
opencv-python-headless==4.11.0.86
piexif==1.1.3

# Hardware / sensors packages
Expand Down

0 comments on commit 9067277

Please sign in to comment.