fix build and enable tests

This commit is contained in:
Adam Williamson 2016-12-25 23:13:26 -08:00
parent 1810dc9ce1
commit 9854b092fc

View File

@ -26,7 +26,15 @@ Summary: JSON Matching Expressions
%{?python_provide:%python_provide python2-%{pypi_name}} %{?python_provide:%python_provide python2-%{pypi_name}}
BuildRequires: python2-devel BuildRequires: python2-devel
BuildRequires: python2-mock
BuildRequires: python-nose
BuildRequires: python-setuptools BuildRequires: python-setuptools
%if 0%{?rhel} && 0%{?rhel} < 7
BuildRequires: python-ordereddict
# tests specifically import simplejson as json if python version is 2.6
BuildRequires: python-simplejson
BuildRequires: python-unittest2
%endif # rhel < 7
%description -n python2-%{pypi_name} %description -n python2-%{pypi_name}
JMESPath allows you to declaratively specify how to extract elements from JMESPath allows you to declaratively specify how to extract elements from
@ -38,6 +46,8 @@ Summary: JSON Matching Expressions
%{?python_provide:%python_provide python3-%{pypi_name}} %{?python_provide:%python_provide python3-%{pypi_name}}
BuildRequires: python3-devel BuildRequires: python3-devel
BuildRequires: python3-mock
BuildRequires: python3-nose
BuildRequires: python3-setuptools BuildRequires: python3-setuptools
%description -n python3-%{pypi_name} %description -n python3-%{pypi_name}
@ -51,7 +61,7 @@ rm -rf %{pypi_name}.egg-info
%build %build
%py2_build %py2_build
%if %{?with python3} %if %{with python3}
%py3_build %py3_build
%endif # with python3 %endif # with python3
@ -67,9 +77,13 @@ mv %{buildroot}/%{_bindir}/jp.py %{buildroot}/%{_bindir}/jp.py-%{python2_version
ln -sf %{_bindir}/jp.py-%{python2_version} %{buildroot}/%{_bindir}/jp.py-2 ln -sf %{_bindir}/jp.py-%{python2_version} %{buildroot}/%{_bindir}/jp.py-2
ln -sf %{_bindir}/jp.py-%{python2_version} %{buildroot}/%{_bindir}/jp.py ln -sf %{_bindir}/jp.py-%{python2_version} %{buildroot}/%{_bindir}/jp.py
%check
nosetests
%if %{with python3}
nosetests-%{python3_version}
%endif # with python3
%files -n python2-%{pypi_name} %files -n python2-%{pypi_name}
%{!?_licensedir:%global license %doc}
%doc README.rst %doc README.rst
%license LICENSE.txt %license LICENSE.txt
%{_bindir}/jp.py %{_bindir}/jp.py