commit 614d55efad9d65d85ddc81e02ef89e7a6d172a8656642b047df3725573d3ac43 Author: Steve Kowalik Date: Tue Jun 24 02:24:20 2025 +0000 - Switch to pyproject macros. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Routes?expand=0&rev=37 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/Routes-2.5.1.tar.gz b/Routes-2.5.1.tar.gz new file mode 100644 index 0000000..46c3f92 --- /dev/null +++ b/Routes-2.5.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b6346459a15f0cbab01a45a90c3d25caf980d4733d628b4cc1952b865125d053 +size 190905 diff --git a/python-Routes.changes b/python-Routes.changes new file mode 100644 index 0000000..404eac4 --- /dev/null +++ b/python-Routes.changes @@ -0,0 +1,148 @@ +------------------------------------------------------------------- +Tue Jun 24 02:21:54 UTC 2025 - Steve Kowalik + +- Switch to pyproject macros. + +------------------------------------------------------------------- +Fri Jun 7 12:54:57 UTC 2024 - Markéta Machová + +- Add remove-six.patch to get rid of six + +------------------------------------------------------------------- +Thu Aug 18 15:15:10 UTC 2022 - Ben Greiner + +- Clean specfile, remove coverage + +------------------------------------------------------------------- +Mon Nov 8 10:28:13 UTC 2021 - Dirk Müller + +- add six dependency declaration + +------------------------------------------------------------------- +Thu Nov 26 09:12:36 UTC 2020 - Dirk Mueller + +- update to 2.5.1: +* Add compatibility for Python 3.7+. + * Add graceful fallback for invalid character encoding from request object. + * Enhanced performance for matching routes that share the same static prefix. + * Fixed issue with child routes not passing route conditions to the Mapper.connect call. + * Fixed documentation to reflect default value for minimization. + * Allow backslash to escape special characters in route paths. + * Resolve invalid escape sequences. + * Remove support for Python 2.6, 3.3, and 3.4. + * Remove obsolete Python 2.3 compat code. + +------------------------------------------------------------------- +Wed Jun 17 15:08:24 UTC 2020 - pgajdos@suse.com + +- nose -> pytest + +------------------------------------------------------------------- +Thu Nov 7 15:44:02 UTC 2019 - Matej Cepl + +- Run through spec-cleaner + +------------------------------------------------------------------- +Tue Dec 4 12:53:55 UTC 2018 - Matej Cepl + +- Remove superfluous devel dependency for noarch package + +------------------------------------------------------------------- +Thu Jun 29 16:20:01 UTC 2017 - tbechtold@suse.com + +- update to 2.4.1: + * Release as a universal wheel. PR #75. + * Convert readthedocs links for their .org -> .io migration for hosted projects. +- convert to singlespec +- Fix Source url + +------------------------------------------------------------------- +Fri Jun 3 15:51:22 UTC 2016 - tbechtold@suse.com + +- update to 2.3.1: + * Backwards compatability fix - connect should work with mandatory + routename and optional path. Patch by Davanum Srinivas (PR #65). + * Fix sub_domain equivalence check. Patch by Nikita Uvarov + * Add support for protocol-relative URLs generation (i.e. starting with double + slash ``//``). PR #60. Patch by Sviatoslav Sydorenko. + * 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 + mapper.resource to create routes. PR #57. Patch by Sean Dague. + * Concatenation fix when using submappers with path prefixes. Multiple + submappers combined the path prefix inside the controller argument in + non-obvious ways. The controller argument will now be properly carried + through when using submappers. PR #28. + +------------------------------------------------------------------- +Fri Aug 7 08:03:53 UTC 2015 - hpj@urpla.net + +- update to 2.2: + * Fix Python 3 support. Patch by Victor Stinner. + +- spell python-WebTest and python-WebOb correctly + +------------------------------------------------------------------- +Mon Apr 20 12:57:47 UTC 2015 - tbechtold@suse.com + +- update to 2.1: + * Fix 3 other route matching groups in route.py to use anonymous groups for + optional sections to avoid exceeding regex limits. Fixes #15. + * Printing a mapper now includes the Controller/action parameters from the + route. Fixes #11. + * Fix regression that didn't allow passing in params 'host', 'protocol', or + 'anchor'. They can now be passed in with a trailing '_' as was possible + before commit d1d1742903fa5ca24ef848a6ae895303f2661b2a. Fixes #7. + * URL generation with/without SCRIPT_NAME was resulting in the URL cache + failing to return the appropriate cached URL generation. The URL cache + should always include the SCRIPT_NAME, even if its empty, in the cache + to avoid this, and now does. Fixes #6. + * Extract Route creation into separate method in Mapper. Subclasses of Route + can be created by Mappers now. + * Use the first X_FORWARDED_FOR value if there are multiple proxies in the + path. Fixes #5. + * Python 3.2/3.3 Support. Fixes Issue #2. Thanks to Alejandro Sánchez for + the pull request! +- Enable testrun during build and adjust BuildRequires for that. +- Adjust documentation links. + +------------------------------------------------------------------- +Thu Oct 24 11:13:33 UTC 2013 - speilicke@suse.com + +- Require python-setuptools instead of distribute (upstreams merged) + +------------------------------------------------------------------- +Mon Apr 16 13:45:10 UTC 2012 - saschpe@suse.de + +- Require python-repoze.lru + +------------------------------------------------------------------- +Wed Mar 14 13:47:48 UTC 2012 - saschpe@suse.de + +- Update to version 1.13: + * Fix bug with dots forcing extension by default. The portion with the dot + can now be recognized. Patch by Michael Basnight. +- Simplified macro usage + +------------------------------------------------------------------- +Tue Jan 24 14:14:03 UTC 2012 - bwiedemann@suse.com + +- Fix Obsoletes + +------------------------------------------------------------------- +Thu Sep 1 13:15:07 UTC 2011 - saschpe@suse.de + +- Fix license to BSD-3-Clause (SPDX style) + +------------------------------------------------------------------- +Thu Sep 1 12:58:33 UTC 2011 - saschpe@suse.de + +- Removed reStructuredText markup from description + +------------------------------------------------------------------- +Thu Sep 1 10:04:50 UTC 2011 - saschpe@suse.de + +- Initial version + diff --git a/python-Routes.spec b/python-Routes.spec new file mode 100644 index 0000000..fe83b01 --- /dev/null +++ b/python-Routes.spec @@ -0,0 +1,66 @@ +# +# spec file for package python-Routes +# +# Copyright (c) 2025 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +Name: python-Routes +Version: 2.5.1 +Release: 0 +Summary: Routing Recognition and Generation Tools +License: BSD-3-Clause +URL: https://routes.readthedocs.io/ +Source: https://files.pythonhosted.org/packages/source/R/Routes/Routes-%{version}.tar.gz +# PATCH-FIX-UPSTREAM https://github.com/bbangert/routes/pull/113 remove python2 support +Patch: remove-six.patch +# for testing +BuildRequires: %{python_module WebOb} +BuildRequires: %{python_module WebTest} +BuildRequires: %{python_module pip} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module repoze.lru} +BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +Requires: python-repoze.lru >= 0.3 +Provides: python-routes = %{version}-%{release} +Obsoletes: python-routes < %{version}-%{release} +BuildArch: noarch +%python_subpackages + +%description +A Routing package for Python that matches URL's to dicts and vice versa. + +%prep +%autosetup -p1 -n Routes-%{version} + +%build +%pyproject_wheel + +%install +%pyproject_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +%pytest --doctest-modules routes + +%files %{python_files} +%license LICENSE.txt +%doc CHANGELOG.rst README.rst +%{python_sitelib}/routes +%{python_sitelib}/[Rr]outes-%{version}.dist-info + +%changelog diff --git a/remove-six.patch b/remove-six.patch new file mode 100644 index 0000000..62a77d8 --- /dev/null +++ b/remove-six.patch @@ -0,0 +1,371 @@ +From 44d96530bb52642a52e2a14921ebda6af0f7afc5 Mon Sep 17 00:00:00 2001 +From: Alexandre Detiste +Date: Fri, 20 Oct 2023 15:39:04 +0200 +Subject: [PATCH] remove python2 support + +--- + routes/mapper.py | 27 +++++------- + routes/route.py | 12 +++-- + routes/util.py | 44 +++++++++---------- + setup.py | 13 ++---- + tests/test_functional/test_generation.py | 3 +- + tests/test_functional/test_nonminimization.py | 2 +- + tests/test_functional/test_recognition.py | 3 +- + 7 files changed, 45 insertions(+), 59 deletions(-) + +diff --git a/routes/mapper.py b/routes/mapper.py +index 72981cb..9de7e60 100644 +--- a/routes/mapper.py ++++ b/routes/mapper.py +@@ -5,7 +5,6 @@ + import threading + + from repoze.lru import LRUCache +-import six + + from routes import request_config + from routes.util import ( +@@ -168,7 +167,7 @@ def connect(self, routename, path=None, **kwargs): + newkargs = {} + _routename = routename + _path = path +- for key, value in six.iteritems(self.kwargs): ++ for key, value in self.kwargs.items(): + if key == 'path_prefix': + if path is not None: + # if there's a name_prefix, add it to the route name +@@ -595,7 +594,7 @@ def _create_gens(self): + if 'controller' in route.hardcoded: + clist = [route.defaults['controller']] + if 'action' in route.hardcoded: +- alist = [six.text_type(route.defaults['action'])] ++ alist = [str(route.defaults['action'])] + for controller in clist: + for action in alist: + actiondict = gendict.setdefault(controller, {}) +@@ -625,7 +624,7 @@ def _create_regs(self, clist=None): + else: + clist = self.controller_scan + +- for key, val in six.iteritems(self.maxkeys): ++ for key, val in self.maxkeys.items(): + for route in val: + route.makeregexp(clist) + +@@ -801,15 +800,11 @@ def generate(self, *args, **kargs): + # If the URL didn't depend on the SCRIPT_NAME, we'll cache it + # keyed by just by kargs; otherwise we need to cache it with + # both SCRIPT_NAME and kargs: +- cache_key = six.text_type(args).encode('utf8') + \ +- six.text_type(kargs).encode('utf8') ++ cache_key = str(args).encode('utf8') + str(kargs).encode('utf8') + + if self.urlcache is not None: +- if six.PY3: +- cache_key_script_name = b':'.join((script_name.encode('utf-8'), +- cache_key)) +- else: +- cache_key_script_name = '%s:%s' % (script_name, cache_key) ++ cache_key_script_name = b':'.join((script_name.encode('utf-8'), ++ cache_key)) + + # Check the url cache to see if it exists, use it if it does + val = self.urlcache.get(cache_key_script_name, self) +@@ -829,7 +824,7 @@ def generate(self, *args, **kargs): + + keys = frozenset(kargs.keys()) + cacheset = False +- cachekey = six.text_type(keys) ++ cachekey = str(keys) + cachelist = sortcache.get(cachekey) + if args: + keylist = args +@@ -1110,7 +1105,7 @@ def resource(self, member_name, collection_name, **kwargs): + def swap(dct, newdct): + """Swap the keys and values in the dict, and uppercase the values + from the dict during the swap.""" +- for key, val in six.iteritems(dct): ++ for key, val in dct.items(): + newdct.setdefault(val.upper(), []).append(key) + return newdct + collection_methods = swap(collection, {}) +@@ -1153,7 +1148,7 @@ def requirements_for(meth): + return opts + + # Add the routes for handling collection methods +- for method, lst in six.iteritems(collection_methods): ++ for method, lst in collection_methods.items(): + primary = (method != 'GET' and lst.pop(0)) or None + route_options = requirements_for(method) + for action in lst: +@@ -1177,7 +1172,7 @@ def requirements_for(meth): + action='index', conditions={'method': ['GET']}, **options) + + # Add the routes that deal with new resource methods +- for method, lst in six.iteritems(new_methods): ++ for method, lst in new_methods.items(): + route_options = requirements_for(method) + for action in lst: + name = "new_" + member_name +@@ -1196,7 +1191,7 @@ def requirements_for(meth): + requirements_regexp = '[^\\/]+(?=0.3" + ], + extras_require=extras_require, +diff --git a/tests/test_functional/test_generation.py b/tests/test_functional/test_generation.py +index b461b5f..cb6732d 100644 +--- a/tests/test_functional/test_generation.py ++++ b/tests/test_functional/test_generation.py +@@ -1,6 +1,5 @@ + """test_generation""" +-import sys, time, unittest +-from six.moves import urllib ++import sys, time, unittest, urllib + + from nose.tools import eq_, assert_raises + from routes import * +diff --git a/tests/test_functional/test_nonminimization.py b/tests/test_functional/test_nonminimization.py +index 1b152c4..7f2d0e1 100644 +--- a/tests/test_functional/test_nonminimization.py ++++ b/tests/test_functional/test_nonminimization.py +@@ -1,5 +1,5 @@ + """Test non-minimization recognition""" +-from six.moves import urllib ++import urllib + + from nose.tools import eq_ + +diff --git a/tests/test_functional/test_recognition.py b/tests/test_functional/test_recognition.py +index 03fe6a7..6295979 100644 +--- a/tests/test_functional/test_recognition.py ++++ b/tests/test_functional/test_recognition.py +@@ -3,7 +3,8 @@ + import sys + import time + import unittest +-from six.moves import urllib ++import urllib ++ + from nose.tools import eq_, assert_raises + from routes import * + from routes.util import RoutesException