[Distutils] [Python-Dev] request for comments - standardization of python's purelib and platlib

Jan Matejek jan.matejek at novell.com
Thu Aug 20 19:17:01 CEST 2009

finally some kind of discussion! ;)

Dne 20.8.2009 11:47, Matthias Klose napsal(a):
> On 14.08.2009 10:02, Tarek Ziadé wrote:
>> On Thu, Aug 13, 2009 at 9:22 PM, Brett Cannon<brett at python.org>  wrote:
>>> On Thu, Aug 13, 2009 at 11:23, Jan Matejek<jan.matejek at novell.com> 
>>> wrote:
>> Among the proposals you have detailed, the sharedir way seems like the
>> most simple/interesting
>> one (depending on you answer to Brett's question )
> The approach of splitting the installation into two different locations
> seems to be wrong, it changes the semantics for imports of python
> packages which are not installed in the same location. Simplest counter
> example is the use of relative imports, which will fail if the imported
> module/extension is not found in the same paths.

isn't using relative imports outside packages a bad practice?

I'm not proposing to split installation of single package. I'm proposing
having two different default install locations, based on package type
(platform dependent/independent), not on file type.
Package is pure (platform independent) as long as -all- of its files are

I have seen one problem so far: wxGTK's python part installs a .pth file
along with its purelib part, that supposedly points to its platlib
package. That of course breaks when purelib != platlib. So far i would
consider this a bug in wxGTK, or rather relying on behavior that is not
well defined. But i admit that i'm not sure.

> Other languages like Perl or Java don't have relative imports, or they
> map all components on the "path" into one logical path so you don't have
> this kind of problem.

and that's probably why perl approach would fail miserably in python ;)
unless we implemented mapping to one path. Hopefully, we probably don't
need to do it.

> I don't see an explict statement that code really has to live inside
> /usr/share,

Doesn't have to - it's just that there doesn't seem to be a better
location. If you know of one, let's see it.

> and even generated .py files differ depending on the
> architecture you build for (e.g. sip, qt bindings).

In that case, such packages aren't pure and installing them into purelib
path would be a bug.


>   Matthias
> _______________________________________________
> Distutils-SIG maillist  -  Distutils-SIG at python.org
> http://mail.python.org/mailman/listinfo/distutils-sig

More information about the Distutils-SIG mailing list