collective / collective.upgrade

11 stars 5 forks source link

Not working on Pyhton3 #9

Closed bsuttor closed 4 years ago

bsuttor commented 4 years ago

Hi, We try to use collective.upgrade on Plone 5.2 with Python 3. As usual, we add

parts  += upgrade
[upgrade]
recipe = zc.recipe.egg
eggs = ${instance:eggs}
scripts = upgrade-portals
arguments = args=[
    '--zope-conf', '${instance:location}/etc/zope.conf',
    '--log-file', '${buildout:directory}/var/log/upgrade.log']

to our buildout

When I start bin/upgrade-portals, I have this traceback

Traceback (most recent call last):
  File "./bin/upgrade-portals", line 296, in <module>
    '--log-file', '/home/bsuttor/projects/buildout.imioweb/var/log/upgrade.log']))
  File "/home/bsuttor/projects/buildout.imioweb/src/collective.upgrade/src/collective/upgrade/run.py", line 100, in main
    Zope2.configure(args.zope_conf)
  File "/home/bsuttor/.buildout/eggs/zope.deferredimport-4.3-py3.7.egg/zope/deferredimport/deferredmodule.py", line 70, in __getattr__
    v = get.get()
  File "/home/bsuttor/.buildout/eggs/zope.deferredimport-4.3-py3.7.egg/zope/deferredimport/deferredmodule.py", line 54, in get
    return super(DeferredAndDeprecated, self).get()
  File "/home/bsuttor/.buildout/eggs/zope.deferredimport-4.3-py3.7.egg/zope/deferredimport/deferredmodule.py", line 37, in get
    v = __import__(module, *self._import_chicken)
ModuleNotFoundError: No module named 'ZServer'

Of course, ZServer is not compatible with Py3 But when I start ./bin/instance -O Plone run src/collective.upgrade/src/collective/upgrade/run.py (after added this line on run.py : parser.add_argument("-c"))

How can I set app correctly on "def main" on run.py ?

gbastien commented 4 years ago

Hi @rpatterson

could you please give pypi rights to bsuttor? As I have it, I will do a new release right now on pypi, does that seem OK to you or have you some work in progress?

Maybe you could add a changelog entry relative to Python3 compatibility?

Thank you! Gauthier

gbastien commented 4 years ago

Hi @rpatterson we need a release so I will do one on pypi, could you please give pypi rights to bsuttor as well? Thank you, Gauthier

rpatterson commented 4 years ago

Done! Apologies for the delay, @bsuttor . Thanks for the work maintaining this.