A guide to upgrading older projects

Existing projects based on bin/buildout may be broken due to older grokproject(s) still referring to the subversion source at http://grok.zope.org.  This may be fixed by changing the line:

extends = http://grok.zope.org/releaseinfo/1.5.5/versions.cfg

in buildout.cfg to

extends = https://raw.githubusercontent.com/zopefoundation/grokproject/master/versions/1.5.5/versions.cfg

PyPI recently (Nov. 2017) dropped support for HTTP, and all connections must use the HTTPS protocol. This means that the version of bootstrap.py/buildout you may be using can no longer work correctly, and must be upgraded.  To do this, download bootstrap.py:

wget https://raw.githubusercontent.com/buildout/buildout/master/bootstrap/bootstrap.py

and run python ./bootstrap.py .  This should update buildout to the current version.

The next step is to edit your buildout.cfg, and change all occurrences of z3c.recipe.script to zc.recipe.egg.  Also remove the line buildout.dumppickedversions, which has been deprecated.  Then run bin/buildout, which should bring your source eggs up to date.

One slight problem, is that the interpreter installed by the zc.recipe.egg is not as nice s the previous one, and cannot be used as an interpreter for IDE installations such as Eclipse, Comodo or PyCharm.  To fix this, make a directory src/[project]/scripts and add __init__.py and interpreter.py.  interpreter.py looks like this:

import os, sys

def main():
    os.environ['PYTHONPATH'] = ':'.join(sys.path)
    os.execve(sys.executable, sys.argv, os.environ)

Now edit your buildout.cfg, and add a part called 'console' under parts:

parts =
app
...
console
...

First remove the existing line referring to python-console, and then define the section for console as follows:

[console]
recipe = zc.recipe.egg:scripts
eggs =
  xxx
entry-points =
  python-console=xxx.scripts.interpreter:main

where xxx is your project name.

When you run bin/buildout, the new python-console installed will be usable from an IDE.

 

Grok 4 Noobs

Installation Notes - older projects