plone / bobtemplates.plone

Python Code Templates for Plone Projects with mr.bob
https://pypi.org/project/bobtemplates.plone/
GNU General Public License v2.0
24 stars 31 forks source link

support for not dotted package, how to create a egg from plonecli #542

Open yurj opened 1 year ago

yurj commented 1 year ago

https://github.com/plone/bobtemplates.plone/blob/f5ff6e44a4c541747f84b23d78e26d4f5dc31376/bobtemplates/plone/base.py#L438-L440

Hi! what about packages like mypackage/src/namespace/name ?

Actually it is supported only

namespace.name/src/namespace/name

Can we just use setup.py to find namespace and name? Or it is better to avoid this kind of situation, just renaming mypackage in namespace.name?

How to improve?

With plonecli I've created an addon with a dotted namespace but I copied all the directory (the one with buildout inside) in plone src/mypackage instead of copying just the plonecli created subfolder src/namespace in src/namespace.name/ in plone. It works because how setup.py is created to make possible to have buildout in the same directory (base.cfg -> develop = .). Is this the way to do it?

If I want to create an egg from the plonecli addon, I've to move that code around, change the lines in setup.py:

    packages=find_packages('src', exclude=['ez_setup']),
    package_dir={'': 'src'},

So I think the template should create a src/namespace.name/namespace/name and use develop = src/namespace.name/ (or better mr.developer?), moving setup.py in src/namespace.name (removing the lines above about packages). Could this help?