Find requirement specs in a Plone buildout setup

爱⌒轻易说出口 提交于 2019-12-01 15:26:41

问题


I have a Plone site (something around 4.2.4, telling from a version.txt in the root directory) which I'd like to update to a recent version (I found this how-to) (as of now, 4.3.4); I have inherited a plethora of pinned versions which are not documented and might be outdated.

When commenting out my versions.cfg, using http://dist.plone.org/release/4.3-latest/versions.cfg instead and re-running buildout with -vvv, I get:

Develop: '.../src/collective.mathjax'
in: '.../src/collective.mathjax'
/tmp/tmpbXsnpD -q develop -mxN -d .../develop-eggs/tmp2yhe9ubuild
...
Installing 'zc.recipe.egg'.
We have the best distribution that satisfies 'zc.recipe.egg<2dev'.
Picked: zc.recipe.egg = 1.3.2
...
There is a version conflict.
We already have: zc.recipe.egg 1.3.2.
While:
  Installing.
  Getting section test.
  Initializing section test.
  Installing recipe zc.recipe.testrunner.

So there seems to be some requirement for a sub-2 version of zc.recipe.egg, but I can't find it. (In my versions.cfg it is pinned to 2.0.1 - which used to work, surprisingly.)

I searched the tree with find and grep, looking for rc.recipe.egg in version*.cfg and setup.py files, but I couldn't find anything but in my project root directory. I even searched every single file below .../src/collective.mathjax, without success.

How can I ferret out this dependency? Thank you!


回答1:


Basically there's three places to look for version-pinnings:

1.) The requires-files of eggs released on PyPi, like Luca Fabbri pointed out, which you can search for pins like this:

grep -r --include=requires.txt "dependency.to.search.for" path/to/eggs-cache

2.) The setup.py-files of development-eggs, similar searchable like:

grep -r --include=setup.py "dependency.to.search.for" path/to/dev-eggs-cache

3.) The [versions]-part of config-files, where in this case the version.cfg is pulling more version-configs in, via its extends-option and the pulled one's might also specify more configs via extends.

You're lucky, admired M. v. Rees has shared a snippet, on how to get all pinnings of all Plone versions: https://gist.github.com/mauritsvanrees/99cb4a25b622479e7dc3




回答2:


but a better way to upgrade the existing installation is probably to get a standard buildout for the plone version you want to upgrade to, and then add your non-standard eggs to this buildout. Finally move your database and blobs over to the new installation, and follow the upgrade guide.




回答3:


The dependency is probably inside a 3rd party egg (so: no setup.py in it). Search again inside ./eggs/*/EGG-INFO/requires.txt (if your egg directory is inside the buildout root).




回答4:


It could be that you have on your buildout configuration to not look for a newer version if you already have one locally. There should be a line like this:

newest = false

You could try to either remove your local cache of eggs or explicitly set to not use the global one and use a specific one (empty).

Something like:

[buildout]
eggs-directory = /home/USER/SOMEWHERE/eggs
download-cache = /home/USER/SOMEWHERE/downloads
extends-cache = /home/USER/SOMEWHERE/extends



回答5:


You can use "eggdeps" (search pypi for it) to get a tree of all dependencies in your buildout - perhaps this can be helpful. Add the egg to your buildout and rerun buildout. Do it on your original, working buildout configuration, before making the changes you mentioned. (Generating the eggdeps script requires buildout to finish successfully).

add this to your buildout configuration:

parts +=
    eggdeps

...

[eggdeps]
recipe = zc.recipe.egg
eggs = tl.eggdeps
       ${instance:eggs}
scripts = eggdeps

Run buildout again. Now you have a script bin/eggdeps, that prints a tree of all dependencies. Run it:

./bin/eggdeps -n

Example output:

zope.app.pagetemplate 3.11.2
    setuptools 8.0.2
    zope.browserpage 3.12.2 ...
    zope.component 3.9.5 [hook] ...
    zope.configuration 3.7.4 ...
    zope.dublincore 3.7.0
        pytz 2013b0
        setuptools 8.0.2
        zope.component 3.9.5 ...
        zope.datetime 3.4.1 ...
        zope.interface 3.6.7 ...
        zope.lifecycleevent 3.6.2 ...
        zope.location 3.9.1 ...
        zope.schema 4.2.2 ...
        zope.security 3.7.4 ...
      [test]
        zope.annotation 3.5.0 ...
        zope.testing 3.9.7 ...
    zope.i18nmessageid 3.5.3 ...
    zope.interface 3.6.7 ...
    zope.pagetemplate 3.6.3 ...
    zope.schema 4.2.2 ...


来源:https://stackoverflow.com/questions/29827258/find-requirement-specs-in-a-plone-buildout-setup

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!