diff --git a/.changeset/support_ruff_013.md b/.changeset/support_ruff_013.md new file mode 100644 index 000000000..5998c0036 --- /dev/null +++ b/.changeset/support_ruff_013.md @@ -0,0 +1,5 @@ +--- +default: minor +--- + +# Support Ruff 0.13 diff --git a/pdm.lock b/pdm.lock index 64cbcfbc0..c1e6e5364 100644 --- a/pdm.lock +++ b/pdm.lock @@ -5,7 +5,7 @@ groups = ["default", "dev"] strategy = ["inherit_metadata"] lock_version = "4.5.0" -content_hash = "sha256:d1e49c632f4236f06cee7604a9882a4baa00aad89e4916a3e407bbc753610a95" +content_hash = "sha256:aa8e052bbac8ae0d1101c6fb11832c0e1270ea3e7478eef51ef9ba67a6c3b06b" [[metadata.targets]] requires_python = "~=3.9" @@ -828,29 +828,30 @@ files = [ [[package]] name = "ruff" -version = "0.12.2" +version = "0.13.0" requires_python = ">=3.7" summary = "An extremely fast Python linter and code formatter, written in Rust." groups = ["default"] files = [ - {file = "ruff-0.12.2-py3-none-linux_armv6l.whl", hash = "sha256:093ea2b221df1d2b8e7ad92fc6ffdca40a2cb10d8564477a987b44fd4008a7be"}, - {file = "ruff-0.12.2-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:09e4cf27cc10f96b1708100fa851e0daf21767e9709e1649175355280e0d950e"}, - {file = "ruff-0.12.2-py3-none-macosx_11_0_arm64.whl", hash = "sha256:8ae64755b22f4ff85e9c52d1f82644abd0b6b6b6deedceb74bd71f35c24044cc"}, - {file = "ruff-0.12.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3eb3a6b2db4d6e2c77e682f0b988d4d61aff06860158fdb413118ca133d57922"}, - {file = "ruff-0.12.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:73448de992d05517170fc37169cbca857dfeaeaa8c2b9be494d7bcb0d36c8f4b"}, - {file = "ruff-0.12.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3b8b94317cbc2ae4a2771af641739f933934b03555e51515e6e021c64441532d"}, - {file = "ruff-0.12.2-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:45fc42c3bf1d30d2008023a0a9a0cfb06bf9835b147f11fe0679f21ae86d34b1"}, - {file = "ruff-0.12.2-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ce48f675c394c37e958bf229fb5c1e843e20945a6d962cf3ea20b7a107dcd9f4"}, - {file = "ruff-0.12.2-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:793d8859445ea47591272021a81391350205a4af65a9392401f418a95dfb75c9"}, - {file = "ruff-0.12.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6932323db80484dda89153da3d8e58164d01d6da86857c79f1961934354992da"}, - {file = "ruff-0.12.2-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:6aa7e623a3a11538108f61e859ebf016c4f14a7e6e4eba1980190cacb57714ce"}, - {file = "ruff-0.12.2-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:2a4a20aeed74671b2def096bdf2eac610c7d8ffcbf4fb0e627c06947a1d7078d"}, - {file = "ruff-0.12.2-py3-none-musllinux_1_2_i686.whl", hash = "sha256:71a4c550195612f486c9d1f2b045a600aeba851b298c667807ae933478fcef04"}, - {file = "ruff-0.12.2-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:4987b8f4ceadf597c927beee65a5eaf994c6e2b631df963f86d8ad1bdea99342"}, - {file = "ruff-0.12.2-py3-none-win32.whl", hash = "sha256:369ffb69b70cd55b6c3fc453b9492d98aed98062db9fec828cdfd069555f5f1a"}, - {file = "ruff-0.12.2-py3-none-win_amd64.whl", hash = "sha256:dca8a3b6d6dc9810ed8f328d406516bf4d660c00caeaef36eb831cf4871b0639"}, - {file = "ruff-0.12.2-py3-none-win_arm64.whl", hash = "sha256:48d6c6bfb4761df68bc05ae630e24f506755e702d4fb08f08460be778c7ccb12"}, - {file = "ruff-0.12.2.tar.gz", hash = "sha256:d7b4f55cd6f325cb7621244f19c873c565a08aff5a4ba9c69aa7355f3f7afd3e"}, + {file = "ruff-0.13.0-py3-none-linux_armv6l.whl", hash = "sha256:137f3d65d58ee828ae136a12d1dc33d992773d8f7644bc6b82714570f31b2004"}, + {file = "ruff-0.13.0-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:21ae48151b66e71fd111b7d79f9ad358814ed58c339631450c66a4be33cc28b9"}, + {file = "ruff-0.13.0-py3-none-macosx_11_0_arm64.whl", hash = "sha256:64de45f4ca5441209e41742d527944635a05a6e7c05798904f39c85bafa819e3"}, + {file = "ruff-0.13.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2b2c653ae9b9d46e0ef62fc6fbf5b979bda20a0b1d2b22f8f7eb0cde9f4963b8"}, + {file = "ruff-0.13.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:4cec632534332062bc9eb5884a267b689085a1afea9801bf94e3ba7498a2d207"}, + {file = "ruff-0.13.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:dcd628101d9f7d122e120ac7c17e0a0f468b19bc925501dbe03c1cb7f5415b24"}, + {file = "ruff-0.13.0-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:afe37db8e1466acb173bb2a39ca92df00570e0fd7c94c72d87b51b21bb63efea"}, + {file = "ruff-0.13.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0f96a8d90bb258d7d3358b372905fe7333aaacf6c39e2408b9f8ba181f4b6ef2"}, + {file = "ruff-0.13.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:94b5e3d883e4f924c5298e3f2ee0f3085819c14f68d1e5b6715597681433f153"}, + {file = "ruff-0.13.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:03447f3d18479df3d24917a92d768a89f873a7181a064858ea90a804a7538991"}, + {file = "ruff-0.13.0-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:fbc6b1934eb1c0033da427c805e27d164bb713f8e273a024a7e86176d7f462cf"}, + {file = "ruff-0.13.0-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:a8ab6a3e03665d39d4a25ee199d207a488724f022db0e1fe4002968abdb8001b"}, + {file = "ruff-0.13.0-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:d2a5c62f8ccc6dd2fe259917482de7275cecc86141ee10432727c4816235bc41"}, + {file = "ruff-0.13.0-py3-none-musllinux_1_2_i686.whl", hash = "sha256:b7b85ca27aeeb1ab421bc787009831cffe6048faae08ad80867edab9f2760945"}, + {file = "ruff-0.13.0-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:79ea0c44a3032af768cabfd9616e44c24303af49d633b43e3a5096e009ebe823"}, + {file = "ruff-0.13.0-py3-none-win32.whl", hash = "sha256:4e473e8f0e6a04e4113f2e1de12a5039579892329ecc49958424e5568ef4f768"}, + {file = "ruff-0.13.0-py3-none-win_amd64.whl", hash = "sha256:48e5c25c7a3713eea9ce755995767f4dcd1b0b9599b638b12946e892123d1efb"}, + {file = "ruff-0.13.0-py3-none-win_arm64.whl", hash = "sha256:ab80525317b1e1d38614addec8ac954f1b3e662de9d59114ecbf771d00cf613e"}, + {file = "ruff-0.13.0.tar.gz", hash = "sha256:5b4b1ee7eb35afae128ab94459b13b2baaed282b1fb0f472a73c82c996c8ae60"}, ] [[package]] diff --git a/pyproject.toml b/pyproject.toml index e0297a289..e1c66aa9d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,7 @@ dependencies = [ "python-dateutil>=2.8.1,<3.0.0", "httpx>=0.23.0,<0.29.0", "ruamel.yaml>=0.18.6,<0.19.0", - "ruff>=0.2,<0.13", + "ruff>=0.2,<0.14", "typing-extensions>=4.8.0,<5.0.0", ] name = "openapi-python-client" diff --git a/tests/test_parser/test_openapi.py b/tests/test_parser/test_openapi.py index 8ab663418..50661ce62 100644 --- a/tests/test_parser/test_openapi.py +++ b/tests/test_parser/test_openapi.py @@ -466,7 +466,7 @@ def test_from_data_no_operation_id(self, mocker, config): mocker.patch("openapi_python_client.utils.remove_string_escapes", return_value=data.description) parameters = mocker.MagicMock() - endpoint, _, return_params = Endpoint.from_data( + Endpoint.from_data( data=data, path=path, method=method, @@ -651,7 +651,7 @@ def test_from_data_overrides_path_item_params_with_operation_params(self, config ) } - collections, schemas, parameters = EndpointCollection.from_data( + collections, _schemas, _parameters = EndpointCollection.from_data( data=data, schemas=Schemas(), parameters=Parameters(), diff --git a/tests/test_parser/test_responses.py b/tests/test_parser/test_responses.py index 22c3ba613..6c0f60e2c 100644 --- a/tests/test_parser/test_responses.py +++ b/tests/test_parser/test_responses.py @@ -20,7 +20,7 @@ def test_response_from_data_no_content(any_property_factory): data = oai.Response.model_construct(description="") - response, schemas = response_from_data( + response, _schemas = response_from_data( status_code=HTTPStatusPattern(pattern="200", code_range=(200, 200)), data=data, schemas=Schemas(), @@ -49,7 +49,7 @@ def test_response_from_data_unsupported_content_type(): data = oai.Response.model_construct(description="", content={"blah": None}) config = MagicMock() config.content_type_overrides = {} - response, schemas = response_from_data( + response, _schemas = response_from_data( status_code=status_code, data=data, schemas=Schemas(), @@ -68,7 +68,7 @@ def test_response_from_data_no_content_schema(any_property_factory): ) config = MagicMock() config.content_type_overrides = {} - response, schemas = response_from_data( + response, _schemas = response_from_data( status_code=status_code, data=data, schemas=Schemas(), @@ -99,7 +99,7 @@ def test_response_from_data_property_error(mocker): config = MagicMock() config.content_type_overrides = {} - response, schemas = responses.response_from_data( + response, _schemas = responses.response_from_data( status_code=HTTPStatusPattern(pattern="400", code_range=(400, 400)), data=data, schemas=Schemas(), @@ -130,7 +130,7 @@ def test_response_from_data_property(mocker, any_property_factory): config.content_type_overrides = {} status_code = HTTPStatusPattern(pattern="400", code_range=(400, 400)) - response, schemas = responses.response_from_data( + response, _schemas = responses.response_from_data( status_code=status_code, data=data, schemas=Schemas(), @@ -165,7 +165,7 @@ def test_response_from_data_reference(mocker, any_property_factory): config = MagicMock() config.content_type_overrides = {} - response, schemas = responses.response_from_data( + response, _schemas = responses.response_from_data( status_code=HTTPStatusPattern(pattern="400", code_range=(400, 400)), data=oai.Reference.model_construct(ref="#/components/responses/ErrorResponse"), schemas=Schemas(), @@ -200,7 +200,7 @@ def test_response_from_data_invalid_reference(ref_string, expected_error_string, config = MagicMock() config.content_type_overrides = {} - response, schemas = responses.response_from_data( + response, _schemas = responses.response_from_data( status_code=HTTPStatusPattern(pattern="400", code_range=(400, 400)), data=oai.Reference.model_construct(ref=ref_string), schemas=Schemas(), @@ -226,7 +226,7 @@ def test_response_from_data_ref_to_response_that_is_a_ref(mocker, any_property_f config = MagicMock() config.content_type_overrides = {} - response, schemas = responses.response_from_data( + response, _schemas = responses.response_from_data( status_code=HTTPStatusPattern(pattern="400", code_range=(400, 400)), data=oai.Reference.model_construct(ref="#/components/responses/ErrorResponse"), schemas=Schemas(), @@ -249,7 +249,7 @@ def test_response_from_data_content_type_overrides(any_property_factory): ) config = MagicMock() config.content_type_overrides = {"application/zip": "application/octet-stream"} - response, schemas = response_from_data( + response, _schemas = response_from_data( status_code=HTTPStatusPattern(pattern="200", code_range=(200, 200)), data=data, schemas=Schemas(),