Search code examples
svnplone

Plone does not checkout a development addon over SVN, buildout fails when applying develop.cfg - what am I doing wrong?


I intend to develop an add-on for Plone. From what I have gathered after reading the manuals, the best way to do so that is compatible with my development tools is by setting up a standalone SVN HTTP server and having Plone checkout my add-on's source code into its own directories.

Having read that, I started out by installing Mr. Bob and Plone's bobtemplates (pip install mr.bob bobtemplates.plone). Then I created on my SVN server a new directory, checked it out into a new directory in my local filesystem with svn checkout https://192.168.1.10/svn/SVN/plone-test/trunk, and initialized a new project this way:

~/plone/test/trunk$ mrbob -O plone.app.RAKK-test bobtemplates.plone:addon

Welcome to mr.bob interactive mode. Before we generate directory structure, some questions need to be answered.

Answer with a question mark to display help.
Values in square brackets at the end of the questions show the default value if there is no answer.


--> Author's name [FakeGitUserOrEmail]: RAKK

--> Author's email [FakeGitUserOrEmail]: [email protected]

--> Author's GitHub username:

--> Package description [An add-on for Plone]: Add-on test for Plone

--> Do you want me to initialze a GIT repository in your new package? (y/n) [y]: n

--> Plone version [5.1]: 5.2

--> Python version for virtualenv [python2.7]: python3.7


git init is disabled!
Generated file structure at /home/user/plone/test/trunk/plone.app.RAKK-test

Then I uploaded my newly created sources to Subversion: svn add *, then svn commit.

With my project newly created, I added the following entries on my configuration file /opt/plone/zinstance/develop.cfg:

[sources]
plone.app.RAKK-test = svn https://192.168.1.10/svn/SVN/plone-test/trunk/plone.app.RAKK-test

[buildout]
always-accept-server-certificate = true

To rule out possible issues with certificate acceptance, I created a temporary directory called /tmp/plone-temp and set its ownership with chown -R plone_buildout:plone_group /tmp/plone-temp, then ran an SVN checkout under user plone_buildout: sudo -u plone_buildout svn checkout https://192.168.1.10/svn/SVN/plone-test/trunk/plone.app.RAKK-test. SVN indeed asked me to trust my server's certificate, to which I chose the option to trust it permanently.

Then, without Plone running, I had Buildout apply the development configuration: cd /opt/plone/zinstance, then sudo -u plone_buildout bin/buildout -c develop.cfg.

However, Buildout fails with the following error:

root@host:/opt/plone/zinstance# sudo -u plone_buildout bin/buildout -c develop.cfg
mr.developer: Queued 'plone.app.RAKK-test' for checkout.
mr.developer: Checked out 'plone.app.RAKK-test' with subversion.
Develop: '/opt/plone/zinstance/src/plone.app.RAKK-test'
error in plone.app.RAKK-test setup command: ("EntryPoint must be in 'name=module:attrs [extras]' format", 'update_locale = plone.app.RAKK-test.locales.update:update_locale')
While:
  Installing.
  Processing develop directory '/opt/plone/zinstance/src/plone.app.RAKK-test'.

An internal error occurred due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
  File "/opt/plone/zinstance/lib/python3.7/site-packages/zc/buildout/buildout.py", line 2174, in main
    getattr(buildout, command)(args)
  File "/opt/plone/zinstance/lib/python3.7/site-packages/zc/buildout/buildout.py", line 679, in install
    installed_develop_eggs = self._develop()
  File "/opt/plone/zinstance/lib/python3.7/site-packages/zc/buildout/buildout.py", line 922, in _develop
    zc.buildout.easy_install.develop(setup, dest)
  File "/opt/plone/zinstance/lib/python3.7/site-packages/zc/buildout/easy_install.py", line 1100, in develop
    call_subprocess(args)
  File "/opt/plone/zinstance/lib/python3.7/site-packages/zc/buildout/easy_install.py", line 166, in call_subprocess
    % repr(args)[1:-1])
Exception: Failed to run command:
'/opt/plone/zinstance/bin/python3.7', '/tmp/tmp7pwev_7c', '-q', 'develop', '-mN', '-d', '/opt/plone/zinstance/develop-eggs/tmpd785ylqtbuild'

This does not look like a bug, because I got the same error after installing Plone 5.1.6 on a separate directory, which uses Python 2.7.

However, after reading and re-reading the documentation many times, I just can't figure out what am I missing or why Plone is not fetching my add-on. Would it be possible for anyone to help me sort this out, or at least give me some pointers to something I might be missing?

I have already tried the following:

  1. From this thread here, ensuring that the Python setuptools package is installed. It is installed both under my system-wide instances of Python 2.7 and Python 3.7.

This is what I'm going to try:

  1. From the same thread about checking setuptools, there is a chance that Plone packages must not have hyphens in the name. I'm going to try recreating the package with a hyphen-less name.

Solution

  • After 3 hours of bashing my head against the wall and re-reading everything for the tenth time, I found on the thread I linked before a suggestion that maybe having a dash in my package name renders it incompatible with pip. After going again through all these steps but with a hyphen-less name, Buildout finally picked up my package.

    I therefore declare this problem solved, and leave this question here on the public interest of making everybody's life easier, since it's very easy to fall into this mistake and figuring it out is not trivial.