in the past I used to declare only dependencies beyond of Plone in our packages, but lately I've been trying to follow the advice from plone.api:

"Declaring dependencies

All direct dependencies should be declared in install_requires or extras_require sections in setup.py. Dependencies, which are not needed for a production environment (like “develop” or “test” dependencies) or are optional (like “archetypes” or “dexterity” flavors of the same package) should go in extras_require. Remember to document how to enable specific features (and think of using zcml:condition statements, if you have such optional features).

Generally all direct dependencies (packages directly imported or used in ZCML) should be declared, even if they would already be pulled in by other dependencies. This explicitness reduces possible runtime errors and gives a good overview on the complexity of a package.

For example, if you depend on Products.CMFPlone and use getToolByName from Products.CMFCore, you should also declare the CMFCore dependency explicitly, even though it’s pulled in by Plone itself. If you use namespace packages from the Zope distribution like Products.Five you should explicitly declare Zope as dependency."

https://ploneapi.readthedocs.org/en/latest/contribute/conventions.html?highlight=imports#declaring-dependencies

at the same time I see plone api is only depending on the following:

    install_requires=[
        'setuptools',
        'Plone',
        'decorator',
    ],

https://github.com/plone/plone.api/blob/master/setup.py#L24

so... do as I say, not as I did? can anybody explain what's the real best practice here?

also, I'm using z3c.dependencychecker as a helper tool to list the dependencies, but I think we should work on it to solve some known issues.

for instance, Leo Rochael told me the other day we should not include special packages declared on Zope 2 like OFS and Products.Five.

does anybody has a complete list of these exceptions?

please note that listing all package dependencies could bring some issues specially on packages using the z3c.autoinclude package.

best regards
--
Héctor Velarde


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
Product-Developers mailing list
[email protected]
https://lists.plone.org/mailman/listinfo/plone-product-developers

Reply via email to