jin-s13 / xtcocoapi

Extended COCO-API
Other
63 stars 24 forks source link

cython 3 compatibility #37

Closed peter-volkov closed 1 year ago

jin-s13 commented 1 year ago

Thanks for the fix. BTW, will this fix affect the installation with cython0.29?

peter-volkov commented 1 year ago

Confirmed

# pip list | grep -i cython
Cython          0.29.36

python setup.py install
/usr/local/lib/python3.11/dist-packages/setuptools/__init__.py:84: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
!!

        ********************************************************************************
        Requirements should be satisfied by a PEP 517 installer.
        If you are using pip, you can try `pip install --use-pep517`.
        ********************************************************************************

!!
  dist.fetch_build_eggs(dist.setup_requires)

running install
/usr/local/lib/python3.11/dist-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` directly.
        Instead, use pypa/build, pypa/installer or other
        standards-based tools.

        See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
        ********************************************************************************

!!
  self.initialize_options()
/usr/local/lib/python3.11/dist-packages/setuptools/_distutils/cmd.py:66: EasyInstallDeprecationWarning: easy_install command is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` and ``easy_install``.
        Instead, use pypa/build, pypa/installer or other
        standards-based tools.

        See https://github.com/pypa/setuptools/issues/917 for details.
        ********************************************************************************

!!
  self.initialize_options()
running bdist_egg
running egg_info
creating xtcocotools.egg-info
writing xtcocotools.egg-info/PKG-INFO
writing dependency_links to xtcocotools.egg-info/dependency_links.txt
writing requirements to xtcocotools.egg-info/requires.txt
writing top-level names to xtcocotools.egg-info/top_level.txt
writing manifest file 'xtcocotools.egg-info/SOURCES.txt'
reading manifest file 'xtcocotools.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'LICENSE'
writing manifest file 'xtcocotools.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build
creating build/lib.linux-x86_64-cpython-311
creating build/lib.linux-x86_64-cpython-311/xtcocotools
copying xtcocotools/version.py -> build/lib.linux-x86_64-cpython-311/xtcocotools
copying xtcocotools/cocoeval.py -> build/lib.linux-x86_64-cpython-311/xtcocotools
copying xtcocotools/mask.py -> build/lib.linux-x86_64-cpython-311/xtcocotools
copying xtcocotools/coco.py -> build/lib.linux-x86_64-cpython-311/xtcocotools
copying xtcocotools/__init__.py -> build/lib.linux-x86_64-cpython-311/xtcocotools
running build_ext
cythoning xtcocotools/_mask.pyx to xtcocotools/_mask.c
/usr/local/lib/python3.11/dist-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /app/xtcocoapi/xtcocotools/_mask.pyx
  tree = Parsing.p_module(s, pxd, full_module_name)
building 'xtcocotools._mask' extension
creating build/temp.linux-x86_64-cpython-311
creating build/temp.linux-x86_64-cpython-311/common
creating build/temp.linux-x86_64-cpython-311/xtcocotools
x86_64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/usr/local/lib/python3.11/dist-packages/numpy/core/include -I./common -I/usr/include/python3.11 -c ./common/maskApi.c -o build/temp.linux-x86_64-cpython-311/./common/maskApi.o
./common/maskApi.c: In function ‘rleDecode’:
./common/maskApi.c:46:7: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation]
   46 |       for( k=0; k<R[i].cnts[j]; k++ ) *(M++)=v; v=!v; }}
      |       ^~~
./common/maskApi.c:46:49: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’
   46 |       for( k=0; k<R[i].cnts[j]; k++ ) *(M++)=v; v=!v; }}
      |                                                 ^
./common/maskApi.c: In function ‘rleFrPoly’:
./common/maskApi.c:166:3: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation]
  166 |   for(j=0; j<k; j++) x[j]=(int)(scale*xy[j*2+0]+.5); x[k]=x[0];
      |   ^~~
./common/maskApi.c:166:54: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’
  166 |   for(j=0; j<k; j++) x[j]=(int)(scale*xy[j*2+0]+.5); x[k]=x[0];
      |                                                      ^
./common/maskApi.c:167:3: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation]
  167 |   for(j=0; j<k; j++) y[j]=(int)(scale*xy[j*2+1]+.5); y[k]=y[0];
      |   ^~~
./common/maskApi.c:167:54: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’
  167 |   for(j=0; j<k; j++) y[j]=(int)(scale*xy[j*2+1]+.5); y[k]=y[0];
      |                                                      ^
