Skip to content

Commit faba418

Browse files
authored
[setup.py] Update dependencies (sonic-net#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.
1 parent 2244d7b commit faba418

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

setup.py

+9-12
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,7 @@
55
# under scripts/. Consider stop using scripts and use console_scripts instead
66
#
77
# https://stackoverflow.com/questions/18787036/difference-between-entry-points-console-scripts-and-scripts-in-setup-py
8-
try:
9-
import fastentrypoints
10-
except ImportError:
11-
from setuptools.command import easy_install
12-
import pkg_resources
13-
easy_install.main(['fastentrypoints'])
14-
pkg_resources.require('fastentrypoints')
15-
import fastentrypoints
8+
import fastentrypoints
169

1710
from setuptools import setup
1811

@@ -151,21 +144,25 @@
151144
'ipaddress',
152145
'jsondiff==1.2.0',
153146
'm2crypto',
154-
'natsort',
147+
'natsort==6.2.1', # 6.2.1 is the last version which supports Python 2
148+
'netaddr',
149+
'netifaces',
155150
'pexpect',
156-
'sonic-config-engine',
157151
'sonic-py-common',
152+
'sonic-yang-mgmt',
158153
'swsssdk>=2.0.1',
159154
'tabulate==0.8.2',
160155
'xmltodict==0.12.0'
161156
],
162157
setup_requires= [
163-
'pytest-runner'
158+
'pytest-runner',
159+
'wheel'
164160
],
165161
tests_require = [
166162
'pytest',
167163
'mock>=2.0.0',
168-
'mockredispy>=2.9.3'
164+
'mockredispy>=2.9.3',
165+
'sonic-config-engine'
169166
],
170167
classifiers=[
171168
'Development Status :: 3 - Alpha',

0 commit comments

Comments
 (0)