From: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 15 Oct 2021 10:03:53 +0000 (+0200) Subject: Bump flake8-pie from 0.5.0 to 0.15.0 (#1879) X-Git-Tag: 0.21.0~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa03b489f0fcd0df53afa8f9c471e24949f09e3e;p=thirdparty%2Fhttpx.git Bump flake8-pie from 0.5.0 to 0.15.0 (#1879) * 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] * 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 Co-authored-by: Florimond Manca --- diff --git a/httpx/_client.py b/httpx/_client.py index c4a6e918..537a4b91 100644 --- a/httpx/_client.py +++ b/httpx/_client.py @@ -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 diff --git a/httpx/_transports/asgi.py b/httpx/_transports/asgi.py index 4e361658..711a6f6c 100644 --- a/httpx/_transports/asgi.py +++ b/httpx/_transports/asgi.py @@ -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 diff --git a/httpx/_transports/default.py b/httpx/_transports/default.py index 2566a3f2..22328ef6 100644 --- a/httpx/_transports/default.py +++ b/httpx/_transports/default.py @@ -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(): diff --git a/httpx/_utils.py b/httpx/_utils.py index 30ab2ed5..c47389f9 100644 --- a/httpx/_utils.py +++ b/httpx/_utils.py @@ -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()]) diff --git a/requirements.txt b/requirements.txt index b64bb6d7..2f459e53 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 diff --git a/setup.cfg b/setup.cfg index de10fa55..6b14b29b 100644 --- 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]