From faba41809f58e59b8b239aee2695f0ebb9e3b17c Mon Sep 17 00:00:00 2001 From: Joe LeVeque Date: Tue, 22 Sep 2020 14:45:19 -0700 Subject: [PATCH] [setup.py] Update dependencies (#1125) Add more dependencies to setup.py. Now that we're building as a wheel, we can add all dependent packages to make building and installation more robust, as there will no longer be a need to install them explicitly. Move sonic-config-engine from `install_requires` to `tests_require`, as it is only needed by the unit tests. Remove code to install fastentrypoints package if not installed. When building a Python 3 wheel using python3 setup.py bdist_wheel, we would receive a permissions error when calling easy_install.main(['fastentrypoints']), as with Python 3 it appears elevated permissions are required to install the package. This appears to be a behavior change between the Python 2 and Python 3 versions of setuptools. This needs to be explicitly installed before building the package. We are already installing in the SONiC slave container. Will update the sonic-utilities README to specify, also. --- setup.py | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/setup.py b/setup.py index cb6df6b3c94c..214d503c0e97 100644 --- a/setup.py +++ b/setup.py @@ -5,14 +5,7 @@ # under scripts/. Consider stop using scripts and use console_scripts instead # # https://stackoverflow.com/questions/18787036/difference-between-entry-points-console-scripts-and-scripts-in-setup-py -try: - import fastentrypoints -except ImportError: - from setuptools.command import easy_install - import pkg_resources - easy_install.main(['fastentrypoints']) - pkg_resources.require('fastentrypoints') - import fastentrypoints +import fastentrypoints from setuptools import setup @@ -151,21 +144,25 @@ 'ipaddress', 'jsondiff==1.2.0', 'm2crypto', - 'natsort', + 'natsort==6.2.1', # 6.2.1 is the last version which supports Python 2 + 'netaddr', + 'netifaces', 'pexpect', - 'sonic-config-engine', 'sonic-py-common', + 'sonic-yang-mgmt', 'swsssdk>=2.0.1', 'tabulate==0.8.2', 'xmltodict==0.12.0' ], setup_requires= [ - 'pytest-runner' + 'pytest-runner', + 'wheel' ], tests_require = [ 'pytest', 'mock>=2.0.0', - 'mockredispy>=2.9.3' + 'mockredispy>=2.9.3', + 'sonic-config-engine' ], classifiers=[ 'Development Status :: 3 - Alpha',