6d49fdf
%global pypi_name testpath
6d49fdf
6d49fdf
Name:           python-%{pypi_name}
63f384c
Version:        0.3.1
66b79db
Release:        5%{?dist}
6d49fdf
Summary:        Test utilities for code working with files and commands
6d49fdf
6d49fdf
License:        MIT
6d49fdf
URL:            https://github.com/jupyter/testpath
6d49fdf
6d49fdf
# There is no sdist on PyPI, download from GitHub
6d49fdf
Source0:        %url/archive/%{version}.tar.gz#/%{pypi_name}-%{version}.tar.gz
6d49fdf
6d49fdf
BuildArch:      noarch
6d49fdf
6d49fdf
BuildRequires:  python2-pip
6d49fdf
BuildRequires:  python2-devel
6d49fdf
6d49fdf
BuildRequires:  python3-pip
6d49fdf
BuildRequires:  python3-devel
6d49fdf
6d49fdf
BuildRequires:  python3-flit
6d49fdf
6d49fdf
BuildRequires:  python3-sphinx
6d49fdf
BuildRequires:  python3-sphinx_rtd_theme
6d49fdf
6d49fdf
# Tests:
6d49fdf
BuildRequires:  python2-pytest
63f384c
BuildRequires:  python2-pathlib2
63f384c
BuildRequires:  python3-pathlib2
6d49fdf
BuildRequires:  python3-pytest
6d49fdf
6d49fdf
%global _description \
6d49fdf
Testpath is a collection of utilities for Python code working with files and \
6d49fdf
commands. \
6d49fdf
\
6d49fdf
It contains functions to check things on the filesystem, and tools for \
6d49fdf
mocking system commands and recording calls to those.
6d49fdf
6d49fdf
%description %_description
6d49fdf
6d49fdf
%package -n     python2-%{pypi_name}
6d49fdf
Summary:        %summary
6d49fdf
%{?python_provide:%python_provide python2-%{pypi_name}}
6d49fdf
6d49fdf
%description -n python2-%{pypi_name}
6d49fdf
6d49fdf
%_description
6d49fdf
6d49fdf
6d49fdf
%package -n     python3-%{pypi_name}
6d49fdf
Summary:        %summary
6d49fdf
%{?python_provide:%python_provide python3-%{pypi_name}}
6d49fdf
6d49fdf
%description -n python3-%{pypi_name}
6d49fdf
6d49fdf
%_description
6d49fdf
6d49fdf
%package        doc
6d49fdf
Summary:        %{name} documentation
6d49fdf
%description doc
6d49fdf
Documentation for %{name}.
6d49fdf
6d49fdf
6d49fdf
%prep
6d49fdf
%autosetup -n %{pypi_name}-%{version}
6d49fdf
6d49fdf
# The exe files are only needed on Microsoft Windows
6d49fdf
rm -f %{pypi_name}/*.exe
6d49fdf
6d49fdf
%build
6d49fdf
# this package has no setup.py
6d49fdf
# and upstream does not want one
6d49fdf
# https://github.com/takluyver/flit/issues/74
6d49fdf
# we use flit to create a wheel from sources
8fbfeb8
flit build --format wheel
6d49fdf
6d49fdf
# generate html docs
6d49fdf
sphinx-build-3 doc html
6d49fdf
# remove the sphinx-build leftovers
6d49fdf
rm -rf html/.{doctrees,buildinfo}
6d49fdf
6d49fdf
6d49fdf
%install
6d49fdf
# We install the wheel created at %%build
6d49fdf
%py2_install_wheel %{pypi_name}-%{version}-py2.py3-none-any.whl 
6d49fdf
%py3_install_wheel %{pypi_name}-%{version}-py2.py3-none-any.whl 
6d49fdf
6d49fdf
6d49fdf
6d49fdf
%check
6d49fdf
%{__python2} -m pytest -v
6d49fdf
%{__python3} -m pytest -v
6d49fdf
6d49fdf
6d49fdf
%files -n python2-%{pypi_name}
6d49fdf
%doc README.rst
6d49fdf
%license LICENSE
6d49fdf
%{python2_sitelib}/%{pypi_name}-%{version}.dist-info/
6d49fdf
%{python2_sitelib}/%{pypi_name}/
6d49fdf
6d49fdf
%files -n python3-%{pypi_name}
6d49fdf
%doc README.rst
6d49fdf
%license LICENSE
6d49fdf
%{python3_sitelib}/%{pypi_name}-%{version}.dist-info/
6d49fdf
%{python3_sitelib}/%{pypi_name}/
6d49fdf
6d49fdf
%files doc
6d49fdf
%doc html
6d49fdf
6d49fdf
%changelog
66b79db
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.1-5
66b79db
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
66b79db
6c2db59
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.3.1-4
6c2db59
- Rebuilt for Python 3.7
6c2db59
479bd90
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.1-3
479bd90
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
479bd90
d64b9cd
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.1-2
d64b9cd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
d64b9cd
63f384c
* Wed May 31 2017 Miro Hrončok <mhroncok@redhat.com> - 0.3.1-1
63f384c
- New version 0.3.1 (#1455375)
63f384c
- Uses pathlib2 instead of pathlib
63f384c
6d49fdf
* Wed Mar 08 2017 Miro Hrončok <mhroncok@redhat.com> - 0.3-1
6d49fdf
- initial package
6d49fdf