Blob Blame History Raw
%global srcname pdir2
# Run the test on Fedora.  In EPEL, we're missing python34-pandas.
%{?fedora:%bcond_without tests}

Name: python-%{srcname}
Version: 0.2.2
Release: 2%{?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
BuildArch: noarch


%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.


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


%description -n python2-%{srcname}
An improved version of dir() with better output.  Attributes are grouped by
types/functionalities, with beautiful colors.  Supports ipython, ptpython,
bpython, and Jupyter Notebook.


%package -n python%{python3_pkgversion}-%{srcname}
Summary: Pretty dir() printing with joy
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}
An improved version of dir() with better output.  Attributes are grouped by
types/functionalities, with beautiful colors.  Supports ipython, ptpython,
bpython, and Jupyter Notebook.


%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}/*


%files -n python%{python3_pkgversion}-%{srcname}
%license LICENSE
%doc docs/README.rst
%{python3_sitelib}/*


%changelog
* 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