Skip to content

Commit

Permalink
python: Fix package requirements with old setuptools
Browse files Browse the repository at this point in the history
Commit 00fcc83 ("Update Python package requirements") added a
PEP 508 environment marker to install pywin32 on Windows systems.

This requires a new setuptools version (>= 20.5), but (at least)
RHEL/CentOS7 and Debian Jessie are using an older version of
setuptools and so python extension failed to build.

This commit adds "extras_require" instead of the PEP 508 environment
markers in order to have the conditional dependency of pywin32, but by
remaining compatible with the old setuptools versions.

CC: Alin Gabriel Serdean <[email protected]>
CC: Lucian Petrut <[email protected]>
Fixes: 00fcc83 ("Update Python package requirements")
Signed-off-by: Timothy Redaelli <[email protected]>
Acked-by: Alin Gabriel Serdean <[email protected]>
Signed-off-by: Alin Gabriel Serdean <[email protected]>
  • Loading branch information
drizzt authored and aserdean committed Mar 22, 2019
1 parent 272ee84 commit 2a6d916
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ def build_extension(self, ext):
ext_modules=[setuptools.Extension("ovs._json", sources=["ovs/_json.c"],
libraries=['openvswitch'])],
cmdclass={'build_ext': try_build_ext},
install_requires=['sortedcontainers',
'pywin32>=1.0;platform_system=="Windows"'],
install_requires=['sortedcontainers'],
extras_require={':sys_platform == "win32"': ['pywin32 >= 1.0']},
)

try:
Expand Down

0 comments on commit 2a6d916

Please sign in to comment.