Build python3 package
- Run tests
This commit is contained in:
parent
3945452d25
commit
4fc915bbfa
@ -1,37 +1,37 @@
|
||||
%global pypi_name ruamel.yaml
|
||||
%global pname ruamel-yaml
|
||||
%global commit 171c3653fc01
|
||||
|
||||
%if 0%{?fedora}
|
||||
# Disabling python3 as python3-ruamel-ordereddict is not available
|
||||
%global with_python3 0
|
||||
%endif
|
||||
%global with_python3 1
|
||||
|
||||
Name: python-%{pname}
|
||||
Version: 0.12.14
|
||||
Release: 3%{?dist}
|
||||
Release: 4%{?dist}
|
||||
Summary: YAML 1.2 loader/dumper package for Python
|
||||
|
||||
License: MIT
|
||||
URL: https://bitbucket.org/ruamel/yaml
|
||||
Source0: https://files.pythonhosted.org/packages/source/r/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
|
||||
#Source0: https://files.pythonhosted.org/packages/source/r/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
|
||||
# Use bitbucket sources so we can run the tests
|
||||
Source0: https://bitbucket.org/ruamel/yaml/get/%{version}.tar.gz#/%{pname}-%{version}.tar.gz
|
||||
|
||||
BuildRequires: python2-devel
|
||||
BuildRequires: python-setuptools
|
||||
|
||||
BuildRequires: libyaml-devel
|
||||
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: python3-setuptools
|
||||
|
||||
%description
|
||||
ruamel.yaml is a YAML 1.2 loader/dumper package for Python.
|
||||
It is a derivative of Kirill Simonov’s PyYAML 3.11
|
||||
|
||||
%package -n python2-%{pname}
|
||||
Summary: YAML 1.2 loader/dumper package for Python
|
||||
BuildRequires: python2-devel
|
||||
BuildRequires: python-setuptools
|
||||
# For tests
|
||||
BuildRequires: pytest
|
||||
BuildRequires: python2-ruamel-ordereddict
|
||||
BuildRequires: python2-typing
|
||||
%{?python_provide:%python_provide python2-%{pypi_name}}
|
||||
|
||||
Requires: python-ruamel-ordereddict
|
||||
Requires: python2-ruamel-ordereddict
|
||||
Requires: python2-typing
|
||||
Requires: python-setuptools
|
||||
|
||||
@ -40,20 +40,23 @@ ruamel.yaml is a YAML 1.2 loader/dumper package for Python.
|
||||
It is a derivative of Kirill Simonov’s PyYAML 3.11
|
||||
|
||||
%if 0%{?with_python3}
|
||||
%package -n python3-%{pname}
|
||||
%package -n python%{python3_pkgversion}-%{pname}
|
||||
Summary: YAML 1.2 loader/dumper package for Python
|
||||
%{?python_provide:%python_provide python3-%{pypi_name}}
|
||||
BuildRequires: python%{python3_pkgversion}-devel
|
||||
BuildRequires: python%{python3_pkgversion}-setuptools
|
||||
# For tests
|
||||
BuildRequires: python%{python3_pkgversion}-pytest
|
||||
%{?python_provide:%python_provide python%{python3_pkgversion}-%{pypi_name}}
|
||||
|
||||
Requires: python3-ruamel-ordereddict
|
||||
Requires: python3-setuptools
|
||||
Requires: python%{python3_pkgversion}-setuptools
|
||||
|
||||
%description -n python3-%{pname}
|
||||
%description -n python%{python3_pkgversion}-%{pname}
|
||||
ruamel.yaml is a YAML 1.2 loader/dumper package for Python.
|
||||
It is a derivative of Kirill Simonov’s PyYAML 3.11
|
||||
%endif
|
||||
|
||||
%prep
|
||||
%autosetup -n %{pypi_name}-%{version}
|
||||
%autosetup -n %{pname}-%{commit}
|
||||
rm -rf %{pypi_name}.egg-info
|
||||
|
||||
%build
|
||||
@ -69,6 +72,12 @@ rm -rf %{pypi_name}.egg-info
|
||||
|
||||
%{__python2} setup.py install --single-version-externally-managed --skip-build --root $RPM_BUILD_ROOT
|
||||
|
||||
%check
|
||||
PYTHONPATH=$(echo build/lib.*%{python2_version}) py.test-%{python2_version} _test/test_*.py
|
||||
%if 0%{?with_python3}
|
||||
PYTHONPATH=$(echo build/lib.*%{python3_version}) py.test-%{python3_version} _test/test_*.py
|
||||
%endif
|
||||
|
||||
%files -n python2-%{pname}
|
||||
%license LICENSE
|
||||
%doc README.rst
|
||||
@ -78,7 +87,7 @@ rm -rf %{pypi_name}.egg-info
|
||||
%{python2_sitearch}/%{pypi_name}-%{version}-py?.?.egg-info
|
||||
|
||||
%if 0%{?with_python3}
|
||||
%files -n python3-%{pname}
|
||||
%files -n python%{python3_pkgversion}-%{pname}
|
||||
%license LICENSE
|
||||
%doc README.rst
|
||||
%{python3_sitearch}/ruamel
|
||||
@ -88,6 +97,10 @@ rm -rf %{pypi_name}.egg-info
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Wed Oct 26 2016 Orion Poplawski <orion@cora.nwra.com> - 0.12.14-4
|
||||
- Build python3 package
|
||||
- Run tests
|
||||
|
||||
* Tue Oct 25 2016 Chandan Kumar <chkumar@redhat.com> - 0.12.14-3
|
||||
- Disabling python3 as python3-ruamel-ordereddict not available
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user