New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adjusting cherrypy WSGI Server import path according to new release #3235
Conversation
Fixing formatting and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the patch!
We don't depend on cherrypy / cheroot at all, which means we cannot test against it, without adding some extra machinery.
Please do update CHANGES.txt
: I'll check to see what PRs have been merged since the 1.9
branch forked off, and update it manually.
pyramid/scripts/pserve.py
Outdated
ssl_pem, ssl_pem) | ||
from cherrypy.wsgiserver import get_ssl_adapter_class, ssl_builtin | ||
get_ssl_adapter_class() | ||
server.ssl_adapter = ssl_builtin.BuiltinSSLAdapter(ssl_pem, ssl_pem) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part needs to use cheroot
, too. E.g.:
try:
from cheroot.server import get_ssl_adapter_class
except ImportError:
from cherrypy.wsgiserver import get_ssl_adapter_class
try:
from cheroot.ssl.builtin import BuiltinSSLAdapter
except ImportError:
from cherrypy.wsgiserver.ssl_builtin import BuiltinSSLAdapter
Thanks @tseaver , I updated what you pointed out 👍 As for |
A note belongs in features and another in backward incompatibilities mentioning the change in import paths for the cherrypy server runner. |
Guess I need update my fork and resolve the conflicts. Will do it shortly. |
@mmerickel I don't think there is a backward-incompatibility here for Pyramid: we try the |
CHANGES.txt
Outdated
@@ -35,6 +39,9 @@ Backward Incompatibilities | |||
depending on it directly within your project. | |||
See https://github.com/Pylons/pyramid/pull/3140 | |||
|
|||
- On CherryPy 9+ all functionality from ``cherrypy.wsgiserver`` was moved to ``cheroot``. | |||
See https://github.com/Pylons/pyramid/issues/3195 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I noted, I think we can drop this mention: users won't need to adjust their code, which means this is not a backward-incompatibility for Pyramid.
CHANGES.rst
Outdated
@@ -21,6 +21,10 @@ Features | |||
instead of ``pyramid.util.Request``. | |||
See https://github.com/Pylons/pyramid/pull/3129 | |||
|
|||
- Added a fallback ``try/except`` block on ``pyramid/scripts/pserve.cherrypy_server_runner`` | |||
due to module/import changes on CherryPy 9+ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we phrase this more clearly as:
- In `cherrypy_server_runner`, prefer imports from the `cheroot` package over the legacy
imports from `cherrypy.wsgiserver`.
@tseaver you're right of course, I missed that the old imports were preserved as a fallback! |
Fixing
cherrypy
WSGI import, ref #3195A couple of questions:
cherrypy_server_runner has a explicit
# pragma: no cover
comment. Should I remove it and add a specif test for it ?CHANGES.txt doesn`t look like is beeing mainted lately. Should I add an entry to it ?