Skip to content

Commit 2d0d9ab

Browse files
committed
Merge branch 'dev' for release 0.0.2
2 parents 83f1262 + 2fbc211 commit 2d0d9ab

5 files changed

Lines changed: 40 additions & 11 deletions

File tree

CHANGELOG.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
0.0.2
2+
-----
3+
4+
* Improved search for .so file to pick up arch-specific files
5+
6+
0.0.1
7+
-----
8+
9+
* Initial release

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ include api/core/vl53l1_api_strings.c
1111
include api/core/vl53l1_api.c
1212
include api/platform/vl53l1_platform.c
1313
include python_lib/vl53l1x_python.c
14+
include README.rst
15+
include CHANGELOG.txt

dist.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
PYTHON_VERSIONS=(
4+
"3.5"
5+
"3.4"
6+
"2.7"
7+
)
8+
9+
for ((i = 0; i < ${#PYTHON_VERSIONS[@]}; i++)); do
10+
PYTHON_VERSION="${PYTHON_VERSIONS[$i]}"
11+
PYTHON_PATH="/usr/bin/python$PYTHON_VERSION"
12+
printf "Building for Python $PYTHON_VERSION\n"
13+
$PYTHON_PATH setup.py bdist_wheel
14+
done
15+

python/VL53L1X.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
from smbus2 import SMBus, i2c_msg
2626
import os
2727
import site
28+
import glob
2829

2930
class VL53L1xError(RuntimeError):
3031
pass
@@ -40,19 +41,23 @@ class VL53L1xDistanceMode:
4041

4142
# Load VL53L1X shared lib
4243
_POSSIBLE_LIBRARY_LOCATIONS = [os.path.dirname(os.path.realpath(__file__))] + site.getsitepackages()
44+
4345
try:
4446
_POSSIBLE_LIBRARY_LOCATIONS += [site.getusersitepackages()]
4547
except AttributeError:
4648
pass
4749

4850
for lib_location in _POSSIBLE_LIBRARY_LOCATIONS:
49-
try:
50-
_TOF_LIBRARY = CDLL(lib_location + "/vl53l1x_python.so")
51-
#print("Using: " + lib_location + "/vl51l1x_python.so")
52-
break
53-
except OSError:
54-
#print(lib_location + "/vl51l1x_python.so not found")
55-
pass
51+
files = glob.glob(lib_location + "/vl53l1x_python*.so")
52+
if len(files) > 0:
53+
lib_file = files[0]
54+
try:
55+
_TOF_LIBRARY = CDLL(lib_file)
56+
#print("Using: " + lib_location + "/vl51l1x_python.so")
57+
break
58+
except OSError:
59+
#print(lib_location + "/vl51l1x_python.so not found")
60+
pass
5661
else:
5762
raise OSError('Could not find vl53l1x_python.so')
5863

setup.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,12 @@
2222
'python_lib/vl53l1x_python.c'])
2323

2424
setup(name='VL53L1X',
25-
version='0.0.1',
25+
version='0.0.2',
2626
description='vl53l1x distance sensor driver for Raspberry Pi',
2727
# author='?',
2828
# author_email='?',
2929
url='https://github.com/pimoroni/vl53l1x-python',
30-
long_description='''
31-
vl53l1x sensor for Raspberry Pi.
32-
''',
30+
long_description=open('README.md').read() + "\n" + open('CHANGELOG.txt').read(),
3331
ext_modules=[extension],
3432
package_dir={'': 'python'},
3533
py_modules=['VL53L1X'],

0 commit comments

Comments
 (0)