summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Merickel <michael@merickel.org>2017-10-22 13:53:39 -0500
committerMichael Merickel <michael@merickel.org>2017-10-22 13:53:39 -0500
commita5d3d2924dc5e43afe44fa71da1a71627ff3d10c (patch)
tree0d666fde66d499ab44b89122c001da7f32a7972f
parent11551647993f3000c8aaf7d3bbae5cfa3c27e005 (diff)
parentd5a66295d8044cd7d60c684a5c1732771822d149 (diff)
downloadpyramid-a5d3d2924dc5e43afe44fa71da1a71627ff3d10c.tar.gz
pyramid-a5d3d2924dc5e43afe44fa71da1a71627ff3d10c.tar.bz2
pyramid-a5d3d2924dc5e43afe44fa71da1a71627ff3d10c.zip
Merge branch 'pr/3140'
-rw-r--r--CHANGES.txt5
-rw-r--r--pyramid/compat.py5
-rw-r--r--pyramid/static.py7
-rw-r--r--pyramid/traversal.py3
-rw-r--r--pyramid/url.py3
-rw-r--r--setup.py3
6 files changed, 17 insertions, 9 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 01e4b2f1c..482610319 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -30,6 +30,11 @@ Deprecations
Backward Incompatibilities
--------------------------
+- On Python 3.4+ the ``repoze.lru`` dependency is dropped. If you were using
+ this package directly in your apps you should make sure that you are
+ depending on it directly within your project.
+ See https://github.com/Pylons/pyramid/pull/3140
+
Documentation Changes
---------------------
diff --git a/pyramid/compat.py b/pyramid/compat.py
index 8c8645460..a7f9c1287 100644
--- a/pyramid/compat.py
+++ b/pyramid/compat.py
@@ -17,6 +17,11 @@ try:
except ImportError: # pragma: no cover
import pickle
+try:
+ from functools import lru_cache
+except ImportError:
+ from repoze.lru import lru_cache
+
# PY3 is left as bw-compat but PY2 should be used for most checks.
PY2 = sys.version_info[0] == 2
PY3 = sys.version_info[0] == 3
diff --git a/pyramid/static.py b/pyramid/static.py
index a8088129e..70fdf877b 100644
--- a/pyramid/static.py
+++ b/pyramid/static.py
@@ -17,14 +17,15 @@ from pkg_resources import (
resource_isdir,
)
-from repoze.lru import lru_cache
-
from pyramid.asset import (
abspath_from_asset_spec,
resolve_asset_spec,
)
-from pyramid.compat import text_
+from pyramid.compat import (
+ lru_cache,
+ text_,
+)
from pyramid.httpexceptions import (
HTTPNotFound,
diff --git a/pyramid/traversal.py b/pyramid/traversal.py
index 641445067..d8f4690fd 100644
--- a/pyramid/traversal.py
+++ b/pyramid/traversal.py
@@ -1,8 +1,6 @@
from zope.interface import implementer
from zope.interface.interfaces import IInterface
-from repoze.lru import lru_cache
-
from pyramid.interfaces import (
IResourceURL,
IRequestFactory,
@@ -20,6 +18,7 @@ from pyramid.compat import (
is_nonstr_iter,
decode_path_info,
unquote_bytes_to_wsgi,
+ lru_cache,
)
from pyramid.encode import url_quote
diff --git a/pyramid/url.py b/pyramid/url.py
index 2e964dc7e..917a3c675 100644
--- a/pyramid/url.py
+++ b/pyramid/url.py
@@ -2,8 +2,6 @@
import os
-from repoze.lru import lru_cache
-
from pyramid.interfaces import (
IResourceURL,
IRoutesMapper,
@@ -12,6 +10,7 @@ from pyramid.interfaces import (
from pyramid.compat import (
bytes_,
+ lru_cache,
string_types,
)
from pyramid.encode import (
diff --git a/setup.py b/setup.py
index 2af0535c3..14c0ab770 100644
--- a/setup.py
+++ b/setup.py
@@ -11,7 +11,6 @@
# FITNESS FOR A PARTICULAR PURPOSE
#
##############################################################################
-
from setuptools import setup, find_packages
def readfile(name):
@@ -24,7 +23,6 @@ CHANGES = readfile('CHANGES.txt')
install_requires = [
'setuptools',
'WebOb >= 1.7.0rc2', # Response.has_body
- 'repoze.lru >= 0.4', # py3 compat
'zope.interface >= 3.8.0', # has zope.interface.registry
'zope.deprecation >= 3.5.0', # py3 compat
'venusian >= 1.0a3', # ``ignore``
@@ -87,6 +85,7 @@ setup(name='pyramid',
python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*',
install_requires=install_requires,
extras_require={
+ ':python_version<"3.2"': ['repoze.lru >= 0.4'],
'testing': testing_extras,
'docs': docs_extras,
},