Issue 5342: packaging: add tests for old versions cleanup on update (original) (raw)

Created on 2009-02-21 22:43 by illume, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (6)
msg82586 - (view) Author: Rene Dudfield (illume) Date: 2009-02-21 22:43
A common problem is removing old files from the installed location. eg. version 1 installs. site-packages/packagename/bla.so version 2 installs. site-packages/packagename/_bla.so site-packages/packagename/bla.py However, in version 2 if we install over the top of version 1, distutils does not remove bla.so. Which causes the package to break because bla.so will be used instead of bla.py distutils should be able to be given a list of old files to make sure are removed from the package. It should work with the various installers... msi, dmg etc, as well as when using setup.py install. I've seen this cause breakage with numerous packages. The solution is to hack some old file detection into each package, or tell users 'delete the old install first'. Neither of which is really nice. Specifying an old_files meta data should be able to help.
msg82588 - (view) Author: Tarek Ziadé (tarek) * (Python committer) Date: 2009-02-21 22:52
A uninstall command, based on the record of installed files, will be proposed for #4673. It should adress your problem, since we will be able to add a new option in the install command. I am leaving this issue open so we can keep track of this need.
msg139774 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-07-04 14:36
I’m renaming this to make the status clearer: it’s about adding tests.
msg160903 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2012-05-16 18:04
Jonathan Fernandes started to work on this at the last Montreal sprint. The tests would use install_local_project, which is missing a parameter to control the destination directory (see #14270).
msg200057 - (view) Author: Sergio Callegari (Sergio.Callegari) Date: 2013-10-16 12:30
Getting bitten by this with numpy/scipy installations Having previous scipy installed, pip install -I scipy creates a broken scipy installation, because the previous one is not removed and gets overwritten. For instance, an old spectral.so file leftover hides the spectral.py file from the new installation causing broken behavior. Similarly trying pip uninstall scipy pip install scipy does the same, because the distutils uninstall does not uninistall anything, leaves the scipy directory there and all cheerful ends with a 'Successfully uninstalled scipy'. This is *dangerous*. Mixing old and new code could lead to the weirdest behavior. In principle, one could even use this property to craft packages such that when two subsequent versions are installed one on top of the other malicious things happen even if individually each version is innoquous.
msg213220 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2014-03-12 08:28
packaging is not developped anymore. The issue described here may be relevant for projects like wheel, distlib or pip.
History
Date User Action Args
2022-04-11 14:56:46 admin set github: 49592
2014-03-12 08:28:15 eric.araujo set status: open -> closedresolution: out of datemessages: + stage: test needed -> resolved
2013-10-16 16:48:05 Alan.Cristhian set nosy: + Alan.Cristhian
2013-10-16 12:30:21 Sergio.Callegari set nosy: + Sergio.Callegarimessages: +
2012-05-16 18:04:51 eric.araujo set assignee: tarek -> eric.araujodependencies: + Can't install a project in a specific directorymessages: + versions: + 3rd party
2011-07-06 00:04:19 thomas.holmes set nosy: + thomas.holmes
2011-07-04 14:36:47 eric.araujo set type: enhancement -> behaviortitle: distutils removing old files, deleting unneeded old files from installed location. -> packaging: add tests for old versions cleanup on updatekeywords: + easynosy: + alexisversions: + Python 3.3, - 3rd partymessages: + stage: test needed
2011-07-04 14:35:14 eric.araujo unlink issue4673 dependencies
2010-10-22 14:55:51 eric.araujo link issue4673 dependencies
2010-10-22 14:55:38 eric.araujo set nosy: + eric.araujocomponents: + Distutils2, - Distutilsversions: + 3rd party, - Python 3.2
2010-08-09 03:22:41 terry.reedy set versions: + Python 3.2, - Python 3.1, Python 2.7
2009-02-21 22:52:18 tarek set messages: + versions: + Python 3.1, Python 2.7
2009-02-21 22:43:49 illume create