From ebcc4936f7bfbdc9b026d52880f2935d19c932f0 Mon Sep 17 00:00:00 2001 From: Melissa LeBlanc-Williams Date: Fri, 20 Oct 2023 11:06:44 -0700 Subject: [PATCH 1/3] Update pitft to run in venv --- adafruit-pitft.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/adafruit-pitft.py b/adafruit-pitft.py index d8f8493..100f32c 100755 --- a/adafruit-pitft.py +++ b/adafruit-pitft.py @@ -7,14 +7,15 @@ Written in Python by Melissa LeBlanc-Williams for Adafruit Industries import time import os +import sys try: import click except ImportError: - raise RuntimeError("The library 'Click' was not found. To install, try typing: sudo pip3 install Click") + raise RuntimeError("The library 'Click' was not found. To install, try typing: pip3 install Click") try: from adafruit_shell import Shell except ImportError: - raise RuntimeError("The library 'adafruit_shell' was not found. To install, try typing: sudo pip3 install adafruit-python-shell") + raise RuntimeError("The library 'adafruit_shell' was not found. To install, try typing: pip3 install adafruit-python-shell") shell = Shell() shell.group = 'PITFT' @@ -242,7 +243,8 @@ def softwareinstall(): warn_exit("Apt failed to install TSLIB!") if not shell.run_command("apt-get install -y bc fbi git python3-dev python3-pip python3-smbus python3-spidev evtest libts-bin device-tree-compiler libraspberrypi-dev build-essential"): warn_exit("Apt failed to install software!") - if not shell.run_command("pip3 install evdev"): + pip_path = f"{os.path.dirname(sys.executable)}/pip3" + if not shell.run_command(f"{pip_path} install evdev", run_as_user=os.environ["SUDO_USER"]): warn_exit("Pip failed to install software!") return True From def7058ee914a2099ed8be7c75f4a6819f6d050d Mon Sep 17 00:00:00 2001 From: Melissa LeBlanc-Williams Date: Fri, 20 Oct 2023 13:13:25 -0700 Subject: [PATCH 2/3] Update script version number --- adafruit-pitft.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adafruit-pitft.py b/adafruit-pitft.py index 100f32c..1f92397 100755 --- a/adafruit-pitft.py +++ b/adafruit-pitft.py @@ -20,7 +20,7 @@ except ImportError: shell = Shell() shell.group = 'PITFT' -__version__ = "3.5.0" +__version__ = "3.6.0" """ This is the main configuration. Displays should be placed in the order From 8ab58b59ed8ff53a9a369b44011f048006800213 Mon Sep 17 00:00:00 2001 From: Melissa LeBlanc-Williams Date: Fri, 20 Oct 2023 14:21:48 -0700 Subject: [PATCH 3/3] Change some py packages to be installed via apt-get --- adafruit-pitft.py | 5 +---- raspi-blinka.py | 5 ++--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/adafruit-pitft.py b/adafruit-pitft.py index 1f92397..ff16d79 100755 --- a/adafruit-pitft.py +++ b/adafruit-pitft.py @@ -241,11 +241,8 @@ def softwareinstall(): if not shell.run_command("apt-get install -y tslib"): if not shell.run_command("apt-get install -y libts-dev"): warn_exit("Apt failed to install TSLIB!") - if not shell.run_command("apt-get install -y bc fbi git python3-dev python3-pip python3-smbus python3-spidev evtest libts-bin device-tree-compiler libraspberrypi-dev build-essential"): + if not shell.run_command("apt-get install -y bc fbi git python3-dev python3-pip python3-smbus python3-spidev evtest libts-bin device-tree-compiler libraspberrypi-dev build-essential python3-evdev"): warn_exit("Apt failed to install software!") - pip_path = f"{os.path.dirname(sys.executable)}/pip3" - if not shell.run_command(f"{pip_path} install evdev", run_as_user=os.environ["SUDO_USER"]): - warn_exit("Pip failed to install software!") return True def uninstall_bootconfigtxt(): diff --git a/raspi-blinka.py b/raspi-blinka.py index b859788..20af1b3 100644 --- a/raspi-blinka.py +++ b/raspi-blinka.py @@ -81,9 +81,8 @@ def update_python(): shell.run_command("sudo update-alternatives --skip-auto --config python") def update_pip(): - print("Making sure PIP is installed") - shell.run_command("sudo apt-get install -y python3-pip") - shell.run_command("sudo pip3 install --upgrade setuptools") + print("Making sure PIP and setuptools is installed") + shell.run_command("sudo apt-get install --upgrade -y python3-pip python3-setuptools") def install_blinka(user=False): print("Installing latest version of Blinka locally")