-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
51 lines (44 loc) · 1.46 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
import os
import glob
import shutil
from setuptools import setup
from setuptools.command.install import install
from distutils.sysconfig import get_python_lib
__library_file__ = './lib/pypowerboard*.so'
__version__ = "0.0.1"
__author__ = "LMWafer"
#-[] Utility class to install bindings
class CopyLibFile(install):
""""
Directly copy library file to python's site-packages directory.
"""
def run(self):
install_dirs = get_python_lib()
print(install_dirs)
lib_file = glob.glob(__library_file__)
assert len(lib_file) == 1 and len(install_dirs) >= 1
print(f"copying {lib_file[0]} -> {install_dirs[0]}")
shutil.copy(lib_file[0], install_dirs)
setup(
name = "pypowerboard",
version = __version__,
description = "A python binding for powerboard I2C driver.",
author = __author__,
keywords = "binding i2c powerboard driver motor controler",
url = "https://github.com/LMWafer/powerboard-driver",
long_description = open('README.md').read(),
author_email = "louismarie.restout@gmail.com",
cmdclass=dict(
install=CopyLibFile
),
classifiers =[
"Topic :: System :: Hardware :: Hardware Drivers",
"Programming Language :: Python :: 3",
"Programming Language :: C++",
"Operating System :: Unix",
"Natural Language :: English",
"License :: OSI Approved :: MIT License",
"Development Status :: 3 - Alpha"
],
license="MIT"
)