Skip to content

Commit

Permalink
[setup.py] Update dependencies (sonic-net#1125)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jleveque authored Sep 22, 2020
1 parent 2244d7b commit faba418
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit faba418

Please sign in to comment.