Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing old egg-info files on Python package setup

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.

like image 700
malenkiy_scot Avatar asked Jan 09 '14 11:01

malenkiy_scot


1 Answers

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?

like image 97
Matthijs van Eede Avatar answered Sep 26 '22 02:09

Matthijs van Eede