#1 add python3_other subpackage
Merged 5 years ago by orion. Opened 5 years ago by raphgro.
rpms/ raphgro/python3-urllib3 epel7  into  epel7

file modified
+66 -21
@@ -1,17 +1,21 @@ 

- %global srcname urllib3

+ # FIXME some missing dependencies for tests of python3_other 

+ %bcond_with python3_other_tests

  

- Name:           python3-%{srcname}

+ %global pypi_name urllib3

+ 

+ Name:           python3-%{pypi_name}

  Version:        1.19.1

- Release:        3%{?dist}

+ Release:        4%{?dist}

  Summary:        Python 3 HTTP library with thread-safe connection pooling and file post

  

  License:        MIT

- URL:            http://urllib3.readthedocs.org/

- Source0:        https://files.pythonhosted.org/packages/source/u/%{srcname}/%{srcname}-%{version}.tar.gz

+ URL:            http://%{pypi_name}.readthedocs.org/

+ Source0:        %pypi_source

  

  BuildArch:      noarch

  

  BuildRequires:  python%{python3_pkgversion}-devel

+ BuildRequires:  python%{python3_pkgversion}-setuptools

  # For unittests

  BuildRequires:  python%{python3_pkgversion}-coverage

  BuildRequires:  python%{python3_pkgversion}-mock
@@ -19,54 +23,95 @@ 

  BuildRequires:  python%{python3_pkgversion}-pysocks

  BuildRequires:  python%{python3_pkgversion}-six

  BuildRequires:  python%{python3_pkgversion}-tornado

- 

- 

+ %if 0%{?python3_other_pkgversion}

+ BuildRequires:  python%{python3_other_pkgversion}-devel

+ BuildRequires:  python%{python3_other_pkgversion}-setuptools

+ # For unittests

+ %if 0%{?with python3_other_tests}

+ BuildRequires:  python%{python3_other_pkgversion}-coverage

+ BuildRequires:  python%{python3_other_pkgversion}-mock

+ BuildRequires:  python%{python3_other_pkgversion}-nose

+ BuildRequires:  python%{python3_other_pkgversion}-pysocks

+ BuildRequires:  python%{python3_other_pkgversion}-six

+ BuildRequires:  python%{python3_other_pkgversion}-tornado

+ %endif

+ %endif

+ 

+ %global _description Python 3 HTTP module with connection pooling and file POST abilities.

  %description

- Python 3 HTTP module with connection pooling and file POST abilities.

+ %_description

  

- %package -n python%{python3_pkgversion}-%{srcname}

+ %package -n python%{python3_pkgversion}-%{pypi_name}

  Summary:        Python %{python3_version} HTTP library with thread-safe connection pooling and file post

  Requires:       ca-certificates

  Requires:       python%{python3_pkgversion}-pysocks

  Requires:       python%{python3_pkgversion}-six

- %{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}

+ %{?python_provide:%python_provide python%{python3_pkgversion}-%{pypi_name}}

+ 

+ %description -n python%{python3_pkgversion}-%{pypi_name}

+ %_description

+ This package is for Python3 version %{python3_version} .

+ 

+ %if 0%{?python3_other_pkgversion}

+ %package -n python%{python3_other_pkgversion}-%{pypi_name}

+ Summary:        Python %{python3_version} HTTP library with thread-safe connection pooling and file post

+ Requires:       ca-certificates

+ Requires:       python%{python3_other_pkgversion}-pysocks

+ Requires:       python%{python3_other_pkgversion}-six

+ %{?python_provide:%python_provide python%{python3_other_pkgversion}-%{pypi_name}}

  

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

- Python %{python3_version} HTTP module with connection pooling and file POST abilities.

+ %description -n python%{python3_other_pkgversion}-%{pypi_name}

+ %_description

+ This package is for Python3 version %{python3_other_version} .

+ %endif

  

  

  %prep

- %setup -q -n %{srcname}-%{version}

+ %setup -q -n %{pypi_name}-%{version}

  # Use system six

- rm urllib3/packages/six.py

+ rm %{pypi_name}/packages/six.py

  find -name \*.py | xargs sed -i -e 's/from .*\.six/from six/' -e 's/from .* import six/import six/'

  

  # Drop the dummyserver tests in koji.  They fail there in real builds, but not

  # in scratch builds (weird).

  rm -r test/with_dummyserver/

  

- 

  %build

  %py3_build

- 

+ %py3_other_build

  

  %install

  %py3_install

- ln -s ../../six.py %{buildroot}%{python3_sitelib}/urllib3/packages/six.py

- 

+ ln -s ../../six.py %{buildroot}%{python3_sitelib}/%{pypi_name}/packages/six.py

+ %py3_other_install

+ ln -s ../../six.py %{buildroot}%{python3_other_sitelib}/%{pypi_name}/packages/six.py

  

  %check

  nosetests-%{python3_version}

+ %{?with python3_other_tests: nosetests-%{python3_other_version}}

  

  

- %files -n python%{python3_pkgversion}-%{srcname}

+ %files -n python%{python3_pkgversion}-%{pypi_name}

  %license LICENSE.txt

  %doc CHANGES.rst README.rst

- %{python3_sitelib}/urllib3/

- %{python3_sitelib}/urllib3-*.egg-info

+ %{python3_sitelib}/%{pypi_name}/

+ %{python3_sitelib}/%{pypi_name}-*.egg-info

+ 

+ %if 0%{?python3_other_pkgversion}

+ %files -n python%{python3_other_pkgversion}-%{pypi_name}

+ %license LICENSE.txt

+ %doc CHANGES.rst README.rst

+ %{python3_other_sitelib}/%{pypi_name}/

+ %{python3_other_sitelib}/%{pypi_name}-*.egg-info

+ %endif

  

  

  %changelog

+ * Sat Sep 29 2018 Raphael Groner <projects.rg@smart.ms>

Please add: - 1.19.1-4
No idea what happened.

+ - add python3_other subpackage

+ - add BR: python3X-setuptools

+ - use pypi macros

+ 

  * Fri Jan 6 2017 Orion Poplawski <orion@cora.nwra.com> - 1.19.1-3

  - Install symlink to system six.py

  

no initial comment

1 new commit added

  • add symlink for six also to python3_other
5 years ago

Pull-Request has been merged by orion

5 years ago

Please add: - 1.19.1-4
No idea what happened.

This is going to requires python36-pysocks in EPEL first.

@orion Oh, pysocks is needed for tests only, no? I assumed so cause of the comment in the spec file.
Is there any recommended process to validate availability of all essential runtime dependencies of a python package to build? Maybe: find <path> -name *.py -exec grep import '{}' \; | sort | uniq

Metadata