diff options
author | Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua> | 2016-02-22 20:33:29 +0200 |
---|---|---|
committer | Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua> | 2016-02-22 20:33:29 +0200 |
commit | 2ffd3b57370d9591cc6edb9a4df28f70eaf7d20d (patch) | |
tree | a56143240647155897107bbf304c6994085860f7 | |
parent | fd2606b0a4fc5d9d9cf80237671e19f3d6515daa (diff) | |
parent | efdf2984516688a3c9ada7981ca4f64d7791682c (diff) | |
download | routes-2ffd3b57370d9591cc6edb9a4df28f70eaf7d20d.tar.gz |
Merge pull request #2 from bbangert/master
Update from upstream #2
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | CHANGELOG.rst | 2 | ||||
-rw-r--r-- | docs/modules/middleware.rst | 1 | ||||
-rw-r--r-- | routes/middleware.py | 7 | ||||
-rw-r--r-- | setup.py | 5 | ||||
-rw-r--r-- | tox.ini | 18 |
6 files changed, 22 insertions, 13 deletions
@@ -13,3 +13,5 @@ html_coverage .idea *.iml .tox/ +.eggs/ +.coverage diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 5f2d915..2a8a322 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -3,6 +3,8 @@ Routes Changelog Release 2.3 (**dev**) ===================== +* Add support for the ``middleware`` extra requirement, making possible to + depend on ``webob`` optionally. PR #59. Patch by Sviatoslav Sydorenko. * Fix matching of an empty string route, which led to exception in earlier versions. PR #58. Patch by Sviatoslav Sydorenko. * Add support for the ``requirements`` option when using diff --git a/docs/modules/middleware.rst b/docs/modules/middleware.rst index eef80a8..9b12e79 100644 --- a/docs/modules/middleware.rst +++ b/docs/modules/middleware.rst @@ -2,7 +2,6 @@ ================================================== .. automodule:: routes.middleware -.. currentmodule:: routes.middleware Module Contents --------------- diff --git a/routes/middleware.py b/routes/middleware.py index 850e06e..885b9d9 100644 --- a/routes/middleware.py +++ b/routes/middleware.py @@ -12,7 +12,12 @@ log = logging.getLogger('routes.middleware') class RoutesMiddleware(object): """Routing middleware that handles resolving the PATH_INFO in - addition to optionally recognizing method overriding.""" + addition to optionally recognizing method overriding. + + .. Note:: + This module requires webob to be installed. To depend on it, you may + list routes[middleware] in your ``requirements.txt`` + """ def __init__(self, wsgi_app, mapper, use_method_override=True, path_info=True, singleton=True): """Create a Route middleware object @@ -57,5 +57,10 @@ setup(name="Routes", "six", "repoze.lru>=0.3" ], + extras_require={ + 'middleware': [ + 'webob', + ] + }, **extra_options ) @@ -1,17 +1,13 @@ [tox] -envlist = py26,py27,py33,py34,pypy,pypy3 +envlist = py26,py27,py33,py34,py35,pypy,pypy3 [testenv] deps= - coverage - nose - webob - webtest + nose # Adds nosetests command to setup.py commands= - python -bb -m nose tests {posargs} + python -bb setup.py nosetests {posargs:--with-coverage} -[testenv:py26] -# Ony Python 2.6, python -m test doesn't work. Anyway, python -bb is only -# interested on Python 3. -commands= - nosetests tests {posargs} + # We could to this in dependencies, but explicit is better than implicit + pip install .[middleware] + # webob optional dependency is fulfilled by [middleware] extra requirement + python -c "import webob" |