From 4ff2c18869d1937ebd46fed7e935f1da7bee8035 Mon Sep 17 00:00:00 2001 From: Vlada Dusek Date: Wed, 29 Jul 2026 15:09:46 +0200 Subject: [PATCH 1/2] chore: Enable Ruff formatting of Python code blocks in Markdown --- docs/04_upgrading/upgrading_to_v3.mdx | 8 +++++--- pyproject.toml | 5 +++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/docs/04_upgrading/upgrading_to_v3.mdx b/docs/04_upgrading/upgrading_to_v3.mdx index 9b2051b1..7572c19a 100644 --- a/docs/04_upgrading/upgrading_to_v3.mdx +++ b/docs/04_upgrading/upgrading_to_v3.mdx @@ -81,7 +81,9 @@ client.key_value_store('my-store').set_record('my-key', {'data': 1}, 'applicatio client.run('my-run').charge('my-event', 5, 'my-idempotency-key') # After -client.key_value_store('my-store').set_record('my-key', {'data': 1}, content_type='application/json') +client.key_value_store('my-store').set_record( + 'my-key', {'data': 1}, content_type='application/json' +) client.run('my-run').charge('my-event', count=5, idempotency_key='my-idempotency-key') ``` @@ -97,10 +99,10 @@ Generated enum-like types are now [`Literal`](https://docs.python.org/3/library/ ```python # Before -event_types=[WebhookEventType.ACTOR_RUN_SUCCEEDED] +event_types = [WebhookEventType.ACTOR_RUN_SUCCEEDED] # After -event_types=['ACTOR.RUN.SUCCEEDED'] +event_types = ['ACTOR.RUN.SUCCEEDED'] ``` Affected types: `ActorJobStatus`, `ActorPermissionLevel`, `ErrorType`, `GeneralAccess`, `HttpMethod`, `RunOrigin`, `SourceCodeFileFormat`, `StorageOwnership`, `VersionSourceType`, `WebhookDispatchStatus`, `WebhookEventType`. For more on the generated types and how they fit into the typed client surface, see [Typed models](/api/client/python/docs/concepts/typed-models). diff --git a/pyproject.toml b/pyproject.toml index 4407c152..1e6567da 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -88,10 +88,15 @@ include = [ "scripts/**/*.py", "docs/**/*.py", "website/**/*.py", + # Ruff formats Python code blocks embedded in Markdown files. + "**/*.md", + "**/*.mdx", ] exclude = [ "website/versioned_docs/**", ] +# MDX is Markdown; without this mapping Ruff would try to parse `.mdx` files as Python. +extension = { mdx = "markdown" } [tool.ruff.lint] select = ["ALL"] From ee18c40dcdf09a74ab5fee261be95bc4eefa622f Mon Sep 17 00:00:00 2001 From: Vlada Dusek Date: Wed, 29 Jul 2026 15:12:11 +0200 Subject: [PATCH 2/2] chore: Simplify Ruff include patterns to a single Python glob --- pyproject.toml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 1e6567da..8c1aff54 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -83,11 +83,7 @@ only-include = [ [tool.ruff] line-length = 120 include = [ - "src/**/*.py", - "tests/**/*.py", - "scripts/**/*.py", - "docs/**/*.py", - "website/**/*.py", + "**/*.py", # Ruff formats Python code blocks embedded in Markdown files. "**/*.md", "**/*.mdx",