Update to 1.3.1. Fixes rhbz#2048147

This commit is contained in:
Kevin Fenzi 2022-05-29 18:01:57 -07:00
parent f8b5fa8606
commit 59d092ff44
4 changed files with 14 additions and 93 deletions

1
.gitignore vendored
View File

@ -4,3 +4,4 @@
/v1.0.0.tar.gz
/v1.2.0.tar.gz
/v1.3.0.tar.gz
/v1.3.1.tar.gz

View File

@ -1,89 +0,0 @@
From 62d8d04f49f731839ccd4a2c448ac08c8a1ab493 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
Date: Mon, 16 Mar 2020 12:34:23 +0100
Subject: [PATCH] Prefer unittest.mock over external mock package
Prefer using unittest.mock over external mock package to avoid
extraneous dependencies in Python 3.3+. Install 'mock' only for older
Python versions.
---
setup.py | 2 +-
tests/test_core.py | 4 ++--
tests/test_oauth1_session.py | 4 ++--
tests/test_oauth2_session.py | 4 ++--
tox.ini | 2 +-
5 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/setup.py b/setup.py
index 1532c17..2e8dd82 100644
--- a/setup.py
+++ b/setup.py
@@ -63,6 +63,6 @@ def readall(path):
"Programming Language :: Python :: Implementation :: PyPy",
],
zip_safe=False,
- tests_require=["mock", "requests-mock"],
+ tests_require=['mock;python_version<"3.3"', "requests-mock"],
test_suite="tests",
)
diff --git a/tests/test_core.py b/tests/test_core.py
index ea4575f..971ee6c 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -8,9 +8,9 @@
import unittest
try:
- import mock
-except ImportError:
from unittest import mock
+except ImportError:
+ import mock
@mock.patch("oauthlib.oauth1.rfc5849.generate_timestamp")
diff --git a/tests/test_oauth1_session.py b/tests/test_oauth1_session.py
index 1dd2b2f..ad0578f 100644
--- a/tests/test_oauth1_session.py
+++ b/tests/test_oauth1_session.py
@@ -9,9 +9,9 @@
from requests_oauthlib import OAuth1Session
try:
- import mock
-except ImportError:
from unittest import mock
+except ImportError:
+ import mock
try:
import cryptography
diff --git a/tests/test_oauth2_session.py b/tests/test_oauth2_session.py
index cfc6236..2f7b227 100644
--- a/tests/test_oauth2_session.py
+++ b/tests/test_oauth2_session.py
@@ -9,9 +9,9 @@
from unittest import TestCase
try:
- import mock
-except ImportError:
from unittest import mock
+except ImportError:
+ import mock
from oauthlib.common import urlencode
from oauthlib.oauth2 import TokenExpiredError, OAuth2Error
diff --git a/tox.ini b/tox.ini
index abc641a..0db1117 100644
--- a/tox.ini
+++ b/tox.ini
@@ -4,7 +4,7 @@ envlist = py27, py34, py35, py36, py37, pypy, pypy3
[testenv]
deps=
-r{toxinidir}/requirements.txt
- mock
+ mock;python_version<"3.3"
coveralls
requests-mock
commands= coverage run --source=requests_oauthlib -m unittest discover

View File

@ -2,14 +2,13 @@
%global modname requests_oauthlib
Name: python-requests-oauthlib
Version: 1.3.0
Release: 12%{?dist}
Version: 1.3.1
Release: 1%{?dist}
Summary: OAuthlib authentication support for Requests.
License: ISC
URL: http://pypi.python.org/pypi/requests-oauthlib
Source0: https://github.com/requests/requests-oauthlib/archive/v%{version}.tar.gz
Patch0001: 401.patch
BuildArch: noarch
@ -26,6 +25,10 @@ BuildRequires: python3-setuptools
BuildRequires: python3-oauthlib >= 0.6.2
BuildRequires: python3-requests >= 2.0.0
BuildRequires: python3-pytest
BuildRequires: python3-pytest-mock
BuildRequires: python3-requests-mock
Requires: python3-oauthlib
Requires: python3-requests
@ -45,6 +48,9 @@ rm -rf %{distname}.egg-info
%install
%py3_install
%check
%pytest -k "not testCanPostBinaryData and not test_content_type_override and not test_url_is_native_str"
%files -n python3-%{distname}
%doc README.rst HISTORY.rst requirements.txt AUTHORS.rst
%license LICENSE
@ -52,6 +58,9 @@ rm -rf %{distname}.egg-info
%{python3_sitelib}/%{modname}-%{version}*
%changelog
* Sun May 29 2022 Kevin Fenzi <kevin@scrye.com> - 1.3.1-1
- Update to 1.3.1. Fixes rhbz#2048147
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.0-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

View File

@ -1 +1 @@
SHA512 (v1.3.0.tar.gz) = 0eebd209dad892567de7d37f1482b5c7523eced3a73a68054674b29447d090c885b2388fd6f2db26436f14098833051c8888ace8b137889a4012e010efb0e86b
SHA512 (v1.3.1.tar.gz) = 86fe34d39ad7224fd44a1b0c4fbf3784032239b894ae73ba65043941cde9675c2f8abedf44ccc00b5fb1648b8e261de258464b311f3ace6392ab6202fb50aa08