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

Timothy Redaelli tredaelli at redhat.com
Fri Mar 22 13:42:37 UTC 2019


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 at cloudbasesolutions.com>
CC: Lucian Petrut <lpetrut at cloudbasesolutions.com>
Fixes: 00fcc832d598 ("Update Python package requirements")
Signed-off-by: Timothy Redaelli <tredaelli at redhat.com>
---
 python/setup.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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:
-- 
2.20.1



More information about the dev mailing list