forked from pool/python-jmespath
Accepting request 481558 from home:rjschwei:branches:devel:languages:python
- 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) * Add support for JEP 9 which introduces "and" expressions, "unary" expressions, "not" expressions, and "paren" expressions (issue 90, issue 88, issue 82) * Improve lexing performance (issue 84) * Fix parsing error for multiselect lists (issue 86) * Fix issue with escaping single quotes in literal strings (issue 85) ordered dictionaries (issue 94) * Add map() function (issue 95) OBS-URL: https://build.opensuse.org/request/show/481558 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-jmespath?expand=0&rev=21
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package python-jmespath
|
||||
#
|
||||
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@@ -16,37 +16,35 @@
|
||||
#
|
||||
|
||||
|
||||
%define baseName jmespath
|
||||
|
||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||||
Name: python-jmespath
|
||||
Version: 0.9.0
|
||||
Version: 0.9.2
|
||||
Release: 0
|
||||
Summary: Extract elements from JSON document
|
||||
License: MIT
|
||||
Group: Development/Languages/Python
|
||||
Url: https://github.com/boto/jmespath
|
||||
Source0: https://pypi.python.org/packages/source/j/%{baseName}/%{baseName}-%{version}.tar.gz
|
||||
Source: https://pypi.io/packages/source/j/jmespath/jmespath-%{version}.tar.gz
|
||||
BuildRequires: %{python_module devel}
|
||||
BuildRequires: %{python_module ply >= 3.4}
|
||||
BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: %{python_module simplejson}
|
||||
BuildRequires: python-rpm-macros
|
||||
# Testing
|
||||
BuildRequires: %{python_module nose}
|
||||
BuildRequires: %{python_module unittest2}
|
||||
Requires: python-base
|
||||
Requires: python-ply >= 3.4
|
||||
Requires(post): update-alternatives
|
||||
Requires: python-simplejson
|
||||
Requires(post): update-alternatives
|
||||
Requires(preun): update-alternatives
|
||||
BuildRequires: python-devel
|
||||
BuildRequires: python-ply >= 3.4
|
||||
BuildRequires: python-setuptools
|
||||
# For testing
|
||||
BuildRequires: python-nose
|
||||
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
|
||||
BuildRequires: python-ordereddict
|
||||
%endif
|
||||
BuildRequires: python-simplejson
|
||||
BuildRequires: python-unittest2
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
|
||||
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
|
||||
%else
|
||||
|
||||
%if 0%{?suse_version} > 1110
|
||||
BuildArch: noarch
|
||||
%endif
|
||||
|
||||
%python_subpackages
|
||||
|
||||
%description
|
||||
JMESPath (pronounced "jaymz path") allows you to declaratively specify how
|
||||
to extract elements from a JSON document.
|
||||
@@ -79,37 +77,35 @@ The * can also be used for hash types:
|
||||
The expression: foo.*.name will return ["one", "two"].
|
||||
|
||||
%prep
|
||||
%setup -q -n %{baseName}-%{version}
|
||||
%setup -q -n jmespath-%{version}
|
||||
|
||||
%build
|
||||
python setup.py build
|
||||
%python_build
|
||||
#pushd build/scripts-%{$python_bin_suffix}
|
||||
#mv jp.py jp-%{$python_bin_suffix}
|
||||
#popd
|
||||
#pushd build/scripts-%{py_ver}
|
||||
#mv jp.py jp-%{py_ver}
|
||||
#popd
|
||||
|
||||
%install
|
||||
python setup.py install --prefix=%{_prefix} --root=%{buildroot} --install-scripts=%{_bindir}
|
||||
|
||||
# Prepare for update-alternatives usage
|
||||
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
|
||||
mv %{buildroot}%{_bindir}/jp.py %{buildroot}%{_bindir}/jp-%{py_ver}
|
||||
ln -s -f %{_sysconfdir}/alternatives/jp %{buildroot}%{_bindir}/jp
|
||||
%python_install
|
||||
mv %{buildroot}%{_bindir}/jp.py %{buildroot}%{_bindir}/jp
|
||||
%python_clone -a %{buildroot}%{_bindir}/jp
|
||||
|
||||
%check
|
||||
nosetests tests
|
||||
%python_expand nosetests-%{$python_bin_suffix} tests
|
||||
|
||||
%post
|
||||
%_sbindir/update-alternatives --install %{_bindir}/jp jp %{_bindir}/jp-%{py_ver} 30
|
||||
%python_install_alternative jp
|
||||
|
||||
%preun
|
||||
if [ $1 -eq 0 ] ; then
|
||||
%_sbindir/update-alternatives --remove jp %{_bindir}/jp-%{py_ver}
|
||||
fi
|
||||
%postun
|
||||
%python_uninstall_alternative jp
|
||||
|
||||
%files
|
||||
%files %{python_files}
|
||||
%defattr(-,root,root,-)
|
||||
%doc LICENSE.txt README.rst
|
||||
%{_bindir}/jp
|
||||
%{_bindir}/jp-%{py_ver}
|
||||
%ghost %{_sysconfdir}/alternatives/jp
|
||||
%{python_sitelib}/jmespath/
|
||||
%{python_sitelib}/%{baseName}-%{version}-py%{py_ver}.egg-info/
|
||||
%{python_sitelib}/*
|
||||
%python_alternative %{_bindir}/jp
|
||||
|
||||
%changelog
|
||||
|
||||
Reference in New Issue
Block a user