Blob Blame History Raw
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}

%global srcname unicode-nazi
%global modname unicodenazi

Name:           python-%{modname}
Version:        1.1
Release:        5%{?dist}
Summary:        Module that finds unicode/bytestring comparisons and other problems

Group:          Development/Languages
License:        BSD
URL:            http://pypi.python.org/pypi/%{srcname}
Source0:        http://pypi.python.org/packages/source/u/%{srcname}/%{srcname}-%{version}.tar.gz
# License file from the upstream repo.  Submitted a MANIFEST.in upstream to
# automatically include this in the future
Source1:        http://github.com/mitsuhiko/unicode-nazi/raw/master/LICENSE
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildArch:      noarch
BuildRequires:  python2-devel

%description
A common source of unicode issues in python2 is that code mixes str and unicode
and is valid for the cases the author tests for (because they only test with
ASCII) but then throws an error when the code is used with non-ASCII strings.

If enabled unicodenazi will complain when this mixing of unicode and byte str
occurs.  It's annoying as hell, has a huge runtime impact on performance, and
will also complain about most of the stuff in the Python standard library.  But
it will point out some areas of your code that may traceback in python2 when
given different data and make it easier to migrate to python3 where unicode and
bytes no longer interoperate.

%prep
%setup -q -n %{srcname}-%{version}
cp %{SOURCE1} .

%build
%{__python} setup.py build


%install
rm -rf %{buildroot}
%{__python} setup.py install --skip-build --root %{buildroot}

 
%clean
rm -rf %{buildroot}


%files
%defattr(-,root,root,-)
%doc README LICENSE
%{python_sitelib}/*


%changelog
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Thu Mar 10 2011 Toshio Kuratomi <toshio@fedoraproject.org> 1.1-2
- Add license file from upstream repo
- Fix a spelling mistake

* Thu Mar 10 2011 Toshio Kuratomi <toshio@fedoraproject.org> 1.1-1
- Initial Fedora packaging