#3 Clean spec, remove python2 subpackage, run tests
Merged 5 years ago by churchyard. Opened 5 years ago by churchyard.
rpms/ churchyard/python-humanize cleanup  into  master

file modified
+1
@@ -1,2 +1,3 @@ 

  /humanize-0.5.tar.gz

  /humanize-0.5.1.tar.gz

+ /0.5.1.tar.gz

file modified
+17 -78
@@ -1,33 +1,19 @@ 

- %if 0%{?fedora} > 12 || 0%{?rhel} > 7

- %global with_python3 1

- %endif

- 

- %if 0%{?el6} 

- %{!?__python2: %global __python2 /usr/bin/python2}

- %{!?python2_version: %global python2_version 2.6}

- %{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}

- %endif

- 

- # Tests are available in head version but not in release 0.5

- # enable them at next release.

- %global with_checks 0

+ %bcond_without check

  

  Name:           python-humanize

  Version:        0.5.1

- Release:        14%{?dist}

+ Release:        15%{?dist}

  Summary:        Turns dates in to human readable format, e.g '3 minutes ago'

  

  License:        MIT

  URL:            https://github.com/jmoiron/humanize

- Source0:        https://pypi.python.org/packages/source/h/humanize/humanize-%{version}.tar.gz

+ Source0:        %{url}/archive/%{version}.tar.gz

  

  BuildArch:      noarch

- BuildRequires:  python2-setuptools

- BuildRequires:  python2-devel

- %if 0%{?with_python3}

  BuildRequires:  python3-devel

  BuildRequires:  python3-setuptools

- BuildRequires:  python3-tools

+ %if %{with check}

+ BuildRequires:  python3-mock

  %endif

  

  
@@ -39,21 +25,14 @@ 

  

  %description %_description

  

- %package -n python2-humanize

- Summary: %summary

- %{?python_provide:%python_provide python2-humanize}

- 

- %description -n python2-humanize %_description

- 

- %if 0%{?with_python3}

  %package -n python3-humanize

- Summary:        Turns dates in to human readable format, e.g '3 minutes ago'

+ Summary: %summary

+ %{?python_provide:%python_provide python3-humanize}

  

  %description -n python3-humanize

  This modest package contains various common humanization utilities, like turning

  a number into a fuzzy human readable duration ('3 minutes ago') or into a human

  readable size or throughput.

- %endif

  

  %prep

  %setup -q -n humanize-%{version}
@@ -64,73 +43,33 @@ 

   touch -r $lib $lib.new && mv $lib.new $lib

  done

  

- %if 0%{?with_python3}

- rm -rf %{py3dir}

- cp -a . %{py3dir}

- %endif

- 

  %build

- %if 0%{?with_python3}

- pushd %{py3dir}

- # LANG required so README.rst can be parsed.

- LANG=en_US.UTF-8 %{__python3} setup.py build

- popd

- %endif

- 

- %{__python2} setup.py build

+ %py3_build

  

  %install

- %if 0%{?with_python3}

- pushd %{py3dir}

- LANG=en_US.UTF-8 %{__python3} setup.py install --skip-build --root %{buildroot}

- %find_lang humanize

- popd

- %endif

+ %py3_install

  

- %{__python2} setup.py install --skip-build --root %{buildroot}

- %if ! 0%{?el6}

  %find_lang humanize

- %else

- touch humanize.lang

- %endif

  

- # Remove python3 lang files

- %if 0%{?with_python3}

- sed -i 's|^.*%{python3_sitelib}.*||' humanize.lang

- %endif

  

+ %if %{with check}

  %check

- %if 0%{?with_checks}

- %{__python2} setup.py test

- %if 0%{?with_python3}

- pushd %{py3dir}

- LANG=en_US.UTF-8 %{__python3} setup.py test

- popd

- %endif

- %endif

- 

- %files -n python2-humanize -f humanize.lang

- %doc README.rst LICENCE

- %dir %{python2_sitelib}/humanize

- %{python2_sitelib}/humanize/*.py*

- %{python2_sitelib}/humanize-%{version}-py%{python2_version}.egg-info

- %if ! 0%{?el6}

- %exclude %{_usr}/lib/python*/site-packages/humanize/locale/*/LC_MESSAGES/*.po

- %else

- %{python2_sitelib}/humanize/locale

+ %{__python3} setup.py test

  %endif

  

- %if 0%{?with_python3}

- %files -n python3-humanize -f %{py3dir}/humanize.lang

+ %files -n python3-humanize -f humanize.lang

  %doc README.rst LICENCE

  %dir %{python3_sitelib}/humanize

  %{python3_sitelib}/humanize/*.py

  %{python3_sitelib}/humanize/__pycache__

  %{python3_sitelib}/humanize-%{version}-py%{python3_version}.egg-info

- %exclude %{_usr}/lib/python*/site-packages/humanize/locale/*/LC_MESSAGES/*.po

- %endif

+ %exclude %{python3_sitelib}/humanize/locale/*/LC_MESSAGES/*.po

  

  %changelog

+ * Thu Jul 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.5.1-15

+ - Clean spec, remove python2 subpackage

+ - Run tests

+ 

  * Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.1-14

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

  

file modified
+1 -1
@@ -1,1 +1,1 @@ 

- e8473d9dc1b220911cac2edd53b1d973  humanize-0.5.1.tar.gz

+ SHA512 (0.5.1.tar.gz) = dd7ad7f3c564cc6abcb6b128e50dbea7f19f7f418bfd936aae2472961c53ec71202133c5c2b5b930ef41ef807b51d6ba1210565627ed32c0b41acc0abd32a2d5

If desired, please announce on devel and keep this open for a week.
If python2 removal is not desired for some reason, close this or cherry-pick the parts you want.

Hi again. Is this desired or not?

I'll assume I can merge this if there is no more response in a week.

Pull-Request has been merged by churchyard

5 years ago