From a02c490a4f88ad24f368758a3fef0153d3d348e6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 01:23:34 +0000 Subject: [PATCH 1/6] chore(deps): lock file maintenance --- poetry.lock | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/poetry.lock b/poetry.lock index da731a608..a87dbad26 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1397,29 +1397,29 @@ use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] [[package]] name = "ruff" -version = "0.7.4" +version = "0.8.0" description = "An extremely fast Python linter and code formatter, written in Rust." optional = false python-versions = ">=3.7" files = [ - {file = "ruff-0.7.4-py3-none-linux_armv6l.whl", hash = "sha256:a4919925e7684a3f18e18243cd6bea7cfb8e968a6eaa8437971f681b7ec51478"}, - {file = "ruff-0.7.4-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:cfb365c135b830778dda8c04fb7d4280ed0b984e1aec27f574445231e20d6c63"}, - {file = "ruff-0.7.4-py3-none-macosx_11_0_arm64.whl", hash = "sha256:63a569b36bc66fbadec5beaa539dd81e0527cb258b94e29e0531ce41bacc1f20"}, - {file = "ruff-0.7.4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0d06218747d361d06fd2fdac734e7fa92df36df93035db3dc2ad7aa9852cb109"}, - {file = "ruff-0.7.4-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e0cea28d0944f74ebc33e9f934238f15c758841f9f5edd180b5315c203293452"}, - {file = "ruff-0.7.4-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:80094ecd4793c68b2571b128f91754d60f692d64bc0d7272ec9197fdd09bf9ea"}, - {file = "ruff-0.7.4-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:997512325c6620d1c4c2b15db49ef59543ef9cd0f4aa8065ec2ae5103cedc7e7"}, - {file = "ruff-0.7.4-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:00b4cf3a6b5fad6d1a66e7574d78956bbd09abfd6c8a997798f01f5da3d46a05"}, - {file = "ruff-0.7.4-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7dbdc7d8274e1422722933d1edddfdc65b4336abf0b16dfcb9dedd6e6a517d06"}, - {file = "ruff-0.7.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0e92dfb5f00eaedb1501b2f906ccabfd67b2355bdf117fea9719fc99ac2145bc"}, - {file = "ruff-0.7.4-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:3bd726099f277d735dc38900b6a8d6cf070f80828877941983a57bca1cd92172"}, - {file = "ruff-0.7.4-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:2e32829c429dd081ee5ba39aef436603e5b22335c3d3fff013cd585806a6486a"}, - {file = "ruff-0.7.4-py3-none-musllinux_1_2_i686.whl", hash = "sha256:662a63b4971807623f6f90c1fb664613f67cc182dc4d991471c23c541fee62dd"}, - {file = "ruff-0.7.4-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:876f5e09eaae3eb76814c1d3b68879891d6fde4824c015d48e7a7da4cf066a3a"}, - {file = "ruff-0.7.4-py3-none-win32.whl", hash = "sha256:75c53f54904be42dd52a548728a5b572344b50d9b2873d13a3f8c5e3b91f5cac"}, - {file = "ruff-0.7.4-py3-none-win_amd64.whl", hash = "sha256:745775c7b39f914238ed1f1b0bebed0b9155a17cd8bc0b08d3c87e4703b990d6"}, - {file = "ruff-0.7.4-py3-none-win_arm64.whl", hash = "sha256:11bff065102c3ae9d3ea4dc9ecdfe5a5171349cdd0787c1fc64761212fc9cf1f"}, - {file = "ruff-0.7.4.tar.gz", hash = "sha256:cd12e35031f5af6b9b93715d8c4f40360070b2041f81273d0527683d5708fce2"}, + {file = "ruff-0.8.0-py3-none-linux_armv6l.whl", hash = "sha256:fcb1bf2cc6706adae9d79c8d86478677e3bbd4ced796ccad106fd4776d395fea"}, + {file = "ruff-0.8.0-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:295bb4c02d58ff2ef4378a1870c20af30723013f441c9d1637a008baaf928c8b"}, + {file = "ruff-0.8.0-py3-none-macosx_11_0_arm64.whl", hash = "sha256:7b1f1c76b47c18fa92ee78b60d2d20d7e866c55ee603e7d19c1e991fad933a9a"}, + {file = "ruff-0.8.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:eb0d4f250a7711b67ad513fde67e8870109e5ce590a801c3722580fe98c33a99"}, + {file = "ruff-0.8.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:0e55cce9aa93c5d0d4e3937e47b169035c7e91c8655b0974e61bb79cf398d49c"}, + {file = "ruff-0.8.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3f4cd64916d8e732ce6b87f3f5296a8942d285bbbc161acee7fe561134af64f9"}, + {file = "ruff-0.8.0-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:c5c1466be2a2ebdf7c5450dd5d980cc87c8ba6976fb82582fea18823da6fa362"}, + {file = "ruff-0.8.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2dabfd05b96b7b8f2da00d53c514eea842bff83e41e1cceb08ae1966254a51df"}, + {file = "ruff-0.8.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:facebdfe5a5af6b1588a1d26d170635ead6892d0e314477e80256ef4a8470cf3"}, + {file = "ruff-0.8.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:87a8e86bae0dbd749c815211ca11e3a7bd559b9710746c559ed63106d382bd9c"}, + {file = "ruff-0.8.0-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:85e654f0ded7befe2d61eeaf3d3b1e4ef3894469cd664ffa85006c7720f1e4a2"}, + {file = "ruff-0.8.0-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:83a55679c4cb449fa527b8497cadf54f076603cc36779b2170b24f704171ce70"}, + {file = "ruff-0.8.0-py3-none-musllinux_1_2_i686.whl", hash = "sha256:812e2052121634cf13cd6fddf0c1871d0ead1aad40a1a258753c04c18bb71bbd"}, + {file = "ruff-0.8.0-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:780d5d8523c04202184405e60c98d7595bdb498c3c6abba3b6d4cdf2ca2af426"}, + {file = "ruff-0.8.0-py3-none-win32.whl", hash = "sha256:5fdb6efecc3eb60bba5819679466471fd7d13c53487df7248d6e27146e985468"}, + {file = "ruff-0.8.0-py3-none-win_amd64.whl", hash = "sha256:582891c57b96228d146725975fbb942e1f30a0c4ba19722e692ca3eb25cc9b4f"}, + {file = "ruff-0.8.0-py3-none-win_arm64.whl", hash = "sha256:ba93e6294e9a737cd726b74b09a6972e36bb511f9a102f1d9a7e1ce94dd206a6"}, + {file = "ruff-0.8.0.tar.gz", hash = "sha256:a7ccfe6331bf8c8dad715753e157457faf7351c2b69f62f32c165c2dbcbacd44"}, ] [[package]] From 64fa321cd30b41b66a55bfd11d87066a11c85cc7 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 01:23:44 +0000 Subject: [PATCH 2/6] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a1bc3752b..2e385c61c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -49,7 +49,7 @@ repos: - 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.0 hooks: - id: ruff args: [--fix, --unsafe-fixes] From f988bcbc3ebe01f3ae52333e186c1e787c94a0b9 Mon Sep 17 00:00:00 2001 From: Joachim Jablon Date: Sun, 1 Dec 2024 22:35:32 +0100 Subject: [PATCH 3/6] Upgrade --- .pre-commit-config.yaml | 2 +- poetry.lock | 82 +++++++++++++------ procrastinate/__init__.py | 6 +- procrastinate/app.py | 3 +- procrastinate/cli.py | 3 +- procrastinate/connector.py | 3 +- .../contrib/aiopg/aiopg_connector.py | 3 +- procrastinate/contrib/django/apps.py | 2 +- .../contrib/django/django_connector.py | 3 +- .../contrib/django/migrations_utils.py | 8 +- .../contrib/psycopg2/psycopg2_connector.py | 3 +- .../contrib/sqlalchemy/psycopg2_connector.py | 3 +- procrastinate/job_context.py | 3 +- procrastinate/manager.py | 3 +- procrastinate/metadata.py | 2 +- procrastinate/periodic.py | 5 +- procrastinate/psycopg_connector.py | 4 +- procrastinate/retry.py | 3 +- procrastinate/schema.py | 6 +- procrastinate/sql/__init__.py | 6 +- procrastinate/sync_psycopg_connector.py | 3 +- procrastinate/testing.py | 7 +- procrastinate/types.py | 4 +- procrastinate/utils.py | 10 ++- procrastinate/worker.py | 3 +- 25 files changed, 105 insertions(+), 75 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2e385c61c..05d3827dd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -49,7 +49,7 @@ repos: - sqlalchemy==2.0.36 - typing-extensions==4.12.2 - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.8.0 + rev: v0.8.1 hooks: - id: ruff args: [--fix, --unsafe-fixes] diff --git a/poetry.lock b/poetry.lock index a87dbad26..4606db976 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.4 and should not be changed by hand. [[package]] name = "aiopg" @@ -1196,13 +1196,13 @@ windows-terminal = ["colorama (>=0.4.6)"] [[package]] name = "pytest" -version = "8.3.3" +version = "8.3.4" description = "pytest: simple powerful testing with Python" optional = false python-versions = ">=3.8" files = [ - {file = "pytest-8.3.3-py3-none-any.whl", hash = "sha256:a6853c7375b2663155079443d2e45de913a911a11d669df02a50814944db57b2"}, - {file = "pytest-8.3.3.tar.gz", hash = "sha256:70b98107bd648308a7952b06e6ca9a50bc660be218d53c257cc1fc94fda10181"}, + {file = "pytest-8.3.4-py3-none-any.whl", hash = "sha256:50e16d954148559c9a74109af1eaf0c945ba2d8f30f0a3d3335edde19788b6f6"}, + {file = "pytest-8.3.4.tar.gz", hash = "sha256:965370d062bce11e73868e0335abac31b4d3de0e82f4007408d242b4f8610761"}, ] [package.dependencies] @@ -1397,29 +1397,29 @@ use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] [[package]] name = "ruff" -version = "0.8.0" +version = "0.8.1" description = "An extremely fast Python linter and code formatter, written in Rust." optional = false python-versions = ">=3.7" files = [ - {file = "ruff-0.8.0-py3-none-linux_armv6l.whl", hash = "sha256:fcb1bf2cc6706adae9d79c8d86478677e3bbd4ced796ccad106fd4776d395fea"}, - {file = "ruff-0.8.0-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:295bb4c02d58ff2ef4378a1870c20af30723013f441c9d1637a008baaf928c8b"}, - {file = "ruff-0.8.0-py3-none-macosx_11_0_arm64.whl", hash = "sha256:7b1f1c76b47c18fa92ee78b60d2d20d7e866c55ee603e7d19c1e991fad933a9a"}, - {file = "ruff-0.8.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:eb0d4f250a7711b67ad513fde67e8870109e5ce590a801c3722580fe98c33a99"}, - {file = "ruff-0.8.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:0e55cce9aa93c5d0d4e3937e47b169035c7e91c8655b0974e61bb79cf398d49c"}, - {file = "ruff-0.8.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3f4cd64916d8e732ce6b87f3f5296a8942d285bbbc161acee7fe561134af64f9"}, - {file = "ruff-0.8.0-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:c5c1466be2a2ebdf7c5450dd5d980cc87c8ba6976fb82582fea18823da6fa362"}, - {file = "ruff-0.8.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2dabfd05b96b7b8f2da00d53c514eea842bff83e41e1cceb08ae1966254a51df"}, - {file = "ruff-0.8.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:facebdfe5a5af6b1588a1d26d170635ead6892d0e314477e80256ef4a8470cf3"}, - {file = "ruff-0.8.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:87a8e86bae0dbd749c815211ca11e3a7bd559b9710746c559ed63106d382bd9c"}, - {file = "ruff-0.8.0-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:85e654f0ded7befe2d61eeaf3d3b1e4ef3894469cd664ffa85006c7720f1e4a2"}, - {file = "ruff-0.8.0-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:83a55679c4cb449fa527b8497cadf54f076603cc36779b2170b24f704171ce70"}, - {file = "ruff-0.8.0-py3-none-musllinux_1_2_i686.whl", hash = "sha256:812e2052121634cf13cd6fddf0c1871d0ead1aad40a1a258753c04c18bb71bbd"}, - {file = "ruff-0.8.0-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:780d5d8523c04202184405e60c98d7595bdb498c3c6abba3b6d4cdf2ca2af426"}, - {file = "ruff-0.8.0-py3-none-win32.whl", hash = "sha256:5fdb6efecc3eb60bba5819679466471fd7d13c53487df7248d6e27146e985468"}, - {file = "ruff-0.8.0-py3-none-win_amd64.whl", hash = "sha256:582891c57b96228d146725975fbb942e1f30a0c4ba19722e692ca3eb25cc9b4f"}, - {file = "ruff-0.8.0-py3-none-win_arm64.whl", hash = "sha256:ba93e6294e9a737cd726b74b09a6972e36bb511f9a102f1d9a7e1ce94dd206a6"}, - {file = "ruff-0.8.0.tar.gz", hash = "sha256:a7ccfe6331bf8c8dad715753e157457faf7351c2b69f62f32c165c2dbcbacd44"}, + {file = "ruff-0.8.1-py3-none-linux_armv6l.whl", hash = "sha256:fae0805bd514066f20309f6742f6ee7904a773eb9e6c17c45d6b1600ca65c9b5"}, + {file = "ruff-0.8.1-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:b8a4f7385c2285c30f34b200ca5511fcc865f17578383db154e098150ce0a087"}, + {file = "ruff-0.8.1-py3-none-macosx_11_0_arm64.whl", hash = "sha256:cd054486da0c53e41e0086e1730eb77d1f698154f910e0cd9e0d64274979a209"}, + {file = "ruff-0.8.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2029b8c22da147c50ae577e621a5bfbc5d1fed75d86af53643d7a7aee1d23871"}, + {file = "ruff-0.8.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:2666520828dee7dfc7e47ee4ea0d928f40de72056d929a7c5292d95071d881d1"}, + {file = "ruff-0.8.1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:333c57013ef8c97a53892aa56042831c372e0bb1785ab7026187b7abd0135ad5"}, + {file = "ruff-0.8.1-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:288326162804f34088ac007139488dcb43de590a5ccfec3166396530b58fb89d"}, + {file = "ruff-0.8.1-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b12c39b9448632284561cbf4191aa1b005882acbc81900ffa9f9f471c8ff7e26"}, + {file = "ruff-0.8.1-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:364e6674450cbac8e998f7b30639040c99d81dfb5bbc6dfad69bc7a8f916b3d1"}, + {file = "ruff-0.8.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b22346f845fec132aa39cd29acb94451d030c10874408dbf776af3aaeb53284c"}, + {file = "ruff-0.8.1-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:b2f2f7a7e7648a2bfe6ead4e0a16745db956da0e3a231ad443d2a66a105c04fa"}, + {file = "ruff-0.8.1-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:adf314fc458374c25c5c4a4a9270c3e8a6a807b1bec018cfa2813d6546215540"}, + {file = "ruff-0.8.1-py3-none-musllinux_1_2_i686.whl", hash = "sha256:a885d68342a231b5ba4d30b8c6e1b1ee3a65cf37e3d29b3c74069cdf1ee1e3c9"}, + {file = "ruff-0.8.1-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:d2c16e3508c8cc73e96aa5127d0df8913d2290098f776416a4b157657bee44c5"}, + {file = "ruff-0.8.1-py3-none-win32.whl", hash = "sha256:93335cd7c0eaedb44882d75a7acb7df4b77cd7cd0d2255c93b28791716e81790"}, + {file = "ruff-0.8.1-py3-none-win_amd64.whl", hash = "sha256:2954cdbe8dfd8ab359d4a30cd971b589d335a44d444b6ca2cb3d1da21b75e4b6"}, + {file = "ruff-0.8.1-py3-none-win_arm64.whl", hash = "sha256:55873cc1a473e5ac129d15eccb3c008c096b94809d693fc7053f588b67822737"}, + {file = "ruff-0.8.1.tar.gz", hash = "sha256:3583db9a6450364ed5ca3f3b4225958b24f78178908d5c4bc0f46251ccca898f"}, ] [[package]] @@ -1823,13 +1823,43 @@ doc = ["sphinx"] [[package]] name = "tomli" -version = "2.1.0" +version = "2.2.1" description = "A lil' TOML parser" optional = false python-versions = ">=3.8" files = [ - {file = "tomli-2.1.0-py3-none-any.whl", hash = "sha256:a5c57c3d1c56f5ccdf89f6523458f60ef716e210fc47c4cfb188c5ba473e0391"}, - {file = "tomli-2.1.0.tar.gz", hash = "sha256:3f646cae2aec94e17d04973e4249548320197cfabdf130015d023de4b74d8ab8"}, + {file = "tomli-2.2.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:678e4fa69e4575eb77d103de3df8a895e1591b48e740211bd1067378c69e8249"}, + {file = "tomli-2.2.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:023aa114dd824ade0100497eb2318602af309e5a55595f76b626d6d9f3b7b0a6"}, + {file = "tomli-2.2.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ece47d672db52ac607a3d9599a9d48dcb2f2f735c6c2d1f34130085bb12b112a"}, + {file = "tomli-2.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6972ca9c9cc9f0acaa56a8ca1ff51e7af152a9f87fb64623e31d5c83700080ee"}, + {file = "tomli-2.2.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c954d2250168d28797dd4e3ac5cf812a406cd5a92674ee4c8f123c889786aa8e"}, + {file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:8dd28b3e155b80f4d54beb40a441d366adcfe740969820caf156c019fb5c7ec4"}, + {file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:e59e304978767a54663af13c07b3d1af22ddee3bb2fb0618ca1593e4f593a106"}, + {file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:33580bccab0338d00994d7f16f4c4ec25b776af3ffaac1ed74e0b3fc95e885a8"}, + {file = "tomli-2.2.1-cp311-cp311-win32.whl", hash = "sha256:465af0e0875402f1d226519c9904f37254b3045fc5084697cefb9bdde1ff99ff"}, + {file = "tomli-2.2.1-cp311-cp311-win_amd64.whl", hash = "sha256:2d0f2fdd22b02c6d81637a3c95f8cd77f995846af7414c5c4b8d0545afa1bc4b"}, + {file = "tomli-2.2.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:4a8f6e44de52d5e6c657c9fe83b562f5f4256d8ebbfe4ff922c495620a7f6cea"}, + {file = "tomli-2.2.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:8d57ca8095a641b8237d5b079147646153d22552f1c637fd3ba7f4b0b29167a8"}, + {file = "tomli-2.2.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4e340144ad7ae1533cb897d406382b4b6fede8890a03738ff1683af800d54192"}, + {file = "tomli-2.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:db2b95f9de79181805df90bedc5a5ab4c165e6ec3fe99f970d0e302f384ad222"}, + {file = "tomli-2.2.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:40741994320b232529c802f8bc86da4e1aa9f413db394617b9a256ae0f9a7f77"}, + {file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:400e720fe168c0f8521520190686ef8ef033fb19fc493da09779e592861b78c6"}, + {file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:02abe224de6ae62c19f090f68da4e27b10af2b93213d36cf44e6e1c5abd19fdd"}, + {file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:b82ebccc8c8a36f2094e969560a1b836758481f3dc360ce9a3277c65f374285e"}, + {file = "tomli-2.2.1-cp312-cp312-win32.whl", hash = "sha256:889f80ef92701b9dbb224e49ec87c645ce5df3fa2cc548664eb8a25e03127a98"}, + {file = "tomli-2.2.1-cp312-cp312-win_amd64.whl", hash = "sha256:7fc04e92e1d624a4a63c76474610238576942d6b8950a2d7f908a340494e67e4"}, + {file = "tomli-2.2.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:f4039b9cbc3048b2416cc57ab3bda989a6fcf9b36cf8937f01a6e731b64f80d7"}, + {file = "tomli-2.2.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:286f0ca2ffeeb5b9bd4fcc8d6c330534323ec51b2f52da063b11c502da16f30c"}, + {file = "tomli-2.2.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a92ef1a44547e894e2a17d24e7557a5e85a9e1d0048b0b5e7541f76c5032cb13"}, + {file = "tomli-2.2.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9316dc65bed1684c9a98ee68759ceaed29d229e985297003e494aa825ebb0281"}, + {file = "tomli-2.2.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e85e99945e688e32d5a35c1ff38ed0b3f41f43fad8df0bdf79f72b2ba7bc5272"}, + {file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:ac065718db92ca818f8d6141b5f66369833d4a80a9d74435a268c52bdfa73140"}, + {file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:d920f33822747519673ee656a4b6ac33e382eca9d331c87770faa3eef562aeb2"}, + {file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:a198f10c4d1b1375d7687bc25294306e551bf1abfa4eace6650070a5c1ae2744"}, + {file = "tomli-2.2.1-cp313-cp313-win32.whl", hash = "sha256:d3f5614314d758649ab2ab3a62d4f2004c825922f9e370b29416484086b264ec"}, + {file = "tomli-2.2.1-cp313-cp313-win_amd64.whl", hash = "sha256:a38aa0308e754b0e3c67e344754dff64999ff9b513e691d0e786265c93583c69"}, + {file = "tomli-2.2.1-py3-none-any.whl", hash = "sha256:cb55c73c5f4408779d0cf3eef9f762b9c9f147a77de7b258bef0a5628adc85cc"}, + {file = "tomli-2.2.1.tar.gz", hash = "sha256:cd45e1dc79c835ce60f7404ec8119f2eb06d38b1deba146f07ced3bbc44505ff"}, ] [[package]] diff --git a/procrastinate/__init__.py b/procrastinate/__init__.py index d0dbffb78..4c4cc0f1b 100644 --- a/procrastinate/__init__.py +++ b/procrastinate/__init__.py @@ -21,14 +21,14 @@ __all__ = [ "App", - "Blueprint", - "JobContext", "BaseConnector", "BaseRetryStrategy", + "Blueprint", + "JobContext", "PsycopgConnector", - "SyncPsycopgConnector", "RetryDecision", "RetryStrategy", + "SyncPsycopgConnector", ] diff --git a/procrastinate/app.py b/procrastinate/app.py index 072aa5738..ebd1b0705 100644 --- a/procrastinate/app.py +++ b/procrastinate/app.py @@ -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 diff --git a/procrastinate/cli.py b/procrastinate/cli.py index 0910352f3..33cc281ab 100644 --- a/procrastinate/cli.py +++ b/procrastinate/cli.py @@ -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 diff --git a/procrastinate/connector.py b/procrastinate/connector.py index 50615d2b4..941b5b191 100644 --- a/procrastinate/connector.py +++ b/procrastinate/connector.py @@ -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 diff --git a/procrastinate/contrib/aiopg/aiopg_connector.py b/procrastinate/contrib/aiopg/aiopg_connector.py index c3ef93976..4a8a0c015 100644 --- a/procrastinate/contrib/aiopg/aiopg_connector.py +++ b/procrastinate/contrib/aiopg/aiopg_connector.py @@ -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 diff --git a/procrastinate/contrib/django/apps.py b/procrastinate/contrib/django/apps.py index 6ea960947..a436cebd2 100644 --- a/procrastinate/contrib/django/apps.py +++ b/procrastinate/contrib/django/apps.py @@ -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 diff --git a/procrastinate/contrib/django/django_connector.py b/procrastinate/contrib/django/django_connector.py index 909c7ac8b..6196e5401 100644 --- a/procrastinate/contrib/django/django_connector.py +++ b/procrastinate/contrib/django/django_connector.py @@ -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 diff --git a/procrastinate/contrib/django/migrations_utils.py b/procrastinate/contrib/django/migrations_utils.py index 1b3ff018b..7230b8cb5 100644 --- a/procrastinate/contrib/django/migrations_utils.py +++ b/procrastinate/contrib/django/migrations_utils.py @@ -1,7 +1,6 @@ from __future__ import annotations import functools -import sys from typing import TYPE_CHECKING from django.db import migrations @@ -10,13 +9,10 @@ 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 + 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 diff --git a/procrastinate/contrib/psycopg2/psycopg2_connector.py b/procrastinate/contrib/psycopg2/psycopg2_connector.py index bb847e95d..fb38999ab 100644 --- a/procrastinate/contrib/psycopg2/psycopg2_connector.py +++ b/procrastinate/contrib/psycopg2/psycopg2_connector.py @@ -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 diff --git a/procrastinate/contrib/sqlalchemy/psycopg2_connector.py b/procrastinate/contrib/sqlalchemy/psycopg2_connector.py index e80ecc5c4..1459c5caa 100644 --- a/procrastinate/contrib/sqlalchemy/psycopg2_connector.py +++ b/procrastinate/contrib/sqlalchemy/psycopg2_connector.py @@ -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 diff --git a/procrastinate/job_context.py b/procrastinate/job_context.py index df25f0cc5..77052ce63 100644 --- a/procrastinate/job_context.py +++ b/procrastinate/job_context.py @@ -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 diff --git a/procrastinate/manager.py b/procrastinate/manager.py index d77261f17..100c48218 100644 --- a/procrastinate/manager.py +++ b/procrastinate/manager.py @@ -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 diff --git a/procrastinate/metadata.py b/procrastinate/metadata.py index 874b1d70e..42589e26e 100644 --- a/procrastinate/metadata.py +++ b/procrastinate/metadata.py @@ -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]: diff --git a/procrastinate/periodic.py b/procrastinate/periodic.py index 78048bffb..94f4cd83a 100644 --- a/procrastinate/periodic.py +++ b/procrastinate/periodic.py @@ -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 @@ -40,7 +41,7 @@ def croniter(self) -> croniter.croniter: return croniter.croniter(self.cron) -TaskAtTime = Tuple[PeriodicTask, int] +TaskAtTime = tuple[PeriodicTask, int] class PeriodicRegistry: diff --git a/procrastinate/psycopg_connector.py b/procrastinate/psycopg_connector.py index 90a07fd28..b990849c1 100644 --- a/procrastinate/psycopg_connector.py +++ b/procrastinate/psycopg_connector.py @@ -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 diff --git a/procrastinate/retry.py b/procrastinate/retry.py index a07341666..c1e43e947 100644 --- a/procrastinate/retry.py +++ b/procrastinate/retry.py @@ -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 diff --git a/procrastinate/schema.py b/procrastinate/schema.py index b32aef2bd..ebb8c9983 100644 --- a/procrastinate/schema.py +++ b/procrastinate/schema.py @@ -1,7 +1,6 @@ from __future__ import annotations import pathlib -import sys from typing import TYPE_CHECKING, cast from typing_extensions import LiteralString @@ -10,10 +9,7 @@ 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 + import importlib.resources as importlib_resources from procrastinate import connector as connector_module diff --git a/procrastinate/sql/__init__.py b/procrastinate/sql/__init__.py index fd4c42ccf..4bd99528a 100644 --- a/procrastinate/sql/__init__.py +++ b/procrastinate/sql/__init__.py @@ -1,7 +1,6 @@ from __future__ import annotations import re -import sys from typing import TYPE_CHECKING, cast from typing_extensions import LiteralString @@ -10,10 +9,7 @@ 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 + import importlib.resources as importlib_resources QUERIES_REGEX = re.compile(r"(?:\n|^)-- ([a-z0-9_]+) --\n(?:-- .+\n)*", re.MULTILINE) diff --git a/procrastinate/sync_psycopg_connector.py b/procrastinate/sync_psycopg_connector.py index c16489d89..e8905647b 100644 --- a/procrastinate/sync_psycopg_connector.py +++ b/procrastinate/sync_psycopg_connector.py @@ -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 diff --git a/procrastinate/testing.py b/procrastinate/testing.py index 2bf5e864f..30e898031 100644 --- a/procrastinate/testing.py +++ b/procrastinate/testing.py @@ -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): diff --git a/procrastinate/types.py b/procrastinate/types.py index eb604a4e1..9c373aff9 100644 --- a/procrastinate/types.py +++ b/procrastinate/types.py @@ -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): diff --git a/procrastinate/utils.py b/procrastinate/utils.py index 9e28dc5b6..d438fd359 100644 --- a/procrastinate/utils.py +++ b/procrastinate/utils.py @@ -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, ) diff --git a/procrastinate/worker.py b/procrastinate/worker.py index 1402d8260..4a73fdffd 100644 --- a/procrastinate/worker.py +++ b/procrastinate/worker.py @@ -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, From 14c383788de43f6c54d7fd88b16602fa02121324 Mon Sep 17 00:00:00 2001 From: Joachim Jablon Date: Sun, 1 Dec 2024 22:39:07 +0100 Subject: [PATCH 4/6] Drop support for py3.8 --- .github/workflows/ci.yml | 1 - .pre-commit-config.yaml | 2 - poetry.lock | 59 +------------------ .../contrib/django/migrations_utils.py | 8 +-- procrastinate/schema.py | 9 +-- procrastinate/sql/__init__.py | 9 +-- pyproject.toml | 6 +- 7 files changed, 9 insertions(+), 85 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ee43a70a9..cc4e97b19 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,6 @@ jobs: strategy: matrix: python-version: - - "3.8" - "3.9" - "3.10" - "3.11" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 05d3827dd..34a64b1f4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -41,13 +41,11 @@ 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.8.1 hooks: diff --git a/poetry.lock b/poetry.lock index 4606db976..861187eb8 100644 --- a/poetry.lock +++ b/poetry.lock @@ -109,40 +109,9 @@ files = [ {file = "babel-2.16.0.tar.gz", hash = "sha256:d1f3554ca26605fe173f3de0c65f750f5a42f924499bf134de6423582298e316"}, ] -[package.dependencies] -pytz = {version = ">=2015.7", markers = "python_version < \"3.9\""} - [package.extras] dev = ["freezegun (>=1.0,<2.0)", "pytest (>=6.0)", "pytest-cov"] -[[package]] -name = "backports-zoneinfo" -version = "0.2.1" -description = "Backport of the standard library zoneinfo module" -optional = false -python-versions = ">=3.6" -files = [ - {file = "backports.zoneinfo-0.2.1-cp36-cp36m-macosx_10_14_x86_64.whl", hash = "sha256:da6013fd84a690242c310d77ddb8441a559e9cb3d3d59ebac9aca1a57b2e18bc"}, - {file = "backports.zoneinfo-0.2.1-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:89a48c0d158a3cc3f654da4c2de1ceba85263fafb861b98b59040a5086259722"}, - {file = "backports.zoneinfo-0.2.1-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:1c5742112073a563c81f786e77514969acb58649bcdf6cdf0b4ed31a348d4546"}, - {file = "backports.zoneinfo-0.2.1-cp36-cp36m-win32.whl", hash = "sha256:e8236383a20872c0cdf5a62b554b27538db7fa1bbec52429d8d106effbaeca08"}, - {file = "backports.zoneinfo-0.2.1-cp36-cp36m-win_amd64.whl", hash = "sha256:8439c030a11780786a2002261569bdf362264f605dfa4d65090b64b05c9f79a7"}, - {file = "backports.zoneinfo-0.2.1-cp37-cp37m-macosx_10_14_x86_64.whl", hash = "sha256:f04e857b59d9d1ccc39ce2da1021d196e47234873820cbeaad210724b1ee28ac"}, - {file = "backports.zoneinfo-0.2.1-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:17746bd546106fa389c51dbea67c8b7c8f0d14b5526a579ca6ccf5ed72c526cf"}, - {file = "backports.zoneinfo-0.2.1-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:5c144945a7752ca544b4b78c8c41544cdfaf9786f25fe5ffb10e838e19a27570"}, - {file = "backports.zoneinfo-0.2.1-cp37-cp37m-win32.whl", hash = "sha256:e55b384612d93be96506932a786bbcde5a2db7a9e6a4bb4bffe8b733f5b9036b"}, - {file = "backports.zoneinfo-0.2.1-cp37-cp37m-win_amd64.whl", hash = "sha256:a76b38c52400b762e48131494ba26be363491ac4f9a04c1b7e92483d169f6582"}, - {file = "backports.zoneinfo-0.2.1-cp38-cp38-macosx_10_14_x86_64.whl", hash = "sha256:8961c0f32cd0336fb8e8ead11a1f8cd99ec07145ec2931122faaac1c8f7fd987"}, - {file = "backports.zoneinfo-0.2.1-cp38-cp38-manylinux1_i686.whl", hash = "sha256:e81b76cace8eda1fca50e345242ba977f9be6ae3945af8d46326d776b4cf78d1"}, - {file = "backports.zoneinfo-0.2.1-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:7b0a64cda4145548fed9efc10322770f929b944ce5cee6c0dfe0c87bf4c0c8c9"}, - {file = "backports.zoneinfo-0.2.1-cp38-cp38-win32.whl", hash = "sha256:1b13e654a55cd45672cb54ed12148cd33628f672548f373963b0bff67b217328"}, - {file = "backports.zoneinfo-0.2.1-cp38-cp38-win_amd64.whl", hash = "sha256:4a0f800587060bf8880f954dbef70de6c11bbe59c673c3d818921f042f9954a6"}, - {file = "backports.zoneinfo-0.2.1.tar.gz", hash = "sha256:fadbfe37f74051d024037f223b8e001611eac868b5c5b06144ef4d8b799862f2"}, -] - -[package.extras] -tzdata = ["tzdata"] - [[package]] name = "beautifulsoup4" version = "4.12.3" @@ -426,7 +395,6 @@ files = [ [package.dependencies] asgiref = ">=3.6.0,<4" -"backports.zoneinfo" = {version = "*", markers = "python_version < \"3.9\""} sqlparse = ">=0.3.1" tzdata = {version = "*", markers = "sys_platform == \"win32\""} @@ -683,28 +651,6 @@ perf = ["ipython"] test = ["flufl.flake8", "importlib-resources (>=1.3)", "jaraco.test (>=5.4)", "packaging", "pyfakefs", "pytest (>=6,!=8.1.*)", "pytest-perf (>=0.9.2)"] type = ["pytest-mypy"] -[[package]] -name = "importlib-resources" -version = "6.4.5" -description = "Read resources from Python packages" -optional = false -python-versions = ">=3.8" -files = [ - {file = "importlib_resources-6.4.5-py3-none-any.whl", hash = "sha256:ac29d5f956f01d5e4bb63102a5a19957f1b9175e45649977264a1416783bb717"}, - {file = "importlib_resources-6.4.5.tar.gz", hash = "sha256:980862a1d16c9e147a59603677fa2aa5fd82b87f223b6cb870695bcfce830065"}, -] - -[package.dependencies] -zipp = {version = ">=3.1.0", markers = "python_version < \"3.10\""} - -[package.extras] -check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1)"] -cover = ["pytest-cov"] -doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] -enabler = ["pytest-enabler (>=2.2)"] -test = ["jaraco.test (>=5.4)", "pytest (>=6,!=8.1.*)", "zipp (>=3.17)"] -type = ["pytest-mypy"] - [[package]] name = "iniconfig" version = "2.0.0" @@ -1003,7 +949,6 @@ files = [ ] [package.dependencies] -"backports.zoneinfo" = {version = ">=0.2.0", markers = "python_version < \"3.9\""} psycopg-binary = {version = "3.2.3", optional = true, markers = "implementation_name != \"pypy\" and extra == \"binary\""} psycopg-pool = {version = "*", optional = true, markers = "extra == \"pool\""} typing-extensions = {version = ">=4.6", markers = "python_version < \"3.13\""} @@ -1940,5 +1885,5 @@ sqlalchemy = ["sqlalchemy"] [metadata] lock-version = "2.0" -python-versions = "^3.8" -content-hash = "e88d066984b0c6d684aa21f007b9eee8cb3c0fa48eb7f55d4a39b5598822e648" +python-versions = "^3.9" +content-hash = "cd1df6f53a7fc2ada2f69b6464c33eccd250dd9fe92d2e0015a654db08bf4340" diff --git a/procrastinate/contrib/django/migrations_utils.py b/procrastinate/contrib/django/migrations_utils.py index 7230b8cb5..513ecc2a0 100644 --- a/procrastinate/contrib/django/migrations_utils.py +++ b/procrastinate/contrib/django/migrations_utils.py @@ -1,16 +1,10 @@ from __future__ import annotations import functools -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 - import importlib.resources as importlib_resources - @functools.cache def list_migration_files() -> dict[str, str]: diff --git a/procrastinate/schema.py b/procrastinate/schema.py index ebb8c9983..17d075079 100644 --- a/procrastinate/schema.py +++ b/procrastinate/schema.py @@ -1,16 +1,11 @@ from __future__ import annotations +import importlib.resources as importlib_resources import pathlib -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 - import importlib.resources as importlib_resources - from procrastinate import connector as connector_module migrations_path = pathlib.Path(__file__).parent / "sql" / "migrations" diff --git a/procrastinate/sql/__init__.py b/procrastinate/sql/__init__.py index 4bd99528a..385fa011f 100644 --- a/procrastinate/sql/__init__.py +++ b/procrastinate/sql/__init__.py @@ -1,16 +1,11 @@ from __future__ import annotations +import importlib.resources as importlib_resources import re -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 - import importlib.resources as importlib_resources - QUERIES_REGEX = re.compile(r"(?:\n|^)-- ([a-z0-9_]+) --\n(?:-- .+\n)*", re.MULTILINE) diff --git a/pyproject.toml b/pyproject.toml index c260f50e1..801a979f2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,7 +23,7 @@ documentation = "https://procrastinate.readthedocs.io/" procrastinate = 'procrastinate.cli:main' [tool.poetry.dependencies] -python = "^3.8" +python = "^3.9" aiopg = { version = "*", optional = true } anyio = "*" asgiref = "*" @@ -31,12 +31,10 @@ 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] @@ -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] From 32b1a583fff9e9a90227e347d55c4091651787a4 Mon Sep 17 00:00:00 2001 From: Joachim Jablon Date: Sun, 1 Dec 2024 22:48:53 +0100 Subject: [PATCH 5/6] Explicit ruff's target --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 801a979f2..567bf8471 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -150,6 +150,7 @@ exclude_lines = [ exclude = ["tests", ".venv"] [tool.ruff] +target-version = "py39" extend-exclude = [".venv"] [tool.ruff.lint] From 50d1b61b80e15dd7c071f97dbfa98bd7ecff9b3f Mon Sep 17 00:00:00 2001 From: Joachim Jablon Date: Sun, 1 Dec 2024 23:26:39 +0100 Subject: [PATCH 6/6] First pass at fixing warnings from py3.13 --- procrastinate/contrib/django/procrastinate_app.py | 2 +- pyproject.toml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/procrastinate/contrib/django/procrastinate_app.py b/procrastinate/contrib/django/procrastinate_app.py index 17108bdf4..952c16fd6 100644 --- a/procrastinate/contrib/django/procrastinate_app.py +++ b/procrastinate/contrib/django/procrastinate_app.py @@ -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: diff --git a/pyproject.toml b/pyproject.toml index 567bf8471..2b27b1c9c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -125,6 +125,7 @@ filterwarnings = """ ignore:unclosed.+:ResourceWarning """ asyncio_mode = "auto" +asyncio_default_fixture_loop_scope = "function" DJANGO_SETTINGS_MODULE = "tests.acceptance.django_settings"