]> git.ipfire.org Git - thirdparty/httpx.git/commitdiff
Bump flake8-pie from 0.5.0 to 0.15.0 (#1879)
authordependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Fri, 15 Oct 2021 10:03:53 +0000 (12:03 +0200)
committerGitHub <noreply@github.com>
Fri, 15 Oct 2021 10:03:53 +0000 (12:03 +0200)
* Bump flake8-pie from 0.5.0 to 0.15.0

Bumps [flake8-pie](https://github.com/sbdchd/flake8-pie) from 0.5.0 to 0.15.0.
- [Release notes](https://github.com/sbdchd/flake8-pie/releases)
- [Commits](https://github.com/sbdchd/flake8-pie/commits)

---
updated-dependencies:
- dependency-name: flake8-pie
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
* Don't use PIE on 3.6

* Adhere or ignore new rules

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tom Christie <tom@tomchristie.com>
Co-authored-by: Florimond Manca <florimond.manca@protonmail.com>
httpx/_client.py
httpx/_transports/asgi.py
httpx/_transports/default.py
httpx/_utils.py
requirements.txt
setup.cfg

index c4a6e9182c24afb970351b54e957e917642dcfff..537a4b9158b0501ba43a22d0a389d895cbe94739 100644 (file)
@@ -79,8 +79,6 @@ class UseClientDefault:
     but it is used internally when a parameter is not included.
     """
 
-    pass  # pragma: nocover
-
 
 USE_CLIENT_DEFAULT = UseClientDefault()
 
@@ -412,8 +410,7 @@ class BaseClient:
         """
         if params or self.params:
             merged_queryparams = QueryParams(self.params)
-            merged_queryparams = merged_queryparams.merge(params)
-            return merged_queryparams
+            return merged_queryparams.merge(params)
         return params
 
     def _build_auth(self, auth: AuthTypes) -> typing.Optional[Auth]:
@@ -987,7 +984,9 @@ class Client(BaseClient):
 
         status = f"{response.status_code} {response.reason_phrase}"
         response_line = f"{response.http_version} {status}"
-        logger.debug(f'HTTP Request: {request.method} {request.url} "{response_line}"')
+        logger.debug(
+            'HTTP Request: %s %s "%s"', request.method, request.url, response_line
+        )
 
         return response
 
@@ -1480,10 +1479,7 @@ class AsyncClient(BaseClient):
             cookies=cookies,
             timeout=timeout,
         )
-        response = await self.send(
-            request, auth=auth, follow_redirects=follow_redirects
-        )
-        return response
+        return await self.send(request, auth=auth, follow_redirects=follow_redirects)
 
     @asynccontextmanager
     async def stream(
@@ -1681,7 +1677,9 @@ class AsyncClient(BaseClient):
 
         status = f"{response.status_code} {response.reason_phrase}"
         response_line = f"{response.http_version} {status}"
-        logger.debug(f'HTTP Request: {request.method} {request.url} "{response_line}"')
+        logger.debug(
+            'HTTP Request: %s %s "%s"', request.method, request.url, response_line
+        )
 
         return response
 
index 4e3616587dfcf2afd0c6e217c4e56a020f661682..711a6f6ce75738685e739d76315f0ce3818f169a 100644 (file)
@@ -150,7 +150,7 @@ class ASGITransport(AsyncBaseTransport):
 
         try:
             await self.app(scope, receive, send)
-        except Exception:
+        except Exception:  # noqa: PIE-786
             if self.raise_app_exceptions or not response_complete.is_set():
                 raise
 
index 2566a3f217a27603c8f493c6bdca34d97a03582e..22328ef60fe2ff4587cf90397e298dac48cb8808 100644 (file)
@@ -60,7 +60,7 @@ A = typing.TypeVar("A", bound="AsyncHTTPTransport")
 def map_httpcore_exceptions() -> typing.Iterator[None]:
     try:
         yield
-    except Exception as exc:
+    except Exception as exc:  # noqa: PIE-786
         mapped_exc = None
 
         for from_exc, to_exc in HTTPCORE_EXC_MAP.items():
index 30ab2ed5a686346f78e058f3c12469147b391df3..c47389f93c79001987fb8d9fd4b222d76b73b240 100644 (file)
@@ -20,7 +20,7 @@ if typing.TYPE_CHECKING:  # pragma: no cover
 
 _HTML5_FORM_ENCODING_REPLACEMENTS = {'"': "%22", "\\": "\\\\"}
 _HTML5_FORM_ENCODING_REPLACEMENTS.update(
-    {chr(c): "%{:02X}".format(c) for c in range(0x00, 0x1F + 1) if c != 0x1B}
+    {chr(c): "%{:02X}".format(c) for c in range(0x1F + 1) if c != 0x1B}
 )
 _HTML5_FORM_ENCODING_RE = re.compile(
     r"|".join([re.escape(c) for c in _HTML5_FORM_ENCODING_REPLACEMENTS.keys()])
index b64bb6d7397d042cf6bbaf453499b8c278575697..2f459e53a0c70cc3173a1c5bb193411deeaf6e06 100644 (file)
@@ -22,7 +22,7 @@ coverage==6.0.2
 cryptography==3.4.8
 flake8==3.9.2
 flake8-bugbear==21.4.3
-flake8-pie==0.5.0
+flake8-pie==0.15.0; python_version>='3.7'
 isort==5.9.3
 mypy==0.910
 types-certifi==0.1.4
index de10fa5500b58b1ef8ef87793f7c98724299b770..6b14b29bbc790a76cc24131b5c4cd4aba2e929ce 100644 (file)
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,5 +1,5 @@
 [flake8]
-ignore = W503, E203, B305
+ignore = W503, E203, B305, PIE801
 max-line-length = 120
 
 [mypy]