forked from ftd2xx/ftd2xx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
57 lines (50 loc) · 1.83 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
from setuptools import setup, find_packages
import subprocess
import sys
if sys.version_info >= (3, 0):
try:
from distutils.command.build_py import build_py_2to3 as build_py
from distutils.command.build_scripts import build_scripts_2to3 as build_scripts
except ImportError:
raise ImportError("build_py_2to3 not found in distutils - it is required for Python 3.x")
suffix = "-py3k"
else:
from distutils.command.build_py import build_py
from distutils.command.build_scripts import build_scripts
suffix = ""
import os
mydir = os.path.dirname(__file__)
if os.path.exists(os.path.join(mydir, '.bzr')):
from bzrlib.branch import Branch
branch = Branch.open_containing('.')[0]
revno = branch.revno()
revid = branch.get_rev_id(revno)
rtagdict = branch.tags.get_reverse_tag_dict()
if revid in rtagdict:
version = rtagdict[revid][0]
else:
version = 'bzr%s' % revno
f = open(os.path.join(mydir, 'myversion.txt'), 'w')
print >> f, "version = %s" % version
f.close()
else:
version = open(os.path.join(mydir, 'myversion.txt'), 'rU').read().strip()
with open('README.rst') as f:
long_description = f.read()
setup(
name="ftd2xx" + suffix,
version=version,
packages=find_packages(),
# metadata for upload to PyPI
author="Satya Mishra",
author_email="[email protected]",
description="Python interface to ftd2xx.dll from FTDI using ctypes based on d2xx by Pablo Bleyer",
license="BSD",
keywords="ftd2xx d2xx ftdi",
url='https://github.com/snmishra/ftd2xx', # project home page, if any
zip_safe=False,
test_suite="ftd2xx.tests.t_ftd2xx",
long_description=long_description,
cmdclass = {'build_py': build_py, 'build_scripts': build_scripts},
# could also include long_description, download_url, classifiers, etc.
)