[Distutils] [ANN] setuptools post install script for bdist_wininst

Manlio Perillo manlio.perillo at gmail.com
Mon Sep 13 14:03:04 CEST 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Il 12/09/2010 20:22, P.J. Eby ha scritto:
> At 02:36 PM 9/12/2010 +0200, Manlio Perillo wrote:
> [...]
> 
>> It should not be hard to track installed dependencies, as an example
>> using the --record option of easy_install, and then registering all
>> installed files (and directories) with `file_created` and
>> `directory_created` functions.
>>
>> The only problem is that created directories are not reported in the
>> record, but if files are always listed ordered, it should not be a
>> problem.
> 
> That's not the only problem: if you install A, then B, and both depend
> on C, then if you uninstall A you will break B.  You would have to also
> track shared use of dependencies.
> 
> This situation is a big mess, and I haven't needed it for myself or any
> client as yet, so I've avoided the whole subject.
> 

The simplest solutions are:
* use py2exe or pyinstaller

  The problem is that there are some issues using them:
    - my scripts are handled by setuptools, and I use pkg_resource
      plugins and project data; this seems to not be supported
    - python >= 2.6 support have several issues

* use virtualenv, and let the unistaller simply wipe out the virtual
  enviromnent

  The problem is that this requires a custom installer.

> 
>> Some other related questions:
>>
>> * Do you think you can change ez_setup.py so that the code used to
>>   check if setuptools must be installed is available as a separate
>>   function?
> 
> Grab the bit that looks like this:
> 

> [...]

Thanks.

> 
> 
>>   For normal package dependencies (and assuming setuptools is
>>   available) I can just use working_set.__contains__(dist)
> 
> No, you need to use require() or resolve() or some other API that:
> 
> 1. Checks versions, and
> 2. Handles recursive dependencies
> 

Right, thanks.


> 
>> * Is it safe to call `ez_setup.use_setuptools` setting `to_dir`
>>   parameter to `sysconfig.get_python_lib()`?
> 
> It's safe for setuptools, but whether it's safe in the context of a
> bdist_wininst I'm not sure.
> 
> 
>>   By default the setuptools egg is copied to the same directory where
>>   the bdist_wininst file is, and this is not safe since the user may
>>   delete these files.
> 
> You could also fix that by calling easy_install(['--always-copy',
> 'setuptools']), in the case where you've had to install setuptools.
> 

This is what I'm doing now.

> [...]



Thanks   Manlio
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkyOEvgACgkQscQJ24LbaUTNQwCfcePklerVIA9+cZwqCXCsVJkL
wioAn2m2Yv+nMJZsBLGcX2jrTX5s6w+e
=u0aO
-----END PGP SIGNATURE-----


More information about the Distutils-SIG mailing list