-
Notifications
You must be signed in to change notification settings - Fork 112
/
setup.py
59 lines (52 loc) · 1.79 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
#!/usr/bin/env python3
# Software License Agreement (BSD License)
#
# Copyright (c) 2017, UFactory, Inc.
# All rights reserved.
#
# Author: Vinman <[email protected]>
import os
from distutils.util import convert_path
try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup
def find_packages(base_path='.'):
base_path = convert_path(base_path)
found = []
for root, dirs, files in os.walk(base_path, followlinks=True):
dirs[:] = [d for d in dirs if d[0] != '.' and d not in ('ez_setup', '__pycache__')]
relpath = os.path.relpath(root, base_path)
parent = relpath.replace(os.sep, '.').lstrip('.')
if relpath != '.' and parent not in found:
# foo.bar package but no foo package, skip
continue
for dir in dirs:
if os.path.isfile(os.path.join(root, dir, '__init__.py')):
package = '.'.join((parent, dir)) if parent else dir
found.append(package)
return found
main_ns = {}
ver_path = convert_path('xarm/version.py')
with open(os.path.join(os.getcwd(), ver_path)) as ver_file:
exec(ver_file.read(), main_ns)
version = main_ns['__version__']
# long_description = open('README.rst').read()
long_description = 'long description for xArm-Python-SDK'
try:
with open(os.path.join(os.getcwd(), 'requirements.txt')) as f:
requirements = f.read().splitlines()
except:
requirements = []
setup(
name='xArm-Python-SDK',
version=version,
author='Vinman',
description='Python SDK for xArm',
packages=find_packages(),
author_email='[email protected]',
install_requires=requirements,
long_description=long_description,
license='MIT',
zip_safe=False
)