From 247b7cd3f0a66a22b3025e0ecf337ef4a653deb4 Mon Sep 17 00:00:00 2001
From: nwright-mcc <32554608+nwright-mcc@users.noreply.github.com>
Date: Tue, 24 Oct 2023 09:17:30 -0400
Subject: [PATCH] Merge testing branch for Python 3.11 fixes (#61)
* Add gitignore
* Fix warning in printf
* Fix Python library install under Bookworm
* Update version
* Fix scripts to work under older Python 3
---
.gitignore | 2 ++
README.md | 2 +-
install.sh | 4 +++-
lib/gpio.c | 2 +-
lib/makefile | 2 +-
setup.py | 2 +-
uninstall.sh | 3 ++-
version_history.txt | 5 +++++
8 files changed, 16 insertions(+), 6 deletions(-)
create mode 100644 .gitignore
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..a5516cb
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+build/*
+daqhats.egg-info/*
diff --git a/README.md b/README.md
index 4bae2d3..8649fb8 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
Info | Contains C and Python Libraries for interacting with
Measurement Computing DAQ HAT boards. |
Author | Measurement Computing |
- Library Version | 1.4.0.7 |
+ Library Version | 1.4.0.8 |
## About
diff --git a/install.sh b/install.sh
index 728f57e..57872bb 100755
--- a/install.sh
+++ b/install.sh
@@ -42,6 +42,8 @@ dpkg-query -l python3-pip &> /dev/null
if [ "$?" != "0" ]; then
apt-get -qy install python3-pip
fi
+# Allow installing local package under Python 3.11+
+export PIP_BREAK_SYSTEM_PACKAGES=1
pip3 install . --upgrade
echo
@@ -66,7 +68,7 @@ if [ "$install_py2" == 1 ]; then
if [ "$?" != "0" ]; then
apt-get -qy install python-pip
fi
- pip2 install . --upgrade
+ pip2 install . --upgrade --break-system-packages
fi
echo
diff --git a/lib/gpio.c b/lib/gpio.c
index ebcc023..9e4fe25 100644
--- a/lib/gpio.c
+++ b/lib/gpio.c
@@ -108,7 +108,7 @@ static void gpio_init(void)
if (gpio_map == MAP_FAILED)
{
- printf("mmap failed %d\n", (int)gpio_map);
+ printf("mmap failed %p\n", gpio_map);
gpio = NULL;
return;
}
diff --git a/lib/makefile b/lib/makefile
index 96f3178..b6303f4 100644
--- a/lib/makefile
+++ b/lib/makefile
@@ -1,6 +1,6 @@
MAJOR = 1
MINOR = 4
-SUB = 0.7
+SUB = 0.8
NAME = daqhats
VERSION = $(MAJOR).$(MINOR).$(SUB)
INSTALL_DIR = /usr/local/lib
diff --git a/setup.py b/setup.py
index 1294a00..a0e1165 100755
--- a/setup.py
+++ b/setup.py
@@ -10,7 +10,7 @@
setup(
name='daqhats',
- version='1.4.0.7',
+ version='1.4.0.8',
description='MCC DAQ HAT Python Library',
author='Measurement Computing Corp.',
author_email='info@mccdaq.com',
diff --git a/uninstall.sh b/uninstall.sh
index 98e1488..3df5a12 100755
--- a/uninstall.sh
+++ b/uninstall.sh
@@ -34,7 +34,7 @@ if [ "$?" -eq 0 ]; then
num=$(pip2 show daqhats | wc -l)
if [ "$num" -ne 0 ]; then
echo "Removing Python 2 package"
- pip2 uninstall daqhats -y
+ pip2 uninstall daqhats -y --break-system-packages
echo
fi
fi
@@ -42,6 +42,7 @@ fi
num=$(pip3 show daqhats | wc -l)
if [ "$num" -ne 0 ]; then
echo "Removing Python 3 package"
+ export PIP_BREAK_SYSTEM_PACKAGES=1
pip3 uninstall daqhats -y
echo
fi
diff --git a/version_history.txt b/version_history.txt
index ba7e115..351695c 100644
--- a/version_history.txt
+++ b/version_history.txt
@@ -1,3 +1,8 @@
+1.4.0.8:
+ - Fixed install / uninstall scripts to allow installing the local Python library
+ on a system running Bookworm.
+ - Fixed warning in gpio.c.
+
1.4.0.7:
- Fixed error in the Python dio_output_write_dict() and dio_config_write_dict()
methods for the MCC 152.