Lianhao Lu | 7676ca5 | 2018-03-22 20:39:04 +0800 | [diff] [blame] | 1 | #!/usr/bin/env python |
| 2 | |
| 3 | # |
| 4 | # Copyright (c) 2016-2017 GigaSpaces Technologies Ltd. All rights reserved. |
| 5 | # |
| 6 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 7 | # not use this file except in compliance with the License. You may obtain |
| 8 | # a copy of the License at |
| 9 | # |
| 10 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | # |
| 12 | # Unless required by applicable law or agreed to in writing, software |
| 13 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 14 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 15 | # License for the specific language governing permissions and limitations |
| 16 | # under the License. |
| 17 | # |
| 18 | |
| 19 | import os |
| 20 | from setuptools import find_packages, setup |
| 21 | import sys |
| 22 | |
| 23 | if sys.version_info < (2, 7): |
| 24 | sys.exit('VNF SDK requires Python 2.7+') |
| 25 | if sys.version_info >= (3, 0): |
| 26 | sys.exit('VNF SDK does not support Python 3') |
| 27 | |
| 28 | |
| 29 | root_dir = os.path.dirname(__file__) |
| 30 | install_requires = [] |
| 31 | extras_require = {} |
| 32 | |
| 33 | with open(os.path.join(root_dir, 'requirements.txt')) as requirements: |
| 34 | for requirement in requirements.readlines(): |
| 35 | # get rid of comments or trailing comments |
| 36 | requirement = requirement.split('#')[0].strip() |
| 37 | if not requirement: |
| 38 | continue # skip empty and comment lines |
| 39 | # dependencies which use environment markers have to go in as |
| 40 | # conditional dependencies under "extra_require", see more at: |
| 41 | # https://wheel.readthedocs.io/en/latest/index.html#defining-conditional-dependencies |
| 42 | if ';' in requirement: |
| 43 | package, condition = requirement.split(';') |
| 44 | cond_name = ':{0}'.format(condition.strip()) |
| 45 | extras_require.setdefault(cond_name, []) |
| 46 | extras_require[cond_name].append(package.strip()) |
| 47 | else: |
| 48 | install_requires.append(requirement) |
| 49 | |
| 50 | version = { } |
| 51 | with open(os.path.join(root_dir, 'vnfsdk_pkgtools/version.py')) as fp: |
| 52 | exec(fp.read(), version) |
| 53 | |
| 54 | setup( |
| 55 | name='vnfsdk', |
| 56 | version=version['__version__'], |
| 57 | description='VNFSDK CSAR package tool', |
| 58 | long_description="VNFSDK CSAR package tool in ONAP", |
| 59 | license='Apache License Version 2.0', |
| 60 | |
| 61 | author='ONAP', |
| 62 | |
| 63 | url='https://git.onap.org/vnfsdk/pkgtools', |
| 64 | |
| 65 | classifiers=[ |
| 66 | 'Development Status :: 4 - Beta', |
| 67 | 'Environment :: Console', |
| 68 | 'Environment :: Web Environment', |
| 69 | 'Intended Audience :: Developers', |
| 70 | 'Intended Audience :: System Administrators', |
| 71 | 'License :: OSI Approved :: Apache Software License', |
| 72 | 'Operating System :: OS Independent', |
| 73 | 'Programming Language :: Python', |
| 74 | 'Programming Language :: Python :: 2', |
| 75 | 'Programming Language :: Python :: 2.7', |
| 76 | 'Topic :: Software Development :: Libraries :: Python Modules', |
| 77 | 'Topic :: System :: Networking', |
| 78 | 'Topic :: System :: Systems Administration'], |
| 79 | |
| 80 | packages=find_packages(exclude=['tests*']), |
Lianhao Lu | 4e3368b | 2018-08-09 16:45:49 +0800 | [diff] [blame] | 81 | package_data={'vnfsdk_pkgtools.validator': ['*.yaml']}, |
Lianhao Lu | 7676ca5 | 2018-03-22 20:39:04 +0800 | [diff] [blame] | 82 | |
| 83 | entry_points={ |
| 84 | 'console_scripts': [ |
| 85 | 'vnfsdk = vnfsdk_pkgtools.cli.__main__:main'], |
| 86 | 'vnfsdk.pkgtools.validator': [ |
Lianhao Lu | 40f7a0f | 2018-08-02 14:48:53 +0800 | [diff] [blame] | 87 | 'toscaparser = vnfsdk_pkgtools.validator.toscaparser_validator:ToscaparserValidator', |
Lianhao Lu | 0af4624 | 2018-08-29 18:17:46 +0800 | [diff] [blame] | 88 | ], |
| 89 | 'vnfsdk.pkgtools.vnfreq': [ |
Lianhao Lu | 7debff0 | 2018-08-30 11:04:38 +0800 | [diff] [blame] | 90 | 'R-04298 = vnfsdk_pkgtools.vnfreq.pkg_reqs:R04298', |
Lianhao Lu | a2998ff | 2018-08-30 14:42:29 +0800 | [diff] [blame] | 91 | 'R-26881 = vnfsdk_pkgtools.vnfreq.pkg_reqs:R26881', |
Lianhao Lu | 5fa8e54 | 2018-08-30 15:02:05 +0800 | [diff] [blame] | 92 | 'R-35851 = vnfsdk_pkgtools.vnfreq.pkg_reqs:R35851', |
Lianhao Lu | 0af4624 | 2018-08-29 18:17:46 +0800 | [diff] [blame] | 93 | 'R-66070 = vnfsdk_pkgtools.vnfreq.pkg_reqs:R66070', |
Lianhao Lu | 40bcf5a | 2018-08-30 10:24:40 +0800 | [diff] [blame] | 94 | 'R-77707 = vnfsdk_pkgtools.vnfreq.pkg_reqs:R77707', |
Lianhao Lu | 0af4624 | 2018-08-29 18:17:46 +0800 | [diff] [blame] | 95 | ], |
Lianhao Lu | 7676ca5 | 2018-03-22 20:39:04 +0800 | [diff] [blame] | 96 | }, |
| 97 | |
| 98 | include_package_data=True, |
| 99 | install_requires=install_requires, |
| 100 | extras_require=extras_require) |
| 101 | |