From 031683c001d214094a84f380b54f0fad7884e1a9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 15 Sep 2025 15:51:23 +0000 Subject: [PATCH 1/2] Lock file maintenance --- uv.lock | 118 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 59 insertions(+), 59 deletions(-) diff --git a/uv.lock b/uv.lock index 965ab474..be7af901 100644 --- a/uv.lock +++ b/uv.lock @@ -287,7 +287,7 @@ wheels = [ [[package]] name = "django-stubs" -version = "5.2.2" +version = "5.2.5" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "django" }, @@ -295,9 +295,9 @@ dependencies = [ { name = "types-pyyaml" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/bc/27/ab9813da817a29ae69ec92af31ad8fc58ce3c904f23ea604bd3bdd9adc37/django_stubs-5.2.2.tar.gz", hash = "sha256:2a04b510c7a812f88223fd7e6d87fb4ea98717f19c8e5c8b59691d83ad40a8a6", size = 243049, upload-time = "2025-07-17T08:35:02.747Z" } +sdist = { url = "https://files.pythonhosted.org/packages/e1/8e/286150f593481c33f54d14efb58d72178f159d57d31043529d38bbc98e2f/django_stubs-5.2.5.tar.gz", hash = "sha256:fc78384e28d8c5292d60983075a5934f644f7c304c25ae2793fc57aa66d5018b", size = 247794, upload-time = "2025-09-12T19:29:49.636Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/55/cb/bb387a1d40691ad54fec2be9e5093becebd63cca0ccb9348cbb27602e1d1/django_stubs-5.2.2-py3-none-any.whl", hash = "sha256:79bd0fdbc78958a8f63e0b062bd9d03f1de539664476c0be62ade5f063c9e41e", size = 485188, upload-time = "2025-07-17T08:35:00.356Z" }, + { url = "https://files.pythonhosted.org/packages/2f/02/cdbf7652ef2c9a7a1fed7c279484b7f3806f15b1bb34aec9fef8e8cfacbf/django_stubs-5.2.5-py3-none-any.whl", hash = "sha256:223c1a3324cd4873b7629dec6e9adbe224a94508284c1926b25fddff7a92252b", size = 490196, upload-time = "2025-09-12T19:29:47.954Z" }, ] [package.optional-dependencies] @@ -307,15 +307,15 @@ compatible-mypy = [ [[package]] name = "django-stubs-ext" -version = "5.2.2" +version = "5.2.5" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "django" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/fc/06/5e94715d103e6cc72380cb0d0b6682a7d5ad2c366cee478c94d77aad777d/django_stubs_ext-5.2.2.tar.gz", hash = "sha256:d9d151b919fe2438760f5bd938f03e1cb08c84d0651f9e5917f1313907e42683", size = 6244, upload-time = "2025-07-17T08:34:35.054Z" } +sdist = { url = "https://files.pythonhosted.org/packages/16/94/c9b8f4c47084a0fa666da9066c36771098101932688adf2c17a40fab79c2/django_stubs_ext-5.2.5.tar.gz", hash = "sha256:ecc628df29d36cede638567c4e33ff485dd7a99f1552ad0cece8c60e9c3a8872", size = 6489, upload-time = "2025-09-12T19:29:06.008Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/4e/38/2903676f97f7902ee31984a06756b0e8836e897f4b617e1a03be4a43eb4f/django_stubs_ext-5.2.2-py3-none-any.whl", hash = "sha256:8833bbe32405a2a0ce168d3f75a87168f61bd16939caf0e8bf173bccbd8a44c5", size = 8816, upload-time = "2025-07-17T08:34:33.715Z" }, + { url = "https://files.pythonhosted.org/packages/e0/fe/a85a105fddffadb4a8d50e500caeee87d836b679d51a19d52dfa0cc6c660/django_stubs_ext-5.2.5-py3-none-any.whl", hash = "sha256:9b4b8ac9d32f7e6c304fd05477f8688fae6ed57f6a0f9f4d074f9e55b5a3da14", size = 9310, upload-time = "2025-09-12T19:29:04.62Z" }, ] [[package]] @@ -517,22 +517,22 @@ wheels = [ [[package]] name = "mypy" -version = "1.17.1" +version = "1.18.1" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "mypy-extensions" }, { name = "pathspec" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/8e/22/ea637422dedf0bf36f3ef238eab4e455e2a0dcc3082b5cc067615347ab8e/mypy-1.17.1.tar.gz", hash = "sha256:25e01ec741ab5bb3eec8ba9cdb0f769230368a22c959c4937360efb89b7e9f01", size = 3352570, upload-time = "2025-07-31T07:54:19.204Z" } +sdist = { url = "https://files.pythonhosted.org/packages/14/a3/931e09fc02d7ba96da65266884da4e4a8806adcdb8a57faaacc6edf1d538/mypy-1.18.1.tar.gz", hash = "sha256:9e988c64ad3ac5987f43f5154f884747faf62141b7f842e87465b45299eea5a9", size = 3448447, upload-time = "2025-09-11T23:00:47.067Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/17/a2/7034d0d61af8098ec47902108553122baa0f438df8a713be860f7407c9e6/mypy-1.17.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:69e83ea6553a3ba79c08c6e15dbd9bfa912ec1e493bf75489ef93beb65209aeb", size = 11086295, upload-time = "2025-07-31T07:53:28.124Z" }, - { url = "https://files.pythonhosted.org/packages/14/1f/19e7e44b594d4b12f6ba8064dbe136505cec813549ca3e5191e40b1d3cc2/mypy-1.17.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:1b16708a66d38abb1e6b5702f5c2c87e133289da36f6a1d15f6a5221085c6403", size = 10112355, upload-time = "2025-07-31T07:53:21.121Z" }, - { url = "https://files.pythonhosted.org/packages/5b/69/baa33927e29e6b4c55d798a9d44db5d394072eef2bdc18c3e2048c9ed1e9/mypy-1.17.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:89e972c0035e9e05823907ad5398c5a73b9f47a002b22359b177d40bdaee7056", size = 11875285, upload-time = "2025-07-31T07:53:55.293Z" }, - { url = "https://files.pythonhosted.org/packages/90/13/f3a89c76b0a41e19490b01e7069713a30949d9a6c147289ee1521bcea245/mypy-1.17.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:03b6d0ed2b188e35ee6d5c36b5580cffd6da23319991c49ab5556c023ccf1341", size = 12737895, upload-time = "2025-07-31T07:53:43.623Z" }, - { url = "https://files.pythonhosted.org/packages/23/a1/c4ee79ac484241301564072e6476c5a5be2590bc2e7bfd28220033d2ef8f/mypy-1.17.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:c837b896b37cd103570d776bda106eabb8737aa6dd4f248451aecf53030cdbeb", size = 12931025, upload-time = "2025-07-31T07:54:17.125Z" }, - { url = "https://files.pythonhosted.org/packages/89/b8/7409477be7919a0608900e6320b155c72caab4fef46427c5cc75f85edadd/mypy-1.17.1-cp312-cp312-win_amd64.whl", hash = "sha256:665afab0963a4b39dff7c1fa563cc8b11ecff7910206db4b2e64dd1ba25aed19", size = 9584664, upload-time = "2025-07-31T07:54:12.842Z" }, - { url = "https://files.pythonhosted.org/packages/1d/f3/8fcd2af0f5b806f6cf463efaffd3c9548a28f84220493ecd38d127b6b66d/mypy-1.17.1-py3-none-any.whl", hash = "sha256:a9f52c0351c21fe24c21d8c0eb1f62967b262d6729393397b6f443c3b773c3b9", size = 2283411, upload-time = "2025-07-31T07:53:24.664Z" }, + { url = "https://files.pythonhosted.org/packages/e7/14/1c3f54d606cb88a55d1567153ef3a8bc7b74702f2ff5eb64d0994f9e49cb/mypy-1.18.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:502cde8896be8e638588b90fdcb4c5d5b8c1b004dfc63fd5604a973547367bb9", size = 12911082, upload-time = "2025-09-11T23:00:41.465Z" }, + { url = "https://files.pythonhosted.org/packages/90/83/235606c8b6d50a8eba99773add907ce1d41c068edb523f81eb0d01603a83/mypy-1.18.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:7509549b5e41be279afc1228242d0e397f1af2919a8f2877ad542b199dc4083e", size = 11919107, upload-time = "2025-09-11T22:58:40.903Z" }, + { url = "https://files.pythonhosted.org/packages/ca/25/4e2ce00f8d15b99d0c68a2536ad63e9eac033f723439ef80290ec32c1ff5/mypy-1.18.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5956ecaabb3a245e3f34100172abca1507be687377fe20e24d6a7557e07080e2", size = 12472551, upload-time = "2025-09-11T22:58:37.272Z" }, + { url = "https://files.pythonhosted.org/packages/32/bb/92642a9350fc339dd9dcefcf6862d171b52294af107d521dce075f32f298/mypy-1.18.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8750ceb014a96c9890421c83f0db53b0f3b8633e2864c6f9bc0a8e93951ed18d", size = 13340554, upload-time = "2025-09-11T22:59:38.756Z" }, + { url = "https://files.pythonhosted.org/packages/cd/ee/38d01db91c198fb6350025d28f9719ecf3c8f2c55a0094bfbf3ef478cc9a/mypy-1.18.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:fb89ea08ff41adf59476b235293679a6eb53a7b9400f6256272fb6029bec3ce5", size = 13530933, upload-time = "2025-09-11T22:59:20.228Z" }, + { url = "https://files.pythonhosted.org/packages/da/8d/6d991ae631f80d58edbf9d7066e3f2a96e479dca955d9a968cd6e90850a3/mypy-1.18.1-cp312-cp312-win_amd64.whl", hash = "sha256:2657654d82fcd2a87e02a33e0d23001789a554059bbf34702d623dafe353eabf", size = 9828426, upload-time = "2025-09-11T23:00:21.007Z" }, + { url = "https://files.pythonhosted.org/packages/e0/1d/4b97d3089b48ef3d904c9ca69fab044475bd03245d878f5f0b3ea1daf7ce/mypy-1.18.1-py3-none-any.whl", hash = "sha256:b76a4de66a0ac01da1be14ecc8ae88ddea33b8380284a9e3eae39d57ebcbe26e", size = 2352212, upload-time = "2025-09-11T22:59:26.576Z" }, ] [[package]] @@ -555,21 +555,21 @@ wheels = [ [[package]] name = "numpy" -version = "2.3.2" +version = "2.3.3" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/37/7d/3fec4199c5ffb892bed55cff901e4f39a58c81df9c44c280499e92cad264/numpy-2.3.2.tar.gz", hash = "sha256:e0486a11ec30cdecb53f184d496d1c6a20786c81e55e41640270130056f8ee48", size = 20489306, upload-time = "2025-07-24T21:32:07.553Z" } +sdist = { url = "https://files.pythonhosted.org/packages/d0/19/95b3d357407220ed24c139018d2518fab0a61a948e68286a25f1a4d049ff/numpy-2.3.3.tar.gz", hash = "sha256:ddc7c39727ba62b80dfdbedf400d1c10ddfa8eefbd7ec8dcb118be8b56d31029", size = 20576648, upload-time = "2025-09-09T16:54:12.543Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/00/6d/745dd1c1c5c284d17725e5c802ca4d45cfc6803519d777f087b71c9f4069/numpy-2.3.2-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:bc3186bea41fae9d8e90c2b4fb5f0a1f5a690682da79b92574d63f56b529080b", size = 20956420, upload-time = "2025-07-24T20:28:18.002Z" }, - { url = "https://files.pythonhosted.org/packages/bc/96/e7b533ea5740641dd62b07a790af5d9d8fec36000b8e2d0472bd7574105f/numpy-2.3.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2f4f0215edb189048a3c03bd5b19345bdfa7b45a7a6f72ae5945d2a28272727f", size = 14184660, upload-time = "2025-07-24T20:28:39.522Z" }, - { url = "https://files.pythonhosted.org/packages/2b/53/102c6122db45a62aa20d1b18c9986f67e6b97e0d6fbc1ae13e3e4c84430c/numpy-2.3.2-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:8b1224a734cd509f70816455c3cffe13a4f599b1bf7130f913ba0e2c0b2006c0", size = 5113382, upload-time = "2025-07-24T20:28:48.544Z" }, - { url = "https://files.pythonhosted.org/packages/2b/21/376257efcbf63e624250717e82b4fae93d60178f09eb03ed766dbb48ec9c/numpy-2.3.2-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:3dcf02866b977a38ba3ec10215220609ab9667378a9e2150615673f3ffd6c73b", size = 6647258, upload-time = "2025-07-24T20:28:59.104Z" }, - { url = "https://files.pythonhosted.org/packages/91/ba/f4ebf257f08affa464fe6036e13f2bf9d4642a40228781dc1235da81be9f/numpy-2.3.2-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:572d5512df5470f50ada8d1972c5f1082d9a0b7aa5944db8084077570cf98370", size = 14281409, upload-time = "2025-07-24T20:40:30.298Z" }, - { url = "https://files.pythonhosted.org/packages/59/ef/f96536f1df42c668cbacb727a8c6da7afc9c05ece6d558927fb1722693e1/numpy-2.3.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8145dd6d10df13c559d1e4314df29695613575183fa2e2d11fac4c208c8a1f73", size = 16641317, upload-time = "2025-07-24T20:40:56.625Z" }, - { url = "https://files.pythonhosted.org/packages/f6/a7/af813a7b4f9a42f498dde8a4c6fcbff8100eed00182cc91dbaf095645f38/numpy-2.3.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:103ea7063fa624af04a791c39f97070bf93b96d7af7eb23530cd087dc8dbe9dc", size = 16056262, upload-time = "2025-07-24T20:41:20.797Z" }, - { url = "https://files.pythonhosted.org/packages/8b/5d/41c4ef8404caaa7f05ed1cfb06afe16a25895260eacbd29b4d84dff2920b/numpy-2.3.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:fc927d7f289d14f5e037be917539620603294454130b6de200091e23d27dc9be", size = 18579342, upload-time = "2025-07-24T20:41:50.753Z" }, - { url = "https://files.pythonhosted.org/packages/a1/4f/9950e44c5a11636f4a3af6e825ec23003475cc9a466edb7a759ed3ea63bd/numpy-2.3.2-cp312-cp312-win32.whl", hash = "sha256:d95f59afe7f808c103be692175008bab926b59309ade3e6d25009e9a171f7036", size = 6320610, upload-time = "2025-07-24T20:42:01.551Z" }, - { url = "https://files.pythonhosted.org/packages/7c/2f/244643a5ce54a94f0a9a2ab578189c061e4a87c002e037b0829dd77293b6/numpy-2.3.2-cp312-cp312-win_amd64.whl", hash = "sha256:9e196ade2400c0c737d93465327d1ae7c06c7cb8a1756121ebf54b06ca183c7f", size = 12786292, upload-time = "2025-07-24T20:42:20.738Z" }, - { url = "https://files.pythonhosted.org/packages/54/cd/7b5f49d5d78db7badab22d8323c1b6ae458fbf86c4fdfa194ab3cd4eb39b/numpy-2.3.2-cp312-cp312-win_arm64.whl", hash = "sha256:ee807923782faaf60d0d7331f5e86da7d5e3079e28b291973c545476c2b00d07", size = 10194071, upload-time = "2025-07-24T20:42:36.657Z" }, + { url = "https://files.pythonhosted.org/packages/51/5d/bb7fc075b762c96329147799e1bcc9176ab07ca6375ea976c475482ad5b3/numpy-2.3.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:cfdd09f9c84a1a934cde1eec2267f0a43a7cd44b2cca4ff95b7c0d14d144b0bf", size = 20957014, upload-time = "2025-09-09T15:56:29.966Z" }, + { url = "https://files.pythonhosted.org/packages/6b/0e/c6211bb92af26517acd52125a237a92afe9c3124c6a68d3b9f81b62a0568/numpy-2.3.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:cb32e3cf0f762aee47ad1ddc6672988f7f27045b0783c887190545baba73aa25", size = 14185220, upload-time = "2025-09-09T15:56:32.175Z" }, + { url = "https://files.pythonhosted.org/packages/22/f2/07bb754eb2ede9073f4054f7c0286b0d9d2e23982e090a80d478b26d35ca/numpy-2.3.3-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:396b254daeb0a57b1fe0ecb5e3cff6fa79a380fa97c8f7781a6d08cd429418fe", size = 5113918, upload-time = "2025-09-09T15:56:34.175Z" }, + { url = "https://files.pythonhosted.org/packages/81/0a/afa51697e9fb74642f231ea36aca80fa17c8fb89f7a82abd5174023c3960/numpy-2.3.3-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:067e3d7159a5d8f8a0b46ee11148fc35ca9b21f61e3c49fbd0a027450e65a33b", size = 6647922, upload-time = "2025-09-09T15:56:36.149Z" }, + { url = "https://files.pythonhosted.org/packages/5d/f5/122d9cdb3f51c520d150fef6e87df9279e33d19a9611a87c0d2cf78a89f4/numpy-2.3.3-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1c02d0629d25d426585fb2e45a66154081b9fa677bc92a881ff1d216bc9919a8", size = 14281991, upload-time = "2025-09-09T15:56:40.548Z" }, + { url = "https://files.pythonhosted.org/packages/51/64/7de3c91e821a2debf77c92962ea3fe6ac2bc45d0778c1cbe15d4fce2fd94/numpy-2.3.3-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d9192da52b9745f7f0766531dcfa978b7763916f158bb63bdb8a1eca0068ab20", size = 16641643, upload-time = "2025-09-09T15:56:43.343Z" }, + { url = "https://files.pythonhosted.org/packages/30/e4/961a5fa681502cd0d68907818b69f67542695b74e3ceaa513918103b7e80/numpy-2.3.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:cd7de500a5b66319db419dc3c345244404a164beae0d0937283b907d8152e6ea", size = 16056787, upload-time = "2025-09-09T15:56:46.141Z" }, + { url = "https://files.pythonhosted.org/packages/99/26/92c912b966e47fbbdf2ad556cb17e3a3088e2e1292b9833be1dfa5361a1a/numpy-2.3.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:93d4962d8f82af58f0b2eb85daaf1b3ca23fe0a85d0be8f1f2b7bb46034e56d7", size = 18579598, upload-time = "2025-09-09T15:56:49.844Z" }, + { url = "https://files.pythonhosted.org/packages/17/b6/fc8f82cb3520768718834f310c37d96380d9dc61bfdaf05fe5c0b7653e01/numpy-2.3.3-cp312-cp312-win32.whl", hash = "sha256:5534ed6b92f9b7dca6c0a19d6df12d41c68b991cef051d108f6dbff3babc4ebf", size = 6320800, upload-time = "2025-09-09T15:56:52.499Z" }, + { url = "https://files.pythonhosted.org/packages/32/ee/de999f2625b80d043d6d2d628c07d0d5555a677a3cf78fdf868d409b8766/numpy-2.3.3-cp312-cp312-win_amd64.whl", hash = "sha256:497d7cad08e7092dba36e3d296fe4c97708c93daf26643a1ae4b03f6294d30eb", size = 12786615, upload-time = "2025-09-09T15:56:54.422Z" }, + { url = "https://files.pythonhosted.org/packages/49/6e/b479032f8a43559c383acb20816644f5f91c88f633d9271ee84f3b3a996c/numpy-2.3.3-cp312-cp312-win_arm64.whl", hash = "sha256:ca0309a18d4dfea6fc6262a66d06c26cfe4640c3926ceec90e57791a82b6eee5", size = 10195936, upload-time = "2025-09-09T15:56:56.541Z" }, ] [[package]] @@ -740,11 +740,11 @@ wheels = [ [[package]] name = "pyparsing" -version = "3.2.3" +version = "3.2.4" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/bb/22/f1129e69d94ffff626bdb5c835506b3a5b4f3d070f17ea295e12c2c6f60f/pyparsing-3.2.3.tar.gz", hash = "sha256:b9c13f1ab8b3b542f72e28f634bad4de758ab3ce4546e4301970ad6fa77c38be", size = 1088608, upload-time = "2025-03-25T05:01:28.114Z" } +sdist = { url = "https://files.pythonhosted.org/packages/98/c9/b4594e6a81371dfa9eb7a2c110ad682acf985d96115ae8b25a1d63b4bf3b/pyparsing-3.2.4.tar.gz", hash = "sha256:fff89494f45559d0f2ce46613b419f632bbb6afbdaed49696d322bcf98a58e99", size = 1098809, upload-time = "2025-09-13T05:47:19.732Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/05/e7/df2285f3d08fee213f2d041540fa4fc9ca6c2d44cf36d3a035bf2a8d2bcc/pyparsing-3.2.3-py3-none-any.whl", hash = "sha256:a749938e02d6fd0b59b356ca504a24982314bb090c383e3cf201c95ef7e2bfcf", size = 111120, upload-time = "2025-03-25T05:01:24.908Z" }, + { url = "https://files.pythonhosted.org/packages/53/b8/fbab973592e23ae313042d450fc26fa24282ebffba21ba373786e1ce63b4/pyparsing-3.2.4-py3-none-any.whl", hash = "sha256:91d0fcde680d42cd031daf3a6ba20da3107e08a75de50da58360e7d94ab24d36", size = 113869, upload-time = "2025-09-13T05:47:17.863Z" }, ] [[package]] @@ -765,16 +765,16 @@ wheels = [ [[package]] name = "pytest-cov" -version = "6.3.0" +version = "7.0.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "coverage" }, { name = "pluggy" }, { name = "pytest" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/30/4c/f883ab8f0daad69f47efdf95f55a66b51a8b939c430dadce0611508d9e99/pytest_cov-6.3.0.tar.gz", hash = "sha256:35c580e7800f87ce892e687461166e1ac2bcb8fb9e13aea79032518d6e503ff2", size = 70398, upload-time = "2025-09-06T15:40:14.361Z" } +sdist = { url = "https://files.pythonhosted.org/packages/5e/f7/c933acc76f5208b3b00089573cf6a2bc26dc80a8aece8f52bb7d6b1855ca/pytest_cov-7.0.0.tar.gz", hash = "sha256:33c97eda2e049a0c5298e91f519302a1334c26ac65c1a483d6206fd458361af1", size = 54328, upload-time = "2025-09-09T10:57:02.113Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/80/b4/bb7263e12aade3842b938bc5c6958cae79c5ee18992f9b9349019579da0f/pytest_cov-6.3.0-py3-none-any.whl", hash = "sha256:440db28156d2468cafc0415b4f8e50856a0d11faefa38f30906048fe490f1749", size = 25115, upload-time = "2025-09-06T15:40:12.44Z" }, + { url = "https://files.pythonhosted.org/packages/ee/49/1377b49de7d0c1ce41292161ea0f721913fa8722c19fb9c1e3aa0367eecb/pytest_cov-7.0.0-py3-none-any.whl", hash = "sha256:3b8e9558b16cc1479da72058bdecf8073661c7f57f7d3c5f22a1c23507f2d861", size = 22424, upload-time = "2025-09-09T10:57:00.695Z" }, ] [[package]] @@ -844,28 +844,28 @@ wheels = [ [[package]] name = "ruff" -version = "0.12.12" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/a8/f0/e0965dd709b8cabe6356811c0ee8c096806bb57d20b5019eb4e48a117410/ruff-0.12.12.tar.gz", hash = "sha256:b86cd3415dbe31b3b46a71c598f4c4b2f550346d1ccf6326b347cc0c8fd063d6", size = 5359915, upload-time = "2025-09-04T16:50:18.273Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/09/79/8d3d687224d88367b51c7974cec1040c4b015772bfbeffac95face14c04a/ruff-0.12.12-py3-none-linux_armv6l.whl", hash = "sha256:de1c4b916d98ab289818e55ce481e2cacfaad7710b01d1f990c497edf217dafc", size = 12116602, upload-time = "2025-09-04T16:49:18.892Z" }, - { url = "https://files.pythonhosted.org/packages/c3/c3/6e599657fe192462f94861a09aae935b869aea8a1da07f47d6eae471397c/ruff-0.12.12-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:7acd6045e87fac75a0b0cdedacf9ab3e1ad9d929d149785903cff9bb69ad9727", size = 12868393, upload-time = "2025-09-04T16:49:23.043Z" }, - { url = "https://files.pythonhosted.org/packages/e8/d2/9e3e40d399abc95336b1843f52fc0daaceb672d0e3c9290a28ff1a96f79d/ruff-0.12.12-py3-none-macosx_11_0_arm64.whl", hash = "sha256:abf4073688d7d6da16611f2f126be86523a8ec4343d15d276c614bda8ec44edb", size = 12036967, upload-time = "2025-09-04T16:49:26.04Z" }, - { url = "https://files.pythonhosted.org/packages/e9/03/6816b2ed08836be272e87107d905f0908be5b4a40c14bfc91043e76631b8/ruff-0.12.12-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:968e77094b1d7a576992ac078557d1439df678a34c6fe02fd979f973af167577", size = 12276038, upload-time = "2025-09-04T16:49:29.056Z" }, - { url = "https://files.pythonhosted.org/packages/9f/d5/707b92a61310edf358a389477eabd8af68f375c0ef858194be97ca5b6069/ruff-0.12.12-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:42a67d16e5b1ffc6d21c5f67851e0e769517fb57a8ebad1d0781b30888aa704e", size = 11901110, upload-time = "2025-09-04T16:49:32.07Z" }, - { url = "https://files.pythonhosted.org/packages/9d/3d/f8b1038f4b9822e26ec3d5b49cf2bc313e3c1564cceb4c1a42820bf74853/ruff-0.12.12-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b216ec0a0674e4b1214dcc998a5088e54eaf39417327b19ffefba1c4a1e4971e", size = 13668352, upload-time = "2025-09-04T16:49:35.148Z" }, - { url = "https://files.pythonhosted.org/packages/98/0e/91421368ae6c4f3765dd41a150f760c5f725516028a6be30e58255e3c668/ruff-0.12.12-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:59f909c0fdd8f1dcdbfed0b9569b8bf428cf144bec87d9de298dcd4723f5bee8", size = 14638365, upload-time = "2025-09-04T16:49:38.892Z" }, - { url = "https://files.pythonhosted.org/packages/74/5d/88f3f06a142f58ecc8ecb0c2fe0b82343e2a2b04dcd098809f717cf74b6c/ruff-0.12.12-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9ac93d87047e765336f0c18eacad51dad0c1c33c9df7484c40f98e1d773876f5", size = 14060812, upload-time = "2025-09-04T16:49:42.732Z" }, - { url = "https://files.pythonhosted.org/packages/13/fc/8962e7ddd2e81863d5c92400820f650b86f97ff919c59836fbc4c1a6d84c/ruff-0.12.12-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:01543c137fd3650d322922e8b14cc133b8ea734617c4891c5a9fccf4bfc9aa92", size = 13050208, upload-time = "2025-09-04T16:49:46.434Z" }, - { url = "https://files.pythonhosted.org/packages/53/06/8deb52d48a9a624fd37390555d9589e719eac568c020b27e96eed671f25f/ruff-0.12.12-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2afc2fa864197634e549d87fb1e7b6feb01df0a80fd510d6489e1ce8c0b1cc45", size = 13311444, upload-time = "2025-09-04T16:49:49.931Z" }, - { url = "https://files.pythonhosted.org/packages/2a/81/de5a29af7eb8f341f8140867ffb93f82e4fde7256dadee79016ac87c2716/ruff-0.12.12-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:0c0945246f5ad776cb8925e36af2438e66188d2b57d9cf2eed2c382c58b371e5", size = 13279474, upload-time = "2025-09-04T16:49:53.465Z" }, - { url = "https://files.pythonhosted.org/packages/7f/14/d9577fdeaf791737ada1b4f5c6b59c21c3326f3f683229096cccd7674e0c/ruff-0.12.12-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:a0fbafe8c58e37aae28b84a80ba1817f2ea552e9450156018a478bf1fa80f4e4", size = 12070204, upload-time = "2025-09-04T16:49:56.882Z" }, - { url = "https://files.pythonhosted.org/packages/77/04/a910078284b47fad54506dc0af13839c418ff704e341c176f64e1127e461/ruff-0.12.12-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:b9c456fb2fc8e1282affa932c9e40f5ec31ec9cbb66751a316bd131273b57c23", size = 11880347, upload-time = "2025-09-04T16:49:59.729Z" }, - { url = "https://files.pythonhosted.org/packages/df/58/30185fcb0e89f05e7ea82e5817b47798f7fa7179863f9d9ba6fd4fe1b098/ruff-0.12.12-py3-none-musllinux_1_2_i686.whl", hash = "sha256:5f12856123b0ad0147d90b3961f5c90e7427f9acd4b40050705499c98983f489", size = 12891844, upload-time = "2025-09-04T16:50:02.591Z" }, - { url = "https://files.pythonhosted.org/packages/21/9c/28a8dacce4855e6703dcb8cdf6c1705d0b23dd01d60150786cd55aa93b16/ruff-0.12.12-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:26a1b5a2bf7dd2c47e3b46d077cd9c0fc3b93e6c6cc9ed750bd312ae9dc302ee", size = 13360687, upload-time = "2025-09-04T16:50:05.8Z" }, - { url = "https://files.pythonhosted.org/packages/c8/fa/05b6428a008e60f79546c943e54068316f32ec8ab5c4f73e4563934fbdc7/ruff-0.12.12-py3-none-win32.whl", hash = "sha256:173be2bfc142af07a01e3a759aba6f7791aa47acf3604f610b1c36db888df7b1", size = 12052870, upload-time = "2025-09-04T16:50:09.121Z" }, - { url = "https://files.pythonhosted.org/packages/85/60/d1e335417804df452589271818749d061b22772b87efda88354cf35cdb7a/ruff-0.12.12-py3-none-win_amd64.whl", hash = "sha256:e99620bf01884e5f38611934c09dd194eb665b0109104acae3ba6102b600fd0d", size = 13178016, upload-time = "2025-09-04T16:50:12.559Z" }, - { url = "https://files.pythonhosted.org/packages/28/7e/61c42657f6e4614a4258f1c3b0c5b93adc4d1f8575f5229d1906b483099b/ruff-0.12.12-py3-none-win_arm64.whl", hash = "sha256:2a8199cab4ce4d72d158319b63370abf60991495fb733db96cd923a34c52d093", size = 12256762, upload-time = "2025-09-04T16:50:15.737Z" }, +version = "0.13.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/6e/1a/1f4b722862840295bcaba8c9e5261572347509548faaa99b2d57ee7bfe6a/ruff-0.13.0.tar.gz", hash = "sha256:5b4b1ee7eb35afae128ab94459b13b2baaed282b1fb0f472a73c82c996c8ae60", size = 5372863, upload-time = "2025-09-10T16:25:37.917Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ac/fe/6f87b419dbe166fd30a991390221f14c5b68946f389ea07913e1719741e0/ruff-0.13.0-py3-none-linux_armv6l.whl", hash = "sha256:137f3d65d58ee828ae136a12d1dc33d992773d8f7644bc6b82714570f31b2004", size = 12187826, upload-time = "2025-09-10T16:24:39.5Z" }, + { url = "https://files.pythonhosted.org/packages/e4/25/c92296b1fc36d2499e12b74a3fdb230f77af7bdf048fad7b0a62e94ed56a/ruff-0.13.0-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:21ae48151b66e71fd111b7d79f9ad358814ed58c339631450c66a4be33cc28b9", size = 12933428, upload-time = "2025-09-10T16:24:43.866Z" }, + { url = "https://files.pythonhosted.org/packages/44/cf/40bc7221a949470307d9c35b4ef5810c294e6cfa3caafb57d882731a9f42/ruff-0.13.0-py3-none-macosx_11_0_arm64.whl", hash = "sha256:64de45f4ca5441209e41742d527944635a05a6e7c05798904f39c85bafa819e3", size = 12095543, upload-time = "2025-09-10T16:24:46.638Z" }, + { url = "https://files.pythonhosted.org/packages/f1/03/8b5ff2a211efb68c63a1d03d157e924997ada87d01bebffbd13a0f3fcdeb/ruff-0.13.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2b2c653ae9b9d46e0ef62fc6fbf5b979bda20a0b1d2b22f8f7eb0cde9f4963b8", size = 12312489, upload-time = "2025-09-10T16:24:49.556Z" }, + { url = "https://files.pythonhosted.org/packages/37/fc/2336ef6d5e9c8d8ea8305c5f91e767d795cd4fc171a6d97ef38a5302dadc/ruff-0.13.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:4cec632534332062bc9eb5884a267b689085a1afea9801bf94e3ba7498a2d207", size = 11991631, upload-time = "2025-09-10T16:24:53.439Z" }, + { url = "https://files.pythonhosted.org/packages/39/7f/f6d574d100fca83d32637d7f5541bea2f5e473c40020bbc7fc4a4d5b7294/ruff-0.13.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:dcd628101d9f7d122e120ac7c17e0a0f468b19bc925501dbe03c1cb7f5415b24", size = 13720602, upload-time = "2025-09-10T16:24:56.392Z" }, + { url = "https://files.pythonhosted.org/packages/fd/c8/a8a5b81d8729b5d1f663348d11e2a9d65a7a9bd3c399763b1a51c72be1ce/ruff-0.13.0-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:afe37db8e1466acb173bb2a39ca92df00570e0fd7c94c72d87b51b21bb63efea", size = 14697751, upload-time = "2025-09-10T16:24:59.89Z" }, + { url = "https://files.pythonhosted.org/packages/57/f5/183ec292272ce7ec5e882aea74937f7288e88ecb500198b832c24debc6d3/ruff-0.13.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0f96a8d90bb258d7d3358b372905fe7333aaacf6c39e2408b9f8ba181f4b6ef2", size = 14095317, upload-time = "2025-09-10T16:25:03.025Z" }, + { url = "https://files.pythonhosted.org/packages/9f/8d/7f9771c971724701af7926c14dab31754e7b303d127b0d3f01116faef456/ruff-0.13.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:94b5e3d883e4f924c5298e3f2ee0f3085819c14f68d1e5b6715597681433f153", size = 13144418, upload-time = "2025-09-10T16:25:06.272Z" }, + { url = "https://files.pythonhosted.org/packages/a8/a6/7985ad1778e60922d4bef546688cd8a25822c58873e9ff30189cfe5dc4ab/ruff-0.13.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:03447f3d18479df3d24917a92d768a89f873a7181a064858ea90a804a7538991", size = 13370843, upload-time = "2025-09-10T16:25:09.965Z" }, + { url = "https://files.pythonhosted.org/packages/64/1c/bafdd5a7a05a50cc51d9f5711da704942d8dd62df3d8c70c311e98ce9f8a/ruff-0.13.0-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:fbc6b1934eb1c0033da427c805e27d164bb713f8e273a024a7e86176d7f462cf", size = 13321891, upload-time = "2025-09-10T16:25:12.969Z" }, + { url = "https://files.pythonhosted.org/packages/bc/3e/7817f989cb9725ef7e8d2cee74186bf90555279e119de50c750c4b7a72fe/ruff-0.13.0-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:a8ab6a3e03665d39d4a25ee199d207a488724f022db0e1fe4002968abdb8001b", size = 12119119, upload-time = "2025-09-10T16:25:16.621Z" }, + { url = "https://files.pythonhosted.org/packages/58/07/9df080742e8d1080e60c426dce6e96a8faf9a371e2ce22eef662e3839c95/ruff-0.13.0-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:d2a5c62f8ccc6dd2fe259917482de7275cecc86141ee10432727c4816235bc41", size = 11961594, upload-time = "2025-09-10T16:25:19.49Z" }, + { url = "https://files.pythonhosted.org/packages/6a/f4/ae1185349197d26a2316840cb4d6c3fba61d4ac36ed728bf0228b222d71f/ruff-0.13.0-py3-none-musllinux_1_2_i686.whl", hash = "sha256:b7b85ca27aeeb1ab421bc787009831cffe6048faae08ad80867edab9f2760945", size = 12933377, upload-time = "2025-09-10T16:25:22.371Z" }, + { url = "https://files.pythonhosted.org/packages/b6/39/e776c10a3b349fc8209a905bfb327831d7516f6058339a613a8d2aaecacd/ruff-0.13.0-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:79ea0c44a3032af768cabfd9616e44c24303af49d633b43e3a5096e009ebe823", size = 13418555, upload-time = "2025-09-10T16:25:25.681Z" }, + { url = "https://files.pythonhosted.org/packages/46/09/dca8df3d48e8b3f4202bf20b1658898e74b6442ac835bfe2c1816d926697/ruff-0.13.0-py3-none-win32.whl", hash = "sha256:4e473e8f0e6a04e4113f2e1de12a5039579892329ecc49958424e5568ef4f768", size = 12141613, upload-time = "2025-09-10T16:25:28.664Z" }, + { url = "https://files.pythonhosted.org/packages/61/21/0647eb71ed99b888ad50e44d8ec65d7148babc0e242d531a499a0bbcda5f/ruff-0.13.0-py3-none-win_amd64.whl", hash = "sha256:48e5c25c7a3713eea9ce755995767f4dcd1b0b9599b638b12946e892123d1efb", size = 13258250, upload-time = "2025-09-10T16:25:31.773Z" }, + { url = "https://files.pythonhosted.org/packages/e1/a3/03216a6a86c706df54422612981fb0f9041dbb452c3401501d4a22b942c9/ruff-0.13.0-py3-none-win_arm64.whl", hash = "sha256:ab80525317b1e1d38614addec8ac954f1b3e662de9d59114ecbf771d00cf613e", size = 12312357, upload-time = "2025-09-10T16:25:35.595Z" }, ] [[package]] @@ -1056,11 +1056,11 @@ wheels = [ [[package]] name = "types-pyyaml" -version = "6.0.12.20250822" +version = "6.0.12.20250915" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/49/85/90a442e538359ab5c9e30de415006fb22567aa4301c908c09f19e42975c2/types_pyyaml-6.0.12.20250822.tar.gz", hash = "sha256:259f1d93079d335730a9db7cff2bcaf65d7e04b4a56b5927d49a612199b59413", size = 17481, upload-time = "2025-08-22T03:02:16.209Z" } +sdist = { url = "https://files.pythonhosted.org/packages/7e/69/3c51b36d04da19b92f9e815be12753125bd8bc247ba0470a982e6979e71c/types_pyyaml-6.0.12.20250915.tar.gz", hash = "sha256:0f8b54a528c303f0e6f7165687dd33fafa81c807fcac23f632b63aa624ced1d3", size = 17522, upload-time = "2025-09-15T03:01:00.728Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/32/8e/8f0aca667c97c0d76024b37cffa39e76e2ce39ca54a38f285a64e6ae33ba/types_pyyaml-6.0.12.20250822-py3-none-any.whl", hash = "sha256:1fe1a5e146aa315483592d292b72a172b65b946a6d98aa6ddd8e4aa838ab7098", size = 20314, upload-time = "2025-08-22T03:02:15.002Z" }, + { url = "https://files.pythonhosted.org/packages/bd/e0/1eed384f02555dde685fff1a1ac805c1c7dcb6dd019c916fe659b1c1f9ec/types_pyyaml-6.0.12.20250915-py3-none-any.whl", hash = "sha256:e7d4d9e064e89a3b3cae120b4990cd370874d2bf12fa5f46c97018dd5d3c9ab6", size = 20338, upload-time = "2025-09-15T03:00:59.218Z" }, ] [[package]] From d1acff996871d053b2fecbe168261bb71505dc58 Mon Sep 17 00:00:00 2001 From: Matt Norton Date: Mon, 15 Sep 2025 23:01:03 +0100 Subject: [PATCH 2/2] Fix Django db type errors --- db/_settings.py | 50 ++++++++------- db/core/models/__init__.py | 126 +++++++++++++++++++++---------------- db/core/models/utils.py | 83 ++++++++++++------------ exceptions/messages.py | 4 +- utils/tex_bot.py | 4 +- 5 files changed, 147 insertions(+), 120 deletions(-) diff --git a/db/_settings.py b/db/_settings.py index ed9f4e84..338e3b96 100644 --- a/db/_settings.py +++ b/db/_settings.py @@ -8,14 +8,22 @@ from pathlib import Path from typing import TYPE_CHECKING +import django_stubs_ext + if TYPE_CHECKING: - from collections.abc import Sequence + from collections.abc import Mapping, Sequence from typing import Final __all__: "Sequence[str]" = () -# Build paths inside the project like this: BASE_DIR / "subdir". -BASE_DIR = Path(__file__).resolve().parent + +# Monkeypatching Django, so stubs will work for all generics, +# SOURCE: https://github.com/typeddjango/django-stubs +django_stubs_ext.monkeypatch() + + +# NOTE: Build paths inside the project like this: BASE_DIR / "subdir". +BASE_DIR: "Final[Path]" = Path(__file__).resolve().parent # NOTE: settings.py is called when setting up the mypy_django_plugin & when running Pytest. When mypy/Pytest runs no config settings variables are set, so they should not be accessed IMPORTED_BY_MYPY_OR_PYTEST: "Final[bool]" = any( @@ -32,31 +40,29 @@ SECRET_KEY = settings.DISCORD_BOT_TOKEN -# Application definition - -INSTALLED_APPS = ["django.contrib.contenttypes", "db.core.app_config.CoreConfig"] - -MIDDLEWARE = ["django.middleware.common.CommonMiddleware"] - - -# Database -# https://docs.djangoproject.com/en/stable/ref/settings/#databases +# Application Definition -DATABASES = {"default": {"ENGINE": "django.db.backends.sqlite3", "NAME": BASE_DIR / "core.db"}} +INSTALLED_APPS: "Final[Sequence[str]]" = [ + "django.contrib.contenttypes", + "db.core.app_config.CoreConfig", +] +MIDDLEWARE: "Final[Sequence[str]]" = ["django.middleware.common.CommonMiddleware"] -# Internationalization -# https://docs.djangoproject.com/en/stable/topics/i18n/ -LANGUAGE_CODE = "en-gb" +# Database Settings -TIME_ZONE = "Europe/London" +DATABASES: "Final[Mapping[str, object]]" = { # SOURCE: https://docs.djangoproject.com/en/stable/ref/settings#databases + "default": {"ENGINE": "django.db.backends.sqlite3", "NAME": BASE_DIR / "core.db"} +} -USE_I18N = True +DEFAULT_AUTO_FIELD: "Final[str]" = "django.db.models.BigAutoField" # SOURCE: https://docs.djangoproject.com/en/stable/ref/settings#default-auto-field -USE_TZ = True -# Default primary key field type -# https://docs.djangoproject.com/en/stable/ref/settings/#default-auto-field +# Internationalisation, Language & Time Settings +# SOURCE: https://docs.djangoproject.com/en/stable/topics/i18n -DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" +LANGUAGE_CODE: "Final[str]" = "en-gb" +TIME_ZONE: "Final[str]" = "Europe/London" +USE_I18N: "Final[bool]" = True +USE_TZ: "Final[bool]" = True diff --git a/db/core/models/__init__.py b/db/core/models/__init__.py index 256eb3df..3978d25d 100644 --- a/db/core/models/__init__.py +++ b/db/core/models/__init__.py @@ -9,12 +9,18 @@ from django.core.validators import MinValueValidator, RegexValidator from django.db import models from django.utils.translation import gettext_lazy as _ +from django_stubs_ext.db.models import TypedModelMeta from .utils import AsyncBaseModel, DiscordMember if TYPE_CHECKING: from collections.abc import Sequence - from typing import Final + from collections.abc import Set as AbstractSet + from typing import ClassVar, Final + + from django.db.models.constraints import BaseConstraint + from django_stubs_ext import StrOrPromise + __all__: "Sequence[str]" = ( "AssignedCommitteeAction", @@ -47,23 +53,23 @@ class Status(models.TextChoices): DiscordMember, on_delete=models.CASCADE, related_name="assigned_committee_actions", - verbose_name="Discord Member", + verbose_name=_("Discord Member"), blank=False, null=False, unique=False, ) - description = models.TextField("Description", max_length=200, null=False, blank=False) + description = models.TextField(_("Description"), max_length=200, null=False, blank=False) status = models.CharField( max_length=3, choices=Status, default=Status.NOT_STARTED, null=False, blank=False ) - class Meta: # noqa: D106 - verbose_name = "Assigned Committee Action" - constraints = [ # noqa: RUF012 + class Meta(TypedModelMeta): # noqa: D106 + verbose_name: "ClassVar[StrOrPromise]" = _("Assigned Committee Action") + constraints: "ClassVar[list[BaseConstraint] | tuple[BaseConstraint, ...]]" = ( models.UniqueConstraint( fields=["discord_member", "description"], name="unique_user_action" - ) - ] + ), + ) @override def __repr__(self) -> str: @@ -88,15 +94,19 @@ class IntroductionReminderOptOutMember(AsyncBaseModel): DiscordMember, on_delete=models.CASCADE, related_name="opted_out_of_introduction_reminders", - verbose_name="Discord Member", + verbose_name=_("Discord Member"), blank=False, null=False, primary_key=True, ) - class Meta: # noqa: D106 - verbose_name = "Discord Member that has Opted-Out of Introduction Reminders" - verbose_name_plural = "Discord Members that have Opted-Out of Introduction Reminders" + class Meta(TypedModelMeta): # noqa: D106 + verbose_name: "ClassVar[StrOrPromise]" = _( + "Discord Member that has Opted-Out of Introduction Reminders" + ) + verbose_name_plural: "ClassVar[StrOrPromise]" = _( + "Discord Members that have Opted-Out of Introduction Reminders" + ) class SentOneOffIntroductionReminderMember(AsyncBaseModel): @@ -114,17 +124,17 @@ class SentOneOffIntroductionReminderMember(AsyncBaseModel): DiscordMember, on_delete=models.CASCADE, related_name="sent_one_off_introduction_reminder", - verbose_name="Discord Member", + verbose_name=_("Discord Member"), blank=False, null=False, primary_key=True, ) - class Meta: # noqa: D106 - verbose_name = ( + class Meta(TypedModelMeta): # noqa: D106 + verbose_name: "ClassVar[StrOrPromise]" = _( "Discord Member that has had a one-off Introduction reminder sent to their DMs" ) - verbose_name_plural = ( + verbose_name_plural: "ClassVar[StrOrPromise]" = _( "Discord Members that have had a one-off Introduction reminder sent to their DMs" ) @@ -147,15 +157,17 @@ class SentGetRolesReminderMember(AsyncBaseModel): DiscordMember, on_delete=models.CASCADE, related_name="sent_get_roles_reminder", - verbose_name="Discord Member", + verbose_name=_("Discord Member"), blank=False, null=False, primary_key=True, ) - class Meta: # noqa: D106 - verbose_name = 'Discord Member that has had a "Get Roles" reminder sent to their DMs' - verbose_name_plural = ( + class Meta(TypedModelMeta): # noqa: D106 + verbose_name: "ClassVar[StrOrPromise]" = _( + 'Discord Member that has had a "Get Roles" reminder sent to their DMs' + ) + verbose_name_plural: "ClassVar[StrOrPromise]" = _( 'Discord Members that have had a "Get Roles" reminder sent to their DMs' ) @@ -175,7 +187,7 @@ class GroupMadeMember(AsyncBaseModel): INSTANCES_NAME_PLURAL: str = "Group Made Members" hashed_group_member_id = models.CharField( - "Hashed Group Member ID", + _("Hashed Group Member ID"), unique=True, null=False, blank=False, @@ -183,14 +195,18 @@ class GroupMadeMember(AsyncBaseModel): validators=[ RegexValidator( r"\A[A-Fa-f\d]{64}\Z", - "hashed_group_member_id must be a valid sha256 hex-digest.", + _("hashed_group_member_id must be a valid sha256 hex-digest."), ) ], ) - class Meta: # noqa: D106 - verbose_name = "Hashed Group ID of User that has been made Member" - verbose_name_plural = "Hashed Group IDs of Users that have been made Member" + class Meta(TypedModelMeta): # noqa: D106 + verbose_name: "ClassVar[StrOrPromise]" = _( + "Hashed Group ID of User that has been made Member" + ) + verbose_name_plural: "ClassVar[StrOrPromise]" = _( + "Hashed Group IDs of Users that have been made Member" + ) @override def __setattr__(self, name: str, value: object) -> None: @@ -236,8 +252,8 @@ def hash_group_member_id( @classmethod @override - def get_proxy_field_names(cls) -> set[str]: - return super().get_proxy_field_names() | {"group_member_id"} + def _get_proxy_field_names(cls) -> "AbstractSet[str]": + return {*super()._get_proxy_field_names(), "group_member_id"} class DiscordReminder(AsyncBaseModel): @@ -249,16 +265,16 @@ class DiscordReminder(AsyncBaseModel): DiscordMember, on_delete=models.CASCADE, related_name="reminders", - verbose_name="Discord Member", + verbose_name=_("Discord Member"), blank=False, null=False, unique=False, ) message = models.TextField( - "Message to remind User", max_length=1500, null=False, blank=True + _("Message to remind User"), max_length=1500, null=False, blank=True ) _channel_id = models.CharField( - "Discord Channel ID of the channel that the reminder needs to be sent in", + _("Discord Channel ID of the channel that the reminder needs to be sent in"), unique=False, null=False, blank=False, @@ -266,12 +282,14 @@ class DiscordReminder(AsyncBaseModel): validators=[ RegexValidator( r"\A\d{17,20}\Z", - "channel_id must be a valid Discord channel ID (see https://docs.pycord.dev/en/stable/api/abcs.html#discord.abc.Snowflake.id)", + _( + "channel_id must be a valid Discord channel ID (see https://docs.pycord.dev/en/stable/api/abcs.html#discord.abc.Snowflake.id)" + ), ) ], ) _channel_type = models.IntegerField( - "Discord Channel Type of the channel that the reminder needs to be sent in", + _("Discord Channel Type of the channel that the reminder needs to be sent in"), choices=[ (channel_type.value, channel_type.name) for channel_type in discord.ChannelType ], @@ -279,12 +297,11 @@ class DiscordReminder(AsyncBaseModel): blank=True, ) send_datetime = models.DateTimeField( - "Date & time to send reminder", unique=False, null=False, blank=False + _("Date & time to send reminder"), unique=False, null=False, blank=False ) @property - def channel_id(self) -> int: - """The ID of the channel that the reminder needs to be sent in.""" + def channel_id(self) -> int: # noqa: D102 return int(self._channel_id) @channel_id.setter @@ -292,8 +309,8 @@ def channel_id(self, channel_id: str | int) -> None: self._channel_id = str(channel_id) @property - def channel_type(self) -> discord.ChannelType: - """The type of channel that the reminder needs to be sent in.""" + def channel_type(self) -> discord.ChannelType: # noqa: D102 + # NOTE: This finds the type of channel that the reminder needs to be sent in.""" return discord.ChannelType(self._channel_type) @channel_type.setter @@ -309,15 +326,15 @@ def channel_type(self, channel_type: discord.ChannelType | int) -> None: self._channel_type = channel_type - class Meta: # noqa: D106 - verbose_name = "A Reminder for a Discord Member" - verbose_name_plural = "Reminders for Discord Members" - constraints = [ # noqa: RUF012 + class Meta(TypedModelMeta): # noqa: D106 + verbose_name: "ClassVar[StrOrPromise]" = _("A Reminder for a Discord Member") + verbose_name_plural: "ClassVar[StrOrPromise]" = _("Reminders for Discord Members") + constraints: "ClassVar[list[BaseConstraint] | tuple[BaseConstraint, ...]]" = ( models.UniqueConstraint( fields=["discord_member", "message", "_channel_id"], name="unique_user_channel_message", - ) - ] + ), + ) @override def __str__(self) -> str: @@ -358,8 +375,8 @@ def get_formatted_message(self, user_mention: str | None) -> str: @classmethod @override - def get_proxy_field_names(cls) -> set[str]: - return super().get_proxy_field_names() | {"channel_id", "channel_type"} + def _get_proxy_field_names(cls) -> "AbstractSet[str]": + return {*super()._get_proxy_field_names(), "channel_id", "channel_type"} class LeftDiscordMember(AsyncBaseModel): @@ -375,20 +392,19 @@ class LeftDiscordMember(AsyncBaseModel): _roles = models.JSONField("List of roles a Discord Member had") @property - def roles(self) -> set[str]: - """Retrieve the set of roles the member had when they left your Discord guild.""" + def roles(self) -> set[str]: # noqa: D102 return set(self._roles) @roles.setter def roles(self, roles: set[str]) -> None: self._roles = list(roles) - class Meta: # noqa: D106 - verbose_name = ( + class Meta(TypedModelMeta): # noqa: D106 + verbose_name: "ClassVar[StrOrPromise]" = _( "A List of Roles that a Discord Member had " "when they left your group's Discord guild" ) - verbose_name_plural = ( + verbose_name_plural: "ClassVar[StrOrPromise]" = _( "Lists of Roles that Discord Members had when they left your group's Discord guild" ) @@ -412,8 +428,8 @@ def clean(self) -> None: @classmethod @override - def get_proxy_field_names(cls) -> set[str]: - return super().get_proxy_field_names() | {"roles"} + def _get_proxy_field_names(cls) -> "AbstractSet[str]": + return {*super()._get_proxy_field_names(), "roles"} class DiscordMemberStrikes(AsyncBaseModel): @@ -449,12 +465,12 @@ class DiscordMemberStrikes(AsyncBaseModel): default=0, ) - class Meta: # noqa: D106 - verbose_name = ( + class Meta(TypedModelMeta): # noqa: D106 + verbose_name: "ClassVar[StrOrPromise]" = _( "Discord Member that has been previously given one or more strikes " "because they broke one or more of your group's Discord guild rules" ) - verbose_name_plural = ( + verbose_name_plural: "ClassVar[StrOrPromise]" = _( "Discord Members that have been previously given one or more strikes " "because they broke one or more of your group's Discord guild rules" ) diff --git a/db/core/models/utils.py b/db/core/models/utils.py index 00e85693..2c024ee8 100644 --- a/db/core/models/utils.py +++ b/db/core/models/utils.py @@ -5,11 +5,16 @@ from asgiref.sync import sync_to_async from django.core.exceptions import FieldDoesNotExist from django.core.validators import RegexValidator -from django.db import models +from django.db import models, transaction +from django.utils.translation import gettext_lazy as _ +from django_stubs_ext.db.models import TypedModelMeta if TYPE_CHECKING: from collections.abc import Iterable, Sequence - from typing import Final + from collections.abc import Set as AbstractSet + from typing import ClassVar, Final + + from django.db.models.base import ModelBase __all__: "Sequence[str]" = ("AsyncBaseModel", "DiscordMember") @@ -19,33 +24,34 @@ class AsyncBaseModel(models.Model): Asynchronous base model, defining extra synchronous and asynchronous utility methods. This class is abstract so should not be instantiated or have a table made for it in the - database (see https://docs.djangoproject.com/en/stable/topics/db/models/#abstract-base-classes). + database (see https://docs.djangoproject.com/en/stable/topics/db/models#abstract-base-classes). """ INSTANCES_NAME_PLURAL: str - class Meta: # noqa: D106 - abstract = True + class Meta(TypedModelMeta): # noqa: D106 + abstract: "ClassVar[bool]" = True @override def __init__(self, *args: object, **kwargs: object) -> None: proxy_fields: dict[str, object] = { field_name: kwargs.pop(field_name) - for field_name in set(kwargs.keys()) & self.get_proxy_field_names() + for field_name in set(kwargs.keys()) & self._get_proxy_field_names() } - super().__init__(*args, **kwargs) + with transaction.atomic(): + super().__init__(*args, **kwargs) - field_name: str - value: object - for field_name, value in proxy_fields.items(): - setattr(self, field_name, value) + field_name: str + value: object + for field_name, value in proxy_fields.items(): + setattr(self, field_name, value) @override - def save( # type: ignore[override] + def save( self, *, - force_insert: bool = False, + force_insert: bool | tuple["ModelBase", ...] = False, force_update: bool = False, using: str | None = None, update_fields: "Iterable[str] | None" = None, @@ -63,7 +69,7 @@ def update( self, *, commit: bool = True, - force_insert: bool = False, + force_insert: bool | tuple["ModelBase", ...] = False, force_update: bool = False, using: str | None = None, update_fields: "Iterable[str] | None" = None, @@ -83,7 +89,7 @@ def update( unexpected_kwargs: set[str] = set() field_name: str - for field_name in set(kwargs.keys()) - self.get_proxy_field_names(): + for field_name in set(kwargs.keys()) - self._get_proxy_field_names(): try: self._meta.get_field(field_name) except FieldDoesNotExist: @@ -96,34 +102,35 @@ def update( ) raise TypeError(UNEXPECTED_KWARGS_MESSAGE) - value: object - for field_name, value in kwargs.items(): - setattr(self, field_name, value) + with transaction.atomic(): + value: object + for field_name, value in kwargs.items(): + setattr(self, field_name, value) - if commit: - return self.save( - force_insert=force_insert, - force_update=force_update, - using=using, - update_fields=update_fields, - ) + if commit: + return self.save( + force_insert=force_insert, + force_update=force_update, + using=using, + update_fields=update_fields, + ) - return None + return None - update.alters_data: bool = True # type: ignore[attr-defined, misc] + setattr(update, "alters_data", True) # noqa: B010 async def aupdate( self, *, commit: bool = True, - force_insert: bool = False, + force_insert: bool | tuple["ModelBase", ...] = False, force_update: bool = False, using: str | None = None, update_fields: "Iterable[str] | None" = None, **kwargs: object, ) -> None: """ - Asyncronously change an in-memory object's values, then save it to the database. + Asynchronously change an in-memory object's values, then save it to the database. This simplifies the two steps into a single operation (based on Django's Queryset.bulk_update method). @@ -142,10 +149,10 @@ async def aupdate( **kwargs, ) - aupdate.alters_data: bool = True # type: ignore[attr-defined, misc] + setattr(aupdate, "alters_data", True) # noqa: B010 @classmethod - def get_proxy_field_names(cls) -> set[str]: + def _get_proxy_field_names(cls) -> "AbstractSet[str]": """ Return the set of extra names of properties that can be saved to the database. @@ -167,17 +174,17 @@ class DiscordMember(AsyncBaseModel): """ discord_id = models.CharField( - "Discord Member ID", + _("Discord Member ID"), unique=True, null=False, blank=False, max_length=20, - validators=[ + validators=( RegexValidator( r"\A\d{17,20}\Z", "discord_id must be a valid Discord member ID (see https://docs.pycord.dev/en/stable/api/abcs.html#discord.abc.Snowflake.id)", ), - ], + ), ) @override @@ -189,16 +196,14 @@ def __repr__(self) -> str: return f"<{self._meta.verbose_name}: {self.discord_id!r}>" @property - def member_id(self) -> str: - """Return the Discord ID of this member.""" + def member_id(self) -> str: # noqa: D102 return self.discord_id @member_id.setter def member_id(self, value: str | int) -> None: - """Set the Discord ID of this member.""" self.discord_id = str(value) @classmethod @override - def get_proxy_field_names(cls) -> set[str]: - return super().get_proxy_field_names() | {"member_id"} + def _get_proxy_field_names(cls) -> "AbstractSet[str]": + return {*super()._get_proxy_field_names(), "member_id"} diff --git a/exceptions/messages.py b/exceptions/messages.py index 9a2911fe..2a1862e1 100644 --- a/exceptions/messages.py +++ b/exceptions/messages.py @@ -46,8 +46,8 @@ def __init__(self, message: str | None = None, missing_key: str | None = None) - super().__init__(message, dict_key=missing_key) @property - def missing_key(self) -> str | None: - """The key that was missing from the messages.json file.""" + def missing_key(self) -> str | None: # noqa: D102 + # NOTE: The key that was missing from the messages.json file. return self.dict_key @missing_key.setter diff --git a/utils/tex_bot.py b/utils/tex_bot.py index f50b8a09..a45c3c3b 100644 --- a/utils/tex_bot.py +++ b/utils/tex_bot.py @@ -73,8 +73,8 @@ async def close(self) -> "NoReturn": # type: ignore[misc] logger.info("TeX-Bot manually terminated.") @property - def EXIT_WAS_DUE_TO_KILL_COMMAND(self) -> bool: # noqa: N802 - """Return whether the TeX-Bot exited due to the kill command being used.""" + def EXIT_WAS_DUE_TO_KILL_COMMAND(self) -> bool: # noqa: D102, N802 + # NOTE: Identifies whether TeX-Bot exited due to the kill command being used.""" return self._exit_was_due_to_kill_command @property