2

The error occurs also when using zopeskel in Plone 4.3.3. This seem to be slightly different from this question. Under Plone 4.3.2 there is no error.

$ ../bin/paster create plone_basic
Selected and implied templates:
  PasteScript#basic_package  A basic setuptools-enabled package

Variables:
  egg:      plone_basic
  package:  plone_basic
  project:  plone_basic
Enter version (Version (like 0.1)) ['']:
Enter description (One-line description of the package) ['']:
Enter long_description (Multi-line description (in reST)) ['']:
Enter keywords (Space-separated keywords/tags) ['']:
Enter author (Author name) ['']:
Enter author_email (Author email) ['']:
Enter url (URL of homepage) ['']:
Enter license_name (License name) ['']:
Enter zip_safe (True/False: if the package can be distributed as a .zip file) [False]:
Creating template basic_package
Creating directory ./plone_basic
  Recursing into +package+
    Creating ./plone_basic/plone_basic/
    Copying __init__.py to ./plone_basic/plone_basic/__init__.py
  Copying setup.cfg to ./plone_basic/setup.cfg
  Copying setup.py_tmpl to ./plone_basic/setup.py
Running /home/Plone-4.3.3/Python-2.7/bin/python setup.py egg_info
Traceback (most recent call last):
  File "/home/Plone-4.3.3/zeocluster/bin/paster", line 259, in <module>
    sys.exit(paste.script.command.run())
  File "/home/Plone-4.3.3/buildout-cache/eggs/PasteScript-1.7.5-py2.7.egg/paste/script/command.py", line 104, in run
    invoke(command, command_name, options, args[1:])
  File "/home/Plone-4.3.3/buildout-cache/eggs/PasteScript-1.7.5-py2.7.egg/paste/script/command.py", line 143, in invoke
    exit_code = runner.run(args)
  File "/home/Plone-4.3.3/buildout-cache/eggs/PasteScript-1.7.5-py2.7.egg/paste/script/command.py", line 238, in run
    result = self.command()
  File "/home/Plone-4.3.3/buildout-cache/eggs/PasteScript-1.7.5-py2.7.egg/paste/script/create_distro.py", line 170, in command
    egg_info_dir = pluginlib.egg_info_dir(output_dir, dist_name)
  File "/home/Plone-4.3.3/buildout-cache/eggs/PasteScript-1.7.5-py2.7.egg/paste/script/pluginlib.py", line 135, in egg_info_dir
    % ', '.join(all))
IOError: No egg-info directory found (looked in ./plone_basic/./plone_basic.egg-info, ./plone_basic/setup.py/plone_basic.egg-info, ./plone_basic/plone_basic/plone_basic.egg-info, ./plone_basic/setup.cfg/plone_basic.egg-info)
Community
  • 1
  • 1
wolfrevo
  • 6,651
  • 2
  • 26
  • 38
  • please do not use paster for this as it is outdated; there are two tools you can use instead: ZopeSkel and mr.bob... also, if you are using paster because you read it in some documentation, let us know to update that also... – hvelarde May 21 '14 at 16:34
  • I also ran into this, could be a UnifiedInstaller-bug. If you want a reliable enviroment, use a virtualenv, activate it, get newest bootstrap.py and use the buildout.cfg propagated in the README of collective.dexteritypaste, make sure ZopeSkel is < 3, that worked for me. Alternatively see also: http://bluedynamics.com/articles/jens/plone-4.3-latest-minimal-buildout, hth. – Ida May 21 '14 at 18:23
  • 2
    @hvelarde: zopeskel makes usage of paster, `paster create -t plone_basic` equals `zopeskel plone_basic`, afaik. – Ida May 21 '14 at 18:32
  • We are investigating whether maybe there is some collision with [templer](https://github.com/collective/templer.plone). "Templer cannot coexist with ZopeSkel before version 3.0 in the same buildout or Python virtualenv" We try to convince our customer to migrate to Plone 4.x (and prepare for Plone 5). In the meantime our customer has become very reluctant and his expectations are to demonstate that things work "the standard way". Their IT-Department has already started to "play" with Plone 4.3.3 and they are not very convinced. Therefore we are searching for a quick fix "in the standards"! – wolfrevo May 21 '14 at 19:35
  • @IdaEbkes no, AFAIK ZopeSkel depends on Templer and Templer idea was to get rid of paster; ask Steve McMahon or Cris Ewing for current status). I using mr.bob and is way easier. – hvelarde May 21 '14 at 22:05
  • @wolfrevo if you are using ZopeSkel, you're suppose to use ZopeSkel template and not paster ones; the documentation only mention paster for local commands, so read it and do the way they are telling you to do it: https://pypi.python.org/pypi/ZopeSkel – hvelarde May 21 '14 at 22:07
  • @hvelarde: as for Plone 4.3.3 `ZopeSkel` is a wrapper on `paster` (as IdaEbkes already mentioned). e.g. `zopeskel.base.BaseTemplate` subclasses `paste.script.templates.Template`. Furthermore Plone 4.3.3 (as installed with `Plone-4.3.3-UnifiedInstaller.tgz` and buildout run with `develop.cfg`) seems not to use `templer` at all. – wolfrevo May 22 '14 at 06:05
  • Is there is somewhere a news that says "paster is outdated, don't use it, use mr.bob instead" ? – Jihaisse May 22 '14 at 06:55
  • @hvelarde: Also templer bases on paster (PasteScript). It was invented to have a better UI, but as it doesn't provide all of the former plone-templates yet, that project is kind of freezed. That's also why the official docs state to use ZopeSkel < 3, because of version 3 onwards it will use templer. So wolfrevo: If you search for a "standard", use zopeskel < 3, that's at least the official recommendation, which you know of course, after having read the new shiny docs (likelikelike) on how to create an add-on. – Ida May 22 '14 at 06:55
  • To handle your original quest, please file a bug-report for the UnifiedInstaller. P.S.: Also zopeskel.dexterity requires zopeskel<3, btw. – Ida May 22 '14 at 08:32
  • @Jihasse: Developers are free to use whatever is out there, be aware though, that mr.bob is definitely not supported by the foundation and thus also not reflected in the docs. If you feel like changing that, you canof course open a discussion on the lists. No wait, on disucussions.plone.org, ehm, whatever, you tell me ;) – Ida May 22 '14 at 08:35
  • @IdaEbkes: please see my answer and the ticket mentioned in it – wolfrevo May 22 '14 at 08:35
  • @wolfrevo: thanks for the report, with including explanation! – Ida May 22 '14 at 08:36
  • 1
    @hvelarde though your point is right. The issue here are the missing `setuptools` in a UnifiedInstaller-4.3.3 installation. Some templates generated by ZopeSkel, Templer, and at the last end by paste, also generate a `setup.py` file which needs `setuptools`. Please see my answer and the ticket mentioned in it. – wolfrevo May 22 '14 at 14:01
  • Unfortunately, Templer is basically dead. The path forward is one of the things we'll be taking up at the PSM 14 sprint. – SteveM May 22 '14 at 16:09
  • Also, please note that the error is scary, but harmless. The module is complete when it occurs. – SteveM May 22 '14 at 16:10
  • Here again, we find a very unfortunate example of the chunks (aka natural language expresions) that we have to hear/read over and over in the Plone community: "basically dead". How many times have I heard/read "old-style", "not endorsed", "more sexy". For those who not belong to the core of insiders this is very frustrating. – wolfrevo May 22 '14 at 18:28
  • I'd see it as another example of an evolutionary progress in an opensource-project: Mutate variations, select the best. "Failures" are part of the process. The wish for making change happening sometimes leads to hastily decisions, but there we are, to learn better. Still I think everything is there you need, and when in doubt you can always ask [communities.plone.org](communities.plone.org) or in IRC. This quest is about a *helpertool*, not the core, no need to panic, really. A lot of appreciations to SteveM here, giving so much love to the UnifiedInstallers! – Ida May 24 '14 at 07:25

