6

I have very basic Python setup scripts that just call distutils.core.setup() with relevant parameters. The packages are for internal use only, so I do not need much more than that at the moment.

What bugs me is that when a new version of a package is installed, the old egg-info files are not automatically removed - although the package directory is overwritten with the new version.

(1) Is there a reason for not removing the old files by default?

(2) Is there a recommended way to remove the old egg-info files on new version setup so that it won't cause me grief later when the setup process becomes more complicated?

Thank you in advance.

malenkiy_scot
  • 16,415
  • 6
  • 64
  • 87
  • This causes problems for me when installing packages with git-revisions in their version numbers. pkg_resources.get_distribution("package") then returns the version that sorts highest, rather than the most recently (and therefore active) installed revision – NeilenMarais Mar 11 '14 at 08:04

1 Answers1

3

I've had issues with egg-info files using the distutils package as well. I think currently the recommended package for this is setuptools. My switch to setuptools fixed the problems I had with old egg-info files. So I would advice to use setuptools.setup() instead of distutils.core.setup(). See this post for more information:

Differences between distribute, distutils, setuptools and distutils2?

Community
  • 1
  • 1