diff mbox series

[ovs-dev] python: Fix package requirements with old setuptools

Message ID 2301d796ec7b408700f04f9e536fb245b3d78cc9.1553262157.git.tredaelli@redhat.com
State New
Headers show
Series [ovs-dev] python: Fix package requirements with old setuptools | expand

Commit Message

Timothy Redaelli March 22, 2019, 1:42 p.m. UTC
Commit 00fcc832d598 ("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 <aserdean@cloudbasesolutions.com>
CC: Lucian Petrut <lpetrut@cloudbasesolutions.com>
Fixes: 00fcc832d598 ("Update Python package requirements")
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
---
 python/setup.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/python/setup.py b/python/setup.py
index 14814ca4a..d7978e507 100644
--- a/python/setup.py
+++ b/python/setup.py
@@ -82,8 +82,8 @@  setup_args = dict(
     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={':platform_system == "Windows"': ['pywin32 >= 1.0']},
 )
 
 try: