lumaku/ctc-segmentation

Package building works with Distutils, but not with Setuptools

lumaku opened this issue · 0 comments

Python packaging using Setuptools fails, but the build with Distutils works.

Setuptools:

$ python3 -m setuptools.launch setup.py sdist
Compiling ctc_segmentation/ctc_segmentation_dyn.pyx because it changed.
[1/1] Cythonizing ctc_segmentation/ctc_segmentation_dyn.pyx
/usr/lib/python3.8/site-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: /xxx/ctc-segmentation/ctc_segmentation/ctc_segmentation_dyn.pyx
  tree = Parsing.p_module(s, pxd, full_module_name)
running sdist
running egg_info
creating ctc_segmentation.egg-info
writing ctc_segmentation.egg-info/PKG-INFO
writing dependency_links to ctc_segmentation.egg-info/dependency_links.txt
writing requirements to ctc_segmentation.egg-info/requires.txt
writing top-level names to ctc_segmentation.egg-info/top_level.txt
writing manifest file 'ctc_segmentation.egg-info/SOURCES.txt'
Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/usr/lib/python3.8/site-packages/setuptools/launch.py", line 36, in <module>
    run()
  File "/usr/lib/python3.8/site-packages/setuptools/launch.py", line 32, in run
    exec(code, namespace)
  File "setup.py", line 39, in <module>
    setup(
  File "/usr/lib/python3.8/site-packages/setuptools/__init__.py", line 163, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib/python3.8/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.8/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/usr/lib/python3.8/site-packages/setuptools/command/sdist.py", line 45, in run
    self.run_command('egg_info')
  File "/usr/lib/python3.8/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/usr/lib/python3.8/site-packages/setuptools/command/egg_info.py", line 297, in run
    self.find_sources()
  File "/usr/lib/python3.8/site-packages/setuptools/command/egg_info.py", line 304, in find_sources
    mm.run()
  File "/usr/lib/python3.8/site-packages/setuptools/command/egg_info.py", line 535, in run
    self.add_defaults()
  File "/usr/lib/python3.8/site-packages/setuptools/command/egg_info.py", line 571, in add_defaults
    sdist.add_defaults(self)
  File "/usr/lib/python3.8/distutils/command/sdist.py", line 228, in add_defaults
    self._add_defaults_ext()
  File "/usr/lib/python3.8/distutils/command/sdist.py", line 311, in _add_defaults_ext
    build_ext = self.get_finalized_command('build_ext')
  File "/usr/lib/python3.8/distutils/cmd.py", line 299, in get_finalized_command
    cmd_obj.ensure_finalized()
  File "/usr/lib/python3.8/distutils/cmd.py", line 107, in ensure_finalized
    self.finalize_options()
  File "setup.py", line 9, in finalize_options
    __builtins__.__NUMPY_SETUP__ = False
AttributeError: 'dict' object has no attribute '__NUMPY_SETUP__'

Distutils:

$ python setup.py sdist
running sdist
running egg_info
writing ctc_segmentation.egg-info/PKG-INFO
writing dependency_links to ctc_segmentation.egg-info/dependency_links.txt
writing requirements to ctc_segmentation.egg-info/requires.txt
writing top-level names to ctc_segmentation.egg-info/top_level.txt
reading manifest file 'ctc_segmentation.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'ctc_segmentation.egg-info/SOURCES.txt'
running check
warning: Check: missing meta-data: if 'author' supplied, 'author_email' must be supplied too

creating ctc_segmentation-1.0.6
creating ctc_segmentation-1.0.6/ctc_segmentation
creating ctc_segmentation-1.0.6/ctc_segmentation.egg-info
copying files to ctc_segmentation-1.0.6...
copying MANIFEST.in -> ctc_segmentation-1.0.6
copying README.md -> ctc_segmentation-1.0.6
copying setup.py -> ctc_segmentation-1.0.6
copying ctc_segmentation/__init__.py -> ctc_segmentation-1.0.6/ctc_segmentation
copying ctc_segmentation/ctc_segmentation.py -> ctc_segmentation-1.0.6/ctc_segmentation
copying ctc_segmentation/ctc_segmentation_dyn.c -> ctc_segmentation-1.0.6/ctc_segmentation
copying ctc_segmentation/ctc_segmentation_dyn.pyx -> ctc_segmentation-1.0.6/ctc_segmentation
copying ctc_segmentation.egg-info/PKG-INFO -> ctc_segmentation-1.0.6/ctc_segmentation.egg-info
copying ctc_segmentation.egg-info/SOURCES.txt -> ctc_segmentation-1.0.6/ctc_segmentation.egg-info
copying ctc_segmentation.egg-info/dependency_links.txt -> ctc_segmentation-1.0.6/ctc_segmentation.egg-info
copying ctc_segmentation.egg-info/not-zip-safe -> ctc_segmentation-1.0.6/ctc_segmentation.egg-info
copying ctc_segmentation.egg-info/requires.txt -> ctc_segmentation-1.0.6/ctc_segmentation.egg-info
copying ctc_segmentation.egg-info/top_level.txt -> ctc_segmentation-1.0.6/ctc_segmentation.egg-info
Writing ctc_segmentation-1.0.6/setup.cfg
creating dist
Creating tar archive
removing 'ctc_segmentation-1.0.6' (and everything under it)