./common/maskApi.c: In function ‘rleToString’:
./common/maskApi.c:212:7: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
  212 |       if(more) c |= 0x20; c+=48; s[p++]=c;
      |       ^~
./common/maskApi.c:212:27: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
  212 |       if(more) c |= 0x20; c+=48; s[p++]=c;
      |                           ^
./common/maskApi.c: In function ‘rleFrString’:
./common/maskApi.c:220:3: warning: this ‘while’ clause does not guard... [-Wmisleading-indentation]
  220 |   while( s[m] ) m++; cnts=malloc(sizeof(uint)*m); m=0;
      |   ^~~~~
./common/maskApi.c:220:22: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘while’
  220 |   while( s[m] ) m++; cnts=malloc(sizeof(uint)*m); m=0;
      |                      ^~~~
./common/maskApi.c:228:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
  228 |     if(m>2) x+=(long) cnts[m-2]; cnts[m++]=(uint) x;
      |     ^~
./common/maskApi.c:228:34: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
  228 |     if(m>2) x+=(long) cnts[m-2]; cnts[m++]=(uint) x;
      |                                  ^~~~
x86_64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/usr/local/lib/python3.11/dist-packages/numpy/core/include -I./common -I/usr/include/python3.11 -c xtcocotools/_mask.c -o build/temp.linux-x86_64-cpython-311/xtcocotools/_mask.o
In file included from /usr/local/lib/python3.11/dist-packages/numpy/core/include/numpy/ndarraytypes.h:1940,
                 from /usr/local/lib/python3.11/dist-packages/numpy/core/include/numpy/ndarrayobject.h:12,
                 from /usr/local/lib/python3.11/dist-packages/numpy/core/include/numpy/arrayobject.h:5,
                 from xtcocotools/_mask.c:752:
/usr/local/lib/python3.11/dist-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
   17 | #warning "Using deprecated NumPy API, disable it with " \
      |  ^~~~~~~
x86_64-linux-gnu-gcc -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -g -fwrapv -O2 build/temp.linux-x86_64-cpython-311/./common/maskApi.o build/temp.linux-x86_64-cpython-311/xtcocotools/_mask.o -L/usr/lib/x86_64-linux-gnu -o build/lib.linux-x86_64-cpython-311/xtcocotools/_mask.cpython-311-x86_64-linux-gnu.so
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/xtcocotools
copying build/lib.linux-x86_64-cpython-311/xtcocotools/version.py -> build/bdist.linux-x86_64/egg/xtcocotools
copying build/lib.linux-x86_64-cpython-311/xtcocotools/cocoeval.py -> build/bdist.linux-x86_64/egg/xtcocotools
copying build/lib.linux-x86_64-cpython-311/xtcocotools/_mask.cpython-311-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/egg/xtcocotools
copying build/lib.linux-x86_64-cpython-311/xtcocotools/mask.py -> build/bdist.linux-x86_64/egg/xtcocotools
copying build/lib.linux-x86_64-cpython-311/xtcocotools/coco.py -> build/bdist.linux-x86_64/egg/xtcocotools
copying build/lib.linux-x86_64-cpython-311/xtcocotools/__init__.py -> build/bdist.linux-x86_64/egg/xtcocotools
byte-compiling build/bdist.linux-x86_64/egg/xtcocotools/version.py to version.cpython-311.pyc
byte-compiling build/bdist.linux-x86_64/egg/xtcocotools/cocoeval.py to cocoeval.cpython-311.pyc
byte-compiling build/bdist.linux-x86_64/egg/xtcocotools/mask.py to mask.cpython-311.pyc
byte-compiling build/bdist.linux-x86_64/egg/xtcocotools/coco.py to coco.cpython-311.pyc
byte-compiling build/bdist.linux-x86_64/egg/xtcocotools/__init__.py to __init__.cpython-311.pyc
creating stub loader for xtcocotools/_mask.cpython-311-x86_64-linux-gnu.so
byte-compiling build/bdist.linux-x86_64/egg/xtcocotools/_mask.py to _mask.cpython-311.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying xtcocotools.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying xtcocotools.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying xtcocotools.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying xtcocotools.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying xtcocotools.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
writing build/bdist.linux-x86_64/egg/EGG-INFO/native_libs.txt
zip_safe flag not set; analyzing archive contents...
xtcocotools.__pycache__._mask.cpython-311: module references __file__
creating dist
creating 'dist/xtcocotools-1.14-py3.11-linux-x86_64.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing xtcocotools-1.14-py3.11-linux-x86_64.egg
creating /usr/local/lib/python3.11/dist-packages/xtcocotools-1.14-py3.11-linux-x86_64.egg
Extracting xtcocotools-1.14-py3.11-linux-x86_64.egg to /usr/local/lib/python3.11/dist-packages
Adding xtcocotools 1.14 to easy-install.pth file

