Annotate celery/fixups#7399
Annotate celery/fixups#7399auvipy merged 2 commits intocelery:masterfrom Kludex:annotate/celery/fixups
celery/fixups#7399Conversation
| else: | ||
| _verify_django_version(django) | ||
| return DjangoFixup(app).install() | ||
| return None |
There was a problem hiding this comment.
Be consistent in return statements. Either all return statements in a function should return an expression, or none of them should. If any return statement returns an expression, any return statements where no value is returned should explicitly state this as return
https://peps.python.org/pep-0008/#programming-recommendations
It's either this or # type: ignore[return]. I'm not attached to any option.
Codecov Report
@@ Coverage Diff @@
## master #7399 +/- ##
==========================================
- Coverage 89.30% 89.26% -0.05%
==========================================
Files 138 138
Lines 16762 16772 +10
Branches 2451 2453 +2
==========================================
+ Hits 14969 14971 +2
- Misses 1561 1568 +7
- Partials 232 233 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
|
This pull request fixes 1 alert when merging 7667ae3 into 1ccd887 - view on LGTM.com fixed alerts:
|
| self._worker_fixup = value | ||
|
|
||
| def on_import_modules(self, **kwargs): | ||
| def on_import_modules(self, **kwargs: Any) -> None: |
There was a problem hiding this comment.
I can see that... It's not like I'm a big fan of it as well...
Comments being against those will not be productive, if you have a suggestion of which type to add there, it can be more helpful.
As you added Seth's blog post as an argument of not using Any, I just want to let you know that urllib3 does have them:
➜ src git:(main) pwd
/Users/marcelotryle/Development/fork/urllib3/src
➜ src git:(main) grep -r "Any"
./urllib3/util/ssltransport.py: Any,
./urllib3/util/ssltransport.py: def __exit__(self, *_: Any) -> None:
./urllib3/util/ssltransport.py: def read(self, len: int = 1024, buffer: Optional[Any] = None) -> Union[int, bytes]:
./urllib3/util/request.py:from typing import IO, TYPE_CHECKING, Any, AnyStr, Dict, List, Optional, Union
./urllib3/util/request.py: body: Any, pos: Optional[_TYPE_BODY_POSITION]
./urllib3/util/request.py:def rewind_body(body: IO[AnyStr], body_pos: _TYPE_BODY_POSITION) -> None:
./urllib3/util/retry.py: Any,
./urllib3/util/retry.py: def new(self, **kw: Any) -> "Retry":
./urllib3/util/url.py: # Anything other than '..', should be appended to the output
./urllib3/util/ssl_match_hostname.py:from typing import TYPE_CHECKING, Any, Match, Optional, Tuple, Union
./urllib3/util/ssl_match_hostname.py: dn: Any, hostname: str, max_wildcards: int = 1
./urllib3/__init__.py:from typing import Any, Mapping, Optional, TextIO, Type, Union
./urllib3/__init__.py: json: Optional[Any] = None,
./urllib3/poolmanager.py: Any,
./urllib3/poolmanager.py: key_class: Type[PoolKey], request_context: Dict[str, Any]
./urllib3/poolmanager.py: **connection_pool_kw: Any,
./urllib3/poolmanager.py: def dispose_func(p: Any) -> None:
./urllib3/poolmanager.py: request_context: Optional[Dict[str, Any]] = None,
./urllib3/poolmanager.py: pool_kwargs: Optional[Dict[str, Any]] = None,
./urllib3/poolmanager.py: self, request_context: Dict[str, Any]
./urllib3/poolmanager.py: self, pool_key: PoolKey, request_context: Dict[str, Any]
./urllib3/poolmanager.py: self, url: str, pool_kwargs: Optional[Dict[str, Any]] = None
./urllib3/poolmanager.py: def _merge_pool_kwargs(self, override: Optional[Dict[str, Any]]) -> Dict[str, Any]:
./urllib3/poolmanager.py: Any keys in the override dictionary with a value of ``None`` are
./urllib3/poolmanager.py: self, method: str, url: str, redirect: bool = True, **kw: Any
./urllib3/poolmanager.py: **connection_pool_kw: Any,
./urllib3/poolmanager.py: pool_kwargs: Optional[Dict[str, Any]] = None,
./urllib3/poolmanager.py: self, method: str, url: str, redirect: bool = True, **kw: Any
./urllib3/poolmanager.py:def proxy_from_url(url: str, **kw: Any) -> ProxyManager:
./urllib3/response.py: Any,
./urllib3/response.py: def json(self) -> Any:
./urllib3/response.py: ResponseCls: Type["HTTPResponse"], r: _HttplibHTTPResponse, **response_kw: Any
./urllib3/contrib/securetransport.py: Any,
./urllib3/contrib/securetransport.py: client_key_passphrase: Any,
./urllib3/contrib/securetransport.py: *args: Any,
./urllib3/contrib/securetransport.py: **kwargs: Any,
./urllib3/contrib/securetransport.py: def check_hostname(self, value: Any) -> None:
./urllib3/contrib/securetransport.py: def set_ciphers(self, ciphers: Any) -> None:
./urllib3/contrib/socks.py:from typing import Any, Dict, Mapping, Optional
./urllib3/contrib/socks.py: _TYPE_SOCKS_OPTIONS = Dict[str, Any] # type: ignore[misc, assignment]
./urllib3/contrib/socks.py: self, _socks_options: _TYPE_SOCKS_OPTIONS, *args: Any, **kwargs: Any
./urllib3/contrib/socks.py: extra_kw: Dict[str, Any] = {}
./urllib3/contrib/socks.py: **connection_pool_kw: Any,
./urllib3/contrib/pyopenssl.py:from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union
./urllib3/contrib/pyopenssl.py: def recv(self, *args: Any, **kwargs: Any) -> bytes:
./urllib3/contrib/pyopenssl.py: def recv_into(self, *args: Any, **kwargs: Any) -> int:
./urllib3/contrib/pyopenssl.py: def getpeercert(self, binary_form: bool = False) -> Dict[str, List[Any]]:
./urllib3/contrib/_securetransport/low_level.py:from typing import Any, List, Optional, Tuple, Type
./urllib3/contrib/_securetransport/low_level.py:def _cf_dictionary_from_tuples(tuples: List[Tuple[Any, Any]]) -> CFDictionary:
./urllib3/connection.py: Any,
./urllib3/connection.py:_TYPE_BODY = Union[bytes, IO[Any], Iterable[bytes], str]
./urllib3/_request_methods.py:from typing import Any, Dict, Mapping, Optional, Sequence, Tuple, Union
./urllib3/_request_methods.py: **kw: Any,
./urllib3/_request_methods.py: json: Optional[Any] = None,
./urllib3/_request_methods.py: **urlopen_kw: Any,
./urllib3/_request_methods.py: extra_kw: Dict[str, Any] = {"headers": headers}
./urllib3/_request_methods.py: extra_kw: Dict[str, Any] = {"headers": {}}
./urllib3/connectionpool.py:from typing import TYPE_CHECKING, Any, Mapping, Optional, Type, TypeVar, Union, overload
./urllib3/connectionpool.py: **conn_kw: Any,
./urllib3/connectionpool.py: self.pool: Optional[queue.LifoQueue[Any]] = self.QueueCls(maxsize)
./urllib3/connectionpool.py: **httplib_request_kw: Any,
./urllib3/connectionpool.py: **response_kw: Any,
./urllib3/connectionpool.py: **conn_kw: Any,
./urllib3/connectionpool.py:def connection_from_url(url: str, **kw: Any) -> HTTPConnectionPool:|
OK let's go with some of them |
|
Thanks 👍 I'll try to spend more time on each |
Uh oh!
There was an error while loading. Please reload this page.