[Distutils] One Package Per Project

David Lyon david.lyon at preisshare.net
Sat May 2 01:07:24 CEST 2009


Hi Brandon,

It sounds like a nice idea, in terms of simplifying things, but it
worries me what "evil" code would have to be written to enforce it.

My simplistic understunding of python packaging is that there are:

 - internal packages

and user packages.. divided into:

 - site-packages
 - registered site-packages
 - packages located elsewhere outside site-packages but 
   'registered' via a .pth in site-packages
 - project packages
 - project sub-packages

I would describe what you are talking about as project sub-packages.

If they aren't registered.. in site-packages.. then it doesn't
really make any difference how many there are. Or what they
are called...

What we need is restructuring sure...

But what seems to be needed is clearer thought around the
whole package registration system.

I'm all for simplification..

On Fri, 01 May 2009 10:20:07 -0400, Brandon Craig Rhodes
<brandon at rhodesmill.org> wrote:
> I think that, going forward, Python packaging tools (not installation
> tools; they should remain as they are, for backwards compatibility)
> should move to supporting only One Package Per Project.  And, each
> project should have the same name as the package inside.  In the future,
> people should have to download an old copy of distutils deliberately if
> they want to build projects with several packages inside; we should stop
> releasing tools that support or encourage it.
> 
>  1. It is easier on developers who want to "import escher" to know that
>     they can simply list "escher" as a dependency instead of having to
>     guess whether it's "Escher" or "EscherProject" or whether it's part
>     of a larger "lithographers" project or whether, heaven forbid, the
>     author decided to redundantly call the project "pyescher".
> 
>  2. This practice would make PyPI's name make actual sense.  It actually
>     claims to be (you can check the site!) the "Python *Package* Index"
>     whereas in fact it's currently nothing of the sort!  It's really an
>     index of "projects" that might have zero, one, or several packages
>     inside of them.  We should move all projects towards the good
>     behavior of the ones that already name themselves after the single
>     package that they contain.
> 
>  3. I think the whole idea of putting several packages in a project was
>     useful back when dependencies didn't exist.  It made sense, in
>     ancient days, for "ZODB" to include "transaction" because there was
>     no other way to make sure they got installed together.  But now that
>     dependencies are possible, there is no longer a need for multiple-
>     package project that outweights the costs involved.
> 
>  4. The current scheme makes it impossible to choose a "safe" package
>     name when creating and registering a new package.  Just because
>     there's no "escher" *project* when you look at PyPI doesn't mean
>     that some project doesn't have an "escher" package hidden inside.
>     You could choose a package name, distribute your product, and only
>     find out later that your users cannot install both your product and
>     another product simultaneously because the other product was, in
>     fact, already using that package name but without your knowing it.
> 
> --
> Brandon Craig Rhodes   brandon at rhodesmill.org  
> http://rhodesmill.org/brandon
> _______________________________________________
> Distutils-SIG maillist  -  Distutils-SIG at python.org
> http://mail.python.org/mailman/listinfo/distutils-sig



More information about the Distutils-SIG mailing list