-
Notifications
You must be signed in to change notification settings - Fork 87
/
setup.py
executable file
·81 lines (70 loc) · 2.57 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import sys, os, shutil, glob
# Some Angstrom images are missing the py_compile module; get it if not
# present:
import random
python_lib_path = random.__file__.split('random')[0]
if not os.path.exists(python_lib_path + 'py_compile.py'):
print "py_compile module missing; installing to %spy_compile.py" %\
python_lib_path
import urllib2
url = "http://hg.python.org/cpython/raw-file/4ebe1ede981e/Lib/py_compile.py"
py_compile = urllib2.urlopen(url)
with open(python_lib_path+'py_compile.py', 'w') as f:
f.write(py_compile.read())
print "testing py_compile..."
try:
import py_compile
print "py_compile installed successfully"
except Exception, e:
print "*py_compile install failed, could not import"
print "*Exception raised:"
raise e
print "Installing PyBBIO..."
from setuptools import setup, Extension, find_packages
install_requires = [
'pyserial',
'requests',
'serbus'
]
extensions = [
Extension('bbio.platform.util.sysfs',
['bbio/platform/util/sysfs.c']),
Extension('bbio.platform.beaglebone.gpio',
['bbio/platform/beaglebone/gpio.c',
'bbio/platform/util/sysfs.c'],
include_dirs=['bbio/platform/util']),
]
data_files = [
# Install the BBIOServer src files to ~/.BBIOServer:
('%s/.BBIOServer/src' % os.getenv('HOME'),
glob.glob('bbio/libraries/BBIOServer/src/*.*')),
# Install the DT overlays:
('/lib/firmware',
glob.glob('tools/overlays/compiled/*.dtbo')),
# Install the examples:
('/usr/local/lib/PyBBIO/examples',
glob.glob('examples/*')),
]
setup(name='PyBBIO',
version='0.10',
description='A Python library for Arduino-style hardware IO support on the BeagleBone and BeagleBone Black',
long_description=open('README.md').read(),
author='Alexander Hiam',
author_email='[email protected]',
license='MIT License',
url='https://github.com/graycatlabs/PyBBIO/wiki',
download_url='https://github.com/graycatlabs/PyBBIO/tarball/v0.10',
keywords=['BeagleBone', 'BeagleBone Black', 'IO', 'GPIO', 'ADC', 'PWM',
'I2C', 'SPI', 'bbio', 'eQEP'],
packages=find_packages(),
data_files=data_files,
ext_modules=extensions,
install_requires=install_requires,
platforms=['BeagleBone', 'BeagleBone Black'],
classifiers=[
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX :: Linux',
'Topic :: Software Development :: Embedded Systems',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: System :: Hardware'
])