ndparker/rcssmin

Installing with new setuptools fails

Closed this issue · 15 comments

This package seems to break in newer versions of pip or setuptools.

$ pip install rcssmin                                  
Collecting rcssmin
  Using cached rcssmin-1.0.6.tar.gz
    Complete output from command python setup.py egg_info:
    running egg_info
    creating pip-egg-info/rcssmin.egg-info
    writing pip-egg-info/rcssmin.egg-info/PKG-INFO
    writing top-level names to pip-egg-info/rcssmin.egg-info/top_level.txt
    writing dependency_links to pip-egg-info/rcssmin.egg-info/dependency_links.txt
    writing manifest file 'pip-egg-info/rcssmin.egg-info/SOURCES.txt'
    warning: manifest_maker: standard file '-c' not found

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-vvpy33ni/rcssmin/setup.py", line 42, in <module>
        setup()
      File "/tmp/pip-build-vvpy33ni/rcssmin/setup.py", line 33, in setup
        return run(script_args=args, ext=ext, manifest_only=_manifest)
      File "/tmp/pip-build-vvpy33ni/rcssmin/_setup/py3/setup.py", line 426, in run
        return _core.setup(**kwargs)
      File "/usr/lib64/python3.5/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/lib64/python3.5/distutils/dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "/usr/lib64/python3.5/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/home/thom/.pythonenvs/tmp-c88a3d086ff79bc/lib/python3.5/site-packages/setuptools/command/egg_info.py", line 279, in run
        self.find_sources()
      File "/home/thom/.pythonenvs/tmp-c88a3d086ff79bc/lib/python3.5/site-packages/setuptools/command/egg_info.py", line 306, in find_sources
        mm.run()
      File "/home/thom/.pythonenvs/tmp-c88a3d086ff79bc/lib/python3.5/site-packages/setuptools/command/egg_info.py", line 533, in run
        self.add_defaults()
      File "/home/thom/.pythonenvs/tmp-c88a3d086ff79bc/lib/python3.5/site-packages/setuptools/command/egg_info.py", line 562, in add_defaults
        sdist.add_defaults(self)
      File "/home/thom/.pythonenvs/tmp-c88a3d086ff79bc/lib/python3.5/site-packages/setuptools/command/py36compat.py", line 35, in add_defaults
        self._add_defaults_data_files()
      File "/home/thom/.pythonenvs/tmp-c88a3d086ff79bc/lib/python3.5/site-packages/setuptools/command/py36compat.py", line 111, in _add_defaults_data_files
        dirname, filenames = item
    TypeError: 'Documentation' object is not iterable

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-vvpy33ni/rcssmin/

the same for me on latest pip 8.1.2 on python 3.5 on linux debian.

In addition, this package doesn't seem to support python wheels.

Note that pip's cache may be hiding this error for you – if it doesn't occur try throwing away ~/.cache/pip.

It did work with setuptools-28.6.1, it does not with setuptools-28.7.0. Using pip 8.1.2, python 3.5, OS X 10.12.1. Probably since the adding data files has changed.

Hmm. setuptools keeps breaking things (not the first time). Fun fact: I don't even actively use setuptools (I'm using distutils), so it appears to be a setuptools bug.
I'm wondering what I'm supposed to do here.

I tried to figure out what your entire _setup folder is doing, but it seems massively complex. I'm not sure what's happening there, nor why it is necessary. The much more complicated package Pillow seems to do just fine with setuptools.

You also need setuptools to build wheels, which are much more convenient to install. Would switching to setuptools be an option?

shrug it evolved the last 10 - 15 years and provides functionality missing in distutils (and setuptools for that matter). I'm using it for all my projects. That might be the reason.

I might do fine with setuptools, however, I really don't like the approach to break working things all the time by modifying semantics of the stdlib. This and the weekly (?) release cycle are not exactly building up trust in using it in the first place.

I've actually recently tried to find out, how to properly structure and build python packages. The documentation there is disastrous. It's impossible to do it as it's supposed to be, because there simply is no documented way. As far as I know, all of this is pure guesswork.

I ran into the same problem, and while attempting to debug it I found out "python setup.py install" does work (at least for me, on Ubuntu 16.04 with Python 3.5 and setuptools 28.7.0). It's the way pip (8.1.12) runs the setup that seems to cause the problem.
Hope this helps narrow it down - and even if not, manually installing this (and rjsmin, by the way) is a practical solution, if not a victory.

Setuptools 28.7.1 was released which reverted the offending change: pypa/setuptools@b18391c

It may still be worth figuring out what caused this problem, but for now I guess that closes this problem.

@ndparker I've described the issue in pypa/setuptools#833 (comment).

You are feeding data_files with unexpected objects. This does not follow the standard Python documented behaviour (See also https://packaging.python.org/distributing/#data-files). This is not a setuptools issue.

More details on that issue. The _setup code rely on hooking the install_data command and translating parameters when finalizing the options. Unfortunately, that translation does not happen for all commands that relies on data_files. For setuptools, that includes the egg_info subcommand. From a rcssmin perspective, it might be worth redefining that command to handle the translation. (The manifest_maker class seems to be similar to _setup/py2/make/*).

thanks for the hint... it's still a weird way, because distutils don't define egg_info in the first place (or do they now?)

No you're right, it doesn't. But you are redefining the format of data_files and making the assumption that any command using that argument will be hooked by your setup-common library.

Moving forward, I have run the tests of that setuptools patch against a large chunk of the Pypi repository (see pypa/setuptools#833 (comment)) and your projects (rcssmin, rjsmin) are the only one preventing us from merging it in the stable version. How would you like to proceed to fix that issue? Would redefining the egg_info command be an option? Have you considered fully moving to setuptools to avoid any similar issues?

Eek.
Now I'm wondering, did you test tdi by any chance or pyliblinear? They use the same setup (possibly another version of it, but not that much different).

Anyway, yes, I am considering moving to setuptools. But time is short at the moment :/

Fized.