From e5cfb9b67c259e04d8190eb01c9042303b3b026f02dbe57d33b1b13a8f7d8f04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Thu, 28 Mar 2019 08:22:42 +0000 Subject: [PATCH] - Sync with python-pytrie to obsolete it, wrong camelcase name there OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-PyTrie?expand=0&rev=2 --- LICENSE | 21 +++++++++++++++++++++ fix-sorting-py2.patch | 33 +++++++++++++++++++++++++++++++++ python-PyTrie.changes | 6 ++++++ python-PyTrie.spec | 18 +++++++++++------- 4 files changed, 71 insertions(+), 7 deletions(-) create mode 100644 LICENSE create mode 100644 fix-sorting-py2.patch diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..3395645 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +Copyright (c) 2009, George Sakkis + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + * The names of its contributors may not be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/fix-sorting-py2.patch b/fix-sorting-py2.patch new file mode 100644 index 0000000..50322d7 --- /dev/null +++ b/fix-sorting-py2.patch @@ -0,0 +1,33 @@ +Index: PyTrie-0.3.1/pytrie.py +=================================================================== +--- PyTrie-0.3.1.orig/pytrie.py ++++ PyTrie-0.3.1/pytrie.py +@@ -51,24 +51,11 @@ import sortedcontainers + + # Python 3 interoperability + PY3 = sys.version_info[0] == 3 +-if PY3: +- def itervalues(d): # pylint: disable=invalid-name +- return d.values() ++def itervalues(d): # pylint: disable=invalid-name ++ return d.values() + +- def iteritems(d): # pylint: disable=invalid-name +- return d.items() +-else: +- def itervalues(d): # pylint: disable=invalid-name +- if hasattr(d, 'itervalues'): +- return d.itervalues() +- +- return d.values() +- +- def iteritems(d): # pylint: disable=invalid-name +- if hasattr(d, 'iteritems'): +- return d.iteritems() +- +- return d.items() ++def iteritems(d): # pylint: disable=invalid-name ++ return d.items() + + + # Singleton sentinel - works with pickling diff --git a/python-PyTrie.changes b/python-PyTrie.changes index ba8cdc4..f748e78 100644 --- a/python-PyTrie.changes +++ b/python-PyTrie.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Mar 28 08:20:50 UTC 2019 - Tomáš Chvátal + +- Sync with python-pytrie to obsolete it, wrong camelcase name there +- Add patch fix-sorting-py2.patch + ------------------------------------------------------------------- Mon Mar 25 18:08:11 CET 2019 - Matej Cepl diff --git a/python-PyTrie.spec b/python-PyTrie.spec index 2ce6a4c..d80a5b0 100644 --- a/python-PyTrie.spec +++ b/python-PyTrie.spec @@ -17,7 +17,6 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} -%bcond_without test Name: python-PyTrie Version: 0.3.1 Release: 0 @@ -26,27 +25,32 @@ License: BSD-3-Clause Group: Development/Languages/Python URL: https://github.com/gsakkis/pytrie/ Source: https://files.pythonhosted.org/packages/source/P/PyTrie/PyTrie-%{version}.tar.gz -BuildRequires: %{python_module devel} -BuildRequires: %{python_module pytest} +Source1: https://raw.githubusercontent.com/gsakkis/pytrie/master/LICENSE +Patch0: fix-sorting-py2.patch BuildRequires: %{python_module setuptools} BuildRequires: %{python_module sortedcontainers} BuildRequires: fdupes +# needs tests, on py2 they are in devel +BuildRequires: python-devel BuildRequires: python-rpm-macros BuildRequires: python3-testsuite Requires: python-sortedcontainers +Provides: python-pytrie BuildArch: noarch %python_subpackages %description -Pytrie is a a pure Python (2 and 3) implementation of the trie data structure. +pytrie is a a pure Python (2 and 3) implementation of the trie data structure. -A trie is an ordered tree data structure that is used to store a mapping +A _trie_ is an ordered tree data structure that is used to store a mapping where the keys are sequences, usually strings over an alphabet. In addition to implementing the mapping interface, tries allow finding the items for a given prefix, and vice versa, finding the items whose keys are prefixes of a given key. %prep %setup -q -n PyTrie-%{version} +cp %{SOURCE1} . +%patch0 -p1 %build %python_build @@ -56,10 +60,10 @@ prefix, and vice versa, finding the items whose keys are prefixes of a given key %python_expand %fdupes %{buildroot}%{$python_sitelib} %check -%python_expand py.test-%{$python_bin_suffix} -v -k 'not (test_empty_string or test_items_wprefix or test_keys_wprefix or test_values_wprefix)' - +%python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} $python -m unittest discover %files %{python_files} +%license LICENSE %doc README.md %{python_sitelib}/*