Pull requests

#25 Declined
Repository
pypa/setuptools setuptools
Branch
default

on ez_setup, remove old eggs, clean up tarball

Author
  1. Mark Mikofski
Reviewers
Description

observed: Updating setuptools or running any install which uses ez_setup leaves a tarball in the folder it was run from and also leaves behind any other setuptools eggs

expected: Tarball is deleted after ez_setup execution, regardless of install success and on successful installation, previously existing eggs are also deleted.

The Setuptools docs state:

The recommended way to install setuptools on Windows is to download ez_setup.py and run it. The script will download the appropriate .egg file and install it for you.

For best results, uninstall previous versions FIRST (see Uninstalling).

The edits in this pull request remove the need to first uninstall previous eggs, and also deletes the tarball downloaded by ez_setup:

  1. It deletes the tarball at the end of _install() since it's no longer needed. IMO it's polite not to leave files behind that the user may not realize were added to their system.
  2. It adds a function _find_existing_eggs() that searches the Python path for any existing setuptools eggs and returns a list of their paths.
  3. At the start of _install it runs_find_existing_eggs() and then at the end of _install tries to remove the the previously existing eggs.
  • Learn about pull requests

Comments (2)

  1. Mark Mikofski author

    Good reasoning. I'll split issue #111 into 2 tickets, one for "remove tarball" and another for "clean-up old eggs" and send a new PR for removing the tarball. Thanks.