Issue #122 open

setup.py clean should delete SOURCES.txt

adam_schmalhofer
created an issue

setup.py clean doesn't delete foo.egg-info/SOURCES.txt. As a result Debian does this in each packages manually (otherwise as SOURCES.txt changes during the build it gets included into the debian's source-diff). I think the proper place to delete it is by distribute/setuptools itself.

Comments (12)

  1. Tarek Ziadé repo owner

    The clean command is a Distutils command, meaning that it is not aware of the existence of the .egg-info directory created by Distribute/Setuptools.

    I'd be happy to include a custom one in Distribute. One question though: why removing only SOURCES.txt ? the "foo.egg-info" directory is fully created at build time, meaning that we can safely remove it by calling clean.

  2. Ben Finney

    Thanks for the quick response, Tarek.

    I wonder, though, what use the egg-info directory has in the source distribution at all? It seems bizarre to create it for distribution, then throw it away when actually building or installing.

    Would a better solution be to simply not *create* the egg-info directory for an sdist command?

  3. adam_schmalhofer reporter

    Ben Chester Finney

    That wouldn't solve the problem (it would actually make it worse). Then SOURCES.txt and other generated files would be included into debian's diff (if not explicitly deleted in each debian package; on second builds). If you consider foo.egg-info in sdist to be a problem (I don't) please file a separate bug report.

  4. Tarek Ziadé repo owner

    anonymous : those custom files *are* autogenerated by the egg_info command each time sdist is called. It uses the writers registered as entry poitns for that. So fully removing this directory is not a problem as far as I can see.

    So if everyone agrees, I propose to remove .egg-info altogether when the clean command is called.

  5. adam_schmalhofer reporter

    More then a month passed and nobody objected. I think this should count as everyone agrees ;-). Sorry if this feels a bit pushy; I just don't want this to be stalled, unnecessarily.

  6. Tarek Ziadé repo owner
    • removed assignee

    I am currently very busy on distutils, and I can't devote time right now on this. If you have some time to do it, I'd be happy to review then include a patch

  7. adam_schmalhofer reporter

    Do you have a Pointer for extending distribute? I tried to add a command called cleaned by copying command/register.py to command/cleand.py; renamed class register to class cleaned in cleaned.py and added 'cleaned' to all in init.py.

    However:

    $ python2.6 setup.py cleaned
    [helpmessage]
    Error: invalid command 'cleaned'
    

    "$ python2.6 setup.py register" works and cleaned does import:

    >>> from setuptools.command import cleaned
    >>> dir(cleaned)
    ['__builtins__', '__doc__', '__file__', '__name__', '__package__', '_register', 'cleaned']
    

    So I am very stuck.

  8. Anonymous

    Are there any news on this? One year has passed, but "myname.egg-info" dir still annoys by its existence after `setup.py clean`.

  9. Anonymous
  10. Log in to comment