[Distutils] 3.3 / packaging - support for Windows installation locations

Éric Araujo merwok at netwok.org
Sat Jun 18 22:46:28 CEST 2011

Le 18/06/2011 16:18, Vinay Sajip a écrit :
> Alexis Métaireau <alexis <at> notmyidea.org> writes:
>> On 06/18/2011 02:26 PM, Vinay Sajip wrote:
>>> What's the best way of handling these sorts of situations with Python 3.3
>>> packaging?
>> Isn't it something that should be handled by the sysconfig module? 
>> (http://docs.python.org/dev/library/sysconfig.html)
> Perhaps, but perhaps not. For example, the sysconfig.get_paths() returns a path
> like this for the 'data' key:
> C:\\Users\\Vinay\\AppData\\Roaming\\Python
> This might be fine for many applications, but say you were to install some
> Powershell scripts, those would need to live in
> C:\\Users\\Vinay\\Documents\\WindowsPowershell
> for Powershell to load them automatically. There's only one reference to the
> special location path determining code - in PC\bdist_wininst\install.c - which
> appears to be for executable installers only.
> This could in theory be handled by a project-specific post-installation step
> (which could e.g. be in Python code bundled with the project), which could be
> declared in setup.cfg and invoked by pysetup3 after the installation actions. Is
> there such a provision? If so, I couldn't find it, but perhaps I missed it and
> someone could point it out to me.

I think two features I’d like to add to 3.3 may cover your needs.  The
first one is standard functions to get the right config, data, cache,
etc. directories for an application (http://bugs.python.org/issue7175);
the second is a configure command for packaging
(http://bugs.python.org/issue8254), which would record everything
related to the installation (paths and al.) and make it available at
build time and run time to other projects, making it possible for a
plugin to find the right dir to install files for an application.

See also the threads last summer about PEP 376 and plugins on
distutils-sig (and I believe python-dev).


More information about the Distutils-SIG mailing list