10gen / mongo-orchestration

Apache License 2.0
7 stars 11 forks source link

Error when starting server on Python 3.8 due to old CherryPy dependency #275

Closed kevinAlbs closed 4 years ago

kevinAlbs commented 4 years ago

I’m seeing an issue running mongo-orchestration on with Python 3.8. Starting a server gets this traceback:

Traceback (most recent call last):
  File "/data/mci/b6560f2af5c20f78ff5a0eca1bae3f99/mongoc/venv/lib/python3.8/site-packages/mongo_orchestration/server.py", line 132, in run
    run(get_app(), host=self.args.bind, port=self.args.port,
  File "/data/mci/b6560f2af5c20f78ff5a0eca1bae3f99/mongoc/venv/bin/bottle.py", line 3131, in run
    server.run(app)
  File "/data/mci/b6560f2af5c20f78ff5a0eca1bae3f99/mongoc/venv/bin/bottle.py", line 2789, in run
    from cherrypy import wsgiserver
  File "/data/mci/b6560f2af5c20f78ff5a0eca1bae3f99/mongoc/venv/lib/python3.8/site-packages/cherrypy/__init__.py", line 64, in <module>
    from cherrypy._cperror import HTTPError, HTTPRedirect, InternalRedirect
  File "/data/mci/b6560f2af5c20f78ff5a0eca1bae3f99/mongoc/venv/lib/python3.8/site-packages/cherrypy/_cperror.py", line 118, in <module>
    from cgi import escape as _escape
ImportError: cannot import name 'escape' from 'cgi' (/usr/lib64/python3.8/cgi.py)

cgi.escape appears to have been removed in Python 3.8, so that traceback makes sense. But, this code is in CherryPy, a dependency of mongo-orchestration. And it appears mongo-orchestration relies on an old version of CherryPy: CherryPy >= 3.5.0, < 7.1 (latest version is 18.5.0). That was set in this commit.

Is it possible to remove the < 7.1 constraint for CherryPy?

kevinAlbs commented 4 years ago

Oops, I did not see this was already being tracked in https://jira.mongodb.org/browse/PYTHON-2067. Closing.

sknopp commented 3 years ago

This error still occurs when one uses the pip package. The last tagged version is already 2 years old! Is there any reason for that?

ShaneHarvey commented 3 years ago

Thanks for the nudge @sknopp. I just released https://pypi.org/project/mongo-orchestration/0.7.0/ which resolves this issue:

$ pip install mongo-orchestration
Collecting mongo-orchestration
  Downloading mongo_orchestration-0.7.0-py2.py3-none-any.whl (67 kB)
     |████████████████████████████████| 67 kB 3.3 MB/s
Collecting CherryPy<9.0.0,>=3.5.0
  Using cached CherryPy-8.9.1-py2.py3-none-any.whl (464 kB)
Collecting bottle>=0.12.7
  Using cached bottle-0.12.19-py3-none-any.whl (89 kB)
Collecting pymongo<4,>=3.0.2
  Downloading pymongo-3.11.3-cp38-cp38-macosx_10_9_x86_64.whl (380 kB)
     |████████████████████████████████| 380 kB 5.6 MB/s
Collecting six
  Using cached six-1.15.0-py2.py3-none-any.whl (10 kB)
Installing collected packages: six, pymongo, CherryPy, bottle, mongo-orchestration
Successfully installed CherryPy-8.9.1 bottle-0.12.19 mongo-orchestration-0.7.0 pymongo-3.11.3 six-1.15.0
$ mongo-orchestration start --no-fork
Starting Mongo Orchestration on port 8889...
Bottle v0.12.19 server starting up (using CherryPyServer())...
Listening on http://localhost:8889/
Hit Ctrl-C to quit.

^C%