From d6c15bf7a15b5456647f4656f1c53792cc08371a Mon Sep 17 00:00:00 2001 From: zhang-liang-pengkun Date: Thu, 28 Dec 2023 15:33:27 +0800 Subject: [PATCH 1/2] always use latest pip and pipenv on travis Signed-off-by: zhang-liang-pengkun --- ...-use-latest-pip-and-pipenv-on-travis.patch | 26 +++++++++++++++++++ python-httpretty.spec | 6 ++++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 0004-always-use-latest-pip-and-pipenv-on-travis.patch diff --git a/0004-always-use-latest-pip-and-pipenv-on-travis.patch b/0004-always-use-latest-pip-and-pipenv-on-travis.patch new file mode 100644 index 0000000..cdd435c --- /dev/null +++ b/0004-always-use-latest-pip-and-pipenv-on-travis.patch @@ -0,0 +1,26 @@ +From d5b88caff4362d4c7d5c97694829c23d3924f624 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Gabriel=20Falc=C3=A3o?= +Date: Mon, 15 Oct 2018 17:12:44 +0200 +Subject: [PATCH] always use latest pip and pipenv on travis + +--- + .travis.yml | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/.travis.yml b/.travis.yml +index 2d01a6e..6679c3e 100644 +--- a/.travis.yml ++++ b/.travis.yml +@@ -14,7 +14,8 @@ env: + - TEST_TYPE=pyopenssl + + install: +- - pip install pipenv ++ - pip install -U pip --no-cache-dir ++ - pip install -U pipenv --no-cache-dir + - pipenv install --dev --skip-lock + + script: +-- +2.39.0.windows.2 + diff --git a/python-httpretty.spec b/python-httpretty.spec index c0d4d0b..b03d7c7 100644 --- a/python-httpretty.spec +++ b/python-httpretty.spec @@ -1,6 +1,6 @@ Name: python-httpretty Version: 0.9.5 -Release: 7 +Release: 8 Summary: HTTP Client mocking tool for Python License: MIT URL: https://pypi.org/project/httpretty/ @@ -12,6 +12,7 @@ Patch0003: 0001-Call-reset-from-setUp-and-tearDown-in-addition-to-en.patch Patch0004: Mock-time-to-make-date-based-tests-reliable.patch Patch0005: 0002-fix-query-param-matching.patch Patch0006: 0003-Support-old-Python-2.7-releases-341.patch +Patch0007: 0004-always-use-latest-pip-and-pipenv-on-travis.patch BuildRequires: python2-devel python2-setuptools python2-httplib2 python2-mock python2-nose BuildRequires: python2-requests python2-sure python2-urllib3 python2-tornado python-unittest2 @@ -71,6 +72,9 @@ LANG=en_US.UTF-8 %{__python3} -m nose2 -v %{python3_sitelib}/httpretty-%{version}-py3.?.egg-info %changelog +* Thu Dec 28 2023 zhangliangpengkun - 0.9.5-8 +- always use latest pip and pipenv on travis + * Thu Oct 23 2023 zhangliangpengkun - 0.9.5-7 - Support old Python 2.7 releases (#341) -- Gitee From 8a0141382df599f0caa5abbf2077cdd50875cf41 Mon Sep 17 00:00:00 2001 From: zhang-liang-pengkun Date: Fri, 29 Dec 2023 16:02:24 +0800 Subject: [PATCH 2/2] lint Signed-off-by: zhang-liang-pengkun --- ...-use-latest-pip-and-pipenv-on-travis.patch | 26 ---- 0004-lint.patch | 121 ++++++++++++++++++ python-httpretty.spec | 4 +- 3 files changed, 123 insertions(+), 28 deletions(-) delete mode 100644 0004-always-use-latest-pip-and-pipenv-on-travis.patch create mode 100644 0004-lint.patch diff --git a/0004-always-use-latest-pip-and-pipenv-on-travis.patch b/0004-always-use-latest-pip-and-pipenv-on-travis.patch deleted file mode 100644 index cdd435c..0000000 --- a/0004-always-use-latest-pip-and-pipenv-on-travis.patch +++ /dev/null @@ -1,26 +0,0 @@ -From d5b88caff4362d4c7d5c97694829c23d3924f624 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Gabriel=20Falc=C3=A3o?= -Date: Mon, 15 Oct 2018 17:12:44 +0200 -Subject: [PATCH] always use latest pip and pipenv on travis - ---- - .travis.yml | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/.travis.yml b/.travis.yml -index 2d01a6e..6679c3e 100644 ---- a/.travis.yml -+++ b/.travis.yml -@@ -14,7 +14,8 @@ env: - - TEST_TYPE=pyopenssl - - install: -- - pip install pipenv -+ - pip install -U pip --no-cache-dir -+ - pip install -U pipenv --no-cache-dir - - pipenv install --dev --skip-lock - - script: --- -2.39.0.windows.2 - diff --git a/0004-lint.patch b/0004-lint.patch new file mode 100644 index 0000000..3329c02 --- /dev/null +++ b/0004-lint.patch @@ -0,0 +1,121 @@ +From 2314893ec5ab46513e91ab867d7b55a72968909e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Gabriel=20Falc=C3=A3o?= +Date: Sun, 4 Nov 2018 23:32:50 +0100 +Subject: [PATCH] lint + +--- + httpretty/http.py | 2 +- + tests/functional/test_httplib2.py | 2 +- + tests/functional/test_requests.py | 14 +++++++------- + tests/functional/test_urllib2.py | 2 +- + 4 files changed, 10 insertions(+), 10 deletions(-) + +diff --git a/httpretty/http.py b/httpretty/http.py +index a256905..79dac73 100644 +--- a/httpretty/http.py ++++ b/httpretty/http.py +@@ -133,7 +133,7 @@ def parse_requestline(s): + ValueError: Not a Request-Line + """ + methods = '|'.join(HttpBaseClass.METHODS) +- m = re.match(r'(' + methods + ')\s+(.*)\s+HTTP/(1.[0|1])', s, re.I) ++ m = re.match(r'(' + methods + r')\s+(.*)\s+HTTP/(1.[0|1])', s, re.I) + if m: + return m.group(1).upper(), m.group(2), m.group(3) + else: +diff --git a/tests/functional/test_httplib2.py b/tests/functional/test_httplib2.py +index 3b78043..9aa6a5b 100644 +--- a/tests/functional/test_httplib2.py ++++ b/tests/functional/test_httplib2.py +@@ -295,7 +295,7 @@ def test_httpretty_should_allow_registering_regexes(): + + HTTPretty.register_uri( + HTTPretty.GET, +- re.compile("https://api.yipit.com/v1/deal;brand=(?P\w+)"), ++ re.compile(r"https://api.yipit.com/v1/deal;brand=(?P\w+)"), + body="Found brand", + ) + +diff --git a/tests/functional/test_requests.py b/tests/functional/test_requests.py +index e98b23f..06bdc1e 100644 +--- a/tests/functional/test_requests.py ++++ b/tests/functional/test_requests.py +@@ -564,7 +564,7 @@ def test_httpretty_should_allow_registering_regexes_and_give_a_proper_match_to_t + + HTTPretty.register_uri( + HTTPretty.GET, +- re.compile("https://api.yipit.com/v1/deal;brand=(?P\w+)"), ++ re.compile(r"https://api.yipit.com/v1/deal;brand=(?P\w+)"), + body=lambda method, uri, headers: [200, headers, uri] + ) + +@@ -581,7 +581,7 @@ def test_httpretty_should_allow_registering_regexes(): + + HTTPretty.register_uri( + HTTPretty.GET, +- re.compile("https://api.yipit.com/v1/deal;brand=(?P\w+)"), ++ re.compile(r"https://api.yipit.com/v1/deal;brand=(?P\w+)"), + body="Found brand", + ) + +@@ -598,7 +598,7 @@ def test_httpretty_provides_easy_access_to_querystrings_with_regexes(): + + HTTPretty.register_uri( + HTTPretty.GET, +- re.compile("https://api.yipit.com/v1/(?P\w+)/$"), ++ re.compile(r"https://api.yipit.com/v1/(?P\w+)/$"), + body="Find the best daily deals" + ) + +@@ -617,7 +617,7 @@ def test_httpretty_allows_to_chose_if_querystring_should_be_matched(): + + HTTPretty.register_uri( + HTTPretty.GET, +- re.compile("https://example.org/(?P\w+)/$"), ++ re.compile(r"https://example.org/(?P\w+)/$"), + body="Nudge, nudge, wink, wink. Know what I mean?", + match_querystring=True + ) +@@ -659,7 +659,7 @@ def test_httpretty_should_allow_registering_regexes_with_streaming_responses(): + + HTTPretty.register_uri( + HTTPretty.POST, +- re.compile("https://api.yipit.com/v1/deal;brand=(?P\w+)"), ++ re.compile(r"https://api.yipit.com/v1/deal;brand=(?P\w+)"), + body=my_callback, + ) + +@@ -842,7 +842,7 @@ def test_httpretty_should_work_with_non_standard_ports(): + + HTTPretty.register_uri( + HTTPretty.GET, +- re.compile("https://api.yipit.com:1234/v1/deal;brand=(?P\w+)"), ++ re.compile(r"https://api.yipit.com:1234/v1/deal;brand=(?P\w+)"), + body=lambda method, uri, headers: [200, headers, uri] + ) + HTTPretty.register_uri( +@@ -901,7 +901,7 @@ def test_httpretty_should_allow_registering_regexes_with_port_and_give_a_proper_ + + HTTPretty.register_uri( + HTTPretty.GET, +- re.compile("https://api.yipit.com:1234/v1/deal;brand=(?P\w+)"), ++ re.compile(r"https://api.yipit.com:1234/v1/deal;brand=(?P\w+)"), + body=lambda method, uri, headers: [200, headers, uri] + ) + +diff --git a/tests/functional/test_urllib2.py b/tests/functional/test_urllib2.py +index d1b92ee..c2a1732 100644 +--- a/tests/functional/test_urllib2.py ++++ b/tests/functional/test_urllib2.py +@@ -326,7 +326,7 @@ def test_httpretty_should_allow_registering_regexes(): + + HTTPretty.register_uri( + HTTPretty.GET, +- re.compile("https://api.yipit.com/v1/deal;brand=(?P\w+)"), ++ re.compile(r"https://api.yipit.com/v1/deal;brand=(?P\w+)"), + body="Found brand", + ) + +-- +2.39.0.windows.2 + diff --git a/python-httpretty.spec b/python-httpretty.spec index b03d7c7..aba02e5 100644 --- a/python-httpretty.spec +++ b/python-httpretty.spec @@ -12,7 +12,7 @@ Patch0003: 0001-Call-reset-from-setUp-and-tearDown-in-addition-to-en.patch Patch0004: Mock-time-to-make-date-based-tests-reliable.patch Patch0005: 0002-fix-query-param-matching.patch Patch0006: 0003-Support-old-Python-2.7-releases-341.patch -Patch0007: 0004-always-use-latest-pip-and-pipenv-on-travis.patch +Patch0007: 0004-lint.patch BuildRequires: python2-devel python2-setuptools python2-httplib2 python2-mock python2-nose BuildRequires: python2-requests python2-sure python2-urllib3 python2-tornado python-unittest2 @@ -73,7 +73,7 @@ LANG=en_US.UTF-8 %{__python3} -m nose2 -v %changelog * Thu Dec 28 2023 zhangliangpengkun - 0.9.5-8 -- always use latest pip and pipenv on travis +- lint * Thu Oct 23 2023 zhangliangpengkun - 0.9.5-7 - Support old Python 2.7 releases (#341) -- Gitee