[Distutils] Installing header files with setuptools

Carl Meyer carl at dirtcircle.com
Wed Mar 3 23:30:03 CET 2010


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

James Porter wrote:
> This works, but it installs the headers in a surprising place. With the
> "prefix" scheme, the headers end up in `pwd`/lib/include. With the
> "home" scheme, the headers end up in <home>/lib/python/lib/include.
> 
> In either case I'd expect them to end up in <home-or-prefix>/include (or
> something like that anyway). I'd *certainly* expect the prefix scheme
> not to install the headers outside of the prefix.
> 
> The issue, it seems, is a workaround for virtualenv in pip/req.py:
> <http://hg.notalon.org/ianb/pip/src/tip/pip/req.py#cl-515>. Since I'm
> not actually using virtualenv, I don't know exactly what would happen
> with that, but if there's a workaround for virtualenv, shouldn't it only
> be activated when virtualenv is in use? Not that I know how to detect
> that. :)

Yeah, that does appear to be a bug in pip, I've reported it at
http://bitbucket.org/ianb/pip/issue/73/header-files-installed-to-wrong-location.
And I think you have the right fix, too; that header location hack
should only happen if actually inside a virtualenv. Shouldn't be a hard
fix. Is your package publicly available? I don't have anything on hand
that installs header files to test the fix with.

BTW, the best way I know of to check for "am I in a virtualenv?" is to
check for the existence of sys.real_prefix.

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

iEYEARECAAYFAkuO4usACgkQ1j/fhc23WEB74QCdGwJslblzsTKIjRrxQUZBL8tO
BZYAni3OGpadrKi5nidV5zKZI1xZ/+A0
=Pn0u
-----END PGP SIGNATURE-----


More information about the Distutils-SIG mailing list