-
Notifications
You must be signed in to change notification settings - Fork 53
/
Copy pathsetup.py
49 lines (43 loc) · 1.21 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
#!/usr/bin/env python
import os
import re
import sys
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
PKG = 'blinkstick'
VERSIONFILE = os.path.join(PKG, "_version.py")
verstr = "unknown"
try:
verstrline = open(VERSIONFILE, "rt").read()
except EnvironmentError:
pass # Okay, there is no version file.
else:
VSRE = r"(\d+\.\d+\.\d+)"
mo = re.search(VSRE, verstrline, re.M)
if mo:
verstr = mo.group(1)
else:
print("unable to find version in {0}").format(VERSIONFILE)
raise RuntimeError("if {0}.py exists, it is required to be well-formed".format(VERSIONFILE))
if sys.platform == "win32":
os_requires = [
"pywinusb"
]
else:
os_requires = [
"pyusb>=1.0.0"
]
setup(
name='BlinkStick',
version=verstr,
author='Arvydas Juskevicius',
author_email='[email protected]',
packages=find_packages(),
scripts=["bin/blinkstick"],
url='http://pypi.python.org/pypi/BlinkStick/',
license='LICENSE.txt',
description='Python package to control BlinkStick USB devices.',
long_description=read('README.rst'),
install_requires=os_requires,
)