-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
executable file
·49 lines (42 loc) · 1.23 KB
/
setup.py
File metadata and controls
executable file
·49 lines (42 loc) · 1.23 KB
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/python
import sys
import os
from distutils.core import setup
from distutils.errors import *
if sys.version_info < (2, 4) or sys.version_info[0] == 3:
raise DistutilsError("This package requires Python 2.4 or higher versions 2.x not Python3")
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)),r"src/UcsSdk"))
from Version import __version__
name='UcsSdk'
def is_package(path):
return (
os.path.isdir(path) and
os.path.isfile(os.path.join(path, '__init__.py'))
)
def find_packages(path, base="" ):
packages = {}
for item in os.listdir(path):
dir = os.path.join(path, item)
if is_package( dir ):
if base:
module_name = "%(base)s.%(item)s" % vars()
else:
module_name = item
packages[module_name] = dir
packages.update(find_packages(dir, module_name))
return packages
setup(
name=name,
version=__version__,
description='Python SDK for Cisco UCS Manager',
author='Cisco Systems',
author_email='',
long_description='Install Instructions: sudo python setup.py install',
license='LICENSE.txt',
packages=find_packages('src'),
package_dir = {'': 'src'},
namespace_packages=['UcsSdk'],
package_data={'': ['resources/*.xml']},
include_package_data = True,
zip_safe = False,
)