%if 0%{?fedora}
%global with_python3 1
%else
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%endif
Name: python-q
Version: 2.5
Release: 2%{?dist}
Summary: Quick and dirty python debugging output
License: ASL 2.0
URL: https://pypi.python.org/pypi/q
Source0: https://pypi.python.org/packages/source/q/q/q-%{version}.tar.gz
# Fix for using @q decorator
# Submitted upstream: https://github.com/mithro/q/pull/1
Patch0: https://github.com/mithro/q/pull/1.diff
# Prettyprint dicts and other builtins
# Submitted upstream: https://github.com/mithro/q/pull/2
Patch1: https://github.com/mithro/q/pull/2.diff
# mentioned here: https://github.com/zestyping/q/pull/15 to judge interest
Patch2: fix-introspection.patch
BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python-setuptools
%if 0%{?with_python3}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
%endif # with_python3
%description
If you've ever been frustrated trying to debug with print because a web
application or a unittesting framework is swallowing your debugging output,
q will make you jump for joy.
import q
variable = 'Hmmm... something happened here'
q(variable)
cat /tmp/q
%if 0%{?with_python3}
%package -n python3-q
Summary: Quick and dirty python3 debugging output
%description -n python3-q
If you've ever been frustrated trying to debug with print because a web
application or a unittesting framework is swallowing your debugging output,
q will make you jump for joy.
import q
variable = 'Hmmm... something happened here'
q(variable)
cat /tmp/q
This package contains the q module for python3
%endif # with_python3
%prep
%setup -q -n q-%{version}
%patch0 -p1
%patch1 -p1
%patch2 -p1
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif # with_python3
%build
%{__python} setup.py build
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py build
popd
%endif # with_python3
%install
rm -rf %{buildroot}
%{__python} setup.py install --skip-build --root %{buildroot}
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install --skip-build --root %{buildroot}
popd
%endif # with_python3
%files
%doc README.md
%{python_sitelib}/*
%if 0%{?with_python3}
%files -n python3-q
%doc README.md
%{python3_sitelib}/*
%endif # with_python3
%changelog
* Fri Dec 12 2014 Toshio Kuratomi <toshio@fedoraproject.org> - 2.5-2
- Add prettyprint of values
- Make the tracing decorator more transparent
* Fri Dec 5 2014 Toshio Kuratomi <toshio@fedoraproject.org> - 2.5-1
- New upstream version
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.4-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Wed May 28 2014 Kalev Lember <kalevlember@gmail.com> - 2.4-3
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Wed May 22 2013 Toshio Kuratomi <toshio@fedoraproject.org> - 2.4-1
- New upstream with some enhancements from severl people.
- Build with python3 support.
* Thu Apr 11 2013 Toshio Kuratomi <toshio@fedoraproject.org> - 2.3-2
- New upstream release.
- README file from upstream's SCM
- Note patches we have for upstream
* Tue Mar 19 2013 Toshio Kuratomi <toshio@fedoraproject.org> - 1.1-1
- Initial Fedora build