Skip to content
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

Drop repoze.lru on Python 3 #3140

Merged
merged 1 commit into from
Oct 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pyramid/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
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
Expand Down
7 changes: 4 additions & 3 deletions pyramid/static.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@
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,
Expand Down
3 changes: 1 addition & 2 deletions pyramid/traversal.py
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -20,6 +18,7 @@
is_nonstr_iter,
decode_path_info,
unquote_bytes_to_wsgi,
lru_cache,
)

from pyramid.encode import url_quote
Expand Down
3 changes: 1 addition & 2 deletions pyramid/url.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import os

from repoze.lru import lru_cache

from pyramid.interfaces import (
IResourceURL,
IRoutesMapper,
Expand All @@ -12,6 +10,7 @@

from pyramid.compat import (
bytes_,
lru_cache,
string_types,
)
from pyramid.encode import (
Expand Down
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#
##############################################################################

import sys

from setuptools import setup, find_packages

def readfile(name):
Expand All @@ -24,7 +26,6 @@ def readfile(name):
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``
Expand Down Expand Up @@ -87,6 +88,7 @@ def readfile(name):
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,
},
Expand Down