[Distutils] conventions or best practice to choose package names?

Benoît Bryon benoit at marmelune.net
Fri Jun 29 09:42:35 CEST 2012


Le 28/06/2012 14:15, Piotr Ozarowski a écrit :
> [Benoît Bryon, 2012-06-27]
>> http://hg.python.org/peps/file/52767ab7e140/pep-0423.txt
> I think PEP 386 (about versions) should be mentioned in "Relationship
> with other PEPs" section.

Why? Right now, I can't see the relationship between
projects/packages/modules names and versions.


> About "Use a single name" section: sometimes one needs to add "python-"
> or "py" prefix to project name (f.e. if the name is already used in
> other programming languages and you cannot register it in your favourite
> forge hosting service)... but please don't add the prefix also in namespace.
> All these PyQts, pyudevs, pygames and pyopencls sound stupid to me (isn't
> it obvious that when I do `import foo` in Python, "foo" is a *Python*
> library?)

Do you mean:

* "pip install pyqt" =>  yes,
* "import pyqt" =>  no,
* "import qt" =>  yes?

Currently, if the project name is "pyqt", then the PEP
proposal recommends "pip install pyqt" and "import pyqt",
to make the name consistent. If one is not a good choice,
change both.
It is convention over configuration.

IMHO, a "py" prefix for package name would not be a problem
in this case. You are not importing Qt itself, but Python
bindings for Qt.

I mean, yes, it is obvious that when I do `import foo` in
Python, then "foo" is a *Python* library. But would the
reverse assertion be that if I see "import qt" in Python
code, then it is obvious that Qt itself is a Python library?

The name could have been "qtbindings", would have it been a
problem then? The "py" prefix has the advantage to be clear:
that's *Python* bindings for Qt. And it's a really short
prefix.


> About ".contrib.": flask uses flask.ext.foo (namespace) and Flask-Foo
> (project name) schema for Flask extensions - maybe it's worth mentioning
> in this PEP as well.
Maybe it will be used in discussions or in examples, but
I suppose the PEP is not the place to list all project-specific
conventions. Currently the draft PEP tells: "search for
specific conventions in main project (Flask) documentation".


Benoit



More information about the Distutils-SIG mailing list