diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2017-12-17 11:13:53 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-12-17 11:13:53 -0500 |
| commit | 951489bcf1d0db047d53b303b6b077272a8245d2 (patch) | |
| tree | 2a3dab8ea85a6e0760dbf2a3b83d8902595190b2 | |
| parent | 0056e389c1de55d4096a18826f0804c05d048c53 (diff) | |
| parent | 3b38b61d96d0c65c05637b53b82fe5b81e7175be (diff) | |
| download | cherrypy-git-13.0.1.tar.gz | |
Merge pull request #1671 from benjaoming/bug/internalize-jaraco-classesv13.0.1
Internalize jaraco.classes code to replace dependency
| -rw-r--r-- | CHANGES.rst | 11 | ||||
| -rw-r--r-- | cherrypy/_cperror.py | 3 | ||||
| -rw-r--r-- | cherrypy/_helper.py | 31 | ||||
| -rwxr-xr-x | setup.py | 3 |
4 files changed, 45 insertions, 3 deletions
diff --git a/CHANGES.rst b/CHANGES.rst index c48d190d..56d4da74 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,10 @@ +v13.0.1 +------- + +* #1671: Restore support for installing CherryPy into + environments hostile to namespace packages, broken since + the 11.1.0 release. + v13.0.0 ------- @@ -101,6 +108,10 @@ v11.1.0 * Also, many improvements around continuous integration and code quality checks. +This release contained an unintentional regression in environments that +are hostile to namespace packages, such as Pex, Celery, and py2exe. +See #1671 for details. + v11.0.0 ------- diff --git a/cherrypy/_cperror.py b/cherrypy/_cperror.py index ab1cc70f..1e6214c0 100644 --- a/cherrypy/_cperror.py +++ b/cherrypy/_cperror.py @@ -125,12 +125,11 @@ from xml.sax import saxutils import six from six.moves import urllib -from jaraco.classes.properties import classproperty - import cherrypy from cherrypy._cpcompat import escape_html from cherrypy._cpcompat import text_or_bytes, ntob from cherrypy._cpcompat import tonative +from cherrypy._helper import classproperty from cherrypy.lib import httputil as _httputil diff --git a/cherrypy/_helper.py b/cherrypy/_helper.py index 505c4bc9..a0ab68fe 100644 --- a/cherrypy/_helper.py +++ b/cherrypy/_helper.py @@ -308,3 +308,34 @@ def normalize_path(path): newpath = '/' + newpath return newpath + + +#### +# Inlined from jaraco.classes 1.4.3 +# Ref #1673 +class _ClassPropertyDescriptor(object): + """Descript for read-only class-based property. + + Turns a classmethod-decorated func into a read-only property of that class + type (means the value cannot be set). + """ + + def __init__(self, fget, fset=None): + """Instantiated by ``_helper.classproperty``.""" + self.fget = fget + self.fset = fset + + def __get__(self, obj, klass=None): + """Return property value.""" + if klass is None: + klass = type(obj) + return self.fget.__get__(obj, klass)() + + +def classproperty(func): + """Decorator like classmethod to implement a static class property.""" + if not isinstance(func, (classmethod, staticmethod)): + func = classmethod(func) + + return _ClassPropertyDescriptor(func) +#### @@ -53,11 +53,12 @@ packages = [ 'cherrypy.scaffold', ] +# install requirements must not contain namespace +# packages. See #1673 install_requires = [ 'six>=1.11.0', 'cheroot>=5.9.1', 'portend>=2.1.1', - 'jaraco.classes', ] extras_require = { |
