#3 EPEL compatibility
Merged 5 years ago by jamielennox. Opened 5 years ago by carlwgeorge.
rpms/ carlwgeorge/python-requests-mock epel-compat  into  master

file modified
+10 -24
@@ -2,14 +2,9 @@ 

  %global with_python3 1

  %endif

  

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

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

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

- %{!?_licensedir:%global license %%doc}

- 

  Name:           python-requests-mock

  Version:        1.3.0

- Release:        5%{?dist}

+ Release:        6%{?dist}

  Summary:        A requests mocking tool for python

  

  License:        ASL 2.0
@@ -33,19 +28,19 @@ 

  Requires:       python2-six

  

  # urllib3 required because requests packaging uses it and our patch uses it

- Requires:       python2-urllib3

+ Requires:       python%{?fedora:2}-urllib3

  

  # standard requirements needed for testing

  BuildRequires:  python2-requests

  BuildRequires:  python2-six

- BuildRequires:  python2-urllib3

+ BuildRequires:  python%{?fedora:2}-urllib3

  

  BuildRequires:  python2-devel

- BuildRequires:  python2-fixtures

+ BuildRequires:  python%{?fedora:2}-fixtures

  BuildRequires:  python2-mock

  BuildRequires:  python2-pbr

  BuildRequires:  python2-setuptools

- BuildRequires:  python2-testtools

+ BuildRequires:  python%{?fedora:2}-testtools

  

  %if 0%{?rhel} && 0%{?rhel} <= 6

  BuildRequires:  python-discover
@@ -98,30 +93,20 @@ 

  # Remove bundled egg-info

  rm -rf requests_mock.egg-info

  

- %if 0%{?with_python3}

- rm -rf %{py3dir}

- cp -a . %{py3dir}

- %endif

- 

  

  %build

  %py2_build

  

  %if 0%{?with_python3}

- pushd %{py3dir}

  %py3_build

- popd

  %endif

  

  

  %install

- rm -rf $RPM_BUILD_ROOT

  %py2_install

  

  %if 0%{?with_python3}

- pushd %{py3dir}

  %py3_install

- popd

  %endif

  

  
@@ -129,9 +114,7 @@ 

  %{__python2} -m testtools.run discover

  

  %if 0%{?with_python3}

- pushd %{py3dir}

  %{__python3} -m testtools.run discover

- popd

  %endif

  

  
@@ -139,7 +122,7 @@ 

  %license LICENSE

  %doc README.rst ChangeLog

  %{python2_sitelib}/requests_mock

- %{python2_sitelib}/requests_mock-%{version}-py2.?.egg-info

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

  

  

  %if 0%{?with_python3}
@@ -147,11 +130,14 @@ 

  %license LICENSE

  %doc README.rst ChangeLog

  %{python3_sitelib}/requests_mock

- %{python3_sitelib}/requests_mock-%{version}-py3.?.egg-info

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

  %endif

  

  

  %changelog

+ * Fri Jun 22 2018 Carl George <carl@george.computer> - 1.3.0-6

+ - EPEL compatibility

+ 

  * Tue Jun 19 2018 Miro HronĨok <mhroncok@redhat.com> - 1.3.0-5

  - Rebuilt for Python 3.7

  

This PR makes the spec file in master compatible with EL7. Once this is merged to master, master can be merged to epel7, and this can be built for EPEL.

I had completely forgotten that this was never pushed to epel, there's a few things there that really should be relying on it.

So i'm going through this wondering what the hell is going on with all this %{?fedora:2} and now I understand and am saddened :). Nice fix. I'm probably going to push a commit after this that just add some comments to explain so we can remove them later.

It breaks on <=f27 but I don't think it's the sort of thing that needs to get backported there anyway.

I'll push the upstream 1.5 today which rearranges tests a little bit as well. I'm open to suggestions of what version you want in epel.

Thanks Carl.

Pull-Request has been merged by jamielennox

5 years ago

My interest in this is just to keep the tests enabled when I build python-geoip2 for EL7. It's only restriction is at least version 0.5, so either 1.3.0 or 1.5.0 are both fine for me. I would lean towards 1.5.0 as a personal preference.