
Is there a way of asking EasyInstall "what packages are installed"? Without that, I can't see myself moving away from bdist_wininst. I know that a registry of installed packages starts to move away from the "easy" bit of "EasyInstall", but to be honest, EasyInstall is no easier *for me* than double clicking on a bdist_wininst executable. Paul.

At 04:40 PM 6/5/2005 +0100, Paul Moore wrote:
Is there a way of asking EasyInstall "what packages are installed"?
Not the command-line script. However "ls site-packages/*.egg" or "dir site-packages\*.egg" depending on your platform will give you the answer. I though about having a --list-packages option, but I tend to dislike having options that completely change a script's behavior and complicate the logic of determining whether you supplied valid options. Still, I suppose I could add it if it just made it list all installed packages after completing its regular operations. That list could get pretty long, though. Maybe there should be a separate command altogether; certainly it'd be easy to write one. Here's some sample code for a package lister: import pkg_resources distros = pkg_resources.AvailableDistributions() # scan sys.path for key in distros: for dist in distros[key]: print dist.name, dist.version If you give AvailableDistributions a list of directories, it'll search those instead of sys.path. Or, you can call its 'scan()' method to scan additional directories after you've created it.
Without that, I can't see myself moving away from bdist_wininst.
I know that a registry of installed packages starts to move away from the "easy" bit of "EasyInstall", but to be honest,
Ah, I see the confusion. Yes, there's a "registry" of packages installed by EasyInstall. They're eggs, so they're in directories or files named for the distribution, version, python version, and platform. So the installation *itself* is the registry, and therefore can't be corrupted or out of date.
EasyInstall is no easier *for me* than double clicking on a bdist_wininst executable.
Perhaps. I hope this weekend however to complete PyPI integration for EasyInstall. It's still not a GUI, but it'll be convenient.

On 6/5/05, Phillip J. Eby <pje@telecommunity.com> wrote:
At 04:40 PM 6/5/2005 +0100, Paul Moore wrote:
Is there a way of asking EasyInstall "what packages are installed"?
Not the command-line script. However "ls site-packages/*.egg" or "dir site-packages\*.egg" depending on your platform will give you the answer. [...] Ah, I see the confusion. Yes, there's a "registry" of packages installed by EasyInstall. They're eggs, so they're in directories or files named for the distribution, version, python version, and platform. So the installation *itself* is the registry, and therefore can't be corrupted or out of date.
I see. On the other hand, there's this .pth file containing the egg name, so you can't just add & remove egg files, you do need to go through the EasyInstall interface or things get mixed up. So there is some (relatively minor) level at which things are more "managed" than just file copies. And of course, egg files with non-standard names are "not in the registry" to some extent. So there's still a sense in which a registry is needed... Paul.

At 09:55 PM 6/5/2005 +0100, Paul Moore wrote:
On 6/5/05, Phillip J. Eby <pje@telecommunity.com> wrote:
At 04:40 PM 6/5/2005 +0100, Paul Moore wrote:
Is there a way of asking EasyInstall "what packages are installed"?
Not the command-line script. However "ls site-packages/*.egg" or "dir site-packages\*.egg" depending on your platform will give you the answer. [...] Ah, I see the confusion. Yes, there's a "registry" of packages installed by EasyInstall. They're eggs, so they're in directories or files named for the distribution, version, python version, and platform. So the installation *itself* is the registry, and therefore can't be corrupted or out of date.
I see. On the other hand, there's this .pth file containing the egg name, so you can't just add & remove egg files, you do need to go through the EasyInstall interface or things get mixed up.
Not really; invalid entries in .pth do nothing but maybe slow down some imports. EasyInstall isn't confused by them at all, and will remove them the next time you do an install operation involving a distribution with the same name.
So there is some (relatively minor) level at which things are more "managed" than just file copies.
Extremely minor. :) Note that the .pth is not a registry; the egg files and directories themselves are the registry, so it's a very robust approach.
And of course, egg files with non-standard names are "not in the registry" to some extent.
Well, you can always look at EGG-INFO/PKG-INFO. The egg runtime system only does this under very limited circumstances, for performance reasons. So you could create a tool that would verify eggs' name and version from PKG-INFO.
participants (2)
-
Paul Moore
-
Phillip J. Eby