1 Answers1

1

workaround 1:

The problem seems to be the missing setuptools. After installing setuptools, then paster (and all tools based on it) can run the generated setup.py. The following fixed the problem:

wget --no-check-certificate https://bootstrap.pypa.io/ez_setup.py -O - | sudo -u plone_buildout /usr/local/Plone-4.3.3/Python-2.7/bin/python

UnifiedInstaller-4.3.3 doesn't install setuptools. See this ticket.

As SteveM points out (see comments) this is not a recommended workaround.

(prefered) workaround 2:

The generated data is there (despite the thrown error!) but setup.py will not run. Thus the Paste* directories will not be generated. Later when buildout runs it will generate/download the Paste* directories etc.

If you want setup.py to be run. You could patch PasteScript (at your own risk!).

As for PasteScript-1.7.5 go to line #587 of /path/to/Plone-4.3.3/buildout-cache/eggs/PasteScript-1.7.5-py2.7.egg/paste/script/command.py and get the current sys.path and pass it to subprocess.Popen(). This way the setup.py will run with the zopeskel or paste environment.

current_env = os.environ.copy()
current_env['PYTHONPATH'] = ':'.join(sys.path)
proc = subprocess.Popen([cmd] + list(args),
                        cwd=cwd,
                        stderr=stderr_pipe,
                        stdout=subprocess.PIPE,
                        env=current_env) # <- pass the env here

I'll try to figure out situations where this workaround could cause problems. I've posted an issue on PasteScript: https://bitbucket.org/ianb/pastescript/issue/16/pass-the-syspath-to-the-subprocess-in

Update: without generating/adding the Paste* dirs (either running buildout or by workaround as above) localcommands won't be available.

wolfrevo
  • 6,651
  • 2
  • 26
  • 38
  • 2
    Keep in mind that adding setuptools to your virtualenv has its own risks. In particular, you won't be able to use that bin/python to bootstrap. So, you're replacing a harmless error message with something that may really bite you later. – SteveM May 22 '14 at 16:12
  • Thanks for the hint. But let me ask: If the error is harmless, why throw an error instead of a warning? It's very frustrating to have to spend hours and nerves to find out that this is harmless. How many people will after me (and others) fall in the same hole? – wolfrevo May 22 '14 at 18:22
  • BTW, if this error is really harmless, why not catch it? – wolfrevo May 22 '14 at 18:29
  • Let's flip that around: if the error bothers you, why don't you fix it? More seriously, we haven't had anyone doing fixes for Zopeskel for some time. What you're seeing is evidence that it's aging and unmaintained. – SteveM May 23 '14 at 14:35
  • Thank you for your suggestion. I've already posted an issue on PasteScript. See above or https://bitbucket.org/ianb/pastescript/issue/16/pass-the-syspath-to-the-subprocess-in. What bothers me is that lots of people will have to waste valuable time fighting against this issue. Why don't explain in the README.txt that "setuptools" has been removed and that this removal has consequences e.g. for ZopeSkel? On the other side why don't communicate this to the documentation team and give them a chance to fix the necessary parts of the docs? Please, see also my update (localcommands) under workaround2 – wolfrevo May 23 '14 at 18:51