Installed /usr/local/lib/python3.11/dist-packages/xtcocotools-1.14-py3.11-linux-x86_64.egg
Processing dependencies for xtcocotools==1.14
Searching for numpy==1.24.4
Best match: numpy 1.24.4
Adding numpy 1.24.4 to easy-install.pth file
detected new path './xtcocotools-1.14-py3.11-linux-x86_64.egg'
Installing f2py script to /usr/local/bin
Installing f2py3 script to /usr/local/bin
Installing f2py3.11 script to /usr/local/bin

Using /usr/local/lib/python3.11/dist-packages
Searching for matplotlib==3.7.2
Best match: matplotlib 3.7.2
Processing matplotlib-3.7.2-py3.11-linux-x86_64.egg
Adding matplotlib 3.7.2 to easy-install.pth file

Using /app/xtcocoapi/.eggs/matplotlib-3.7.2-py3.11-linux-x86_64.egg
Searching for Cython==0.29.36
Best match: Cython 0.29.36
Adding Cython 0.29.36 to easy-install.pth file
Installing cygdb script to /usr/local/bin
Installing cython script to /usr/local/bin
Installing cythonize script to /usr/local/bin

Using /usr/local/lib/python3.11/dist-packages
Searching for setuptools==68.1.2
Best match: setuptools 68.1.2
Adding setuptools 68.1.2 to easy-install.pth file

Using /usr/local/lib/python3.11/dist-packages
Searching for python-dateutil==2.8.2
Best match: python-dateutil 2.8.2
Processing python_dateutil-2.8.2-py3.11.egg
Adding python-dateutil 2.8.2 to easy-install.pth file

Using /app/xtcocoapi/.eggs/python_dateutil-2.8.2-py3.11.egg
Searching for pyparsing==3.0.9
Best match: pyparsing 3.0.9
Processing pyparsing-3.0.9-py3.11.egg
Adding pyparsing 3.0.9 to easy-install.pth file

Using /app/xtcocoapi/.eggs/pyparsing-3.0.9-py3.11.egg
Searching for Pillow==10.0.0
Best match: Pillow 10.0.0
Processing Pillow-10.0.0-py3.11-linux-x86_64.egg
Adding Pillow 10.0.0 to easy-install.pth file

Using /app/xtcocoapi/.eggs/Pillow-10.0.0-py3.11-linux-x86_64.egg
Searching for packaging==23.1
Best match: packaging 23.1
Processing packaging-23.1-py3.11.egg
Adding packaging 23.1 to easy-install.pth file

Using /app/xtcocoapi/.eggs/packaging-23.1-py3.11.egg
Searching for kiwisolver==1.4.5
Best match: kiwisolver 1.4.5
Processing kiwisolver-1.4.5-py3.11-linux-x86_64.egg
Adding kiwisolver 1.4.5 to easy-install.pth file

Using /app/xtcocoapi/.eggs/kiwisolver-1.4.5-py3.11-linux-x86_64.egg
Searching for fonttools==4.42.1
Best match: fonttools 4.42.1
Processing fonttools-4.42.1-py3.11-linux-x86_64.egg
Adding fonttools 4.42.1 to easy-install.pth file
Installing fonttools script to /usr/local/bin
Installing pyftmerge script to /usr/local/bin
Installing pyftsubset script to /usr/local/bin
Installing ttx script to /usr/local/bin

Using /app/xtcocoapi/.eggs/fonttools-4.42.1-py3.11-linux-x86_64.egg
Searching for cycler==0.11.0
Best match: cycler 0.11.0
Processing cycler-0.11.0-py3.11.egg
Adding cycler 0.11.0 to easy-install.pth file

Using /app/xtcocoapi/.eggs/cycler-0.11.0-py3.11.egg
Searching for contourpy==1.1.0
Best match: contourpy 1.1.0
Processing contourpy-1.1.0-py3.11-linux-x86_64.egg
Adding contourpy 1.1.0 to easy-install.pth file

Using /app/xtcocoapi/.eggs/contourpy-1.1.0-py3.11-linux-x86_64.egg
Searching for six==1.16.0
Best match: six 1.16.0
Processing six-1.16.0-py3.11.egg
Adding six 1.16.0 to easy-install.pth file

Using /app/xtcocoapi/.eggs/six-1.16.0-py3.11.egg
Finished processing dependencies for xtcocotools==1.14