Skip to content

Commit

Permalink
Merge testing branch for Python 3.11 fixes (#61)
Browse files Browse the repository at this point in the history
* Add gitignore

* Fix warning in printf

* Fix Python library install under Bookworm

* Update version

* Fix scripts to work under older Python 3
  • Loading branch information
nwright-mcc committed Oct 24, 2023
1 parent d5b2dcb commit 247b7cd
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build/*
daqhats.egg-info/*
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<tr><td>Info</td><td>Contains C and Python Libraries for interacting with
Measurement Computing DAQ HAT boards.</td></tr>
<tr><td>Author</td><td>Measurement Computing</td></tr>
<tr><td>Library Version<td>1.4.0.7</td></tr>
<tr><td>Library Version<td>1.4.0.8</td></tr>
</table>

## About
Expand Down
4 changes: 3 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/makefile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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='[email protected]',
Expand Down
3 changes: 2 additions & 1 deletion uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,15 @@ 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

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
Expand Down
5 changes: 5 additions & 0 deletions version_history.txt
Original file line number Diff line number Diff line change
@@ -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.
Expand Down

0 comments on commit 247b7cd

Please sign in to comment.