[Distutils] Packaging of files, which aren't in the package root folder

David Cournapeau cournape at gmail.com
Thu Dec 17 10:19:05 CET 2009


On Thu, Dec 17, 2009 at 1:21 PM, Lukas Hetzenecker <LuHe at gmx.at> wrote:
> Hello,
>
> now I have only one problem left:
> If i call my setup.py script with the prefix argument (python setup.py install
> --prefix /home/lukas/tmp/) I can't get this argument in the script file.
>
> distutils.sysconfig.get_config_var("prefix") returns '/usr' and
> get_config_var("datarootdir") returns '/usr/share'. Is there any way to
> initialize the variables so that the command line arguments are noticed and
> that the function returns '/home/lukas/tmp/share'?

No, at least not using public API.

What you can do is to override the install command (the one which
knows the computed install prefix), and use it from there. But you
still cannot control this from the setup.py, that is your command is
called by distutils, and you don't control it.

David


More information about the Distutils-SIG mailing list