From 8c406bdb04356a4e7fdb1f3eeb75cac640a67397 Mon Sep 17 00:00:00 2001 From: Thiago Bellini Ribeiro Date: Thu, 18 Jul 2024 12:21:12 -0300 Subject: [PATCH] feat: Bump strawberry to 0.236.0 and refactor changed imports (#591) --- poetry.lock | 198 ++++++++++----------- pyproject.toml | 4 +- strawberry_django/arguments.py | 2 +- strawberry_django/fields/base.py | 12 +- strawberry_django/fields/field.py | 6 +- strawberry_django/fields/filter_order.py | 4 +- strawberry_django/fields/types.py | 2 +- strawberry_django/filters.py | 9 +- strawberry_django/integrations/guardian.py | 6 +- strawberry_django/mutations/fields.py | 11 +- strawberry_django/mutations/mutations.py | 2 +- strawberry_django/mutations/resolvers.py | 23 ++- strawberry_django/optimizer.py | 9 +- strawberry_django/ordering.py | 9 +- strawberry_django/pagination.py | 4 +- strawberry_django/permissions.py | 6 +- strawberry_django/relay.py | 3 +- strawberry_django/type.py | 7 +- strawberry_django/utils/inspect.py | 10 +- strawberry_django/utils/typing.py | 4 +- tests/auth/test_types.py | 3 +- tests/fields/test_attributes.py | 2 +- tests/fields/test_input.py | 3 +- tests/fields/test_ref.py | 2 +- tests/fields/test_relations.py | 4 +- tests/fields/test_types.py | 6 +- tests/filters/test_filters_v2.py | 4 +- tests/filters/test_types.py | 3 +- tests/test_ordering.py | 5 +- tests/test_type.py | 2 +- tests/test_types.py | 4 +- tests/types2/test_input.py | 3 +- tests/types2/test_type.py | 4 +- 33 files changed, 202 insertions(+), 174 deletions(-) diff --git a/poetry.lock b/poetry.lock index 956b7e94..44de8b9f 100644 --- a/poetry.lock +++ b/poetry.lock @@ -233,63 +233,63 @@ files = [ [[package]] name = "coverage" -version = "7.5.4" +version = "7.6.0" description = "Code coverage measurement for Python" optional = false python-versions = ">=3.8" files = [ - {file = "coverage-7.5.4-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6cfb5a4f556bb51aba274588200a46e4dd6b505fb1a5f8c5ae408222eb416f99"}, - {file = "coverage-7.5.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:2174e7c23e0a454ffe12267a10732c273243b4f2d50d07544a91198f05c48f47"}, - {file = "coverage-7.5.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2214ee920787d85db1b6a0bd9da5f8503ccc8fcd5814d90796c2f2493a2f4d2e"}, - {file = "coverage-7.5.4-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1137f46adb28e3813dec8c01fefadcb8c614f33576f672962e323b5128d9a68d"}, - {file = "coverage-7.5.4-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b385d49609f8e9efc885790a5a0e89f2e3ae042cdf12958b6034cc442de428d3"}, - {file = "coverage-7.5.4-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:b4a474f799456e0eb46d78ab07303286a84a3140e9700b9e154cfebc8f527016"}, - {file = "coverage-7.5.4-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:5cd64adedf3be66f8ccee418473c2916492d53cbafbfcff851cbec5a8454b136"}, - {file = "coverage-7.5.4-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:e564c2cf45d2f44a9da56f4e3a26b2236504a496eb4cb0ca7221cd4cc7a9aca9"}, - {file = "coverage-7.5.4-cp310-cp310-win32.whl", hash = "sha256:7076b4b3a5f6d2b5d7f1185fde25b1e54eb66e647a1dfef0e2c2bfaf9b4c88c8"}, - {file = "coverage-7.5.4-cp310-cp310-win_amd64.whl", hash = "sha256:018a12985185038a5b2bcafab04ab833a9a0f2c59995b3cec07e10074c78635f"}, - {file = "coverage-7.5.4-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:db14f552ac38f10758ad14dd7b983dbab424e731588d300c7db25b6f89e335b5"}, - {file = "coverage-7.5.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:3257fdd8e574805f27bb5342b77bc65578e98cbc004a92232106344053f319ba"}, - {file = "coverage-7.5.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3a6612c99081d8d6134005b1354191e103ec9705d7ba2754e848211ac8cacc6b"}, - {file = "coverage-7.5.4-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d45d3cbd94159c468b9b8c5a556e3f6b81a8d1af2a92b77320e887c3e7a5d080"}, - {file = "coverage-7.5.4-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ed550e7442f278af76d9d65af48069f1fb84c9f745ae249c1a183c1e9d1b025c"}, - {file = "coverage-7.5.4-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:7a892be37ca35eb5019ec85402c3371b0f7cda5ab5056023a7f13da0961e60da"}, - {file = "coverage-7.5.4-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:8192794d120167e2a64721d88dbd688584675e86e15d0569599257566dec9bf0"}, - {file = "coverage-7.5.4-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:820bc841faa502e727a48311948e0461132a9c8baa42f6b2b84a29ced24cc078"}, - {file = "coverage-7.5.4-cp311-cp311-win32.whl", hash = "sha256:6aae5cce399a0f065da65c7bb1e8abd5c7a3043da9dceb429ebe1b289bc07806"}, - {file = "coverage-7.5.4-cp311-cp311-win_amd64.whl", hash = "sha256:d2e344d6adc8ef81c5a233d3a57b3c7d5181f40e79e05e1c143da143ccb6377d"}, - {file = "coverage-7.5.4-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:54317c2b806354cbb2dc7ac27e2b93f97096912cc16b18289c5d4e44fc663233"}, - {file = "coverage-7.5.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:042183de01f8b6d531e10c197f7f0315a61e8d805ab29c5f7b51a01d62782747"}, - {file = "coverage-7.5.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a6bb74ed465d5fb204b2ec41d79bcd28afccf817de721e8a807d5141c3426638"}, - {file = "coverage-7.5.4-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b3d45ff86efb129c599a3b287ae2e44c1e281ae0f9a9bad0edc202179bcc3a2e"}, - {file = "coverage-7.5.4-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5013ed890dc917cef2c9f765c4c6a8ae9df983cd60dbb635df8ed9f4ebc9f555"}, - {file = "coverage-7.5.4-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:1014fbf665fef86cdfd6cb5b7371496ce35e4d2a00cda501cf9f5b9e6fced69f"}, - {file = "coverage-7.5.4-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:3684bc2ff328f935981847082ba4fdc950d58906a40eafa93510d1b54c08a66c"}, - {file = "coverage-7.5.4-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:581ea96f92bf71a5ec0974001f900db495488434a6928a2ca7f01eee20c23805"}, - {file = "coverage-7.5.4-cp312-cp312-win32.whl", hash = "sha256:73ca8fbc5bc622e54627314c1a6f1dfdd8db69788f3443e752c215f29fa87a0b"}, - {file = "coverage-7.5.4-cp312-cp312-win_amd64.whl", hash = "sha256:cef4649ec906ea7ea5e9e796e68b987f83fa9a718514fe147f538cfeda76d7a7"}, - {file = "coverage-7.5.4-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:cdd31315fc20868c194130de9ee6bfd99755cc9565edff98ecc12585b90be882"}, - {file = "coverage-7.5.4-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:02ff6e898197cc1e9fa375581382b72498eb2e6d5fc0b53f03e496cfee3fac6d"}, - {file = "coverage-7.5.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d05c16cf4b4c2fc880cb12ba4c9b526e9e5d5bb1d81313d4d732a5b9fe2b9d53"}, - {file = "coverage-7.5.4-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c5986ee7ea0795a4095ac4d113cbb3448601efca7f158ec7f7087a6c705304e4"}, - {file = "coverage-7.5.4-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5df54843b88901fdc2f598ac06737f03d71168fd1175728054c8f5a2739ac3e4"}, - {file = "coverage-7.5.4-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:ab73b35e8d109bffbda9a3e91c64e29fe26e03e49addf5b43d85fc426dde11f9"}, - {file = "coverage-7.5.4-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:aea072a941b033813f5e4814541fc265a5c12ed9720daef11ca516aeacd3bd7f"}, - {file = "coverage-7.5.4-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:16852febd96acd953b0d55fc842ce2dac1710f26729b31c80b940b9afcd9896f"}, - {file = "coverage-7.5.4-cp38-cp38-win32.whl", hash = "sha256:8f894208794b164e6bd4bba61fc98bf6b06be4d390cf2daacfa6eca0a6d2bb4f"}, - {file = "coverage-7.5.4-cp38-cp38-win_amd64.whl", hash = "sha256:e2afe743289273209c992075a5a4913e8d007d569a406ffed0bd080ea02b0633"}, - {file = "coverage-7.5.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:b95c3a8cb0463ba9f77383d0fa8c9194cf91f64445a63fc26fb2327e1e1eb088"}, - {file = "coverage-7.5.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:3d7564cc09dd91b5a6001754a5b3c6ecc4aba6323baf33a12bd751036c998be4"}, - {file = "coverage-7.5.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:44da56a2589b684813f86d07597fdf8a9c6ce77f58976727329272f5a01f99f7"}, - {file = "coverage-7.5.4-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e16f3d6b491c48c5ae726308e6ab1e18ee830b4cdd6913f2d7f77354b33f91c8"}, - {file = "coverage-7.5.4-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dbc5958cb471e5a5af41b0ddaea96a37e74ed289535e8deca404811f6cb0bc3d"}, - {file = "coverage-7.5.4-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:a04e990a2a41740b02d6182b498ee9796cf60eefe40cf859b016650147908029"}, - {file = "coverage-7.5.4-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:ddbd2f9713a79e8e7242d7c51f1929611e991d855f414ca9996c20e44a895f7c"}, - {file = "coverage-7.5.4-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:b1ccf5e728ccf83acd313c89f07c22d70d6c375a9c6f339233dcf792094bcbf7"}, - {file = "coverage-7.5.4-cp39-cp39-win32.whl", hash = "sha256:56b4eafa21c6c175b3ede004ca12c653a88b6f922494b023aeb1e836df953ace"}, - {file = "coverage-7.5.4-cp39-cp39-win_amd64.whl", hash = "sha256:65e528e2e921ba8fd67d9055e6b9f9e34b21ebd6768ae1c1723f4ea6ace1234d"}, - {file = "coverage-7.5.4-pp38.pp39.pp310-none-any.whl", hash = "sha256:79b356f3dd5b26f3ad23b35c75dbdaf1f9e2450b6bcefc6d0825ea0aa3f86ca5"}, - {file = "coverage-7.5.4.tar.gz", hash = "sha256:a44963520b069e12789d0faea4e9fdb1e410cdc4aab89d94f7f55cbb7fef0353"}, + {file = "coverage-7.6.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:dff044f661f59dace805eedb4a7404c573b6ff0cdba4a524141bc63d7be5c7fd"}, + {file = "coverage-7.6.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:a8659fd33ee9e6ca03950cfdcdf271d645cf681609153f218826dd9805ab585c"}, + {file = "coverage-7.6.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7792f0ab20df8071d669d929c75c97fecfa6bcab82c10ee4adb91c7a54055463"}, + {file = "coverage-7.6.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d4b3cd1ca7cd73d229487fa5caca9e4bc1f0bca96526b922d61053ea751fe791"}, + {file = "coverage-7.6.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e7e128f85c0b419907d1f38e616c4f1e9f1d1b37a7949f44df9a73d5da5cd53c"}, + {file = "coverage-7.6.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:a94925102c89247530ae1dab7dc02c690942566f22e189cbd53579b0693c0783"}, + {file = "coverage-7.6.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:dcd070b5b585b50e6617e8972f3fbbee786afca71b1936ac06257f7e178f00f6"}, + {file = "coverage-7.6.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:d50a252b23b9b4dfeefc1f663c568a221092cbaded20a05a11665d0dbec9b8fb"}, + {file = "coverage-7.6.0-cp310-cp310-win32.whl", hash = "sha256:0e7b27d04131c46e6894f23a4ae186a6a2207209a05df5b6ad4caee6d54a222c"}, + {file = "coverage-7.6.0-cp310-cp310-win_amd64.whl", hash = "sha256:54dece71673b3187c86226c3ca793c5f891f9fc3d8aa183f2e3653da18566169"}, + {file = "coverage-7.6.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c7b525ab52ce18c57ae232ba6f7010297a87ced82a2383b1afd238849c1ff933"}, + {file = "coverage-7.6.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:4bea27c4269234e06f621f3fac3925f56ff34bc14521484b8f66a580aacc2e7d"}, + {file = "coverage-7.6.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ed8d1d1821ba5fc88d4a4f45387b65de52382fa3ef1f0115a4f7a20cdfab0e94"}, + {file = "coverage-7.6.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:01c322ef2bbe15057bc4bf132b525b7e3f7206f071799eb8aa6ad1940bcf5fb1"}, + {file = "coverage-7.6.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:03cafe82c1b32b770a29fd6de923625ccac3185a54a5e66606da26d105f37dac"}, + {file = "coverage-7.6.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:0d1b923fc4a40c5832be4f35a5dab0e5ff89cddf83bb4174499e02ea089daf57"}, + {file = "coverage-7.6.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:4b03741e70fb811d1a9a1d75355cf391f274ed85847f4b78e35459899f57af4d"}, + {file = "coverage-7.6.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:a73d18625f6a8a1cbb11eadc1d03929f9510f4131879288e3f7922097a429f63"}, + {file = "coverage-7.6.0-cp311-cp311-win32.whl", hash = "sha256:65fa405b837060db569a61ec368b74688f429b32fa47a8929a7a2f9b47183713"}, + {file = "coverage-7.6.0-cp311-cp311-win_amd64.whl", hash = "sha256:6379688fb4cfa921ae349c76eb1a9ab26b65f32b03d46bb0eed841fd4cb6afb1"}, + {file = "coverage-7.6.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:f7db0b6ae1f96ae41afe626095149ecd1b212b424626175a6633c2999eaad45b"}, + {file = "coverage-7.6.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:bbdf9a72403110a3bdae77948b8011f644571311c2fb35ee15f0f10a8fc082e8"}, + {file = "coverage-7.6.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9cc44bf0315268e253bf563f3560e6c004efe38f76db03a1558274a6e04bf5d5"}, + {file = "coverage-7.6.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:da8549d17489cd52f85a9829d0e1d91059359b3c54a26f28bec2c5d369524807"}, + {file = "coverage-7.6.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0086cd4fc71b7d485ac93ca4239c8f75732c2ae3ba83f6be1c9be59d9e2c6382"}, + {file = "coverage-7.6.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:1fad32ee9b27350687035cb5fdf9145bc9cf0a094a9577d43e909948ebcfa27b"}, + {file = "coverage-7.6.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:044a0985a4f25b335882b0966625270a8d9db3d3409ddc49a4eb00b0ef5e8cee"}, + {file = "coverage-7.6.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:76d5f82213aa78098b9b964ea89de4617e70e0d43e97900c2778a50856dac605"}, + {file = "coverage-7.6.0-cp312-cp312-win32.whl", hash = "sha256:3c59105f8d58ce500f348c5b56163a4113a440dad6daa2294b5052a10db866da"}, + {file = "coverage-7.6.0-cp312-cp312-win_amd64.whl", hash = "sha256:ca5d79cfdae420a1d52bf177de4bc2289c321d6c961ae321503b2ca59c17ae67"}, + {file = "coverage-7.6.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:d39bd10f0ae453554798b125d2f39884290c480f56e8a02ba7a6ed552005243b"}, + {file = "coverage-7.6.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:beb08e8508e53a568811016e59f3234d29c2583f6b6e28572f0954a6b4f7e03d"}, + {file = "coverage-7.6.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b2e16f4cd2bc4d88ba30ca2d3bbf2f21f00f382cf4e1ce3b1ddc96c634bc48ca"}, + {file = "coverage-7.6.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6616d1c9bf1e3faea78711ee42a8b972367d82ceae233ec0ac61cc7fec09fa6b"}, + {file = "coverage-7.6.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ad4567d6c334c46046d1c4c20024de2a1c3abc626817ae21ae3da600f5779b44"}, + {file = "coverage-7.6.0-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:d17c6a415d68cfe1091d3296ba5749d3d8696e42c37fca5d4860c5bf7b729f03"}, + {file = "coverage-7.6.0-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:9146579352d7b5f6412735d0f203bbd8d00113a680b66565e205bc605ef81bc6"}, + {file = "coverage-7.6.0-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:cdab02a0a941af190df8782aafc591ef3ad08824f97850b015c8c6a8b3877b0b"}, + {file = "coverage-7.6.0-cp38-cp38-win32.whl", hash = "sha256:df423f351b162a702c053d5dddc0fc0ef9a9e27ea3f449781ace5f906b664428"}, + {file = "coverage-7.6.0-cp38-cp38-win_amd64.whl", hash = "sha256:f2501d60d7497fd55e391f423f965bbe9e650e9ffc3c627d5f0ac516026000b8"}, + {file = "coverage-7.6.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:7221f9ac9dad9492cecab6f676b3eaf9185141539d5c9689d13fd6b0d7de840c"}, + {file = "coverage-7.6.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ddaaa91bfc4477d2871442bbf30a125e8fe6b05da8a0015507bfbf4718228ab2"}, + {file = "coverage-7.6.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c4cbe651f3904e28f3a55d6f371203049034b4ddbce65a54527a3f189ca3b390"}, + {file = "coverage-7.6.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:831b476d79408ab6ccfadaaf199906c833f02fdb32c9ab907b1d4aa0713cfa3b"}, + {file = "coverage-7.6.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:46c3d091059ad0b9c59d1034de74a7f36dcfa7f6d3bde782c49deb42438f2450"}, + {file = "coverage-7.6.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:4d5fae0a22dc86259dee66f2cc6c1d3e490c4a1214d7daa2a93d07491c5c04b6"}, + {file = "coverage-7.6.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:07ed352205574aad067482e53dd606926afebcb5590653121063fbf4e2175166"}, + {file = "coverage-7.6.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:49c76cdfa13015c4560702574bad67f0e15ca5a2872c6a125f6327ead2b731dd"}, + {file = "coverage-7.6.0-cp39-cp39-win32.whl", hash = "sha256:482855914928c8175735a2a59c8dc5806cf7d8f032e4820d52e845d1f731dca2"}, + {file = "coverage-7.6.0-cp39-cp39-win_amd64.whl", hash = "sha256:543ef9179bc55edfd895154a51792b01c017c87af0ebaae092720152e19e42ca"}, + {file = "coverage-7.6.0-pp38.pp39.pp310-none-any.whl", hash = "sha256:6fe885135c8a479d3e37a7aae61cbd3a0fb2deccb4dda3c25f92a49189f766d6"}, + {file = "coverage-7.6.0.tar.gz", hash = "sha256:289cc803fa1dc901f84701ac10c9ee873619320f2f9aff38794db4a4a0268d51"}, ] [package.dependencies] @@ -310,13 +310,13 @@ files = [ [[package]] name = "django" -version = "4.2.13" +version = "4.2.14" description = "A high-level Python web framework that encourages rapid development and clean, pragmatic design." optional = false python-versions = ">=3.8" files = [ - {file = "Django-4.2.13-py3-none-any.whl", hash = "sha256:a17fcba2aad3fc7d46fdb23215095dbbd64e6174bf4589171e732b18b07e426a"}, - {file = "Django-4.2.13.tar.gz", hash = "sha256:837e3cf1f6c31347a1396a3f6b65688f2b4bb4a11c580dcb628b5afe527b68a5"}, + {file = "Django-4.2.14-py3-none-any.whl", hash = "sha256:3ec32bc2c616ab02834b9cac93143a7dc1cdcd5b822d78ac95fc20a38c534240"}, + {file = "Django-4.2.14.tar.gz", hash = "sha256:fc6919875a6226c7ffcae1a7d51e0f2ceaf6f160393180818f6c95f51b1e7b96"}, ] [package.dependencies] @@ -346,17 +346,17 @@ typing_extensions = ">=4.0.0" [[package]] name = "django-debug-toolbar" -version = "4.4.5" +version = "3.8.1" description = "A configurable set of panels that display various debug information about the current request/response." optional = false -python-versions = ">=3.8" +python-versions = ">=3.7" files = [ - {file = "django_debug_toolbar-4.4.5-py3-none-any.whl", hash = "sha256:91425606673ee674d780f7aeedf3595c264eb382dcf41f55c6779577900904c0"}, - {file = "django_debug_toolbar-4.4.5.tar.gz", hash = "sha256:8298ce966b4c8fc71430082dd4739ef2badb5f867734e1973a413c4ab2ea81b7"}, + {file = "django_debug_toolbar-3.8.1-py3-none-any.whl", hash = "sha256:879f8a4672d41621c06a4d322dcffa630fc4df056cada6e417ed01db0e5e0478"}, + {file = "django_debug_toolbar-3.8.1.tar.gz", hash = "sha256:24ef1a7d44d25e60d7951e378454c6509bf536dce7e7d9d36e7c387db499bc27"}, ] [package.dependencies] -django = ">=4.2.9" +django = ">=3.2.4" sqlparse = ">=0.2" [[package]] @@ -447,13 +447,13 @@ files = [ [[package]] name = "exceptiongroup" -version = "1.2.1" +version = "1.2.2" description = "Backport of PEP 654 (exception groups)" optional = false python-versions = ">=3.7" files = [ - {file = "exceptiongroup-1.2.1-py3-none-any.whl", hash = "sha256:5258b9ed329c5bbdd31a309f53cbfb0b155341807f6ff7606a1e801a891b29ad"}, - {file = "exceptiongroup-1.2.1.tar.gz", hash = "sha256:a4785e48b045528f5bfe627b6ad554ff32def154f42372786903b7abcfe1aa16"}, + {file = "exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b"}, + {file = "exceptiongroup-1.2.2.tar.gz", hash = "sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc"}, ] [package.extras] @@ -790,13 +790,13 @@ pyyaml = "*" [[package]] name = "mkdocs-material" -version = "9.5.28" +version = "9.5.29" description = "Documentation that simply works" optional = false python-versions = ">=3.8" files = [ - {file = "mkdocs_material-9.5.28-py3-none-any.whl", hash = "sha256:ff48b11b2a9f705dd210409ec3b418ab443dd36d96915bcba45a41f10ea27bfd"}, - {file = "mkdocs_material-9.5.28.tar.gz", hash = "sha256:9cba305283ad1600e3d0a67abe72d7a058b54793b47be39930911a588fe0336b"}, + {file = "mkdocs_material-9.5.29-py3-none-any.whl", hash = "sha256:afc1f508e2662ded95f0a35a329e8a5acd73ee88ca07ba73836eb6fcdae5d8b4"}, + {file = "mkdocs_material-9.5.29.tar.gz", hash = "sha256:3e977598ec15a4ddad5c4dfc9e08edab6023edb51e88f0729bd27be77e3d322a"}, ] [package.dependencies] @@ -1208,13 +1208,13 @@ dev = ["argcomplete", "attrs (>=19.2)", "hypothesis (>=3.56)", "mock", "pygments [[package]] name = "pytest-asyncio" -version = "0.23.7" +version = "0.23.8" description = "Pytest support for asyncio" optional = false python-versions = ">=3.8" files = [ - {file = "pytest_asyncio-0.23.7-py3-none-any.whl", hash = "sha256:009b48127fbe44518a547bddd25611551b0e43ccdbf1e67d12479f569832c20b"}, - {file = "pytest_asyncio-0.23.7.tar.gz", hash = "sha256:5f5c72948f4c49e7db4f29f2521d4031f1c27f86e57b046126654083d4770268"}, + {file = "pytest_asyncio-0.23.8-py3-none-any.whl", hash = "sha256:50265d892689a5faefb84df80819d1ecef566eb3549cf915dfb33569359d1ce2"}, + {file = "pytest_asyncio-0.23.8.tar.gz", hash = "sha256:759b10b33a6dc61cce40a8bd5205e302978bbbcc00e279a8b61d9a6a3c82e4d3"}, ] [package.dependencies] @@ -1516,40 +1516,40 @@ use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] [[package]] name = "ruff" -version = "0.5.1" +version = "0.5.2" description = "An extremely fast Python linter and code formatter, written in Rust." optional = false python-versions = ">=3.7" files = [ - {file = "ruff-0.5.1-py3-none-linux_armv6l.whl", hash = "sha256:6ecf968fcf94d942d42b700af18ede94b07521bd188aaf2cd7bc898dd8cb63b6"}, - {file = "ruff-0.5.1-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:204fb0a472f00f2e6280a7c8c7c066e11e20e23a37557d63045bf27a616ba61c"}, - {file = "ruff-0.5.1-py3-none-macosx_11_0_arm64.whl", hash = "sha256:d235968460e8758d1e1297e1de59a38d94102f60cafb4d5382033c324404ee9d"}, - {file = "ruff-0.5.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:38beace10b8d5f9b6bdc91619310af6d63dd2019f3fb2d17a2da26360d7962fa"}, - {file = "ruff-0.5.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5e478d2f09cf06add143cf8c4540ef77b6599191e0c50ed976582f06e588c994"}, - {file = "ruff-0.5.1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f0368d765eec8247b8550251c49ebb20554cc4e812f383ff9f5bf0d5d94190b0"}, - {file = "ruff-0.5.1-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:3a9a9a1b582e37669b0138b7c1d9d60b9edac880b80eb2baba6d0e566bdeca4d"}, - {file = "ruff-0.5.1-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:bdd9f723e16003623423affabcc0a807a66552ee6a29f90eddad87a40c750b78"}, - {file = "ruff-0.5.1-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:be9fd62c1e99539da05fcdc1e90d20f74aec1b7a1613463ed77870057cd6bd96"}, - {file = "ruff-0.5.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e216fc75a80ea1fbd96af94a6233d90190d5b65cc3d5dfacf2bd48c3e067d3e1"}, - {file = "ruff-0.5.1-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:c4c2112e9883a40967827d5c24803525145e7dab315497fae149764979ac7929"}, - {file = "ruff-0.5.1-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:dfaf11c8a116394da3b65cd4b36de30d8552fa45b8119b9ef5ca6638ab964fa3"}, - {file = "ruff-0.5.1-py3-none-musllinux_1_2_i686.whl", hash = "sha256:d7ceb9b2fe700ee09a0c6b192c5ef03c56eb82a0514218d8ff700f6ade004108"}, - {file = "ruff-0.5.1-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:bac6288e82f6296f82ed5285f597713acb2a6ae26618ffc6b429c597b392535c"}, - {file = "ruff-0.5.1-py3-none-win32.whl", hash = "sha256:5c441d9c24ec09e1cb190a04535c5379b36b73c4bc20aa180c54812c27d1cca4"}, - {file = "ruff-0.5.1-py3-none-win_amd64.whl", hash = "sha256:b1789bf2cd3d1b5a7d38397cac1398ddf3ad7f73f4de01b1e913e2abc7dfc51d"}, - {file = "ruff-0.5.1-py3-none-win_arm64.whl", hash = "sha256:2875b7596a740cbbd492f32d24be73e545a4ce0a3daf51e4f4e609962bfd3cd2"}, - {file = "ruff-0.5.1.tar.gz", hash = "sha256:3164488aebd89b1745b47fd00604fb4358d774465f20d1fcd907f9c0fc1b0655"}, + {file = "ruff-0.5.2-py3-none-linux_armv6l.whl", hash = "sha256:7bab8345df60f9368d5f4594bfb8b71157496b44c30ff035d1d01972e764d3be"}, + {file = "ruff-0.5.2-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:1aa7acad382ada0189dbe76095cf0a36cd0036779607c397ffdea16517f535b1"}, + {file = "ruff-0.5.2-py3-none-macosx_11_0_arm64.whl", hash = "sha256:aec618d5a0cdba5592c60c2dee7d9c865180627f1a4a691257dea14ac1aa264d"}, + {file = "ruff-0.5.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a0b62adc5ce81780ff04077e88bac0986363e4a3260ad3ef11ae9c14aa0e67ef"}, + {file = "ruff-0.5.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:dc42ebf56ede83cb080a50eba35a06e636775649a1ffd03dc986533f878702a3"}, + {file = "ruff-0.5.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c15c6e9f88c67ffa442681365d11df38afb11059fc44238e71a9d9f1fd51de70"}, + {file = "ruff-0.5.2-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:d3de9a5960f72c335ef00763d861fc5005ef0644cb260ba1b5a115a102157251"}, + {file = "ruff-0.5.2-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:fe5a968ae933e8f7627a7b2fc8893336ac2be0eb0aace762d3421f6e8f7b7f83"}, + {file = "ruff-0.5.2-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a04f54a9018f75615ae52f36ea1c5515e356e5d5e214b22609ddb546baef7132"}, + {file = "ruff-0.5.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1ed02fb52e3741f0738db5f93e10ae0fb5c71eb33a4f2ba87c9a2fa97462a649"}, + {file = "ruff-0.5.2-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:3cf8fe659f6362530435d97d738eb413e9f090e7e993f88711b0377fbdc99f60"}, + {file = "ruff-0.5.2-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:237a37e673e9f3cbfff0d2243e797c4862a44c93d2f52a52021c1a1b0899f846"}, + {file = "ruff-0.5.2-py3-none-musllinux_1_2_i686.whl", hash = "sha256:2a2949ce7c1cbd8317432ada80fe32156df825b2fd611688814c8557824ef060"}, + {file = "ruff-0.5.2-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:481af57c8e99da92ad168924fd82220266043c8255942a1cb87958b108ac9335"}, + {file = "ruff-0.5.2-py3-none-win32.whl", hash = "sha256:f1aea290c56d913e363066d83d3fc26848814a1fed3d72144ff9c930e8c7c718"}, + {file = "ruff-0.5.2-py3-none-win_amd64.whl", hash = "sha256:8532660b72b5d94d2a0a7a27ae7b9b40053662d00357bb2a6864dd7e38819084"}, + {file = "ruff-0.5.2-py3-none-win_arm64.whl", hash = "sha256:73439805c5cb68f364d826a5c5c4b6c798ded6b7ebaa4011f01ce6c94e4d5583"}, + {file = "ruff-0.5.2.tar.gz", hash = "sha256:2c0df2d2de685433794a14d8d2e240df619b748fbe3367346baa519d8e6f1ca2"}, ] [[package]] name = "setuptools" -version = "70.2.0" +version = "70.3.0" description = "Easily download, build, install, upgrade, and uninstall Python packages" optional = false python-versions = ">=3.8" files = [ - {file = "setuptools-70.2.0-py3-none-any.whl", hash = "sha256:b8b8060bb426838fbe942479c90296ce976249451118ef566a5a0b7d8b78fb05"}, - {file = "setuptools-70.2.0.tar.gz", hash = "sha256:bd63e505105011b25c3c11f753f7e3b8465ea739efddaccef8f0efac2137bac1"}, + {file = "setuptools-70.3.0-py3-none-any.whl", hash = "sha256:fe384da74336c398e0d956d1cae0669bc02eed936cdb1d49b57de1990dc11ffc"}, + {file = "setuptools-70.3.0.tar.gz", hash = "sha256:f171bab1dfbc86b132997f26a119f6056a57950d058587841a0082e8830f9dc5"}, ] [package.extras] @@ -1569,13 +1569,13 @@ files = [ [[package]] name = "sqlparse" -version = "0.5.0" +version = "0.5.1" description = "A non-validating SQL parser." optional = false python-versions = ">=3.8" files = [ - {file = "sqlparse-0.5.0-py3-none-any.whl", hash = "sha256:c204494cd97479d0e39f28c93d46c0b2d5959c7b9ab904762ea6c7af211c8663"}, - {file = "sqlparse-0.5.0.tar.gz", hash = "sha256:714d0a4932c059d16189f58ef5411ec2287a4360f17cdd0edd2d09d4c5087c93"}, + {file = "sqlparse-0.5.1-py3-none-any.whl", hash = "sha256:773dcbf9a5ab44a090f3441e2180efe2560220203dc2f8c0b0fa141e18b505e4"}, + {file = "sqlparse-0.5.1.tar.gz", hash = "sha256:bb6b4df465655ef332548e24f08e205afc81b9ab86cb1c45657a7ff173a3a00e"}, ] [package.extras] @@ -1584,13 +1584,13 @@ doc = ["sphinx"] [[package]] name = "strawberry-graphql" -version = "0.235.1" +version = "0.236.0" description = "A library for creating GraphQL APIs" optional = false python-versions = "<4.0,>=3.8" files = [ - {file = "strawberry_graphql-0.235.1-py3-none-any.whl", hash = "sha256:616844222fc144972e1235b47362b64e9e7c9b17b5f81c7328855c839aaf59a3"}, - {file = "strawberry_graphql-0.235.1.tar.gz", hash = "sha256:135ff15d91bd6b0ba5c675103ebbfb188db16d95cf2652860febc7108787f427"}, + {file = "strawberry_graphql-0.236.0-py3-none-any.whl", hash = "sha256:685f775be47c0753c39e0ef601d7f2b6f0e15dd4dfe5d57094d29a9cceb066f4"}, + {file = "strawberry_graphql-0.236.0.tar.gz", hash = "sha256:26dcae2c0b506330db60624194cdd0b49c1e773166791bd4f729126bf872b65c"}, ] [package.dependencies] @@ -1759,4 +1759,4 @@ enum = ["django-choices-field"] [metadata] lock-version = "2.0" python-versions = ">=3.8,<4.0" -content-hash = "7f0a34117502cc0c472fca0781fcda0e9bfa63ce9a416477da4bf891f5d69c08" +content-hash = "da678e32dda1f80eee447008b7d5e118e3603b132b9af2a394c4c922e6ac6a75" diff --git a/pyproject.toml b/pyproject.toml index 28babbc1..9828b1d2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,14 +36,14 @@ django = ">=3.2" asgiref = ">=3.8" django-choices-field = { version = ">=2.2.2", optional = true } django-debug-toolbar = { version = ">=3.4", optional = true } -strawberry-graphql = ">=0.235.1" +strawberry-graphql = ">=0.236.0" [tool.poetry.group.dev.dependencies] Markdown = "^3.3.7" Pygments = "^2.15.1" channels = { version = ">=3.0.5" } django-choices-field = "^2.2.2" -django-debug-toolbar = "^4.2.0" +django-debug-toolbar = "^3.4" django-guardian = "^2.4.0" django-mptt = "^0.14.0" django-types = "^0.19.1" diff --git a/strawberry_django/arguments.py b/strawberry_django/arguments.py index 022e3220..ecf55f29 100644 --- a/strawberry_django/arguments.py +++ b/strawberry_django/arguments.py @@ -2,7 +2,7 @@ from strawberry import UNSET from strawberry.annotation import StrawberryAnnotation -from strawberry.arguments import StrawberryArgument +from strawberry.types.arguments import StrawberryArgument def argument( diff --git a/strawberry_django/fields/base.py b/strawberry_django/fields/base.py index 862e1c2f..07b11891 100644 --- a/strawberry_django/fields/base.py +++ b/strawberry_django/fields/base.py @@ -7,17 +7,17 @@ from django.db.models import ForeignKey from strawberry import LazyType, relay from strawberry.annotation import StrawberryAnnotation -from strawberry.auto import StrawberryAuto -from strawberry.field import UNRESOLVED, StrawberryField -from strawberry.type import ( +from strawberry.types import get_object_definition +from strawberry.types.auto import StrawberryAuto +from strawberry.types.base import ( StrawberryContainer, StrawberryList, StrawberryOptional, StrawberryType, WithStrawberryObjectDefinition, - get_object_definition, ) -from strawberry.union import StrawberryUnion +from strawberry.types.field import UNRESOLVED, StrawberryField +from strawberry.types.union import StrawberryUnion from strawberry.utils.inspect import get_specialized_type_var_map from strawberry_django.resolvers import django_resolver @@ -30,8 +30,8 @@ if TYPE_CHECKING: from django.db import models - from strawberry.object_type import StrawberryObjectDefinition from strawberry.types import Info + from strawberry.types.object_type import StrawberryObjectDefinition from typing_extensions import Literal, Self from strawberry_django.type import StrawberryDjangoDefinition diff --git a/strawberry_django/fields/field.py b/strawberry_django/fields/field.py index 87ed5e84..9c48352d 100644 --- a/strawberry_django/fields/field.py +++ b/strawberry_django/fields/field.py @@ -52,14 +52,14 @@ if TYPE_CHECKING: from graphql.pyutils import AwaitableOrValue from strawberry import BasePermission - from strawberry.arguments import StrawberryArgument from strawberry.extensions.field_extension import ( FieldExtension, SyncExtensionResolver, ) - from strawberry.field import _RESOLVER_TYPE, StrawberryField from strawberry.relay.types import NodeIterableType - from strawberry.unset import UnsetType + from strawberry.types.arguments import StrawberryArgument + from strawberry.types.field import _RESOLVER_TYPE, StrawberryField + from strawberry.types.unset import UnsetType from typing_extensions import Literal, Self from strawberry_django.utils.typing import ( diff --git a/strawberry_django/fields/filter_order.py b/strawberry_django/fields/filter_order.py index 33ec2ebb..d00e4a5d 100644 --- a/strawberry_django/fields/filter_order.py +++ b/strawberry_django/fields/filter_order.py @@ -8,7 +8,7 @@ from strawberry import UNSET from strawberry.annotation import StrawberryAnnotation from strawberry.exceptions import MissingArgumentsAnnotationsError -from strawberry.field import StrawberryField +from strawberry.types.field import StrawberryField from strawberry.types.fields.resolver import ReservedName, StrawberryResolver from typing_extensions import Self @@ -22,8 +22,8 @@ from collections.abc import Callable, MutableMapping from strawberry.extensions.field_extension import FieldExtension - from strawberry.field import _RESOLVER_TYPE, T from strawberry.types import Info + from strawberry.types.field import _RESOLVER_TYPE, T QUERYSET_PARAMSPEC = ReservedName("queryset") diff --git a/strawberry_django/fields/types.py b/strawberry_django/fields/types.py index b83c72c2..f43d37ab 100644 --- a/strawberry_django/fields/types.py +++ b/strawberry_django/fields/types.py @@ -24,9 +24,9 @@ from django.db.models import Field, Model, fields from django.db.models.fields import files, json, related, reverse_related from strawberry import UNSET, relay -from strawberry.enum import EnumValueDefinition from strawberry.file_uploads.scalars import Upload from strawberry.scalars import JSON +from strawberry.types.enum import EnumValueDefinition from strawberry.utils.str_converters import capitalize_first, to_camel_case from strawberry_django import filters diff --git a/strawberry_django/filters.py b/strawberry_django/filters.py index e486fced..bdd63d62 100644 --- a/strawberry_django/filters.py +++ b/strawberry_django/filters.py @@ -22,10 +22,11 @@ import strawberry from django.db.models import Q, QuerySet from strawberry import UNSET, relay -from strawberry.field import StrawberryField, field from strawberry.tools import create_type -from strawberry.type import WithStrawberryObjectDefinition, has_object_definition -from strawberry.unset import UnsetType +from strawberry.types import has_object_definition +from strawberry.types.base import WithStrawberryObjectDefinition +from strawberry.types.field import StrawberryField, field +from strawberry.types.unset import UnsetType from typing_extensions import Self, assert_never, dataclass_transform from strawberry_django.fields.filter_order import ( @@ -47,8 +48,8 @@ from types import FunctionType from django.db.models import Model - from strawberry.arguments import StrawberryArgument from strawberry.types import Info + from strawberry.types.arguments import StrawberryArgument T = TypeVar("T") diff --git a/strawberry_django/integrations/guardian.py b/strawberry_django/integrations/guardian.py index d252f406..f15baf44 100644 --- a/strawberry_django/integrations/guardian.py +++ b/strawberry_django/integrations/guardian.py @@ -1,7 +1,7 @@ import contextlib import dataclasses import weakref -from typing import Optional, Union, cast +from typing import Optional, Type, Union, cast from django.contrib.auth import get_user_model from django.contrib.auth.models import Group @@ -24,7 +24,9 @@ class ObjectPermissionModels: group: GroupObjectPermissionBase -def get_object_permission_models(model: models.Model): +def get_object_permission_models( + model: Union[models.Model, Type[models.Model]], +) -> ObjectPermissionModels: return ObjectPermissionModels( user=cast(UserObjectPermissionBase, get_user_obj_perms_model(model)), group=cast(GroupObjectPermissionBase, get_group_obj_perms_model(model)), diff --git a/strawberry_django/mutations/fields.py b/strawberry_django/mutations/fields.py index 8be80c24..5f039db0 100644 --- a/strawberry_django/mutations/fields.py +++ b/strawberry_django/mutations/fields.py @@ -13,7 +13,7 @@ from django.db import models, transaction from strawberry import UNSET, relay from strawberry.annotation import StrawberryAnnotation -from strawberry.field import UNRESOLVED +from strawberry.types.field import UNRESOLVED from strawberry.utils.str_converters import capitalize_first, to_camel_case from typing_extensions import Annotated @@ -33,10 +33,13 @@ if TYPE_CHECKING: from graphql.pyutils import AwaitableOrValue - from strawberry.arguments import StrawberryArgument - from strawberry.type import StrawberryType, WithStrawberryObjectDefinition from strawberry.types import Info - from strawberry.types.types import StrawberryObjectDefinition + from strawberry.types.arguments import StrawberryArgument + from strawberry.types.base import ( + StrawberryObjectDefinition, + StrawberryType, + WithStrawberryObjectDefinition, + ) from typing_extensions import Literal, Self diff --git a/strawberry_django/mutations/mutations.py b/strawberry_django/mutations/mutations.py index 0c92d8b0..ebd4f523 100644 --- a/strawberry_django/mutations/mutations.py +++ b/strawberry_django/mutations/mutations.py @@ -17,7 +17,7 @@ from strawberry.field_extensions import InputMutationExtension from strawberry.permission import BasePermission from strawberry.types.fields.resolver import StrawberryResolver -from strawberry.unset import UNSET, UnsetType +from strawberry.types.unset import UNSET, UnsetType from typing_extensions import Literal from .fields import ( diff --git a/strawberry_django/mutations/resolvers.py b/strawberry_django/mutations/resolvers.py index 9c1bfe79..928804c6 100644 --- a/strawberry_django/mutations/resolvers.py +++ b/strawberry_django/mutations/resolvers.py @@ -8,6 +8,7 @@ Callable, Iterable, List, + Type, TypeVar, cast, overload, @@ -262,7 +263,10 @@ def prepare_create_update( (ParsedObject, str), ): value, value_data = _parse_data( # noqa: PLW2901 - info, field.related_model, value, key_attr=key_attr + info, + cast(Type[Model], field.related_model), + value, + key_attr=key_attr, ) if value is None and not value_data: value = None # noqa: PLW2901 @@ -508,7 +512,7 @@ def update_field(info: Info, instance: Model, field: models.Field, value: Any): and isinstance(field, models.ForeignObject) and not isinstance(value, Model) ): - value, data = _parse_pk(value, field.related_model) + value, data = _parse_pk(value, cast(Type[Model], field.related_model)) field.save_form_data(instance, value) # If data was passed to the foreign key, update it recursively @@ -574,7 +578,9 @@ def update_m2m( existing = set(manager.all()) need_remove_cache = need_remove_cache or bool(values) for v in values: - obj, data = _parse_data(info, manager.model, v, key_attr=key_attr) + obj, data = _parse_data( + info, cast(Type[Model], manager.model), v, key_attr=key_attr + ) if obj: data.pop(key_attr, None) through_defaults = data.pop("through_defaults", {}) @@ -632,7 +638,12 @@ def update_m2m( else: need_remove_cache = need_remove_cache or bool(value.add) for v in value.add or []: - obj, data = _parse_data(info, manager.model, v, key_attr=key_attr) + obj, data = _parse_data( + info, + cast(Type[Model], manager.model), + v, + key_attr=key_attr, + ) if obj and data: data.pop(key_attr, None) if full_clean: @@ -653,7 +664,9 @@ def update_m2m( need_remove_cache = need_remove_cache or bool(value.remove) for v in value.remove or []: - obj, data = _parse_data(info, manager.model, v, key_attr=key_attr) + obj, data = _parse_data( + info, cast(Type[Model], manager.model), v, key_attr=key_attr + ) data.pop(key_attr, None) assert not data to_remove.append(obj) diff --git a/strawberry_django/optimizer.py b/strawberry_django/optimizer.py index 24a696f9..9845bae9 100644 --- a/strawberry_django/optimizer.py +++ b/strawberry_django/optimizer.py @@ -40,13 +40,14 @@ from graphql.type.definition import GraphQLResolveInfo, get_named_type from strawberry import relay from strawberry.extensions import SchemaExtension -from strawberry.lazy_type import LazyType -from strawberry.object_type import StrawberryObjectDefinition from strawberry.relay.utils import SliceMetadata from strawberry.schema.schema import Schema from strawberry.schema.schema_converter import get_arguments -from strawberry.type import StrawberryContainer, get_object_definition +from strawberry.types import get_object_definition +from strawberry.types.base import StrawberryContainer from strawberry.types.info import Info +from strawberry.types.lazy_type import LazyType +from strawberry.types.object_type import StrawberryObjectDefinition from typing_extensions import assert_never, assert_type from strawberry_django.fields.types import resolve_model_field_name @@ -74,7 +75,7 @@ ) if TYPE_CHECKING: - from strawberry.field import StrawberryField # noqa: I001 + from strawberry.types.field import StrawberryField # noqa: I001 from strawberry.types.execution import ExecutionContext from strawberry.utils.await_maybe import AwaitableOrValue from django.contrib.contenttypes.fields import GenericRelation diff --git a/strawberry_django/ordering.py b/strawberry_django/ordering.py index ec48f929..8cd1be02 100644 --- a/strawberry_django/ordering.py +++ b/strawberry_django/ordering.py @@ -16,9 +16,10 @@ from django.db.models import F, OrderBy, QuerySet from graphql.language.ast import ObjectValueNode from strawberry import UNSET -from strawberry.field import StrawberryField, field -from strawberry.type import WithStrawberryObjectDefinition, has_object_definition -from strawberry.unset import UnsetType +from strawberry.types import has_object_definition +from strawberry.types.base import WithStrawberryObjectDefinition +from strawberry.types.field import StrawberryField, field +from strawberry.types.unset import UnsetType from strawberry.utils.str_converters import to_camel_case from typing_extensions import Self, dataclass_transform @@ -34,8 +35,8 @@ if TYPE_CHECKING: from django.db.models import Model - from strawberry.arguments import StrawberryArgument from strawberry.types import Info + from strawberry.types.arguments import StrawberryArgument _T = TypeVar("_T") _QS = TypeVar("_QS", bound="QuerySet") diff --git a/strawberry_django/pagination.py b/strawberry_django/pagination.py index cc3ec8c0..cec44699 100644 --- a/strawberry_django/pagination.py +++ b/strawberry_django/pagination.py @@ -5,9 +5,9 @@ from django.db import DEFAULT_DB_ALIAS from django.db.models import Count, Window from django.db.models.functions import RowNumber -from strawberry.arguments import StrawberryArgument from strawberry.types import Info -from strawberry.unset import UNSET, UnsetType +from strawberry.types.arguments import StrawberryArgument +from strawberry.types.unset import UNSET, UnsetType from typing_extensions import Self from strawberry_django.fields.base import StrawberryDjangoFieldBase diff --git a/strawberry_django/permissions.py b/strawberry_django/permissions.py index 7534a423..c1424306 100644 --- a/strawberry_django/permissions.py +++ b/strawberry_django/permissions.py @@ -35,11 +35,11 @@ FieldExtension, SyncExtensionResolver, ) -from strawberry.field import StrawberryField from strawberry.schema_directive import Location -from strawberry.type import StrawberryList, StrawberryOptional +from strawberry.types.base import StrawberryList, StrawberryOptional +from strawberry.types.field import StrawberryField from strawberry.types.info import Info -from strawberry.union import StrawberryUnion +from strawberry.types.union import StrawberryUnion from typing_extensions import Literal, assert_never from strawberry_django.auth.utils import aget_current_user, get_current_user diff --git a/strawberry_django/relay.py b/strawberry_django/relay.py index 6ceb198e..19649ca4 100644 --- a/strawberry_django/relay.py +++ b/strawberry_django/relay.py @@ -19,7 +19,8 @@ from strawberry import relay from strawberry.relay.exceptions import NodeIDAnnotationError from strawberry.relay.types import NodeIterableType -from strawberry.type import StrawberryContainer, get_object_definition +from strawberry.types import get_object_definition +from strawberry.types.base import StrawberryContainer from strawberry.types.info import Info from strawberry.utils.await_maybe import AwaitableOrValue from typing_extensions import Literal, Self diff --git a/strawberry_django/type.py b/strawberry_django/type.py index 92598540..a2193d9f 100644 --- a/strawberry_django/type.py +++ b/strawberry_django/type.py @@ -27,9 +27,10 @@ from strawberry.exceptions import ( MissingFieldAnnotationError, ) -from strawberry.field import StrawberryField -from strawberry.private import is_private -from strawberry.type import WithStrawberryObjectDefinition, get_object_definition +from strawberry.types import get_object_definition +from strawberry.types.base import WithStrawberryObjectDefinition +from strawberry.types.field import StrawberryField +from strawberry.types.private import is_private from strawberry.utils.deprecations import DeprecatedDescriptor from typing_extensions import Literal, Self, dataclass_transform diff --git a/strawberry_django/utils/inspect.py b/strawberry_django/utils/inspect.py index 89b1d278..ca08257a 100644 --- a/strawberry_django/utils/inspect.py +++ b/strawberry_django/utils/inspect.py @@ -12,15 +12,15 @@ from django.db.models.query import Prefetch, QuerySet from django.db.models.sql.where import WhereNode -from strawberry.lazy_type import LazyType -from strawberry.type import ( +from strawberry.types import has_object_definition +from strawberry.types.base import ( StrawberryContainer, + StrawberryObjectDefinition, StrawberryType, StrawberryTypeVar, - has_object_definition, ) -from strawberry.types.types import StrawberryObjectDefinition -from strawberry.union import StrawberryUnion +from strawberry.types.lazy_type import LazyType +from strawberry.types.union import StrawberryUnion from strawberry.utils.str_converters import to_camel_case from typing_extensions import assert_never diff --git a/strawberry_django/utils/typing.py b/strawberry_django/utils/typing.py index 86adcd84..8d8e3b62 100644 --- a/strawberry_django/utils/typing.py +++ b/strawberry_django/utils/typing.py @@ -18,8 +18,8 @@ from django.db.models.expressions import BaseExpression, Combinable from graphql.type.definition import GraphQLResolveInfo from strawberry.annotation import StrawberryAnnotation -from strawberry.auto import StrawberryAuto -from strawberry.type import ( +from strawberry.types.auto import StrawberryAuto +from strawberry.types.base import ( StrawberryContainer, StrawberryType, WithStrawberryObjectDefinition, diff --git a/tests/auth/test_types.py b/tests/auth/test_types.py index d55ee942..95773d13 100644 --- a/tests/auth/test_types.py +++ b/tests/auth/test_types.py @@ -1,6 +1,7 @@ import strawberry from django.contrib.auth.models import Group, User -from strawberry.type import StrawberryList, get_object_definition +from strawberry.types import get_object_definition +from strawberry.types.base import StrawberryList import strawberry_django from strawberry_django import DjangoModelType diff --git a/tests/fields/test_attributes.py b/tests/fields/test_attributes.py index abfb8be1..db9d1fc0 100644 --- a/tests/fields/test_attributes.py +++ b/tests/fields/test_attributes.py @@ -5,7 +5,7 @@ from django.db import models from django.test import override_settings from strawberry import BasePermission, auto, relay -from strawberry.type import get_object_definition +from strawberry.types import get_object_definition import strawberry_django from strawberry_django.fields.field import StrawberryDjangoField diff --git a/tests/fields/test_input.py b/tests/fields/test_input.py index ab7d8464..845f69f1 100644 --- a/tests/fields/test_input.py +++ b/tests/fields/test_input.py @@ -1,7 +1,8 @@ import strawberry from django.db import models from strawberry import auto -from strawberry.type import StrawberryOptional, get_object_definition +from strawberry.types import get_object_definition +from strawberry.types.base import StrawberryOptional import strawberry_django diff --git a/tests/fields/test_ref.py b/tests/fields/test_ref.py index 6fd439e3..761d0fa4 100644 --- a/tests/fields/test_ref.py +++ b/tests/fields/test_ref.py @@ -1,6 +1,6 @@ from django.db import models from strawberry import auto -from strawberry.type import get_object_definition +from strawberry.types import get_object_definition import strawberry_django diff --git a/tests/fields/test_relations.py b/tests/fields/test_relations.py index e72d7bbd..827bfe6d 100644 --- a/tests/fields/test_relations.py +++ b/tests/fields/test_relations.py @@ -3,10 +3,10 @@ import strawberry from django.db import models from strawberry import auto -from strawberry.type import ( +from strawberry.types import get_object_definition +from strawberry.types.base import ( StrawberryList, StrawberryOptional, - get_object_definition, ) import strawberry_django diff --git a/tests/fields/test_types.py b/tests/fields/test_types.py index 5cdba922..d4f25b85 100644 --- a/tests/fields/test_types.py +++ b/tests/fields/test_types.py @@ -12,14 +12,14 @@ from django.core.exceptions import FieldDoesNotExist from django.db import models from strawberry import auto -from strawberry.enum import EnumDefinition, EnumValue from strawberry.scalars import JSON -from strawberry.type import ( +from strawberry.types import get_object_definition +from strawberry.types.base import ( StrawberryContainer, StrawberryList, StrawberryOptional, - get_object_definition, ) +from strawberry.types.enum import EnumDefinition, EnumValue import strawberry_django from strawberry_django.fields.field import StrawberryDjangoField diff --git a/tests/filters/test_filters_v2.py b/tests/filters/test_filters_v2.py index 5ab06827..349147bb 100644 --- a/tests/filters/test_filters_v2.py +++ b/tests/filters/test_filters_v2.py @@ -8,8 +8,8 @@ from strawberry import auto from strawberry.exceptions import MissingArgumentsAnnotationsError from strawberry.relay import GlobalID -from strawberry.type import WithStrawberryObjectDefinition, get_object_definition -from strawberry.types import ExecutionResult +from strawberry.types import ExecutionResult, get_object_definition +from strawberry.types.base import WithStrawberryObjectDefinition, get_object_definition import strawberry_django from strawberry_django.exceptions import ( diff --git a/tests/filters/test_types.py b/tests/filters/test_types.py index 2386e0c7..6dcfb80f 100644 --- a/tests/filters/test_types.py +++ b/tests/filters/test_types.py @@ -3,7 +3,8 @@ import pytest import strawberry from strawberry import auto -from strawberry.type import StrawberryOptional, get_object_definition +from strawberry.types import get_object_definition +from strawberry.types.base import StrawberryOptional import strawberry_django from strawberry_django.filters import get_django_model_filter_input_type diff --git a/tests/test_ordering.py b/tests/test_ordering.py index 1a11f92d..fb87bb71 100644 --- a/tests/test_ordering.py +++ b/tests/test_ordering.py @@ -9,12 +9,13 @@ from strawberry import auto from strawberry.annotation import StrawberryAnnotation from strawberry.exceptions import MissingArgumentsAnnotationsError -from strawberry.field import StrawberryField -from strawberry.type import ( +from strawberry.types import get_object_definition +from strawberry.types.base import ( StrawberryOptional, WithStrawberryObjectDefinition, get_object_definition, ) +from strawberry.types.field import StrawberryField import strawberry_django from strawberry_django.exceptions import ( diff --git a/tests/test_type.py b/tests/test_type.py index 4cbcf0c9..2e6853f5 100644 --- a/tests/test_type.py +++ b/tests/test_type.py @@ -3,7 +3,7 @@ import strawberry from django.db import models -from strawberry.type import get_object_definition +from strawberry.types import get_object_definition import strawberry_django from strawberry_django.fields.field import StrawberryDjangoField diff --git a/tests/test_types.py b/tests/test_types.py index 79728ad5..7b90973f 100644 --- a/tests/test_types.py +++ b/tests/test_types.py @@ -4,8 +4,8 @@ import strawberry from django.test import override_settings from strawberry import auto -from strawberry.object_type import StrawberryObjectDefinition -from strawberry.type import get_object_definition +from strawberry.types import get_object_definition +from strawberry.types.object_type import StrawberryObjectDefinition import strawberry_django from strawberry_django.fields.field import StrawberryDjangoField diff --git a/tests/types2/test_input.py b/tests/types2/test_input.py index 291d278b..b7dc1127 100644 --- a/tests/types2/test_input.py +++ b/tests/types2/test_input.py @@ -1,6 +1,7 @@ import strawberry from strawberry import auto -from strawberry.type import StrawberryOptional, get_object_definition +from strawberry.types import get_object_definition +from strawberry.types.base import StrawberryOptional import strawberry_django diff --git a/tests/types2/test_type.py b/tests/types2/test_type.py index 9c7f5f61..df49040a 100644 --- a/tests/types2/test_type.py +++ b/tests/types2/test_type.py @@ -3,11 +3,11 @@ import strawberry from django.db import models from strawberry import auto -from strawberry.type import ( +from strawberry.types import get_object_definition +from strawberry.types.base import ( StrawberryContainer, StrawberryList, StrawberryOptional, - get_object_definition, ) import strawberry_django