Re: Deprecation done right?

Alexander Pilz <[email protected]>
Newsgroups gmane.comp.web.zope.plone.devel,gmane.comp.web.zope.plone.teams.framework
Message-ID <[email protected]>
I want to raise an idea that has helped us a lot in the past.

We wanted to massively reduce the work to create releases but didn't want to refactor too much code to achieve that. In the end, we combined several packages which anyway had the same namespace into one repository. We now only release one egg which contains them all.

An example for this is the Euphorie project at https://github.com/euphorie/Euphorie

We release the Euphorie egg and it contains euphorie.client, euphorie.content, euphorie.deployment and euphorie.tests. When moving the github repositories, it is possible to keep the history as well.

I wonder whether it would be possible to create e.g. a PloneApp egg like this.

Just an idea.

Best
Alex

> On 26 Nov 2014, at 10:32, Jens W. Klein <jens-/[email protected]> wrote:
> 
> In yesterdays framework-team hangout we discussed briefly the best way
> to deprecate single functions, classes, methods, modules or whole python
> eggs.
> 
> Background:
> ===========
> 
> At the moment we have way to many single packages. This is a nightmare
> for our release manager.
> 
> So we planned to merge core functionality like the controlpanels into
> Products.CMFPlone. Another example and low hanging fruit is the merge of
> plone.behavior into plone.dexterity. And more is planned. But thats not
> the question here - please discuss in a separate thread ;)
> 
> Moving stuff around in core results always a headache for addon
> developers and integrators. Good deprecation acts as a pain killer. So
> we plan to not break existing imports.
> 
> To have a clear communication about deprecations and in order to avoid
> different (confusing) styles of deprecation, we need a deprecation
> guideline.
> 
> 
> Proposal:
> =========
> 
> Case A: Deprecation because of renaming
> ---------------------------------------
> 
> We may want to rename methods, or functions in order to get a more
> consistent api or because of a typo, etc.
> We never just rename, we always provide a deprecated version
> logging/raising a verbose deprecation warning with information where to
> import from in future.
> 
> We need a wrapper/decorator which handles this. (To be defined)
> 
> Case B: Moving a module, class, function, etc to another place
> --------------------------------------------------------------
> 
> For some reason, i.e. merging packages or resolving cirular import
> problems, we need to move things around.
> 
> The object is imported at the old place, but logs/raises a verbose
> DeprecationWarning telling with information where to import from in future.
> 
> (details to be defined)
> 
> 
> Case C: Deprecation of a package
> --------------------------------
> 
> A whole package (folder with __init__.py)
> 
> - all imports still works, but they are raising Deprecation Warnings
> 
> - ZCML still exists, but is empty (or includes the zcml from the new
> place if theres no auto import (i.e. for meta.zcml). Not sure if we can
> raise/log deprecation warnings in this case
> 
> (details to be defined)
> 
> 
> Case D: Deprecation of a whole python egg
> -----------------------------------------
> 
> We will provide a last major release with no 'real' code, only backward
> compatible (bbb) imports are provided, case C applies.
> 
> The README clearly states why it was moved and where to find the code now.
> 
> 
> Question to you
> ===============
> 
> Please comment the above proposal. Did we miss a case? Something is odd?
> 
> Is there already some package around dealing with this cases?
> 
> We know there are:
> 
> zope.deprecation
>     looks like what we need.
>     but seems not raising any warning here, is this still useful? Did I
>     miss something?
> 
> zope.deferredimport.deprecated
>     helps if code moves around
> 
> Is there something for zcml as well?
> 
> thanks in advance for your ideas
> 
> Jens
> --
> Klein & Partner KG, member of BlueDynamics Alliance
> 
> 
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
> http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
> _______________________________________________
> Plone-developers mailing list
> Plone-developers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/plone-developers

--
Alexander Pilz
SYSLAB.COM GmbH, Landwehrstrasse 60-62, 80336 Munich, Germany
Tel: +49 89 3063589-0 - Fax: +49 89 3063589-9
http://www.syslab.com - Amtsgericht Muenchen, HRB 135057
Steuernummer 143/184/50154 - Ust.-ID: DE212842815

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk

_______________________________________________
Plone-developers mailing list
Plone-developers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/plone-developers
signature.asc (application/pgp-signature, 495 B)
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org

iQEcBAEBAgAGBQJUdaKCAAoJEGfY1J9i1RofykAH/081EavL5OaMaT4PNAqsnQGY
QVbo0IuGAbeCmuLWj4UMMRJ3k0Wl0Ti9meUqH6M34LU0CX7vZYE4OKLt+xgDg+fN
2nQA6hR+XzqQArniXXDTPKUz60b6Hq/ShNec/Xdd62u0eNkS0uRR8IQgdsaF//mR
qEiOBWR5hxE2PQWUoXJbMI7sG9JudpijarJDvlWWObQAwZacNoHwYEhVewMLLr9/
t/oBxE36L48e5aXr6XUXgH9zOhSL+2pdeoPpL3TN+cqBvHtva6TQYgGMy3O4jvC7
B3WL5EEmxaz7E1rnzyg+El9SJh5VDnRcX4IkdoOBZhDqg9vM1NNu63qynpVc1QA=
=XBAm
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.