2020-09-29 00:34:39 -05:00
|
|
|
import glob
|
2020-10-26 15:48:50 -05:00
|
|
|
import sys
|
2017-01-06 20:19:42 -06:00
|
|
|
|
|
|
|
from setuptools import setup
|
2017-01-19 22:56:26 -06:00
|
|
|
|
2020-10-26 15:48:50 -05:00
|
|
|
# Common dependencies for Python 2 and 3
|
2020-09-29 00:34:39 -05:00
|
|
|
dependencies = [
|
2020-10-26 15:48:50 -05:00
|
|
|
'bitarray==1.5.3',
|
|
|
|
'ipaddress==1.0.23',
|
2021-03-27 13:54:38 -05:00
|
|
|
'lxml==4.6.3',
|
2020-10-26 15:48:50 -05:00
|
|
|
'netaddr==0.8.0',
|
2021-01-28 12:46:56 -06:00
|
|
|
'pyyaml==5.4.1',
|
2020-10-26 15:48:50 -05:00
|
|
|
'sonic-py-common',
|
|
|
|
]
|
|
|
|
|
|
|
|
if sys.version_info.major == 3:
|
|
|
|
# Python 3-only dependencies
|
|
|
|
dependencies += [
|
|
|
|
# pyangbind v0.8.1 pull down enum43 which causes 're' package to malfunction.
|
|
|
|
# Python3 has enum module and so pyangbind should be installed outside
|
|
|
|
# dependencies section of setuptools followed by uninstall of enum43
|
|
|
|
# 'pyangbind==0.8.1',
|
2021-06-10 14:03:33 -05:00
|
|
|
'Jinja2>=2.10',
|
|
|
|
'sonic-yang-mgmt>=1.0',
|
|
|
|
'sonic-yang-models>=1.0'
|
2020-10-26 15:48:50 -05:00
|
|
|
]
|
|
|
|
else:
|
|
|
|
# Python 2-only dependencies
|
|
|
|
dependencies += [
|
|
|
|
# Jinja2 v3.0.0+ dropped support for Python 2.7 and causes setuptools to
|
|
|
|
# malfunction on stretch slave docker.
|
2020-09-29 00:34:39 -05:00
|
|
|
'future',
|
|
|
|
'Jinja2<3.0.0',
|
|
|
|
'pyangbind==0.6.0',
|
2020-12-23 20:00:31 -06:00
|
|
|
'zipp==1.2.0', # importlib-resources needs zipp and seems to have a bug where it will try to install too new of a version for Python 2
|
2021-06-28 19:15:03 -05:00
|
|
|
'importlib-resources==3.3.1', # importlib-resources v4.0.0 was released 2020-12-23 and drops support for Python 2
|
|
|
|
'contextlib2==0.6.0.post1'
|
2020-10-26 15:48:50 -05:00
|
|
|
]
|
|
|
|
|
2021-06-10 14:03:33 -05:00
|
|
|
# Common modules for python2 and python3
|
|
|
|
py_modules = [
|
|
|
|
'config_samples',
|
|
|
|
'minigraph',
|
|
|
|
'openconfig_acl',
|
|
|
|
'portconfig',
|
|
|
|
'redis_bcc',
|
|
|
|
]
|
|
|
|
if sys.version_info.major == 3:
|
|
|
|
# Python 3-only modules
|
|
|
|
py_modules += [
|
|
|
|
'sonic_yang_cfg_generator'
|
|
|
|
]
|
2017-03-17 13:07:12 -05:00
|
|
|
|
2020-08-19 11:29:40 -05:00
|
|
|
setup(
|
|
|
|
name = 'sonic-config-engine',
|
|
|
|
version = '1.0',
|
|
|
|
description = 'Utilities for generating SONiC configuration files',
|
2020-09-29 00:34:39 -05:00
|
|
|
author = 'Taoyu Li',
|
|
|
|
author_email = 'taoyl@microsoft.com',
|
2020-08-19 11:29:40 -05:00
|
|
|
url = 'https://github.com/Azure/sonic-buildimage',
|
2021-06-10 14:03:33 -05:00
|
|
|
py_modules = py_modules,
|
2020-08-19 11:29:40 -05:00
|
|
|
scripts = [
|
|
|
|
'sonic-cfggen',
|
|
|
|
],
|
2020-09-29 00:34:39 -05:00
|
|
|
install_requires = dependencies,
|
2020-08-19 11:29:40 -05:00
|
|
|
data_files = [
|
2018-04-24 18:01:17 -05:00
|
|
|
('/usr/share/sonic/templates', glob.glob('data/*')),
|
2020-08-19 11:29:40 -05:00
|
|
|
],
|
2020-09-29 00:34:39 -05:00
|
|
|
setup_requires= [
|
|
|
|
'pytest-runner',
|
2020-10-26 15:48:50 -05:00
|
|
|
'wheel'
|
2020-09-29 00:34:39 -05:00
|
|
|
],
|
|
|
|
tests_require=[
|
|
|
|
'pytest',
|
|
|
|
],
|
|
|
|
classifiers = [
|
2020-08-19 11:29:40 -05:00
|
|
|
'Intended Audience :: Developers',
|
|
|
|
'Natural Language :: English',
|
2020-09-29 00:34:39 -05:00
|
|
|
'Programming Language :: Python :: 2',
|
2020-08-19 11:29:40 -05:00
|
|
|
'Programming Language :: Python :: 2.7',
|
|
|
|
'Programming Language :: Python :: 3',
|
|
|
|
'Programming Language :: Python :: 3.5',
|
|
|
|
'Programming Language :: Python :: 3.6',
|
|
|
|
'Programming Language :: Python :: 3.7',
|
|
|
|
'Programming Language :: Python :: 3.8',
|
|
|
|
],
|
2020-09-29 00:34:39 -05:00
|
|
|
keywords = 'SONiC sonic-cfggen config-engine PYTHON python'
|
2020-08-19 11:29:40 -05:00
|
|
|
)
|