summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES.rst11
-rw-r--r--cherrypy/_cperror.py3
-rw-r--r--cherrypy/_helper.py31
-rwxr-xr-xsetup.py3
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)
+####
diff --git a/setup.py b/setup.py
index df6630c7..b3ab3cb6 100755
--- a/setup.py
+++ b/setup.py
@@ -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 = {