]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
lint: Set black target version to 3.8+
authorBen Darnell <ben@bendarnell.com>
Thu, 13 Jun 2024 19:08:18 +0000 (15:08 -0400)
committerBen Darnell <ben@bendarnell.com>
Thu, 13 Jun 2024 19:08:18 +0000 (15:08 -0400)
This makes black use trailing commas consistently across the codebase.
Without this, it uses certain trailing commas only in files that
contain fstrings (because this marks them as requiring Python 3.6+).

pyproject.toml
tornado/auth.py
tornado/httpclient.py
tornado/ioloop.py
tornado/netutil.py
tornado/websocket.py

index fa75e066f7ed81f7bba3424ae38325ec97cd0fa7..f8268bf0edf516c18d3885448c152d9530469a4d 100644 (file)
@@ -2,6 +2,9 @@
 requires = ["setuptools", "wheel"]
 build-backend = "setuptools.build_meta"
 
+[tool.black]
+target-version = ['py38', 'py39', 'py310', 'py311', 'py312']
+
 [tool.cibuildwheel]
 build = "cp3[89]* cp310* cp311* cp312*"
 test-command = "python -m tornado.test"
index 73acf9e93e82f26d76c95170782cf68516d0b034..035d34b0458ffa079189e45bffa938a35a8ba424 100644 (file)
@@ -632,7 +632,7 @@ class OAuth2Mixin:
         url: str,
         access_token: Optional[str] = None,
         post_args: Optional[Dict[str, Any]] = None,
-        **args: Any
+        **args: Any,
     ) -> Any:
         """Fetches the given URL auth an OAuth2 access token.
 
@@ -761,7 +761,7 @@ class TwitterMixin(OAuthMixin):
         path: str,
         access_token: Dict[str, Any],
         post_args: Optional[Dict[str, Any]] = None,
-        **args: Any
+        **args: Any,
     ) -> Any:
         """Fetches the given API path, e.g., ``statuses/user_timeline/btaylor``
 
@@ -1096,7 +1096,7 @@ class FacebookGraphMixin(OAuth2Mixin):
         path: str,
         access_token: Optional[str] = None,
         post_args: Optional[Dict[str, Any]] = None,
-        **args: Any
+        **args: Any,
     ) -> Any:
         """Fetches the given relative API path, e.g., "/btaylor/picture"
 
index 879c45f6269ae79f0213d96700dbc50171c5c56c..1fc04c64f06b031ea3ccd202fda7526a31a9b1ef 100644 (file)
@@ -89,7 +89,7 @@ class HTTPClient:
     def __init__(
         self,
         async_client_class: "Optional[Type[AsyncHTTPClient]]" = None,
-        **kwargs: Any
+        **kwargs: Any,
     ) -> None:
         # Initialize self._closed at the beginning of the constructor
         # so that an exception raised here doesn't lead to confusing
@@ -250,7 +250,7 @@ class AsyncHTTPClient(Configurable):
         self,
         request: Union[str, "HTTPRequest"],
         raise_error: bool = True,
-        **kwargs: Any
+        **kwargs: Any,
     ) -> "Future[HTTPResponse]":
         """Executes a request, asynchronously returning an `HTTPResponse`.
 
index e6a1796841969993da45a2604dca3f4787b086a5..31874fd268033b59e5257e8c6139f95875958fe4 100644 (file)
@@ -554,7 +554,7 @@ class IOLoop(Configurable):
         deadline: Union[float, datetime.timedelta],
         callback: Callable,
         *args: Any,
-        **kwargs: Any
+        **kwargs: Any,
     ) -> object:
         """Runs the ``callback`` at the time ``deadline`` from the I/O loop.
 
@@ -705,7 +705,7 @@ class IOLoop(Configurable):
         self,
         executor: Optional[concurrent.futures.Executor],
         func: Callable[..., _T],
-        *args: Any
+        *args: Any,
     ) -> "Future[_T]":
         """Runs a function in a ``concurrent.futures.Executor``. If
         ``executor`` is ``None``, the IO loop's default executor will be used.
index da134c15044cd41eb666d7e9f8045f023d470732..e74cf0f1ec1e32e8e2a0cd97f597d314bc12e786 100644 (file)
@@ -645,7 +645,7 @@ def ssl_wrap_socket(
     ssl_options: Union[Dict[str, Any], ssl.SSLContext],
     server_hostname: Optional[str] = None,
     server_side: Optional[bool] = None,
-    **kwargs: Any
+    **kwargs: Any,
 ) -> ssl.SSLSocket:
     """Returns an ``ssl.SSLSocket`` wrapping the given socket.
 
index 581a0f403ed67209c57b166f6cc7914054443b3d..1e0161e1b8be5526fb8202a8202cb7b470863ba2 100644 (file)
@@ -212,7 +212,7 @@ class WebSocketHandler(tornado.web.RequestHandler):
         self,
         application: tornado.web.Application,
         request: httputil.HTTPServerRequest,
-        **kwargs: Any
+        **kwargs: Any,
     ) -> None:
         super().__init__(application, request, **kwargs)
         self.ws_connection = None  # type: Optional[WebSocketProtocol]
@@ -1015,7 +1015,7 @@ class WebSocketProtocol13(WebSocketProtocol):
             max_message_size=self.params.max_message_size,
             **self._get_compressor_options(
                 other_side, agreed_parameters, compression_options
-            )
+            ),
         )
 
     def _write_frame(