Blob Blame History Raw
%global _docdir_fmt %{name}

%global srcname pdir2
%global _description \
An improved version of dir() with better output.  Attributes are grouped by\
types/functionalities, with beautiful colors.  Supports ipython, ptpython,\
bpython, and Jupyter Notebook.

# Run the test on Fedora.  In EPEL, we're missing python34-pandas.
%{?fedora:%bcond_without tests}

Name: python-%{srcname}
Version: 0.3.0
Release: 3%{?dist}
Summary: Pretty dir() printing with joy
License: MIT
URL: https://pypi.python.org/pypi/%{srcname}
# PyPI tarball doesn't have tests
Source0: https://github.com/laike9m/pdir2/archive/v%{version}/pdir2-%{version}.tar.gz
# https://github.com/laike9m/pdir2/issues/31
Patch0: remove-environment-markers.patch
# https://github.com/laike9m/pdir2/issues/39
# Upstream only expects this test to pass on Python 2.7 and 3.6.
Patch1: xfail-test-pdir-class.patch
BuildArch: noarch


%description %{_description}


%package -n python2-%{srcname}
Summary: %{summary}
BuildRequires: python2-devel
BuildRequires: python%{?fedora:2}-setuptools
%if %{with tests}
BuildRequires: %{?fedora:python2-}pytest >= 2.4
BuildRequires: python%{?fedora:2}-pandas
BuildRequires: python%{?fedora:2}-enum34
%endif
Requires: python%{?fedora:2}-enum34
%{?python_provide:%python_provide python2-%{srcname}}


%description -n python2-%{srcname} %{_description}


%package -n python%{python3_pkgversion}-%{srcname}
Summary: %{summary}
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-setuptools
%if %{with tests}
BuildRequires: python%{python3_pkgversion}-pytest >= 2.4
BuildRequires: python%{python3_pkgversion}-pandas
%endif
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}


%description -n python%{python3_pkgversion}-%{srcname} %{_description}


%prep
%autosetup -n %{srcname}-%{version} -p 1


%build
%py2_build
%py3_build


%install
%py2_install
%py3_install


%if %{with tests}
%check
%{__python2} -m pytest --verbose
%{__python3} -m pytest --verbose
%endif


%files -n python2-%{srcname}
%license LICENSE
%doc docs/README.rst
%{python2_sitelib}/pdir
%{python2_sitelib}/%{srcname}-%{version}-py%{python2_version}.egg-info


%files -n python%{python3_pkgversion}-%{srcname}
%license LICENSE
%doc docs/README.rst
%{python3_sitelib}/pdir
%{python3_sitelib}/%{srcname}-%{version}-py%{python3_version}.egg-info


%changelog
* Mon Jun 25 2018 Carl George <carl@george.computer> - 0.3.0-3
- Add patch1 to mark test_pdir_class as an expected fail
- Share doc and license dir between subpackages

* Tue Jun 19 2018 Miro HronĨok <mhroncok@redhat.com> - 0.3.0-2
- Rebuilt for Python 3.7

* Wed Feb 28 2018 Carl George <carl@george.computer> - 0.3.0-1
- Latest upstream

* Tue Feb 27 2018 Iryna Shcherbina <ishcherb@redhat.com> - 0.2.2-3
- Update Python 2 dependency declarations to new packaging standards
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)

* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Fri Oct 20 2017 Carl George <carl@george.computer> - 0.2.2-1
- Latest upstream
- Remove environment markers from setup.py to allow using older setuptools
- EPEL compatibility

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Wed Jul 05 2017 Carl George <carl@george.computer> - 0.2.1-1
- Latest upstream
- Remove patch100 and patch101

* Thu Jun 29 2017 Carl George <carl@george.computer> - 0.2.0-1
- Initial package