Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update mypy #403

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion arq/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ async def queued_jobs(self, *, queue_name: Optional[str] = None) -> List[JobDef]


async def create_pool(
settings_: RedisSettings = None,
settings_: Optional[RedisSettings] = None,
*,
retry: int = 0,
job_serializer: Optional[Serializer] = None,
Expand Down
2 changes: 1 addition & 1 deletion arq/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def __init__(
self._deserializer = _deserializer

async def result(
self, timeout: Optional[float] = None, *, poll_delay: float = 0.5, pole_delay: float = None
self, timeout: Optional[float] = None, *, poll_delay: float = 0.5, pole_delay: Optional[float] = None
) -> Any:
"""
Get the result of the job or, if the job raised an exception, reraise it.
Expand Down
4 changes: 2 additions & 2 deletions arq/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ def __init__(
*,
queue_name: Optional[str] = default_queue_name,
cron_jobs: Optional[Sequence[CronJob]] = None,
redis_settings: RedisSettings = None,
redis_pool: ArqRedis = None,
redis_settings: Optional[RedisSettings] = None,
redis_pool: Optional[ArqRedis] = None,
burst: bool = False,
on_startup: Optional['StartupShutdown'] = None,
on_shutdown: Optional['StartupShutdown'] = None,
Expand Down
20 changes: 2 additions & 18 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,23 +92,7 @@ combine_as_imports = true
color_output = true

[tool.mypy]
show_error_codes = true
follow_imports = 'silent'
strict_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
disallow_any_generics = true
check_untyped_defs = true
no_implicit_reexport = true
warn_unused_configs = true
disallow_subclassing_any = true
disallow_incomplete_defs = true
disallow_untyped_decorators = true
disallow_untyped_calls = true

# for strict mypy: (this is the tricky one :-))
disallow_untyped_defs = true
strict = true

# remaining arguments from `mypy --strict` which cause errors
#no_implicit_optional = true
#warn_return_any = true
warn_return_any = false
2 changes: 1 addition & 1 deletion requirements/linting.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ black>=22,<23
flake8>=5,<6
flake8-quotes>=3,<4
isort[colors]>=5,<6
mypy<1
mypy>=1,<2
types-pytz
types_redis>=4.2,<4.3
12 changes: 5 additions & 7 deletions requirements/linting.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# This file is autogenerated by pip-compile with python 3.9
# To update, run:
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile --output-file=requirements/linting.txt requirements/linting.in
#
Expand All @@ -20,9 +20,9 @@ isort[colors]==5.10.1
# via -r requirements/linting.in
mccabe==0.7.0
# via flake8
mypy==0.971
mypy==1.3.0
# via -r requirements/linting.in
mypy-extensions==0.4.3
mypy-extensions==1.0.0
# via
# black
# mypy
Expand All @@ -43,6 +43,4 @@ types-pytz==2022.2.1.0
types-redis==4.2.8
# via -r requirements/linting.in
typing-extensions==4.3.0
# via
# black
# mypy
# via mypy