如何解决Plone 4.2和4.3的collective.js.jqueryui版本控制问题

如何解决Plone 4.2和4.3的collective.js.jqueryui版本控制问题,plone,Plone,我有一个插件,我想更新它以与Plone4.3兼容,但当Plone4.2用户进行升级时,它应该保持功能 报告说: 对于Plone 3,您需要此软件包的1.7.x版 Plone

我有一个插件,我想更新它以与Plone4.3兼容,但当Plone4.2用户进行升级时,它应该保持功能

报告说:

对于Plone 3,您需要此软件包的1.7.x版
Plone<4.3使用版本<1.9


如何在setup.py中配置这种特定于版本的依赖关系?

实际上是c.js.jqueryui应该将Plone版本固定在它们的标记版本中,IMHO。 所以你应该联系作者。 因此,您也应该添加'Products.CMFPlone'作为依赖项,但我不知道这里的最佳实践是什么

无论如何,为了回答您的问题,无论我们是否有Plone-3,这里有一种可能性来区分:

setup.py中,在顶部添加

import glob

# BBB: Append Plone-3-specific version-pinnings
# to `install_requires`, in case third-party-eggs
# do not specify their requirement-versions.
# Assumes, Plone-eggs are in the same directory
# as this egg, which is given, if fetched of pypi.
# Otherwise assumes, you know how to tweak
# buildout and pin versions yourself.

# Collect P3-eggs in eggs-directory:
plone3_eggs = glob.glob('../Products.CMFPlone-3*')

# Found something?
if len(plone3_eggs) > 0:

    # Expects `install_requires=[ ... ] + plone3_requires,`
    # in setup-method below, to take effect:
    plone3_requires = [
    'collective.js.jqueryui<=1.7',
    # Add more P3-pins here.
    ]

您是否在问,如何确保Plone-4.2.x产品也能与Plone-4.3.x配合使用?因为您所指的自述文件指的是Plone-3兼容性而不是P4…它指的是Plone 3、Plone 4<4.3和Plone 4>=4.3。是的,不过,这正是这里的利害关系。@Campbell:你可能也感兴趣:
      install_requires= [
    'setuptools',
    'collective.js.jqueryui',
    ] + plone3_requires,