Skip to content

Commit

Permalink
Merge pull request #1244 from procrastinate-org/renovate/lock-file-ma…
Browse files Browse the repository at this point in the history
…intenance

chore(deps): lock file maintenance
  • Loading branch information
renovate[bot] authored Dec 1, 2024
2 parents dd619a0 + 50d1b61 commit fc23262
Show file tree
Hide file tree
Showing 28 changed files with 114 additions and 158 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ jobs:
strategy:
matrix:
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
Expand Down
4 changes: 1 addition & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,13 @@ repos:
- croniter==5.0.1
- django-stubs==5.1.1
- django==5.1.3
- importlib-resources==6.4.5
- psycopg2-binary==2.9.10
- psycopg[pool]==3.2.3
- python-dateutil==2.9.0.post0
- sphinx==7.1.2
- sqlalchemy==2.0.36
- typing-extensions==4.12.2
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.4
rev: v0.8.1
hooks:
- id: ruff
args: [--fix, --unsafe-fixes]
Expand Down
141 changes: 58 additions & 83 deletions poetry.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions procrastinate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@

__all__ = [
"App",
"Blueprint",
"JobContext",
"BaseConnector",
"BaseRetryStrategy",
"Blueprint",
"JobContext",
"PsycopgConnector",
"SyncPsycopgConnector",
"RetryDecision",
"RetryStrategy",
"SyncPsycopgConnector",
]


Expand Down
3 changes: 2 additions & 1 deletion procrastinate/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
import contextlib
import functools
import logging
from typing import TYPE_CHECKING, Any, Iterable, Iterator
from collections.abc import Iterable, Iterator
from typing import TYPE_CHECKING, Any

from procrastinate import blueprints, exceptions, jobs, manager, schema, utils
from procrastinate import connector as connector_module
Expand Down
3 changes: 2 additions & 1 deletion procrastinate/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
import os
import shlex
import sys
from typing import Any, Awaitable, Callable, Literal, Union
from collections.abc import Awaitable
from typing import Any, Callable, Literal, Union

import procrastinate
from procrastinate import connector, exceptions, jobs, shell, types, utils, worker
Expand Down
3 changes: 2 additions & 1 deletion procrastinate/connector.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from __future__ import annotations

import asyncio
from typing import Any, Callable, Iterable
from collections.abc import Iterable
from typing import Any, Callable

from typing_extensions import LiteralString

Expand Down
3 changes: 2 additions & 1 deletion procrastinate/contrib/aiopg/aiopg_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
import asyncio
import functools
import logging
from typing import Any, AsyncGenerator, Callable, Coroutine, Iterable
from collections.abc import AsyncGenerator, Coroutine, Iterable
from typing import Any, Callable

import aiopg
import psycopg2
Expand Down
2 changes: 1 addition & 1 deletion procrastinate/contrib/django/apps.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from typing import Iterable
from collections.abc import Iterable

from django import apps
from django.utils import module_loading
Expand Down
3 changes: 1 addition & 2 deletions procrastinate/contrib/django/django_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

import asyncio
import contextlib
from collections.abc import Generator, Iterable
from typing import (
TYPE_CHECKING,
Any,
Generator,
Iterable,
)

import asgiref.sync
Expand Down
14 changes: 2 additions & 12 deletions procrastinate/contrib/django/migrations_utils.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,12 @@
from __future__ import annotations

import functools
import sys
from typing import TYPE_CHECKING
import importlib.resources as importlib_resources

from django.db import migrations

if TYPE_CHECKING:
import importlib_resources
else:
# https://github.com/pypa/twine/pull/551
if sys.version_info[:2] < (3, 9): # coverage: exclude
import importlib_resources
else: # coverage: exclude
import importlib.resources as importlib_resources


