On 30/10/12 12:58 +0100, Cédric Krier wrote: > Hi, > > I already talked about this topic but here I got a first example what we > are going to face when the number of modules will increase [1]. > It is clear that prepends "trytond_" to the module name makes it looks > like an official Tryton module.
After some thoughts, I think I got a clear picture on how we can fix
this.
First, let clarify the two concepts here:
- package name: it is the name of the package, the archive that
contains the source code. It is this name that is exposed on PyPI.
- module name: it is the name of the module under the directory
"trytond/modules" or in the entry points "trytond.modules"
As you can see, there is no requirement that both are the same. It is
what we did for the official Tryton modules, package names are prefixed
with "trytond_".
What I propose is that non-official modules use an other prefix than
"trytond_" to not confuse people. The prefix could be the company name,
the author name or whatever you like. But you can still use a
non-prefixed name for the module.
Let take an example:
* trytond_sale_kit: http://pypi.python.org/pypi/trytond_sale_kit
It could have a package name: "nantic_sale_kit"
And still have the module name: "sale_kit"
This means that if one day this module become official it is just about
rename the package into trytond_sale_kit but not the module. So for the
user who install it, it just need to rename the package.
Moreover, we can manage at the package level dependencies for a specific
flavor of a tryton module. For example, if there are a friendly fork :-)
of sale_kit by B2CK like b2ck_sale_kit. Other can put in their setup.py
that they depend on the b2ck_sale_kit flavor instead of nantic_sale_kit.
Finally, I think the main issue for this adoption is the lake a clean
setup.py reusable for everyone (I think people has just copy/paste the
setup.py of Tryton module). This setup.py will contain the definition of
the prefix and a simple mechanism to manage flavor.
I will try to provide this one ASAP.
--
Cédric Krier
B2CK SPRL
Rue de Rotterdam, 4
4000 Liège
Belgium
Tel: +32 472 54 46 59
Email/Jabber: [email protected]
Website: http://www.b2ck.com/
pgpwBZCO5DkhV.pgp
Description: PGP signature
