From b074648f972895c47da93cd16bdbacaa07c30a5a Mon Sep 17 00:00:00 2001 From: fcakyon Date: Sat, 13 Feb 2021 22:14:15 +0300 Subject: [PATCH 1/2] fix windows build --- PythonAPI/setup.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/PythonAPI/setup.py b/PythonAPI/setup.py index 2280a8e2..a804157b 100644 --- a/PythonAPI/setup.py +++ b/PythonAPI/setup.py @@ -2,6 +2,9 @@ # To compile and install locally run "python setup.py build_ext --inplace" # To install library to Python site-packages run "python setup.py build_ext install" +# Note that the original compile flags below are GCC flags unsupported by +# the Visual C++ 2015 build tools. +# They can safely be removed. install_requires = [ 'setuptools>=18.0', @@ -17,7 +20,8 @@ 'pycocotools._mask', sources=['./common/maskApi.c', 'pycocotools/_mask.pyx'], include_dirs=[np.get_include(), './common'], - extra_compile_args=['-Wno-cpp', '-Wno-unused-function', '-std=c99'], + # extra_compile_args=['-Wno-cpp', '-Wno-unused-function', '-std=c99'], + extra_compile_args=[], ) ] From 9ba7c2f5d126ba9b61b6042bacec1d675b4308a0 Mon Sep 17 00:00:00 2001 From: fcakyon Date: Sat, 13 Feb 2021 22:15:43 +0300 Subject: [PATCH 2/2] update to v2.0.0.10 --- PythonAPI/setup.py | 46 ++++++++++++++++++---------------------------- 1 file changed, 18 insertions(+), 28 deletions(-) diff --git a/PythonAPI/setup.py b/PythonAPI/setup.py index a804157b..df01e8f6 100644 --- a/PythonAPI/setup.py +++ b/PythonAPI/setup.py @@ -1,4 +1,4 @@ -from setuptools import dist, setup, Extension +from setuptools import Extension, dist, setup # To compile and install locally run "python setup.py build_ext --inplace" # To install library to Python site-packages run "python setup.py build_ext install" @@ -6,43 +6,33 @@ # the Visual C++ 2015 build tools. # They can safely be removed. -install_requires = [ - 'setuptools>=18.0', - 'cython>=0.27.3', - 'matplotlib>=2.1.0' -] +install_requires = ["setuptools>=18.0", "cython>=0.27.3", "matplotlib>=2.1.0"] dist.Distribution().fetch_build_eggs(install_requires) import numpy as np + ext_modules = [ Extension( - 'pycocotools._mask', - sources=['./common/maskApi.c', 'pycocotools/_mask.pyx'], - include_dirs=[np.get_include(), './common'], + "pycocotools._mask", + sources=["./common/maskApi.c", "pycocotools/_mask.pyx"], + include_dirs=[np.get_include(), "./common"], # extra_compile_args=['-Wno-cpp', '-Wno-unused-function', '-std=c99'], extra_compile_args=[], ) ] setup( - name='pycocotools-fix', - author='Junjue Wang', - author_email='junjuew@cs.cmu.edu', - description='Fixed pycocotools package installation error of numpy or cython not installed', - long_description='Created due to the inactivity of the original repo: https://github.com/cocodataset/cocoapi', - url='https://github.com/junjuew/cocoapi', - packages=['pycocotools'], - package_dir={'pycocotools': 'pycocotools'}, - install_requires=[ - 'setuptools>=18.0', - 'cython>=0.27.3', - 'matplotlib>=2.1.0' - ], - setup_requires=[ - 'cython>=0.27.3', - 'numpy' - ], - version='2.0.0.9', - ext_modules=ext_modules + name="pycocotools-fix", + author="Junjue Wang", + author_email="junjuew@cs.cmu.edu", + description="Fixed pycocotools package installation error of numpy or cython not installed", + long_description="Created due to the inactivity of the original repo: https://github.com/cocodataset/cocoapi", + url="https://github.com/junjuew/cocoapi", + packages=["pycocotools"], + package_dir={"pycocotools": "pycocotools"}, + install_requires=["setuptools>=18.0", "cython>=0.27.3", "matplotlib>=2.1.0"], + setup_requires=["cython>=0.27.3", "numpy"], + version="2.0.0.10", + ext_modules=ext_modules, )