@functools.lru_cache(maxsize=None)
@functools.cache
def list_migration_files() -> dict[str, str]:
"""
Returns a list of filenames and file contents for all migration files
Expand Down
2 changes: 1 addition & 1 deletion procrastinate/contrib/django/procrastinate_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class FutureApp(blueprints.Blueprint):
]
)
for method in _shadowed_methods:
locals()[method] = functools.partial(_not_ready, method)
locals()[method] = staticmethod(functools.partial(_not_ready, method))


class ProxyApp:
Expand Down
3 changes: 2 additions & 1 deletion procrastinate/contrib/psycopg2/psycopg2_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
import contextlib
import functools
import logging
from typing import Any, Callable, Generator, Iterator
from collections.abc import Generator, Iterator
from typing import Any, Callable

import psycopg2
import psycopg2.errors
Expand Down
3 changes: 2 additions & 1 deletion procrastinate/contrib/sqlalchemy/psycopg2_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
import contextlib
import functools
import re
from typing import Any, Callable, Generator, Mapping
from collections.abc import Generator, Mapping
from typing import Any, Callable

import psycopg2.errors
import sqlalchemy
Expand Down
3 changes: 2 additions & 1 deletion procrastinate/job_context.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from __future__ import annotations

import time
from typing import Any, Iterable
from collections.abc import Iterable
from typing import Any

import attr

Expand Down
3 changes: 2 additions & 1 deletion procrastinate/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
import asyncio
import datetime
import logging
from typing import Any, Iterable, NoReturn
from collections.abc import Iterable
from typing import Any, NoReturn

from procrastinate import connector, exceptions, jobs, sql, utils

Expand Down
2 changes: 1 addition & 1 deletion procrastinate/metadata.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

import importlib.metadata as importlib_metadata
from typing import Mapping
from collections.abc import Mapping


def extract_metadata() -> Mapping[str, str]:
Expand Down
5 changes: 3 additions & 2 deletions procrastinate/periodic.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
import functools
import logging
import time
from typing import Callable, Generic, Iterable, Tuple, cast
from collections.abc import Iterable
from typing import Callable, Generic, cast

import attr
import croniter
Expand Down Expand Up @@ -40,7 +41,7 @@ def croniter(self) -> croniter.croniter:
return croniter.croniter(self.cron)


TaskAtTime = Tuple[PeriodicTask, int]
TaskAtTime = tuple[PeriodicTask, int]


class PeriodicRegistry:
Expand Down
4 changes: 1 addition & 3 deletions procrastinate/psycopg_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
import asyncio
import contextlib
import logging
from collections.abc import AsyncGenerator, AsyncIterator, Iterable
from typing import (
TYPE_CHECKING,
Any,
AsyncGenerator,
AsyncIterator,
Callable,
Iterable,
)

from typing_extensions import LiteralString
Expand Down
3 changes: 2 additions & 1 deletion procrastinate/retry.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

import datetime
import warnings
from typing import Iterable, Union, overload
from collections.abc import Iterable
from typing import Union, overload

import attr

Expand Down
13 changes: 2 additions & 11 deletions procrastinate/schema.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
from __future__ import annotations

import importlib.resources as importlib_resources
import pathlib
import sys
from typing import TYPE_CHECKING, cast
from typing import cast

from typing_extensions import LiteralString

if TYPE_CHECKING:
import importlib_resources
else:
# https://github.com/pypa/twine/pull/551
if sys.version_info[:2] < (3, 9): # coverage: exclude
import importlib_resources
else: # coverage: exclude
import importlib.resources as importlib_resources

from procrastinate import connector as connector_module

migrations_path = pathlib.Path(__file__).parent / "sql" / "migrations"
Expand Down
13 changes: 2 additions & 11 deletions procrastinate/sql/__init__.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
from __future__ import annotations

import importlib.resources as importlib_resources
import re
import sys
from typing import TYPE_CHECKING, cast
from typing import cast

from typing_extensions import LiteralString

if TYPE_CHECKING:
import importlib_resources
else:
# https://github.com/pypa/twine/pull/551
if sys.version_info[:2] < (3, 9): # coverage: exclude
import importlib_resources
else: # coverage: exclude
import importlib.resources as importlib_resources

QUERIES_REGEX = re.compile(r"(?:\n|^)-- ([a-z0-9_]+) --\n(?:-- .+\n)*", re.MULTILINE)


Expand Down
3 changes: 2 additions & 1 deletion procrastinate/sync_psycopg_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

import contextlib
import logging
from typing import Any, Callable, Generator, Iterator
from collections.abc import Generator, Iterator
from typing import Any, Callable

import psycopg
import psycopg.rows
Expand Down
7 changes: 4 additions & 3 deletions procrastinate/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
import asyncio
import datetime
from collections import Counter
from collections.abc import Iterable
from itertools import count
from typing import Any, Dict, Iterable
from typing import Any

from procrastinate import connector, exceptions, schema, sql, types, utils

JobRow = Dict[str, Any]
EventRow = Dict[str, Any]
JobRow = dict[str, Any]
EventRow = dict[str, Any]


class InMemoryConnector(connector.BaseAsyncConnector):
Expand Down
4 changes: 2 additions & 2 deletions procrastinate/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

from typing_extensions import NotRequired

JSONValue = t.Union[str, int, float, bool, None, t.Dict[str, t.Any], t.List[t.Any]]
JSONDict = t.Dict[str, JSONValue]
JSONValue = t.Union[str, int, float, bool, None, dict[str, t.Any], list[t.Any]]
JSONDict = dict[str, JSONValue]


class TimeDeltaParams(t.TypedDict):
Expand Down
10 changes: 6 additions & 4 deletions procrastinate/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@
import pathlib
import sys
import types
from typing import (
Any,
from collections.abc import (
AsyncGenerator,
AsyncIterator,
Awaitable,
Callable,
Coroutine,
Generic,
Iterable,
)
from typing import (
Any,
Callable,
Generic,
TypeVar,
)

Expand Down
3 changes: 2 additions & 1 deletion procrastinate/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
import inspect
import logging
import time
from collections.abc import Awaitable, Iterable
from enum import Enum
from typing import Any, Awaitable, Callable, Iterable
from typing import Any, Callable

from procrastinate import (
app,
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,18 @@ documentation = "https://procrastinate.readthedocs.io/"
procrastinate = 'procrastinate.cli:main'

[tool.poetry.dependencies]
python = "^3.8"
python = "^3.9"
aiopg = { version = "*", optional = true }
anyio = "*"
asgiref = "*"
attrs = "*"
contextlib2 = { version = "*", python = "<3.10" }
croniter = "*"
django = { version = ">=2.2", optional = true }
importlib-resources = { version = ">=1.4", python = "<3.9" }
psycopg = { extras = ["pool"], version = "*" }
psycopg2-binary = { version = "*", optional = true }
python-dateutil = "*"
sqlalchemy = { version = "^2.0", optional = true }
typing-extensions = { version = "*", python = "<3.8" }
sphinx = { version = "*", optional = true }

[tool.poetry.extras]
Expand Down Expand Up @@ -79,7 +77,7 @@ psycopg = [
[tool.poetry.group.django.dependencies]
django = [
{ version = "4.2.*", python = "<3.10" },
{ version = "*", python = "^3.10" },
{ version = "*", python = ">=3.10" },
]

[tool.poetry.group.test.dependencies]
Expand Down Expand Up @@ -127,6 +125,7 @@ filterwarnings = """
ignore:unclosed.+:ResourceWarning
"""
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
DJANGO_SETTINGS_MODULE = "tests.acceptance.django_settings"


Expand All @@ -152,6 +151,7 @@ exclude_lines = [
exclude = ["tests", ".venv"]

[tool.ruff]
target-version = "py39"
extend-exclude = [".venv"]

[tool.ruff.lint]
Expand Down

0 comments on commit fc23262

Please sign in to comment.