From d54987cdca58cd6d3abd437f9432c9eddb2f5835a8bf10670b18adf8d63e5de8 Mon Sep 17 00:00:00 2001 From: Robert Schweikert Date: Wed, 5 Feb 2025 14:09:30 +0000 Subject: [PATCH] - Use libalternatives instead of update-alternatives, bsc#1235786 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-jmespath?expand=0&rev=58 --- .gitattributes | 23 +++++ .gitignore | 1 + jmespath-1.0.1.tar.gz | 3 + python-jmespath.changes | 219 ++++++++++++++++++++++++++++++++++++++++ python-jmespath.spec | 117 +++++++++++++++++++++ 5 files changed, 363 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 jmespath-1.0.1.tar.gz create mode 100644 python-jmespath.changes create mode 100644 python-jmespath.spec 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/jmespath-1.0.1.tar.gz b/jmespath-1.0.1.tar.gz new file mode 100644 index 0000000..d9012d5 --- /dev/null +++ b/jmespath-1.0.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6a02470b1716ec7a32abe89a873a4795c41c938468225f8a53d860980ec9e3c6 +size 80936 diff --git a/python-jmespath.changes b/python-jmespath.changes new file mode 100644 index 0000000..c34eaa7 --- /dev/null +++ b/python-jmespath.changes @@ -0,0 +1,219 @@ +------------------------------------------------------------------- +Fri Jan 24 14:57:30 UTC 2025 - Nico Krapp + +- Use libalternatives instead of update-alternatives, bsc#1235786 + +------------------------------------------------------------------- +Mon Feb 26 12:47:18 UTC 2024 - Robert Schweikert + +- Remove the forced switch to Python 3.11 in SLE 15 SP4 and + openSUSE Leap 15.4 and later. However the updated version will only + be available as a Python 3.11 build. (jsc#PED-4514) + +------------------------------------------------------------------- +Thu Feb 1 21:08:03 UTC 2024 - Robert Schweikert + +- Switch users of SLE 15 SP4 and openSUSE Leap 15.4 and later to the + Python 3.11 build (jsc#PCT-371). The Python 3.6 build will no longer be + maintained + +------------------------------------------------------------------- +Thu Feb 1 14:09:31 UTC 2024 - Dirk Müller + +- switch to PEP517 / wheel build + +------------------------------------------------------------------- +Sun Jun 11 14:05:39 UTC 2023 - ecsos + +- Add %{?sle15_python_module_pythons} + +------------------------------------------------------------------- +Fri Feb 10 09:10:10 UTC 2023 - Matej Cepl + +- We actually don't need simplejson at all, it is just for 2.6 + [sic!] compatibility. + +------------------------------------------------------------------- +Sat Sep 17 15:41:47 UTC 2022 - Dirk Müller + +- update to 1.0.1: + * Drop support for Python versions less than 3.7 (including Python 2). +- drop remove-nose.patch (upstream) + +------------------------------------------------------------------- +Mon Sep 27 03:03:07 UTC 2021 - Steve Kowalik + +- Add patch remove-nose.patch: + * Remove use of nose in the tests. + +------------------------------------------------------------------- +Mon May 31 08:00:06 UTC 2021 - pgajdos@suse.com + +- use github tarball to use upstream tests +- %check: use %pyunittest rpm macro to test the package +- deleted sources + - test_hypothesis.py (not needed) + +------------------------------------------------------------------- +Tue Jun 2 16:21:51 UTC 2020 - Dirk Mueller + +- update to 0.10.0: + * Python 2.6 and 3.3 have reached end-of-life and have been deprecated. (issue 175) + * Fix race condition when clearing cached parsed expressions. (issue 197) + +------------------------------------------------------------------- +Wed Mar 11 09:37:57 UTC 2020 - Dirk Mueller + +- update to 0.9.5: + * * Fix syntax warnings on python 3.8 + +------------------------------------------------------------------- +Tue Mar 26 14:43:27 UTC 2019 - Tomáš Chvátal + +- Update to 0.9.4: + * Fix min_by/max_by with empty lists (`issue 151) + * Fix reverse type for null type (issue 145) + +------------------------------------------------------------------- +Mon Mar 18 06:06:26 UTC 2019 - John Vandenberg + +- Add extra testing with hypothesis +- Remove unnecessary dependency on python-base +- Update to v0.9.4 + * Fix min_by/max_by with empty lists + * Fix reverse type for null type + +------------------------------------------------------------------- +Tue Dec 4 12:49:31 UTC 2018 - Matej Cepl + +- Remove superfluous devel dependency for noarch package + +------------------------------------------------------------------- +Thu Aug 16 10:24:41 UTC 2018 - jengelh@inai.de + +- Use noun phrase for summary. + +------------------------------------------------------------------- +Mon Aug 13 11:20:47 UTC 2018 - mcepl@suse.com + +- Remove dependency on unittest2 +- Clean up SPEC file + +------------------------------------------------------------------- +Thu Nov 9 23:08:53 UTC 2017 - rjschwei@suse.com + +- Update to 0.9.3: + + Fix issue where long types in py2 and Decimal types were not + being evaluated as numbers (issue 125) + + Handle numbers in scientific notation in to_number() function (issue 120) + + Fix issue where custom functions would override the function + table of the builtin function class (issue 133) + +------------------------------------------------------------------- +Wed Mar 29 14:15:59 UTC 2017 - jmatejek@suse.com + +- properly Requires(postun) for %postun section + +------------------------------------------------------------------- +Wed Mar 29 08:16:19 UTC 2017 - tbechtold@suse.com + +- Only BuildRequire unittest2 for python2 + +------------------------------------------------------------------- +Thu Mar 16 18:43:59 UTC 2017 - rjschwei@suse.com + +- Switch to single-spec build +- Update to version 0.9.2 + + Fix regression when using ordering comparators on strings (issue 124) +- From 0.9.1 + + Raise LexerError on invalid numbers (issue 98) + + Add support for custom functions (#100) (issue 100) + + Fix ZeroDivisionError for built-in function avg() on empty lists (#115) + (issue 115) + + Properly handle non numerical ordering operators (#117) (issue 117) + +------------------------------------------------------------------- +Mon Aug 15 14:51:56 UTC 2016 - toddrme2178@gmail.com + +- Fix update-alternatives implementation. + +------------------------------------------------------------------- +Mon Feb 1 11:24:14 UTC 2016 - toddrme2178@gmail.com + +- Update to version 0.9.0 + * Add support for new lines with tokens in an expression + * Add support for JEP 9 which introduces "and" expressions, "unary" + expressions, "not" expressions, and "paren" expressions + * Fix issue with hardcoded path in ``jp.py`` executable + (issue 90, issue 88, issue 82) +- Update to version 0.8.0 + * Improve lexing performance (issue 84) + * Fix parsing error for multiselect lists (issue 86) + * Fix issue with escaping single quotes in literal strings (issue 85) + * Add support for providing your own dict cls to support + ordered dictionaries (issue 94) + * Add map() function (issue 95) + +------------------------------------------------------------------- +Wed Jan 20 19:42:39 UTC 2016 - rjschwei@suse.com + +- Fix build issues for SLE 11 + + More test dependencies required + +------------------------------------------------------------------- +Wed Jan 20 19:08:32 UTC 2016 - rjschwei@suse.com + +- Manage the jp executable with update-alternatives now that + python3-jmespath exists +- spec file improvements + +------------------------------------------------------------------- +Wed May 27 17:04:07 UTC 2015 - rjschwei@suse.com + +- Update to version 0.7.1: + * Rename ``bin/jp`` to ``bin/jp.py`` + * Fix issue with precedence when parsing wildcard + projections + * Remove ordereddict and simplejson as py2.6 dependencies. + These were never actually used in the jmespath code base, + only in the unit tests. Unittests requirements are handled + via requirements26.txt. + +------------------------------------------------------------------- +Sun Apr 26 16:57:39 UTC 2015 - benoit.monin@gmx.fr + +- update to version 0.7.0: + * Add support for JEP-12, raw string literals + * Support .whl files +- additional changes from version 0.6.2: + * Implement JEP-10, slice projections + * Fix bug with filter projection parsing + * Add to_array function + * Add merge function + * Fix error messages for function argument type errors +- point source URL to pypi + +------------------------------------------------------------------- +Thu Mar 26 21:40:43 UTC 2015 - aboe76@gmail.com + +- Updated to version 0.6.1 + + No Upstream Changelog + +------------------------------------------------------------------- +Sun Jan 18 13:13:01 UTC 2015 - rschweikert@suse.com + +- Update to version 0.5.0 + + No upstream changelog + + Update in support for fix of bnc#905354 + +------------------------------------------------------------------- +Thu Oct 23 23:55:43 UTC 2014 - rschweikert@suse.com + +- Update to version 0.4.1 + + No upstream changelog + +------------------------------------------------------------------- +Sat Jan 18 11:35:01 UTC 2014 - rschweikert@suse.com + +- Initial build + diff --git a/python-jmespath.spec b/python-jmespath.spec new file mode 100644 index 0000000..41efe6a --- /dev/null +++ b/python-jmespath.spec @@ -0,0 +1,117 @@ +# +# spec file for package python-jmespath +# +# 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/ +# + + +%if 0%{?suse_version} > 1500 +%bcond_without libalternatives +%else +%bcond_with libalternatives +%endif + +%{?sle15_python_module_pythons} +Name: python-jmespath +Version: 1.0.1 +Release: 0 +Summary: Python module for declarative JSON document element extraction +License: MIT +URL: https://github.com/jmespath/jmespath.py +Source: https://github.com/jmespath/jmespath.py/archive/refs/tags/%{version}.tar.gz#/jmespath-%{version}.tar.gz +# Testing +BuildRequires: %{python_module hypothesis} +BuildRequires: %{python_module pip} +BuildRequires: %{python_module ply >= 3.4} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +Requires: python-ply >= 3.4 +%if %{with libalternatives} +Requires: alts +BuildRequires: alts +%else +Requires(post): update-alternatives +Requires(postun): update-alternatives +%endif +BuildArch: noarch +%python_subpackages + +%description +JMESPath (pronounced "jaymz path") allows you to declaratively specify how +to extract elements from a JSON document. + +For example, given this document: + +{"foo": {"bar": "baz"}} + +The jmespath expression foo.bar will return "baz". + +JMESPath also supports: + +Referencing elements in a list. Given the data: + +{"foo": {"bar": ["one", "two"]}} + +The expression: foo.bar[0] will return "one". You can also reference all +the items in a list using the * syntax: + +{"foo": {"bar": [{"name": "one"}, {"name": "two"}]}} + +The expression: foo.bar[*].name will return ["one", "two"]. Negative +indexing is also supported (-1 refers to the last element in the list). +Given the data above, the expression foo.bar[-1].name will return ["two"]. + +The * can also be used for hash types: + +{"foo": {"bar": {"name": "one"}, "baz": {"name": "two"}}} + +The expression: foo.*.name will return ["one", "two"]. + +%prep +%autosetup -p1 -n jmespath.py-%{version} + +%build +%pyproject_wheel + +%install +%pyproject_install +mv %{buildroot}%{_bindir}/jp.py %{buildroot}%{_bindir}/jp +%python_clone -a %{buildroot}%{_bindir}/jp +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +# hangs on python 3.8 with pytest +%pyunittest discover -v + +%pre +# If libalternatives is used: Removing old update-alternatives entries. +%python_libalternatives_reset_alternative jp + +%post +%python_install_alternative jp + +%postun +%python_uninstall_alternative jp + +%files %{python_files} +%license LICENSE.txt +%doc README.rst +%{python_sitelib}/jmespath +%{python_sitelib}/jmespath-%{version}.dist-info +%python_alternative %{_bindir}/jp + +%changelog