4 Responses to Get your egg version form the metadata.xml file

  1. Hanno Schlichting dit :

    Please don’t do this!

    The profile version and the code version are two very different concepts, which should in fact never be the same.

    The setup.py version marks the evolution of the code and is updated in the normal manner from 0.1, 0.2, 1.0, 1.1, 1.1b1, …

    The metadata version specifies the version of the GenericSetup profile alone. It should only ever be updated if the profile itself changes. If it does you also need to add an upgrade profile in later Plone versions, so users can upgrade from one profile to the next.

    Code updates don’t require any upgrade beyond the installation of the new package.

    The recommended best practice for profile versions is to use simple increasing integers, like 1, 2, 3, 4, … to make it very obvious that there is no clear relation between those two version numbers.

    It took us a while to make sense of this situation, but with Plone 3.3 we have finally nailed this I hope.

  2. Watch it! The profile version found in metadata.xml is *not* the same as the egg version!

    The GenericSetup profile version is only intended for consumption by the portal_setup tool; it uses the version number to determine if upgrade steps need to be run, for example. You update the version number whenever the profile contents change.

    The egg version itself is thus not related to the profile version. The egg version truely reflects the version of the package-as-a-whole. But the package version can be incremented for a mere bugfix that doesn’t touch the profile, thus leaving the numbers out of sync.

  3. encolpe dit :

    First, I posted this article because some people asked for this method. They are begginers and want a centralized way to control egg version. Some of them don’t use any version control system.

    For the usage of metadata.xml, I always create a new upgrade step (and upgrade profile when need it) even an empty one for each egg release. The only case I modify the default profile is when I’m preparing a major release. There’s bugs in upgrade steps handler in GenericSetup that I will fix for Plone 4.

  4. As others have said, these numbers are not related, and the numbering scheme that Hanno talks about is the best way to minimize this confusion.

%d blogueurs aiment cette page :