Skip to content

Build AI methods with your coding agent, then run them anywhere: as an MCP for chatbots, as a webapp for people, or via API for your software.

Move ruff to 0.16.4 and take the lint fallout (#1145)

Louis Choquel6214a7b4fd24
diff --git a/.drift/acks/cli-docs.toml b/.drift/acks/cli-docs.toml
index d463c9ec3..807da5865 100644
--- a/.drift/acks/cli-docs.toml
+++ b/.drift/acks/cli-docs.toml
@@ -1,57 +1,57 @@
contract = "cli-docs"
-digest = "sha256:75a2007c7886c8f2afa15bfa27aca73e6963371f23eb12f6a463620c9da6d609"
+digest = "sha256:a2001ebaf33421c58b9d42c0a02cd3b6871a9da01bac3a64849bac79e729761c"
reviewed_by = "Louis Choquel"
-reviewed_at = "2026-08-18T14:31:50Z"
-rationale = "pipelex migrate now ensures the config-directory .gitignore on its nothing-to-migrate return as well as its clean one, so the reach of that file changed again. Reviewed docs/tools/cli/migrate.md and found its gitignore paragraph needs no edit -- but not because nothing moved: the sentence 'you get it from any run that is allowed to write, including one that finds nothing to migrate' was already written as a universal, and it was false in exactly one reachable case that this same page devotes a section to, namely a run whose files are all blocked (When it cannot do the whole job). The code moved to meet the claim rather than the claim being weakened, so the page and the command now agree where they previously contradicted each other. Enumerated the real runs to check the universal is now exhaustive: clean writes it, all-blocked writes it, a migration you decline deliberately does not because 'nothing was written' has to stay true of the whole directory, and a run that applies writes it through migrate_config_directories. init.md needed no edit since the pipelex init path is untouched and its create-if-absent sentence still holds. Re-derived the agent-CLI claims from the code rather than from my own previous ack: agent_migrate_cmd has no early return at all, it calls migrate_config_directories with dry_run = not yes, so the new call site is unreachable from that command and the migrate row claim that it writes only with --yes is unaffected; the new write is neither reported nor rendered, so the migrate report-contract line at the top of that file is unchanged too. The doctor row reaches the dry-run scan only, so it is unaffected as well."
+reviewed_at = "2026-08-21T09:18:57Z"
+rationale = "Trigger fired on a lint-comment migration only. The ruff 0.16 upgrade rewrote '# noqa: CODE' suppressions across pipelex/cli/** into the new '# ruff: ignore[rule-name]' spelling, and removed the per-line '# noqa: PLC2701' halves that a tests/** per-file-ignore now covers; filtering the diff over pipelex/cli/** for any changed line that is not a noqa, ruff-ignore or pyright-ignore comment returns nothing. No command was added, removed or renamed, no option or argument changed, no output format or exit code moved, and the agent-CLI report contract is untouched. docs/tools/cli/**, the agent-CLI contract doc and the doctor/migrate pages therefore need no edit."
[trigger_files]
"pipelex/cli/__init__.py" = "blob:8b137891791fe96927ad78e64b0aad7bded08bdc"
-"pipelex/cli/_cli.py" = "blob:2fdd24792b8281e1aca3facfef06660ab8b34731"
+"pipelex/cli/_cli.py" = "blob:55a391d3eb92fb041c0e58292e048c41fa903234"
"pipelex/cli/agent_cli/__init__.py" = "blob:e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"
-"pipelex/cli/agent_cli/_agent_cli.py" = "blob:60b5e959906fc806153ff11332bb9cb56752c5c6"
+"pipelex/cli/agent_cli/_agent_cli.py" = "blob:8d1bdb80e7a45eb2fbc71df18cf983eaba1dc446"
"pipelex/cli/agent_cli/commands/__init__.py" = "blob:e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"
-"pipelex/cli/agent_cli/commands/accept_gateway_terms_cmd.py" = "blob:a1fc438119dd10607252c08390ebd6384d999678"
-"pipelex/cli/agent_cli/commands/agent_cli_factory.py" = "blob:6529ed4e6b52407723fdd2fbbdfe8969dea207bd"
+"pipelex/cli/agent_cli/commands/accept_gateway_terms_cmd.py" = "blob:cb8338c09a7b5dee6088551c156d69dab613213a"
+"pipelex/cli/agent_cli/commands/agent_cli_factory.py" = "blob:c9a251db61d8655bdb41002c62eab88b486fc32f"
"pipelex/cli/agent_cli/commands/agent_output.py" = "blob:19cb8df5cf764c85aeaf91d24ce13b26607fff1c"
"pipelex/cli/agent_cli/commands/bundle_path_resolver.py" = "blob:30339c5d91048f4e67312d5691ed9a65d57472e0"
-"pipelex/cli/agent_cli/commands/check_model_cmd.py" = "blob:f4bdc5f3732b067e397dde384b511f436f95e526"
+"pipelex/cli/agent_cli/commands/check_model_cmd.py" = "blob:ff33446143044332983a0cb7b204b8eca349795a"
"pipelex/cli/agent_cli/commands/codegen/__init__.py" = "blob:e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"
"pipelex/cli/agent_cli/commands/codegen/app.py" = "blob:56130b89fe9efec5ad3d014ed6bc16bef1bd1645"
-"pipelex/cli/agent_cli/commands/codegen/check_cmd.py" = "blob:bacfda014d158c9a4e9de5f8ca03ba9628b6b102"
-"pipelex/cli/agent_cli/commands/codegen/types_cmd.py" = "blob:256d428cff7738af33ce69281f8e81b538ba7996"
-"pipelex/cli/agent_cli/commands/concept_cmd.py" = "blob:518d291b5e74a7f5ffb2da1606aae42ca2c57835"
-"pipelex/cli/agent_cli/commands/doctor_cmd.py" = "blob:8d75a1630eeb94ebb5450eb1fa0273e7d85b18c2"
+"pipelex/cli/agent_cli/commands/codegen/check_cmd.py" = "blob:9e8beb084a9f04f39e8acca9e6ae2554d40cb667"
+"pipelex/cli/agent_cli/commands/codegen/types_cmd.py" = "blob:dea775a8a469816f2c84ea4f6a5c9234c4af6705"
+"pipelex/cli/agent_cli/commands/concept_cmd.py" = "blob:8e5c1881805cda39a1dae06be247a4fc257ccf69"
+"pipelex/cli/agent_cli/commands/doctor_cmd.py" = "blob:d19554769b75dd2f096ccadb5e2cedc3acb86925"
"pipelex/cli/agent_cli/commands/fix/__init__.py" = "blob:65662c86f17f610ad55ecfc3e27a022b9aa26e8b"
"pipelex/cli/agent_cli/commands/fix/app.py" = "blob:e6190d9bde6a05755c04bd21806f699461038ac0"
-"pipelex/cli/agent_cli/commands/fix/bundle_cmd.py" = "blob:aa2328eb97365a37ce3c2fd885847402508c7476"
+"pipelex/cli/agent_cli/commands/fix/bundle_cmd.py" = "blob:37b13a1ead7b55d601f53b23647c285fc85418cd"
"pipelex/cli/agent_cli/commands/fmt_cmd.py" = "blob:97d6fb6c328e0b718b1293bd6b73cba03edcb7dc"
-"pipelex/cli/agent_cli/commands/init_cmd.py" = "blob:3ed36d13bddebbadb90272b689a15e9ebdbcabf7"
+"pipelex/cli/agent_cli/commands/init_cmd.py" = "blob:56093bbbd43dd478a058e45b69ae70b4ce3c6930"
"pipelex/cli/agent_cli/commands/inputs/__init__.py" = "blob:e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"
"pipelex/cli/agent_cli/commands/inputs/_inputs_core.py" = "blob:d37826d96099028a1ad5dbc5cbf8ce0cfdb01e30"
"pipelex/cli/agent_cli/commands/inputs/app.py" = "blob:7e19284687b334c684fb03381a8d9d20af1aa152"
-"pipelex/cli/agent_cli/commands/inputs/bundle_cmd.py" = "blob:886beecd4ea98d8ba2cc5b40061af4456285622d"
-"pipelex/cli/agent_cli/commands/inputs/method_cmd.py" = "blob:bc5658f7549e766c5827884d3be939eda6e519fd"
-"pipelex/cli/agent_cli/commands/inputs/pipe_cmd.py" = "blob:eda6ea9a683f01bcc59336b44354c3556b3fcfec"
+"pipelex/cli/agent_cli/commands/inputs/bundle_cmd.py" = "blob:43ac0fe0887f5f31144df4e4973a1ab1d0dec166"
+"pipelex/cli/agent_cli/commands/inputs/method_cmd.py" = "blob:b0839083b096b5f5a07844ca35cc8e44c68f74fa"
+"pipelex/cli/agent_cli/commands/inputs/pipe_cmd.py" = "blob:a5cf89c89d5e2e84cc7b817ec184e8dc9e92b781"
"pipelex/cli/agent_cli/commands/lint_cmd.py" = "blob:91ad9cb4d618ba4c0b7da366cde2f74f38d350df"
"pipelex/cli/agent_cli/commands/migrate_cmd.py" = "blob:ce733b78df03e65c3c8a10d46b27b57c05ec054c"
-"pipelex/cli/agent_cli/commands/models_cmd.py" = "blob:10ad2916530308ad650de386cf042dc2528b80e8"
-"pipelex/cli/agent_cli/commands/pipe_cmd.py" = "blob:0be9fb13dbec21da0958ed66b45748291b4e5e2d"
-"pipelex/cli/agent_cli/commands/plxt_passthrough.py" = "blob:22a4666dbd179a68b86cb340cdb9dbe207c8c1e1"
+"pipelex/cli/agent_cli/commands/models_cmd.py" = "blob:dde4c246a28eba9f54cd582f0b171c9c26194be8"
+"pipelex/cli/agent_cli/commands/pipe_cmd.py" = "blob:e5b313aad1dbf88ce31ed7e2f6ad4a0e85337453"
+"pipelex/cli/agent_cli/commands/plxt_passthrough.py" = "blob:a1c530d110482485ce462f199b9e79fac29f8896"
"pipelex/cli/agent_cli/commands/run/__init__.py" = "blob:e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"
"pipelex/cli/agent_cli/commands/run/_output_helpers.py" = "blob:40ed1700e0d5e86d7696eadd7f9887baeb8059f6"
"pipelex/cli/agent_cli/commands/run/_run_core.py" = "blob:71847c81c0fd1986f73c117c7b358ea4a20d5d5d"
"pipelex/cli/agent_cli/commands/run/_run_core_api.py" = "blob:78a27e0ba91e6bbf99c11caedb29ad4cf20ac78b"
"pipelex/cli/agent_cli/commands/run/app.py" = "blob:64b2ecc02007cda11b526d8d3fc139593875dd9d"
-"pipelex/cli/agent_cli/commands/run/bundle_cmd.py" = "blob:78edc9a2fb9a27f4449d51a0a4f7012fde43ce1f"
-"pipelex/cli/agent_cli/commands/run/method_cmd.py" = "blob:afc6ead79ebc71cb235a50c4c7f74660d1a9c2db"
-"pipelex/cli/agent_cli/commands/run/pipe_cmd.py" = "blob:5e6f706722a884f1df51eb86695507d02f5b8064"
+"pipelex/cli/agent_cli/commands/run/bundle_cmd.py" = "blob:daf6207146c0ea41fe34bb272ed51350208af790"
+"pipelex/cli/agent_cli/commands/run/method_cmd.py" = "blob:1115f848865ecd217f0f3e3ae9776840d5842894"
+"pipelex/cli/agent_cli/commands/run/pipe_cmd.py" = "blob:df5e7f80a328932ffde901eda8d0585d009678ad"
"pipelex/cli/agent_cli/commands/run/stdin_resolver.py" = "blob:4bc7f4e91ddb3900a75356f8f8e6ba5a586a3690"
"pipelex/cli/agent_cli/commands/validate/__init__.py" = "blob:e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"
"pipelex/cli/agent_cli/commands/validate/_validate_core.py" = "blob:cd1dd07661fc5ce60971ed0d2c7579cba6da7861"
"pipelex/cli/agent_cli/commands/validate/app.py" = "blob:d2d0ed19288c2d1c25be1650dd962189fcdb3b86"
-"pipelex/cli/agent_cli/commands/validate/bundle_cmd.py" = "blob:fd751a2176bc9d62f164b293ec83006d22947d89"
-"pipelex/cli/agent_cli/commands/validate/method_cmd.py" = "blob:24ddeef224fa2d88781141467ef80c414d34f77a"
-"pipelex/cli/agent_cli/commands/validate/pipe_cmd.py" = "blob:8f9aa91cdfa9a1688ce500c07dc00801737ea626"
+"pipelex/cli/agent_cli/commands/validate/bundle_cmd.py" = "blob:3207973c194b096ed5c6ec2d3a955c417789e019"
+"pipelex/cli/agent_cli/commands/validate/method_cmd.py" = "blob:985226bdaf005a41f8c9fa7559485b67cb1b3d19"
+"pipelex/cli/agent_cli/commands/validate/pipe_cmd.py" = "blob:7c15cf5a7341b774baad2f14540acbef8daebf76"
"pipelex/cli/bundle_target_resolution.py" = "blob:8dccc50b700b877968ed1b2c1c3652ab1c32e956"
"pipelex/cli/cli_factory.py" = "blob:1f859ab3b995e1a67e5fdc812a168d56c338e970"
"pipelex/cli/commands/__init__.py" = "blob:e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"
@@ -82,7 +82,7 @@ rationale = "pipelex migrate now ensures the config-directory .gitignore on its
"pipelex/cli/commands/codegen/inputs_cmd.py" = "blob:20738a9e42f0e5ef7ffc489093348af3cb4643a0"
"pipelex/cli/commands/codegen/types_cmd.py" = "blob:b7c9c7a3664c9fbe66f9b4c3c5ebf9ea1322445c"
"pipelex/cli/commands/crate_loading.py" = "blob:3d7d651931ecf1a15a3e2d72411b3212b55d74ef"
-"pipelex/cli/commands/doctor_cmd.py" = "blob:fec9beb92a82bb492ea123a52bf10d568ba3bfa2"
+"pipelex/cli/commands/doctor_cmd.py" = "blob:c5be1a89ac851d51dbca1f0b6ad4c49e720472ab"
"pipelex/cli/commands/fix/__init__.py" = "blob:e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"
"pipelex/cli/commands/fix/_diff_sandbox.py" = "blob:5ce264f5b0ab4ff4172f4d8789450916947f5c0e"
"pipelex/cli/commands/fix/_fix_core.py" = "blob:8f6a187a0fb42c498629b177753d81620800b0da"
@@ -90,12 +90,12 @@ rationale = "pipelex migrate now ensures the config-directory .gitignore on its
"pipelex/cli/commands/fix/bundle_cmd.py" = "blob:427364cc453957dfe0cec879f019050329c13b3c"
"pipelex/cli/commands/graph_cmd.py" = "blob:aa3649ca4ee3d4c9084236f0c3f6b1072803df46"
"pipelex/cli/commands/init/__init__.py" = "blob:e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"
-"pipelex/cli/commands/init/backends.py" = "blob:1618d4f7f16c6d5a814680b17185501fade9f3fd"
-"pipelex/cli/commands/init/command.py" = "blob:21c700c66b9c608e14e6bb373c40d37c241ea509"
+"pipelex/cli/commands/init/backends.py" = "blob:24d61a06f613c0f460c6330ce5fb8dd965b27d79"
+"pipelex/cli/commands/init/command.py" = "blob:1bc09139f8c2635b0f8af34c9644fd61dbf90da9"
"pipelex/cli/commands/init/config_files.py" = "blob:c13be6b8d2a8b211ce9ef0f4889ee131ffc3d2d8"
"pipelex/cli/commands/init/credentials.py" = "blob:7475c3082b8ee7530a76a52a8ab8bf18a7e21209"
-"pipelex/cli/commands/init/ide_extension.py" = "blob:b1ff7341253a56a8cbccfccce7b14d9053cd5b16"
-"pipelex/cli/commands/init/routing.py" = "blob:e8206196776ae43c12804ac74f770e72a681e1b6"
+"pipelex/cli/commands/init/ide_extension.py" = "blob:9f0ec1494c07062246ecc906bc55b7f2cf95c715"
+"pipelex/cli/commands/init/routing.py" = "blob:7fe0ddc47ea9039f5f8640bfffcbdbdb118c1232"
"pipelex/cli/commands/init/telemetry.py" = "blob:da0c79bdf04b97f0655c42bc9cea98e9e40ea256"
"pipelex/cli/commands/init/ui/__init__.py" = "blob:e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"
"pipelex/cli/commands/init/ui/backends_ui.py" = "blob:16006c2efa81640ef196986a527b629b4d91fbda"
diff --git a/.drift/acks/config-docs.toml b/.drift/acks/config-docs.toml
index cc99c874d..f5b63ccf9 100644
--- a/.drift/acks/config-docs.toml
+++ b/.drift/acks/config-docs.toml
@@ -1,8 +1,8 @@
contract = "config-docs"
-digest = "sha256:78f92935ef035d0a239c3a731caf5f93549c6243ca1128efa5c078a7599bc8d3"
-reviewed_by = "thomashebrard"
-reviewed_at = "2026-08-19T21:35:11Z"
-rationale = "uri_format now renders the FILENAME only: the prefix (storage_scope plus the new generated/ leaf) moved into GeneratedContentFactory, so {storage_scope} is retired from URI_FORMAT_SUPPORTED_FIELDS and the shipped default in pipelex/pipelex.toml, .pipelex/pipelex.toml and kit/configs/pipelex.toml becomes {hash}.{extension}; a leading / is refused too, since the value is appended after one. Reviewed all four targets. docs/configuration/**: still no page documents uri_format or the storage section (index.md line 54 names [runtime] storage only as a category), so nothing there went stale; the two docs outside this contract's targets that DO name it were updated anyway - storage-provider-plugins.md now says the format renders the filename and lists {hash}/{extension}, and pipelex-kernel.md now names four leaves instead of three, since generated/ joined assets/, results/ and payloads/. pipelex/migration/ledgers/: no entry, and that remains the considered answer - cmig reported the fingerprint move as additive ('nothing breaks and no entry is needed') and per docs/migration-ledger.md a free string's value domain can never be proven stale from the schema, so a remap_value on uri_format could only ever be unsafe (reported, never applied); the failure is loud at boot instead, where _collect_uri_format_error_msgs rejects a retired placeholder by name and lists the supported set. Goldens regenerated with umig; cmig and cl both pass. configs.py and config_cogt.py untouched - no key removed, renamed or narrowed, so no model-level narrowing is owed an entry."
+digest = "sha256:b23e603b819c383878a1ddab23614497d506f4bc77f4b6ea5e71d388bbd77c9c"
+reviewed_by = "Louis Choquel"
+reviewed_at = "2026-08-21T09:19:21Z"
+rationale = "Trigger fired on a lint-comment migration only. config_loader.py and config_surface.py changed by three lines between them, every one a '# noqa: CODE' suppression rewritten into the new '# ruff: ignore[rule-name]' spelling that ruff 0.16 prefers; filtering their diff for any changed line that is not such a comment returns nothing. No config key was added, removed, renamed or narrowed, and none of the four validator sites this contract names (KitConfig._validate_targets, DryRunConfig.validate_image_urls, ImgGenConfig.validate_quality_mapping, LLMConfig.validate_effort_to_budget_mapping) was touched, so no value domain moved. docs/configuration/**, configs.py and config_cogt.py need no edit, and no migration-ledger entry is owed: a comment carries no schema, so there is nothing a ledger could remap."
[trigger_files]
"pipelex/cogt/config_cogt.py" = "blob:02f71cb4a6b01aebda59c2e31f262ef9c865e17b"
@@ -10,10 +10,10 @@ rationale = "uri_format now renders the FILENAME only: the prefix (storage_scope
"pipelex/pipelex.toml" = "blob:a82dbc5011d2ceba5eb3ef2a463bc720ee0f169c"
"pipelex/system/configuration/__init__.py" = "blob:8b137891791fe96927ad78e64b0aad7bded08bdc"
"pipelex/system/configuration/config_check.py" = "blob:efa78599c08e5e003d975cc54978ea5d267214a0"
-"pipelex/system/configuration/config_loader.py" = "blob:fadc4557422f0c93335446a854d9883b3cceaf8c"
+"pipelex/system/configuration/config_loader.py" = "blob:86856b64aeff095a77f0c038fded2ee4dd948d00"
"pipelex/system/configuration/config_model.py" = "blob:83b29dc6e93393c9b98c4353636caf0135c80339"
"pipelex/system/configuration/config_root.py" = "blob:c7d43851270912d17413cfc6a511247d3c7cc160"
-"pipelex/system/configuration/config_surface.py" = "blob:657ee0282ad07d831386f1cdadbad544a5b8ec40"
+"pipelex/system/configuration/config_surface.py" = "blob:96f685656a3f4355e8a073e8bf6184e020fea8f5"
"pipelex/system/configuration/configs.py" = "blob:60f346ba1205b762d4b6cff63494b0b34171e6ad"
"pipelex/system/configuration/pipe_func_config.py" = "blob:dc8890e914fbcdb611147e42eaa0cd87b32288a5"
"pipelex/system/telemetry/telemetry_config.py" = "blob:7070951a6d3e4c10cb7d59822ce168c6590c53be"
diff --git a/.drift/acks/pipelex-kernel-docs.toml b/.drift/acks/pipelex-kernel-docs.toml
index 3ab41abb9..1a78ff3aa 100644
--- a/.drift/acks/pipelex-kernel-docs.toml
+++ b/.drift/acks/pipelex-kernel-docs.toml
@@ -1,8 +1,8 @@
contract = "pipelex-kernel-docs"
-digest = "sha256:ba88545c68191606d49339b145a8ed109fda948f3b16e4a4ed31d6a783e420a2"
-reviewed_by = "thomashebrard"
-reviewed_at = "2026-08-20T16:42:26Z"
-rationale = "PipelexKernel.make's signature is unchanged: user_id, storage_scope and trace_context are still flat keyword arguments, so both code examples on the page (lines 28 and 148) remain correct as written, and the paragraph at line 33 describing the two fields and why neither defaults is untouched by this change. What did change is internal to make(): it now builds JobMetadata(run_metadata=RunMetadata(...)) because JobMetadata split its run-constant half (user_id, pipeline_run_id, storage_scope, request_id) into a nested RunMetadata. That is invisible at the call site but NOT to a programmatic caller reading a field off kernel.job_metadata, and this page is the kernel's specification for exactly those callers - so the job_metadata bullet now states which half a field lives in, that the path is job_metadata.run_metadata.pipeline_run_id rather than job_metadata.pipeline_run_id, and that there is no read-through accessor. The split also formalises the run-level-vs-per-step distinction that bullet already drew informally, which is noted. Checked the rest: make_step_metadata still mints a per-step copy with a fresh pipe_run_id (pipe_run_id stays on JobMetadata, not RunMetadata), so that half of the bullet is unchanged; the trace_context paragraph at line 155 still holds because graph_id is still adopted as the run's pipeline_run_id, only nested; and the module table's public surface (make / llm_text / llm_object / make_step_metadata) is unchanged in both name and signature."
+digest = "sha256:72913ee5d4505143e4919037ef9dd8012392f895197ea56513caec82dd42b85a"
+reviewed_by = "Louis Choquel"
+reviewed_at = "2026-08-21T09:18:48Z"
+rationale = "Trigger fired on a lint-comment migration only. The ruff 0.16 upgrade rewrote two suppressions in tests/unit/pipelex/kernel/test_kernel_boot_contract.py from '# noqa: S404/S603' to the new '# ruff: ignore[suspicious-subprocess-import]' / '# ruff: ignore[subprocess-without-shell-equals-true]' spelling; the diff on that file is those two comments and nothing else. No kernel surface moved: PipelexKernel.make, llm_text, llm_object and make_step_metadata are untouched in name and signature, and the boot contract the test asserts is unchanged. docs/under-the-hood/pipelex-kernel.md therefore cannot have gone stale from this change and needs no edit. The page was touched in the same sweep, but only by ruff 0.16's new formatting of Python code blocks inside Markdown (blank lines and trailing-comment spacing) - no prose or code semantics changed."
[trigger_files]
"pipelex/kernel/__init__.py" = "blob:c4f1b0fe2ccc17db9110733f71b612f4ac1ba4ce"
@@ -25,4 +25,4 @@ rationale = "PipelexKernel.make's signature is unchanged: user_id, storage_scope
"pipelex/kernel/search_ops.py" = "blob:ed0a8c7953aca1e38de852d0ddef11731b819539"
"pipelex/kernel/search_results.py" = "blob:101b70dc96cc5ee1721c9f6b1cb725a5ca78ff70"
"pipelex/kernel/templating_style_ops.py" = "blob:395473806d600dfc4f124c07f2afebb951fc086b"
-"tests/unit/pipelex/kernel/test_kernel_boot_contract.py" = "blob:0f5f3239738781d20d13c458071382a0fc6931aa"
+"tests/unit/pipelex/kernel/test_kernel_boot_contract.py" = "blob:f7520706acd4ba906e30ca5dc2a2c2d5dd1fbf11"
diff --git a/AGENTS.md b/AGENTS.md
index f1bd42f4c..e62508af5 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -224,6 +224,7 @@ Once you've landed on a `BaseModel` (the default for anything that serializes),
from pydantic import BaseModel, Field
from pipelex.tools.typing.pydantic_utils import empty_list_factory_of
+
class MyModel(BaseModel):
names: list[str] = Field(default_factory=list) # OK for strings
numbers: list[int] = Field(default_factory=empty_list_factory_of(int), description="A list of numbers")
diff --git a/CHANGELOG.md b/CHANGELOG.md
index fa1a51e8f..d758ca296 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,23 @@
# Changelog
+## [Unreleased]
+
+### Changed
+
+- **Ruff moves to 0.16.4, matching the version the VS Code extension bundles.** The extension now syncs `pyproject.toml` and `ruff.toml` documents to the language server, because Ruff from 0.16 on lints its own config files. A binary older than that parses those documents as Python source and paints phantom `invalid-syntax` diagnostics across every `pyproject.toml` — `requires-python = ...` read as `requires - python`. Pinning the dev dependency to the exact version the extension ships keeps the editor and the command line on one binary, so a rule can never fire in one and not the other. This is a dev-dependency change: nothing shipped changes, and there is no version bump.
+
+ Two mechanical conversions ride along, both applied by `ruff check --fix` and therefore not deferrable — `make lint` would re-apply them on first contact. Selector lists in `pyproject.toml` now name rules rather than code them (`"implicit-namespace-package"` for `INP001`), which is what the config linter prefers and reads better besides; and `# noqa: CODE` suppressions became `# ruff: ignore[rule-name]`, explanations preserved. The new formatter also reformats Python code blocks inside Markdown, so the documentation picked up trailing-comment and blank-line normalization.
+
+ The new directive is not a drop-in for `# noqa`: it attaches to the first line of a statement's range, where `# noqa` was also honoured on a continuation line. Where the migration made a line long enough for the formatter to split it, the suppression landed on a continuation line and stopped applying, which the follow-up pass then removed as unused. The affected deferred imports in `pipelex/tools/storage/gcp_storage_provider.py` and `pipelex/providers/openai/openai_completions_factory.py` carry their directive on the `from ... import (` line again.
+
+- **Rules newly reported under `preview` are ignored deliberately rather than in bulk.** `too-many-statements-in-try-clause` and `property-docstring-starts-with-verb` are ignored globally, `float-equality-comparison` and `import-private-name` only under `tests/`, each with the reason recorded next to it. Shrinking an existing `try` clause changes which statements its handlers cover, so it is an error-handling refactor rather than lint cleanup; the tests that compare floats assert literals that round-trip exactly, and the ones that import private `_core` modules do so on purpose, to exercise the logic behind a CLI command without going through the CLI. Those test-wide relaxations replace the per-line suppressions that used to carry them.
+
+### Fixed
+
+- **`pipelex.providers.bedrock` imported a type-stub package at runtime.** `ConverseResponseTypeDef` was imported both at module level and inside the module's `if TYPE_CHECKING:` block. It resolves only through `types-aioboto3`, which is a development dependency, so the module-level copy would raise `ModuleNotFoundError` on any install of `pipelex[bedrock]` without the dev extras. The duplicate is gone and the surviving import is the type-checking one; the annotation it serves is a local variable annotation, which is never evaluated at runtime.
+
+- **A usage example in `pipelex.test_extras.shared_pytest_plugins` had lost its `yield`.** The example fixture in `needs_inference_in_pipelex`'s docstring showed a teardown call with nothing handing control to the test first, its `yield` line having drifted into a literal `Yield:` docstring section on a function that only ever returns a `bool`. The example is a working fixture again.
+
## [v0.51.0] - 2026-08-21
### Added
diff --git a/README.md b/README.md
index f6f487a41..0451108e9 100644
--- a/README.md
+++ b/README.md
@@ -404,9 +404,11 @@ import asyncio
from pipelex.core.stuffs.document_content import DocumentContent
from pipelex.pipelex import Pipelex
from pipelex.pipeline.runner import PipelexRunner
+
# Generated by: `pipelex build structures bundle cv_batch_screening.mthds`
from structures.cv_batch_screening__candidate_match import CandidateMatch
+
async def run_pipeline() -> list[CandidateMatch]:
runner = PipelexRunner()
response = await runner.execute_pipeline(
@@ -429,6 +431,7 @@ async def run_pipeline() -> list[CandidateMatch]:
print(pipe_output)
return pipe_output.main_stuff_as_items(item_type=CandidateMatch)
+
Pipelex.make()
asyncio.run(run_pipeline())
```
diff --git a/docs/advanced/index.md b/docs/advanced/index.md
index 257a136cd..37dc01b78 100644
--- a/docs/advanced/index.md
+++ b/docs/advanced/index.md
@@ -16,10 +16,7 @@ Inject at boot, by passing your implementation to `Pipelex.make()`:
from pipelex.pipelex import Pipelex
pipelex = Pipelex.make(
- reporting_delegate=MyReportingDelegate(),
- secrets_provider=MySecretsProvider(),
- content_generator=MyContentGenerator(),
- pipe_router=MyPipeRouter()
+ reporting_delegate=MyReportingDelegate(), secrets_provider=MySecretsProvider(), content_generator=MyContentGenerator(), pipe_router=MyPipeRouter()
)
```
diff --git a/docs/advanced/observer-provider-injection.md b/docs/advanced/observer-provider-injection.md
index 3427d23a7..4d69060eb 100644
--- a/docs/advanced/observer-provider-injection.md
+++ b/docs/advanced/observer-provider-injection.md
@@ -25,6 +25,7 @@ from typing import Any, Protocol
PayloadType = dict[str, Any]
+
class ObserverProtocol(Protocol):
async def observe_before_run(self, payload: PayloadType) -> None:
"""Process and store the payload before the run"""
@@ -55,8 +56,8 @@ payload = {
```python
payload = {
"pipeline_run_id": str, # Identifier of the pipeline run
- "pipe_job": PipeJob, # Initial job information
- "pipe_output": PipeOutput, # Results and final working memory
+ "pipe_job": PipeJob, # Initial job information
+ "pipe_output": PipeOutput, # Results and final working memory
}
```
@@ -65,7 +66,7 @@ payload = {
payload = {
"pipeline_run_id": str, # Identifier of the pipeline run
"pipe_job": PipeJob, # Initial job information
- "error": Exception, # The exception that caused the failure
+ "error": Exception, # The exception that caused the failure
}
```
@@ -78,6 +79,7 @@ import os
from typing import Optional
from pipelex.observer.observer_protocol import ObserverProtocol, PayloadType
+
class MyCustomObserver(ObserverProtocol):
def __init__(self, config_param: str = "default_value"):
self.config_param = config_param
@@ -161,6 +163,7 @@ import asyncio
import aiohttp
from pipelex.observer.observer_protocol import ObserverProtocol, PayloadType
+
class DatabaseObserver(ObserverProtocol):
def __init__(self, db_connection_string: str):
self.db_connection = db_connection_string
@@ -217,6 +220,7 @@ from pipelex.pipelex import Pipelex
from my_project.observers import MyCustomObserver
+
def setup_pipelex():
# Initialize Pipelex with the observer wired in from the start
return Pipelex.make(observers={"my_observer": MyCustomObserver()})
diff --git a/docs/building-methods/concepts/python-classes.md b/docs/building-methods/concepts/python-classes.md
index a2e52c574..b2f73199a 100644
--- a/docs/building-methods/concepts/python-classes.md
+++ b/docs/building-methods/concepts/python-classes.md
@@ -26,9 +26,10 @@ Most structured data needs are covered by inline structures + `pipelex build str
from pipelex.core.stuffs.structured_content import StructuredContent
from pydantic import Field
+
class Invoice(StructuredContent):
"""A commercial invoice."""
-
+
invoice_number: str = Field(description="Unique invoice identifier")
issue_date: datetime = Field(description="Date the invoice was issued")
total_amount: float = Field(ge=0, description="Total invoice amount")
@@ -49,20 +50,21 @@ Classes inheriting from `StructuredContent` are automatically discovered and reg
from pipelex.core.stuffs.structured_content import StructuredContent
from pydantic import Field, field_validator
+
class Invoice(StructuredContent):
"""A commercial invoice with validation."""
-
+
total_amount: float = Field(ge=0, description="Total invoice amount")
tax_amount: float = Field(ge=0, description="Tax amount")
net_amount: float = Field(ge=0, description="Net amount before tax")
-
- @field_validator('tax_amount')
+
+ @field_validator("tax_amount")
@classmethod
def validate_tax(cls, v, info):
"""Ensure tax doesn't exceed total."""
- total = info.data.get('total_amount', 0)
+ total = info.data.get("total_amount", 0)
if v > total:
- raise ValueError('Tax amount cannot exceed total amount')
+ raise ValueError("Tax amount cannot exceed total amount")
return v
```
@@ -73,18 +75,19 @@ from datetime import datetime
from pipelex.core.stuffs.structured_content import StructuredContent
from pydantic import Field
+
class Subscription(StructuredContent):
"""A subscription with computed properties."""
-
+
start_date: datetime = Field(description="Subscription start date")
end_date: datetime = Field(description="Subscription end date")
monthly_price: float = Field(ge=0, description="Monthly subscription price")
-
+
@property
def duration_days(self) -> int:
"""Calculate subscription duration in days."""
return (self.end_date - self.start_date).days
-
+
@property
def total_cost(self) -> float:
"""Calculate total subscription cost."""
@@ -145,13 +148,13 @@ from .structures import UserProfile
class ValidatedUserProfile(UserProfile):
"""A user profile with email validation."""
- @field_validator('email')
+ @field_validator("email")
@classmethod
def validate_email(cls, v):
"""Validate email format."""
- pattern = r'^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$'
+ pattern = r"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$"
if not re.match(pattern, v):
- raise ValueError('Invalid email format')
+ raise ValueError("Invalid email format")
return v
```
@@ -186,6 +189,7 @@ in_stock = { type = "boolean", description = "Stock availability", default_value
from pipelex.core.stuffs.structured_content import StructuredContent
from pydantic import Field, field_validator
+
class Product(StructuredContent):
"""A product in the catalog."""
@@ -194,14 +198,14 @@ class Product(StructuredContent):
price: float = Field(ge=0, description="Product price")
in_stock: bool = Field(default=True, description="Stock availability")
- @field_validator('price')
+ @field_validator("price")
@classmethod
def validate_price(cls, v):
"""Ensure price is positive and reasonable."""
if v < 0:
- raise ValueError('Price cannot be negative')
+ raise ValueError("Price cannot be negative")
if v > 1_000_000:
- raise ValueError('Price seems unreasonably high')
+ raise ValueError("Price seems unreasonably high")
return v
@property
diff --git a/docs/building-methods/domain.md b/docs/building-methods/domain.md
index 0fbdf4fe4..1fcd04af1 100644
--- a/docs/building-methods/domain.md
+++ b/docs/building-methods/domain.md
@@ -184,7 +184,7 @@ from pipelex.core.stuffs.stuff_factory import StuffFactory
invoice_stuff = StuffFactory.make_from_concept_ref(
concept_ref="finance.Invoice", # domain_code.ConceptName
name="invoice_123",
- content=invoice_data
+ content=invoice_data,
)
```
diff --git a/docs/building-methods/pipes/pipe-operators/PipeFunc.md b/docs/building-methods/pipes/pipe-operators/PipeFunc.md
index e65ec7acb..4f27d0465 100644
--- a/docs/building-methods/pipes/pipe-operators/PipeFunc.md
+++ b/docs/building-methods/pipes/pipe-operators/PipeFunc.md
@@ -58,6 +58,7 @@ from pipelex.system.registries.func_registry import pipe_func
from pipelex.core.memory.working_memory import WorkingMemory
from pipelex.core.stuffs.text_content import TextContent
+
@pipe_func() # Required decorator for auto-discovery
async def concatenate_texts(working_memory: WorkingMemory) -> TextContent:
"""
diff --git a/docs/building-methods/pipes/provide-inputs.md b/docs/building-methods/pipes/provide-inputs.md
index 365916fbc..d08a2e45b 100644
--- a/docs/building-methods/pipes/provide-inputs.md
+++ b/docs/building-methods/pipes/provide-inputs.md
@@ -176,11 +176,9 @@ inputs = {
# Light values, shaped against the signature
"topic": "A robot learning to love",
"priority": 3,
-
# Native content objects (typed directly)
"photo": ImageContent(url="photo.jpg"),
"contract": DocumentContent(url="nda.pdf"),
-
# Explicit envelope with a custom concept
"draft_tweet": {
"concept": "social.DraftTweet",
diff --git a/docs/building-methods/pipes/understanding-multiplicity.md b/docs/building-methods/pipes/understanding-multiplicity.md
index 5a2383ec9..8b09038ce 100644
--- a/docs/building-methods/pipes/understanding-multiplicity.md
+++ b/docs/building-methods/pipes/understanding-multiplicity.md
@@ -381,10 +381,7 @@ from pipelex.pipeline.runner import PipelexMTHDSProtocol
# Execute a pipe with multiple outputs
runner = PipelexMTHDSProtocol()
-response = await runner.execute(
- pipe_code="extract_line_items",
- inputs={"invoice_text": "Your invoice text here..."}
-)
+response = await runner.execute(pipe_code="extract_line_items", inputs={"invoice_text": "Your invoice text here..."})
pipe_output = response.pipe_output
# Get the list of line items
@@ -411,7 +408,7 @@ response = await runner.execute(
TextContent(text="Document 2 content..."),
TextContent(text="Document 3 content..."),
]
- }
+ },
)
pipe_output = response.pipe_output
```
diff --git a/docs/configuration/config-technical/library-config.md b/docs/configuration/config-technical/library-config.md
index 8dd6d4f0a..ccf861199 100644
--- a/docs/configuration/config-technical/library-config.md
+++ b/docs/configuration/config-technical/library-config.md
@@ -152,9 +152,7 @@ from pipelex.pipelex import Pipelex
from pipelex.pipeline.runner import PipelexMTHDSProtocol
# Set instance-level defaults at initialization
-Pipelex.make(
- library_dirs=["/path/to/shared_pipes", "/path/to/project_pipes"]
-)
+Pipelex.make(library_dirs=["/path/to/shared_pipes", "/path/to/project_pipes"])
# All PipelexMTHDSProtocol.execute() calls will use these directories by default
runner = PipelexMTHDSProtocol()
@@ -174,9 +172,7 @@ from pipelex.pipelex import Pipelex
from pipelex.pipeline.runner import PipelexMTHDSProtocol
# Initialize with default directories
-Pipelex.make(
- library_dirs=["/path/to/default_pipes"]
-)
+Pipelex.make(library_dirs=["/path/to/default_pipes"])
# Use the default directories
runner1 = PipelexMTHDSProtocol()
@@ -439,6 +435,7 @@ from pipelex.system.registries.func_registry import pipe_func
from pipelex.core.memory.working_memory import WorkingMemory
from pipelex.core.stuffs.text_content import TextContent
+
@pipe_func()
async def my_custom_function(working_memory: WorkingMemory) -> TextContent:
"""
@@ -448,6 +445,7 @@ async def my_custom_function(working_memory: WorkingMemory) -> TextContent:
# Process data
return TextContent(text=f"Processed: {input_data.content.text}")
+
# Optional: specify a custom name
@pipe_func(name="custom_processor")
async def another_function(working_memory: WorkingMemory) -> TextContent:
diff --git a/docs/contribute/keyword-only-arguments.md b/docs/contribute/keyword-only-arguments.md
index 7e05ca64f..7994d642d 100644
--- a/docs/contribute/keyword-only-arguments.md
+++ b/docs/contribute/keyword-only-arguments.md
@@ -7,8 +7,8 @@ This is the canonical convention for keyword-only function parameters across the
A function or method must place a bare `*` separator in its signature so that every parameter after the subject is keyword-only. The compliant shapes are:
```python
-def f(*, opt1, opt2): ... # fully keyword-only — always compliant, no registry entry needed
-def f(subject, *, opt1, opt2): ... # positional subject — compliant ONLY under a recorded subject grant
+def f(*, opt1, opt2): ... # fully keyword-only — always compliant, no registry entry needed
+def f(subject, *, opt1, opt2): ... # positional subject — compliant ONLY under a recorded subject grant
```
The first non-`self`/`cls` parameter — the subject — may stay positional-or-keyword **only when a subject grant for that def is recorded in `subject_grants.toml`** (see the next section). We deliberately do NOT use the positional-only `/` separator anywhere; a granted subject may be passed positionally or by keyword, at the caller's discretion.
@@ -140,19 +140,19 @@ A subject plus options — the canonical shape, legal only with a grant:
```python
# subject_grants.toml carries: ["pipelex/builder/build.py::build_pipe"] param = "spec" rationale = "…"
-def build_pipe(spec, *, dry_run, retries, validate): ... # build_pipe(my_spec, dry_run=True, retries=3, validate=False)
+def build_pipe(spec, *, dry_run, retries, validate): ... # build_pipe(my_spec, dry_run=True, retries=3, validate=False)
```
A single subject and nothing else — needs a grant too (strict-all scope; lone-subject defs are not implicitly exempt):
```python
-def render(node): ... # render(my_node) — granted: verb–object, single operand
+def render(node): ... # render(my_node) — granted: verb–object, single operand
```
All parameters named, including the first — always compliant, no registry entry, and often the most readable choice:
```python
-def copy_payload(*, source, target): ... # copy_payload(source=a, target=b)
+def copy_payload(*, source, target): ... # copy_payload(source=a, target=b)
```
Even a single defaulted option must be named — this is the common case the convention fixes, not an exception to it:
@@ -176,7 +176,7 @@ def doctor_cmd(*, fix: bool): ...
A symmetric tuple on the allowlist — exempt entirely, stays positional:
```python
-def set_env(key: str, value: str) -> None: ... # set_env("PIPELEX_ENV", "prod")
+def set_env(key: str, value: str) -> None: ... # set_env("PIPELEX_ENV", "prod")
```
A directional pair with a trailing option — neither operand is "the object", and a whole-function allowlist exemption would let the option go positional too, so the whole signature becomes keyword-only:
@@ -194,13 +194,13 @@ An override — skipped because of `@override`; fix (and grant) the base signatu
```python
@override
-def _store(self, data, *, key, content_type): ... # base StorageProviderAbstract._store defines the contract and holds any grant
+def _store(self, data, *, key, content_type): ... # base StorageProviderAbstract._store defines the contract and holds any grant
```
A dunder — skipped by name; the interpreter owns the calling convention:
```python
-def __format__(self, format_spec: str) -> str: ... # called positionally by format()/f-strings
+def __format__(self, format_spec: str) -> str: ... # called positionally by format()/f-strings
```
A pydantic validator — skipped by decorator; pydantic owns the positional protocol:
diff --git a/docs/tools/cli/build/output.md b/docs/tools/cli/build/output.md
index b907bb4e1..4da9cc2cc 100644
--- a/docs/tools/cli/build/output.md
+++ b/docs/tools/cli/build/output.md
@@ -151,10 +151,7 @@ When a pipe's output has multiplicity (returns multiple items), the content is a
The Python format generates class instantiation code:
```python
-{
- "concept": "my_domain.MyOutputConcept",
- "content": "MyOutputConcept(title=\"title_value\", key_points=\"key_points_value\")"
-}
+{"concept": "my_domain.MyOutputConcept", "content": 'MyOutputConcept(title="title_value", key_points="key_points_value")'}
```
### Schema Format
diff --git a/docs/under-the-hood/codegen-projections.md b/docs/under-the-hood/codegen-projections.md
index 1fec34da0..10686d03c 100644
--- a/docs/under-the-hood/codegen-projections.md
+++ b/docs/under-the-hood/codegen-projections.md
@@ -187,8 +187,8 @@ Generated code is never edited — hand edits are overwritten on regeneration, a
# my_types_ext.py
from .structures import Report
- class MyReport(Report):
- ...
+
+ class MyReport(Report): ...
```
- **TypeScript** — augment the generated type from a sibling module via declaration merging.
diff --git a/docs/under-the-hood/distributed-content-generation.md b/docs/under-the-hood/distributed-content-generation.md
index 0d165400e..9841cf304 100644
--- a/docs/under-the-hood/distributed-content-generation.md
+++ b/docs/under-the-hood/distributed-content-generation.md
@@ -56,7 +56,7 @@ Reconstruction is the *boundary* answer, and only that. An in-process run never
On the worker, `SchemaToModelFactory.make_from_json_schema(schema, *, class_name)` (`pipelex/cogt/content_generation/schema_to_model_factory.py`) rebuilds a live Pydantic class from the embedded schema:
```python
-source_code = cls._generate_source_from_schema(schema) # datamodel-code-generator
+source_code = cls._generate_source_from_schema(schema) # datamodel-code-generator
reconstructed_class = cls._exec_and_extract_class(source_code, class_name=class_name) # exec()
reconstructed_class.__kajson_class_source__ = source_code # attached for downstream use
```
diff --git a/docs/under-the-hood/dry-run-mock-generation.md b/docs/under-the-hood/dry-run-mock-generation.md
index 061f29afd..82550ec27 100644
--- a/docs/under-the-hood/dry-run-mock-generation.md
+++ b/docs/under-the-hood/dry-run-mock-generation.md
@@ -16,7 +16,8 @@ Pydantic models in Pipelex often enforce format constraints via `field_validator
```python
class BundleHeaderSpec(StructuredContent):
domain_code: str # Must be snake_case
- main_pipe: str # Must be snake_case, must exist in pipe dict
+ main_pipe: str # Must be snake_case, must exist in pipe dict
+
class ConceptSpec(StructuredContent):
concept_code: str # Must be PascalCase
@@ -102,8 +103,7 @@ class DryRunFactory:
*,
snake_case_field_names: set[str] | None = None,
pascal_case_field_names: set[str] | None = None,
- ) -> type[ModelFactory[BaseModelTypeVar]]:
- ...
+ ) -> type[ModelFactory[BaseModelTypeVar]]: ...
```
---
@@ -130,12 +130,10 @@ The `DryRunFactory` auto-detects format constraints from Pydantic `Field` defini
from pydantic import Field
from pipelex.cogt.content_generation.dry_run_factory import MockFormat
+
class ConceptStructureSpec(StructuredContent):
# Snake case field
- the_field_name: str = Field(
- description="Field name. Must be snake_case.",
- json_schema_extra={"mock_format": MockFormat.SNAKE_CASE}
- )
+ the_field_name: str = Field(description="Field name. Must be snake_case.", json_schema_extra={"mock_format": MockFormat.SNAKE_CASE})
# Concept reference field (domain.ConceptCode format)
concept_ref: str | None = Field(
@@ -145,10 +143,7 @@ class ConceptStructureSpec(StructuredContent):
)
# Field to ignore during mock generation (use default/None)
- default_value: Any | None = Field(
- default=None,
- json_schema_extra={"mock_format": MockFormat.IGNORE}
- )
+ default_value: Any | None = Field(default=None, json_schema_extra={"mock_format": MockFormat.IGNORE})
```
---
@@ -165,6 +160,7 @@ class ConceptSpec(StructuredContent):
examples=["Text", "Image", "Document", "TextAndImages", "Number", "Page"],
)
+
class PipeComposeSpec(PipeSpec):
# Target format should be a valid TargetFormat value
target_format: TargetFormat | str | None = Field(
@@ -297,10 +293,7 @@ There is one fallback: when composition fails with a `StructuredContentComposerV
```python
class MySpec(StructuredContent):
- my_kebab_field: str = Field(
- description="A kebab-case identifier",
- json_schema_extra={"mock_format": MockFormat.KEBAB_CASE}
- )
+ my_kebab_field: str = Field(description="A kebab-case identifier", json_schema_extra={"mock_format": MockFormat.KEBAB_CASE})
```
!!! warning "Field name matching is exact"
diff --git a/docs/under-the-hood/error-model.md b/docs/under-the-hood/error-model.md
index 99c432eb8..48eff67e5 100644
--- a/docs/under-the-hood/error-model.md
+++ b/docs/under-the-hood/error-model.md
@@ -105,9 +105,9 @@ Membership means a value is *reachable on the wire*, not that it is a useful thi
```python
report = exc.to_error_report()
-report.to_dict() # {"error_type": "LLMCompletionError", "message": "...", ...}
-ErrorReport.from_dict(d) # strict inverse — raises ValidationError on a malformed dict
-report.http_status # 422 / 429 / 500 — for HTTP adapters
+report.to_dict() # {"error_type": "LLMCompletionError", "message": "...", ...}
+ErrorReport.from_dict(d) # strict inverse — raises ValidationError on a malformed dict
+report.http_status # 422 / 429 / 500 — for HTTP adapters
```
!!! warning "`ErrorReport` is `extra="forbid"`"
@@ -182,7 +182,7 @@ Defined in `pipelex/base_exceptions.py`. Set as a class-level attribute on the e
```python
class PipelexConfigError(PipelexError):
- error_domain = ErrorDomain.CONFIG # class-level — every instance carries it
+ error_domain = ErrorDomain.CONFIG # class-level — every instance carries it
```
---
@@ -230,7 +230,7 @@ class ProviderErrorMetadata(BaseModel):
request_id: str | None = None
retry_after_seconds: float | None = None
provider_error_code: str | None = None
- body: Any | None = Field(default=None, exclude=True) # may carry secrets
+ body: Any | None = Field(default=None, exclude=True) # may carry secrets
```
!!! warning "`body` is excluded from serialization"
@@ -264,7 +264,7 @@ def _enrich_error_report_from_cause(self, report: ErrorReport) -> ErrorReport:
return report
cause_report = cause.to_error_report()
return ErrorReport(
- error_type=report.error_type, # keep own identity
+ error_type=report.error_type, # keep own identity
message=report.message,
error_category=report.error_category or cause_report.error_category,
error_domain=report.error_domain or cause_report.error_domain,
@@ -412,19 +412,19 @@ The "outcome" exceptions (`LLMCompletionError`, `ImgGenGenerationError`, `Extrac
```python
# Produce a report from any PipelexError
-report = exc.to_error_report() # enriched from the __cause__ chain
-payload = report.to_dict() # None-free dict for serialization
+report = exc.to_error_report() # enriched from the __cause__ chain
+payload = report.to_dict() # None-free dict for serialization
# Consume a report
-report.http_status # 422 / 429 / 500
-report.user_action_detail() # free-form advice text, or None
-report.error_category # "transient" / "capacity" / ...
+report.http_status # 422 / 429 / 500
+report.user_action_detail() # free-form advice text, or None
+report.error_category # "transient" / "capacity" / ...
# Round-trip across a boundary
-ErrorReport.from_dict(payload) # strict inverse of to_dict()
+ErrorReport.from_dict(payload) # strict inverse of to_dict()
# Retry decision
-InferenceErrorCategory.TRANSIENT.is_retryable # True — only TRANSIENT
+InferenceErrorCategory.TRANSIENT.is_retryable # True — only TRANSIENT
```
### File → Purpose
diff --git a/docs/under-the-hood/execution-graph-tracing.md b/docs/under-the-hood/execution-graph-tracing.md
index 2dc2ca9c6..00e2a77b1 100644
--- a/docs/under-the-hood/execution-graph-tracing.md
+++ b/docs/under-the-hood/execution-graph-tracing.md
@@ -291,10 +291,10 @@ TraceContext is a serializable context that flows through pipe execution:
```python
class TraceContext(BaseModel):
- graph_id: str # Unique graph identifier
- parent_node_id: str | None # Parent pipe's node ID
- node_sequence: int # Counter for generating node IDs
- data_inclusion: DataInclusionConfig # What data to capture
+ graph_id: str # Unique graph identifier
+ parent_node_id: str | None # Parent pipe's node ID
+ node_sequence: int # Counter for generating node IDs
+ data_inclusion: DataInclusionConfig # What data to capture
def copy_for_child(self, child_node_id: str, *, next_sequence: int) -> TraceContext:
"""Create context for nested pipe execution."""
@@ -467,16 +467,16 @@ IOSpec captures input/output data for nodes:
```python
class IOSpec(BaseModel):
- name: str # Variable name
- concept: str | None # Concept code
- content_type: str | None # MIME type
- preview: str | None # Truncated preview (max 200 chars)
- size: int | None # Content size
- digest: str | None # Unique identifier for data flow
+ name: str # Variable name
+ concept: str | None # Concept code
+ content_type: str | None # MIME type
+ preview: str | None # Truncated preview (max 200 chars)
+ size: int | None # Content size
+ digest: str | None # Unique identifier for data flow
data: str | dict[str, Any] | list[str] | list[dict[str, Any]] | None # Full serialized content
- data_text: str | None # ASCII text representation
- data_html: str | None # HTML representation
- extra: dict[str, Any] # Extra markers, e.g. `optional` set on a declared-optional (`?`) output
+ data_text: str | None # ASCII text representation
+ data_html: str | None # HTML representation
+ extra: dict[str, Any] # Extra markers, e.g. `optional` set on a declared-optional (`?`) output
```
!!! warning "Preview Truncation"
diff --git a/docs/under-the-hood/image-handling-in-llm-prompts.md b/docs/under-the-hood/image-handling-in-llm-prompts.md
index 5aec04739..96eeb4e96 100644
--- a/docs/under-the-hood/image-handling-in-llm-prompts.md
+++ b/docs/under-the-hood/image-handling-in-llm-prompts.md
@@ -137,11 +137,8 @@ Given a `Page` with text and images:
```python
PageContent(
- text_and_images=TextAndImagesContent(
- text=TextContent(text="Welcome to the guide"),
- images=[ImageContent(url="...")]
- ),
- page_view=ImageContent(url="...")
+ text_and_images=TextAndImagesContent(text=TextContent(text="Welcome to the guide"), images=[ImageContent(url="...")]),
+ page_view=ImageContent(url="..."),
)
```
@@ -207,19 +204,9 @@ When a PipeLLM is created from a blueprint, the `TemplateImageAnalyzer` examines
```python
# Stored in PipeLLM after analysis
user_image_references = [
- ImageReference(
- variable_path="page",
- kind=ImageReferenceKind.NESTED,
- nested_image_paths=["text_and_images.images", "page_view"]
- )
-]
-system_image_references = [
- ImageReference(
- variable_path="context_image",
- kind=ImageReferenceKind.DIRECT,
- nested_image_paths=None
- )
+ ImageReference(variable_path="page", kind=ImageReferenceKind.NESTED, nested_image_paths=["text_and_images.images", "page_view"])
]
+system_image_references = [ImageReference(variable_path="context_image", kind=ImageReferenceKind.DIRECT, nested_image_paths=None)]
```
### Runtime: Image Collection
@@ -334,6 +321,7 @@ The `with_images` filter uses the `ImageRenderable` protocol to handle StuffArte
if isinstance(value, ImageRenderable):
return value.render_with_images(registry=registry, text_format=text_format)
+
# StuffArtefact.render_with_images() delegates to content
def render_with_images(self, *, registry, text_format) -> str:
return self._stuff.content.render_with_images(registry=registry, text_format=text_format)
diff --git a/docs/under-the-hood/inference-backend-plugins.md b/docs/under-the-hood/inference-backend-plugins.md
index 7002ac5e8..fd19ac254 100644
--- a/docs/under-the-hood/inference-backend-plugins.md
+++ b/docs/under-the-hood/inference-backend-plugins.md
@@ -39,8 +39,9 @@ A plugin is any object satisfying the `@runtime_checkable` `PipelexPlugin` proto
```python
class PipelexPlugin(Protocol):
- name: str # unique, lowercase identifier (e.g. "openai")
- targets_api: int # must equal PLUGIN_API_VERSION
+ name: str # unique, lowercase identifier (e.g. "openai")
+ targets_api: int # must equal PLUGIN_API_VERSION
+
def register(self, registrar: PluginRegistrar) -> None: ...
```
@@ -56,9 +57,9 @@ A backend plugin's `register` calls one menu method per `(family, sdk)` it serve
```python
registrar.add_inference_backend(
- family=InferenceFamily.LLM, # LLM | IMG_GEN | EXTRACT | SEARCH
- sdk="acme", # the model's `sdk` string
- make_worker=_make_acme_worker, # a MakeWorkerFn (a plain callable)
+ family=InferenceFamily.LLM, # LLM | IMG_GEN | EXTRACT | SEARCH
+ sdk="acme", # the model's `sdk` string
+ make_worker=_make_acme_worker, # a MakeWorkerFn (a plain callable)
)
```
@@ -79,8 +80,7 @@ def _make_acme_worker(
backend: InferenceBackend,
sdk_clients: SdkClientRegistry,
reporting_delegate: ReportingProtocol | None,
-) -> InferenceWorkerAbstract:
- ...
+) -> InferenceWorkerAbstract: ...
```
The factory always passes all four keyword arguments. A stateless backend simply ignores the ones it doesn't need (`# noqa: ARG001` on the unused parameter — see the built-in `pypdfium2` and `azure_rest` plugins).
diff --git a/docs/under-the-hood/orchestrator-plugins.md b/docs/under-the-hood/orchestrator-plugins.md
index 1889b526c..8fc1a7c07 100644
--- a/docs/under-the-hood/orchestrator-plugins.md
+++ b/docs/under-the-hood/orchestrator-plugins.md
@@ -108,8 +108,8 @@ The plugin bridges that gap by contributing a **framework-agnostic mapper** —
```python
registrar.add_http_error_mapper(
- exc_type_provider=lambda: TemporalError, # SDK imported only when a host resolves the mappers, never at register
- to_error_report=lambda exc: ErrorReport(...), # classified transient / RUNTIME
+ exc_type_provider=lambda: TemporalError, # SDK imported only when a host resolves the mappers, never at register
+ to_error_report=lambda exc: ErrorReport(...), # classified transient / RUNTIME
)
```
@@ -133,7 +133,7 @@ Not every orchestrator goes this far. A per-call-only plugin — our Mistral Wor
```python
if registrar.boot_orchestrator == self.name:
- registrar.claim_content_generator(_make_temporal_content_generator) # a thunk, not an instance
+ registrar.claim_content_generator(_make_temporal_content_generator) # a thunk, not an instance
registrar.claim_task_manager(_setup_temporal_task_manager)
registrar.claim_pipe_router(_make_temporal_pipe_router)
registrar.claim_pipe_run(_make_temporal_pipe_run)
diff --git a/docs/under-the-hood/pipe-routing-and-execution.md b/docs/under-the-hood/pipe-routing-and-execution.md
index 9f0697119..f2e2fb886 100644
--- a/docs/under-the-hood/pipe-routing-and-execution.md
+++ b/docs/under-the-hood/pipe-routing-and-execution.md
@@ -119,7 +119,7 @@ The router is selected during `Pipelex.setup()` by resolving the hub's `PIPE_ROU
# boot_orchestrator == its own name; otherwise this default runs.
effective_pipe_router = self._resolve_hub_slot(
slot=HubSlot.PIPE_ROUTER,
- default=lambda: PipeRouter(observer=multi_observer), # Direct, in-process
+ default=lambda: PipeRouter(observer=multi_observer), # Direct, in-process
)
```
diff --git a/docs/under-the-hood/pipelex-kernel.md b/docs/under-the-hood/pipelex-kernel.md
index 0c567e48a..0a56e6a5b 100644
--- a/docs/under-the-hood/pipelex-kernel.md
+++ b/docs/under-the-hood/pipelex-kernel.md
@@ -115,7 +115,9 @@ summary = extract_main_content(memory=result.memory, content_type=Summary)
Reach for the list pair whenever the call asked for several — `is_multiple_output=True` or `fixed_nb_output=n`:
```python
-result = await kernel.llm_object(memory=memory, output_class=Summary, concept=summary_concept, model=model, user="Summarize $topic", result="summaries", is_multiple_output=True)
+result = await kernel.llm_object(
+ memory=memory, output_class=Summary, concept=summary_concept, model=model, user="Summarize $topic", result="summaries", is_multiple_output=True
+)
summaries = extract_main_content_as_list(memory=result.memory, item_type=Summary).items
```
diff --git a/docs/under-the-hood/runtime-bridge-and-transport.md b/docs/under-the-hood/runtime-bridge-and-transport.md
index 8dc925d6c..ef2982c34 100644
--- a/docs/under-the-hood/runtime-bridge-and-transport.md
+++ b/docs/under-the-hood/runtime-bridge-and-transport.md
@@ -53,10 +53,10 @@ A `LibraryCrate` (`pipelex/libraries/library_crate.py`) is a flat, serializable
```python
class LibraryCrate(BaseModel):
concepts: dict[str, ConceptBlueprint | str] # concept ref -> blueprint or description
- pipes: dict[str, PipeBlueprintUnion] # pipe ref -> blueprint
- domains: dict[str, DomainBlueprint] # domain code -> domain metadata
- source_map: dict[str, str] # ref -> source file (error traceability)
- fingerprint: str # SHA256 of serialized content
+ pipes: dict[str, PipeBlueprintUnion] # pipe ref -> blueprint
+ domains: dict[str, DomainBlueprint] # domain code -> domain metadata
+ source_map: dict[str, str] # ref -> source file (error traceability)
+ fingerprint: str # SHA256 of serialized content
```
Domain is encoded in the dictionary keys (e.g., `scoring.WeightedScore`, `scoring.compute_score`), not in a structural container. `source_map` lets error messages trace back to origin files. The `fingerprint` enables idempotent loading — a worker that already loaded a crate with the same fingerprint skips the reload. The crate is a plain Pydantic model, so a host runtime serializes it as structured JSON in the job input — fully inspectable, not opaque bytes.
diff --git a/docs/under-the-hood/stuffartefact-and-image-rendering.md b/docs/under-the-hood/stuffartefact-and-image-rendering.md
index 7230fae86..3e3569c82 100644
--- a/docs/under-the-hood/stuffartefact-and-image-rendering.md
+++ b/docs/under-the-hood/stuffartefact-and-image-rendering.md
@@ -114,11 +114,16 @@ def __getattribute__(self, key: str) -> Any:
# 3. Metadata accessors
match key:
- case "_stuff_name": return stuff.stuff_name
- case "_content_class": return content.__class__.__name__
- case "_concept_code": return stuff.concept.code
- case "_stuff_code": return stuff.stuff_code
- case "_content": return content
+ case "_stuff_name":
+ return stuff.stuff_name
+ case "_content_class":
+ return content.__class__.__name__
+ case "_concept_code":
+ return stuff.concept.code
+ case "_stuff_code":
+ return stuff.stuff_code
+ case "_content":
+ return content
# 4. Fallback to normal lookup
return object.__getattribute__(self, key)
@@ -149,6 +154,7 @@ StuffArtefact supports bracket notation and iteration:
```python
from typing import Protocol, runtime_checkable
+
@runtime_checkable
class ImageRenderable(Protocol):
"""Protocol for types that can render with image extraction."""
diff --git a/docs/under-the-hood/test-profile-configuration.md b/docs/under-the-hood/test-profile-configuration.md
index 685f793a1..89c94144c 100644
--- a/docs/under-the-hood/test-profile-configuration.md
+++ b/docs/under-the-hood/test-profile-configuration.md
@@ -211,9 +211,9 @@ This file contains:
from tests.integration.pipelex.fixtures.model_combo import ModelCombo
LLM_COMBOS: list[ModelCombo] = [
- ModelCombo('claude-4.5-haiku', 'pipelex_gateway'),
- ModelCombo('gemini-2.5-flash-lite', 'pipelex_gateway'),
- ModelCombo('gpt-4o-mini', 'pipelex_gateway'),
+ ModelCombo("claude-4.5-haiku", "pipelex_gateway"),
+ ModelCombo("gemini-2.5-flash-lite", "pipelex_gateway"),
+ ModelCombo("gpt-4o-mini", "pipelex_gateway"),
]
IMG_GEN_COMBOS: list[ModelCombo] = [...]
diff --git a/pipelex/cli/_cli.py b/pipelex/cli/_cli.py
index 2fdd24792..55a391d3e 100644
--- a/pipelex/cli/_cli.py
+++ b/pipelex/cli/_cli.py
@@ -114,7 +114,7 @@ def version_callback(value: bool) -> None: # kw-only: ignore — click invokes
@app.callback(invoke_without_command=True)
def app_callback(
ctx: typer.Context,
- version: Annotated[ # noqa: ARG001
+ version: Annotated[ # ruff: ignore[unused-function-argument]
bool,
typer.Option(
"--version",
diff --git a/pipelex/cli/agent_cli/_agent_cli.py b/pipelex/cli/agent_cli/_agent_cli.py
index 60b5e9599..8d1bdb80e 100644
--- a/pipelex/cli/agent_cli/_agent_cli.py
+++ b/pipelex/cli/agent_cli/_agent_cli.py
@@ -57,7 +57,7 @@ class PipelexAgentCLI(TyperGroup):
"""Get command by name."""
cmd = super().get_command(ctx, cmd_name)
if cmd is None:
- from pipelex.cli.agent_cli.commands.agent_output import agent_error # noqa: PLC0415
+ from pipelex.cli.agent_cli.commands.agent_output import agent_error # ruff: ignore[import-outside-top-level]
valid_commands = super().list_commands(ctx)
agent_error(
@@ -87,7 +87,7 @@ def version_callback(value: bool) -> None: # kw-only: ignore — click invokes
@app.callback(invoke_without_command=True)
def app_callback(
ctx: typer.Context,
- version: Annotated[ # noqa: ARG001
+ version: Annotated[ # ruff: ignore[unused-function-argument]
bool,
typer.Option(
"--version",
diff --git a/pipelex/cli/agent_cli/commands/accept_gateway_terms_cmd.py b/pipelex/cli/agent_cli/commands/accept_gateway_terms_cmd.py
index a1fc43811..cb8338c09 100644
--- a/pipelex/cli/agent_cli/commands/accept_gateway_terms_cmd.py
+++ b/pipelex/cli/agent_cli/commands/accept_gateway_terms_cmd.py
@@ -31,7 +31,7 @@ def agent_accept_gateway_terms_cmd() -> None:
)
except typer.Exit:
raise
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Agent CLI command boundary: agent_error() (NoReturn) converts any unexpected failure into the structured error payload.
agent_error(
f"Failed to accept gateway terms: {exc}",
diff --git a/pipelex/cli/agent_cli/commands/agent_cli_factory.py b/pipelex/cli/agent_cli/commands/agent_cli_factory.py
index 6529ed4e6..c9a251db6 100644
--- a/pipelex/cli/agent_cli/commands/agent_cli_factory.py
+++ b/pipelex/cli/agent_cli/commands/agent_cli_factory.py
@@ -263,7 +263,7 @@ def make_pipelex_for_agent_cli(
model_handle=exc.model_handle,
enabled_backends=sorted(exc.enabled_backends),
)
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Agent CLI command boundary: agent_error() (NoReturn) converts any unexpected failure into the structured error payload.
agent_error(
f"Pipelex initialization failed: {exc}",
diff --git a/pipelex/cli/agent_cli/commands/check_model_cmd.py b/pipelex/cli/agent_cli/commands/check_model_cmd.py
index f4bdc5f37..ff3344614 100644
--- a/pipelex/cli/agent_cli/commands/check_model_cmd.py
+++ b/pipelex/cli/agent_cli/commands/check_model_cmd.py
@@ -112,7 +112,7 @@ def agent_check_model_cmd(
raise
except ModelReferenceParseError as exc:
agent_error(f"Invalid model reference: {exc}", error_type="ArgumentError", cause=exc)
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Agent CLI command boundary: agent_error() (NoReturn) converts any unexpected failure into the structured error payload.
agent_error(f"Failed to check model: {exc}", error_type=type(exc).__name__, cause=exc)
finally:
diff --git a/pipelex/cli/agent_cli/commands/codegen/check_cmd.py b/pipelex/cli/agent_cli/commands/codegen/check_cmd.py
index bacfda014..9e8beb084 100644
--- a/pipelex/cli/agent_cli/commands/codegen/check_cmd.py
+++ b/pipelex/cli/agent_cli/commands/codegen/check_cmd.py
@@ -85,7 +85,7 @@ def agent_codegen_check_cmd(
# No verdict: the lock exists but cannot be read, so nothing can be checked.
agent_error(exc.message, error_type=type(exc).__name__, cause=exc, exit_code=2, root=str(root_path))
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Agent CLI command boundary: agent_error() (NoReturn) converts any unexpected failure into the structured error payload.
agent_error(str(exc), error_type=type(exc).__name__, cause=exc)
diff --git a/pipelex/cli/agent_cli/commands/codegen/types_cmd.py b/pipelex/cli/agent_cli/commands/codegen/types_cmd.py
index 256d428cf..dea775a8a 100644
--- a/pipelex/cli/agent_cli/commands/codegen/types_cmd.py
+++ b/pipelex/cli/agent_cli/commands/codegen/types_cmd.py
@@ -115,7 +115,7 @@ def agent_codegen_types_cmd(
except typer.Exit:
raise
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Agent CLI command boundary: agent_error() (NoReturn) converts any unexpected failure into the structured error payload.
agent_error(str(exc), error_type=type(exc).__name__, cause=exc)
diff --git a/pipelex/cli/agent_cli/commands/concept_cmd.py b/pipelex/cli/agent_cli/commands/concept_cmd.py
index 518d291b5..8e5c18818 100644
--- a/pipelex/cli/agent_cli/commands/concept_cmd.py
+++ b/pipelex/cli/agent_cli/commands/concept_cmd.py
@@ -129,6 +129,6 @@ def concept_cmd(
except ValueError as exc:
agent_error(str(exc), error_type="ValueError", cause=exc)
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Agent CLI command boundary: agent_error() (NoReturn) converts any unexpected failure into the structured error payload.
agent_error(str(exc), error_type=type(exc).__name__, cause=exc)
diff --git a/pipelex/cli/agent_cli/commands/doctor_cmd.py b/pipelex/cli/agent_cli/commands/doctor_cmd.py
index 8d75a1630..d19554769 100644
--- a/pipelex/cli/agent_cli/commands/doctor_cmd.py
+++ b/pipelex/cli/agent_cli/commands/doctor_cmd.py
@@ -263,7 +263,7 @@ def agent_doctor_cmd(
models_healthy = False
models_message = "skipped — fix configuration errors first"
backend_file_reports = {}
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Agent CLI command boundary: agent_error() (NoReturn) converts any genuinely
# unexpected failure into the structured error payload. PipelexConfigError is
# handled by the inner arm above and never reaches here.
diff --git a/pipelex/cli/agent_cli/commands/fix/bundle_cmd.py b/pipelex/cli/agent_cli/commands/fix/bundle_cmd.py
index aa2328eb9..37b13a1ea 100644
--- a/pipelex/cli/agent_cli/commands/fix/bundle_cmd.py
+++ b/pipelex/cli/agent_cli/commands/fix/bundle_cmd.py
@@ -178,7 +178,7 @@ def fix_bundle_cmd(
except typer.Exit:
raise
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Agent CLI command boundary: agent_error() (NoReturn) converts any unexpected failure into the structured error payload.
agent_error(str(exc), error_type=type(exc).__name__, cause=exc, exit_code=2)
diff --git a/pipelex/cli/agent_cli/commands/init_cmd.py b/pipelex/cli/agent_cli/commands/init_cmd.py
index 3ed36d13b..56093bbbd 100644
--- a/pipelex/cli/agent_cli/commands/init_cmd.py
+++ b/pipelex/cli/agent_cli/commands/init_cmd.py
@@ -429,6 +429,6 @@ def agent_init_cmd(
except typer.Exit:
raise
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Agent CLI command boundary: agent_error() (NoReturn) converts any unexpected failure into the structured error payload.
agent_error(f"Initialization failed: {exc}", error_type=type(exc).__name__, cause=exc)
diff --git a/pipelex/cli/agent_cli/commands/inputs/bundle_cmd.py b/pipelex/cli/agent_cli/commands/inputs/bundle_cmd.py
index 886beecd4..43ac0fe08 100644
--- a/pipelex/cli/agent_cli/commands/inputs/bundle_cmd.py
+++ b/pipelex/cli/agent_cli/commands/inputs/bundle_cmd.py
@@ -138,7 +138,7 @@ def inputs_bundle_cmd(
except typer.Exit:
raise
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Agent CLI command boundary: agent_error() (NoReturn) converts any unexpected failure into the structured error payload.
agent_error(str(exc), error_type=type(exc).__name__, cause=exc)
diff --git a/pipelex/cli/agent_cli/commands/inputs/method_cmd.py b/pipelex/cli/agent_cli/commands/inputs/method_cmd.py
index bc5658f75..b0839083b 100644
--- a/pipelex/cli/agent_cli/commands/inputs/method_cmd.py
+++ b/pipelex/cli/agent_cli/commands/inputs/method_cmd.py
@@ -108,7 +108,7 @@ def inputs_method_cmd(
availability_extra["pipe_stack"] = exc.pipe_stack
agent_error(exc.message, error_type="PipeOperatorModelAvailabilityError", cause=exc, **availability_extra)
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Agent CLI command boundary: agent_error() (NoReturn) converts any unexpected failure into the structured error payload.
agent_error(str(exc), error_type=type(exc).__name__, cause=exc)
diff --git a/pipelex/cli/agent_cli/commands/inputs/pipe_cmd.py b/pipelex/cli/agent_cli/commands/inputs/pipe_cmd.py
index eda6ea9a6..a5cf89c89 100644
--- a/pipelex/cli/agent_cli/commands/inputs/pipe_cmd.py
+++ b/pipelex/cli/agent_cli/commands/inputs/pipe_cmd.py
@@ -119,7 +119,7 @@ def inputs_pipe_cmd(
except typer.Exit:
raise
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Agent CLI command boundary: agent_error() (NoReturn) converts any unexpected failure into the structured error payload.
agent_error(str(exc), error_type=type(exc).__name__, cause=exc)
diff --git a/pipelex/cli/agent_cli/commands/models_cmd.py b/pipelex/cli/agent_cli/commands/models_cmd.py
index 10ad29165..dde4c246a 100644
--- a/pipelex/cli/agent_cli/commands/models_cmd.py
+++ b/pipelex/cli/agent_cli/commands/models_cmd.py
@@ -50,7 +50,7 @@ def agent_models_cmd(
# broad catch below and printed a second envelope after the first — stderr then held two
# JSON documents and a machine consumer parsing it got "Extra data".
raise
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Agent CLI command boundary: agent_error() (NoReturn) converts any unexpected failure into the structured error payload.
agent_error(f"Failed to list models: {exc}", error_type=type(exc).__name__, cause=exc)
finally:
diff --git a/pipelex/cli/agent_cli/commands/pipe_cmd.py b/pipelex/cli/agent_cli/commands/pipe_cmd.py
index 0be9fb13d..e5b313aad 100644
--- a/pipelex/cli/agent_cli/commands/pipe_cmd.py
+++ b/pipelex/cli/agent_cli/commands/pipe_cmd.py
@@ -318,6 +318,6 @@ def pipe_cmd(
except ValueError as exc:
agent_error(str(exc), error_type="ValueError", cause=exc)
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Agent CLI command boundary: agent_error() (NoReturn) converts any unexpected failure into the structured error payload.
agent_error(str(exc), error_type=type(exc).__name__, cause=exc)
diff --git a/pipelex/cli/agent_cli/commands/plxt_passthrough.py b/pipelex/cli/agent_cli/commands/plxt_passthrough.py
index 22a4666db..a1c530d11 100644
--- a/pipelex/cli/agent_cli/commands/plxt_passthrough.py
+++ b/pipelex/cli/agent_cli/commands/plxt_passthrough.py
@@ -1,7 +1,7 @@
"""Passthrough helper for delegating to the plxt CLI binary."""
import shutil
-import subprocess # noqa: S404
+import subprocess # ruff: ignore[suspicious-subprocess-import]
import typer
@@ -25,7 +25,7 @@ def run_plxt(subcommand: str, *, file_path: str) -> None:
error_type="BinaryNotFoundError",
)
- result = subprocess.run( # noqa: S603
+ result = subprocess.run( # ruff: ignore[subprocess-without-shell-equals-true]
[plxt_path, subcommand, file_path],
check=False,
)
diff --git a/pipelex/cli/agent_cli/commands/run/bundle_cmd.py b/pipelex/cli/agent_cli/commands/run/bundle_cmd.py
index 78edc9a2f..daf620714 100644
--- a/pipelex/cli/agent_cli/commands/run/bundle_cmd.py
+++ b/pipelex/cli/agent_cli/commands/run/bundle_cmd.py
@@ -169,8 +169,8 @@ def run_bundle_cmd(
if mock_inputs:
agent_error("--mock-inputs is not supported with --runner api", error_type="ArgumentError")
- from mthds.protocol.exceptions import PipelineRequestError # noqa: PLC0415
- from mthds.runners.api.exceptions import ClientAuthenticationError # noqa: PLC0415
+ from mthds.protocol.exceptions import PipelineRequestError # ruff: ignore[import-outside-top-level]
+ from mthds.runners.api.exceptions import ClientAuthenticationError # ruff: ignore[import-outside-top-level]
try:
result = asyncio.run(
@@ -191,7 +191,7 @@ def run_bundle_cmd(
except PipelineRequestError as exc:
agent_error(str(exc), error_type="PipelineRequestError", cause=exc)
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Agent CLI command boundary: agent_error() (NoReturn) converts any unexpected failure into the structured error payload.
agent_error(str(exc), error_type=type(exc).__name__, cause=exc)
@@ -249,7 +249,7 @@ def run_bundle_cmd(
availability_extra["pipe_stack"] = exc.pipe_stack
agent_error(exc.message, error_type="PipeOperatorModelAvailabilityError", cause=exc, **availability_extra)
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Agent CLI command boundary: agent_error() (NoReturn) converts any unexpected failure into the structured error payload.
agent_error(str(exc), error_type=type(exc).__name__, cause=exc)
diff --git a/pipelex/cli/agent_cli/commands/run/method_cmd.py b/pipelex/cli/agent_cli/commands/run/method_cmd.py
index afc6ead79..1115f8488 100644
--- a/pipelex/cli/agent_cli/commands/run/method_cmd.py
+++ b/pipelex/cli/agent_cli/commands/run/method_cmd.py
@@ -129,8 +129,8 @@ def run_method_cmd(
if mock_inputs:
agent_error("--mock-inputs is not supported with --runner api", error_type="ArgumentError")
- from mthds.protocol.exceptions import PipelineRequestError # noqa: PLC0415
- from mthds.runners.api.exceptions import ClientAuthenticationError # noqa: PLC0415
+ from mthds.protocol.exceptions import PipelineRequestError # ruff: ignore[import-outside-top-level]
+ from mthds.runners.api.exceptions import ClientAuthenticationError # ruff: ignore[import-outside-top-level]
try:
result = asyncio.run(
@@ -151,7 +151,7 @@ def run_method_cmd(
except PipelineRequestError as exc:
agent_error(str(exc), error_type="PipelineRequestError", cause=exc)
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Agent CLI command boundary: agent_error() (NoReturn) converts any unexpected failure into the structured error payload.
agent_error(str(exc), error_type=type(exc).__name__, cause=exc)
@@ -209,7 +209,7 @@ def run_method_cmd(
availability_extra["pipe_stack"] = exc.pipe_stack
agent_error(exc.message, error_type="PipeOperatorModelAvailabilityError", cause=exc, **availability_extra)
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Agent CLI command boundary: agent_error() (NoReturn) converts any unexpected failure into the structured error payload.
agent_error(str(exc), error_type=type(exc).__name__, cause=exc)
diff --git a/pipelex/cli/agent_cli/commands/run/pipe_cmd.py b/pipelex/cli/agent_cli/commands/run/pipe_cmd.py
index 5e6f70672..df5e7f80a 100644
--- a/pipelex/cli/agent_cli/commands/run/pipe_cmd.py
+++ b/pipelex/cli/agent_cli/commands/run/pipe_cmd.py
@@ -123,8 +123,8 @@ def run_pipe_cmd(
if mock_inputs:
agent_error("--mock-inputs is not supported with --runner api", error_type="ArgumentError")
- from mthds.protocol.exceptions import PipelineRequestError # noqa: PLC0415
- from mthds.runners.api.exceptions import ClientAuthenticationError # noqa: PLC0415
+ from mthds.protocol.exceptions import PipelineRequestError # ruff: ignore[import-outside-top-level]
+ from mthds.runners.api.exceptions import ClientAuthenticationError # ruff: ignore[import-outside-top-level]
try:
result = asyncio.run(
@@ -144,7 +144,7 @@ def run_pipe_cmd(
except PipelineRequestError as exc:
agent_error(str(exc), error_type="PipelineRequestError", cause=exc)
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Agent CLI command boundary: agent_error() (NoReturn) converts any unexpected failure into the structured error payload.
agent_error(str(exc), error_type=type(exc).__name__, cause=exc)
@@ -200,7 +200,7 @@ def run_pipe_cmd(
availability_extra["pipe_stack"] = exc.pipe_stack
agent_error(exc.message, error_type="PipeOperatorModelAvailabilityError", cause=exc, **availability_extra)
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Agent CLI command boundary: agent_error() (NoReturn) converts any unexpected failure into the structured error payload.
agent_error(str(exc), error_type=type(exc).__name__, cause=exc)
diff --git a/pipelex/cli/agent_cli/commands/validate/bundle_cmd.py b/pipelex/cli/agent_cli/commands/validate/bundle_cmd.py
index fd751a217..3207973c1 100644
--- a/pipelex/cli/agent_cli/commands/validate/bundle_cmd.py
+++ b/pipelex/cli/agent_cli/commands/validate/bundle_cmd.py
@@ -138,7 +138,7 @@ def validate_bundle_cmd(
agent_error(f"Graph generation failed: {exc}", error_type=type(exc).__name__, cause=exc, exit_code=2)
except typer.Exit:
raise
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Agent CLI command boundary: agent_error() (NoReturn) converts any unexpected failure into the structured error payload.
agent_error(f"Graph generation failed: {exc}", error_type=type(exc).__name__, cause=exc, exit_code=2)
@@ -167,7 +167,7 @@ def validate_bundle_cmd(
agent_error(f"View generation failed: {exc}", error_type=type(exc).__name__, cause=exc, exit_code=2)
except typer.Exit:
raise
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Agent CLI command boundary: agent_error() (NoReturn) converts any unexpected failure into the structured error payload.
agent_error(f"View generation failed: {exc}", error_type=type(exc).__name__, cause=exc, exit_code=2)
@@ -224,7 +224,7 @@ def validate_bundle_cmd(
except typer.Exit:
raise
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Agent CLI command boundary: agent_error() (NoReturn) converts any unexpected failure into the structured error payload.
agent_error(str(exc), error_type=type(exc).__name__, cause=exc, exit_code=2)
diff --git a/pipelex/cli/agent_cli/commands/validate/method_cmd.py b/pipelex/cli/agent_cli/commands/validate/method_cmd.py
index 24ddeef22..985226bda 100644
--- a/pipelex/cli/agent_cli/commands/validate/method_cmd.py
+++ b/pipelex/cli/agent_cli/commands/validate/method_cmd.py
@@ -148,7 +148,7 @@ def validate_method_cmd(
# propagate (exit code) rather than be reshaped into an agent_error by the broad handler below.
raise
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Agent CLI command boundary: agent_error() (NoReturn) converts any unexpected failure into the structured error payload.
agent_error(str(exc), error_type=type(exc).__name__, cause=exc, exit_code=2)
diff --git a/pipelex/cli/agent_cli/commands/validate/pipe_cmd.py b/pipelex/cli/agent_cli/commands/validate/pipe_cmd.py
index 8f9aa91cd..7c15cf5a7 100644
--- a/pipelex/cli/agent_cli/commands/validate/pipe_cmd.py
+++ b/pipelex/cli/agent_cli/commands/validate/pipe_cmd.py
@@ -136,7 +136,7 @@ def validate_pipe_cmd(
# propagate (exit code) rather than be reshaped into an agent_error by the broad handler below.
raise
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Agent CLI command boundary: agent_error() (NoReturn) converts any unexpected failure into the structured error payload.
agent_error(str(exc), error_type=type(exc).__name__, cause=exc, exit_code=2)
@@ -232,7 +232,7 @@ def validate_pipe_cmd(
except typer.Exit:
raise
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Agent CLI command boundary: agent_error() (NoReturn) converts any unexpected failure into the structured error payload.
agent_error(str(exc), error_type=type(exc).__name__, cause=exc, exit_code=2)
diff --git a/pipelex/cli/commands/doctor_cmd.py b/pipelex/cli/commands/doctor_cmd.py
index fec9beb92..c5be1a89a 100644
--- a/pipelex/cli/commands/doctor_cmd.py
+++ b/pipelex/cli/commands/doctor_cmd.py
@@ -465,7 +465,7 @@ def check_backend_credentials(*, config_dir: Path | None = None) -> tuple[bool,
backends_with_issues = sum(1 for r in backend_reports.values() if not r.all_credentials_valid)
return False, backend_reports, f"{backends_with_issues} backend(s) have missing or invalid credentials"
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Doctor probe: the credential scan spans TOML load, env lookups and placeholder checks; any failure is reported as a finding.
return False, {}, f"Error checking backend credentials: {exc}"
@@ -488,7 +488,7 @@ def check_kit_template_exists(backend_name: str) -> bool:
# For Traversable, we check if it's a file
return backend_file.is_file()
- except Exception: # noqa: BLE001
+ except Exception: # ruff: ignore[blind-except]
# Doctor probe: kit-template existence is a best-effort bool check; any lookup failure means "no template".
return False
@@ -530,7 +530,7 @@ def replace_backend_file(backend_name: str, *, dry_run: bool = False, config_dir
target_file.write_text(template_content, encoding="utf-8")
return True
- except Exception: # noqa: BLE001
+ except Exception: # ruff: ignore[blind-except]
# Doctor --fix helper: the kit-template copy is best-effort; any failure means "could not replace" (returns False).
return False
@@ -611,7 +611,7 @@ def check_backend_files(*, config_dir: Path | None = None) -> tuple[bool, dict[s
is_valid = False
error_message = error_str
all_valid = False
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Doctor probe: a backend load can fail in many ways; any error naming this backend is recorded as its validation failure.
error_str = str(exc)
if backend_name in error_str or backend_file_path in error_str:
@@ -1165,7 +1165,7 @@ def doctor_cmd(
try:
do_doctor_cmd(fix=fix)
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Handle unexpected errors gracefully without printing traces
console.print()
console.print(f"[red]✗ Unexpected error: {escape(str(exc))}[/red]")
@@ -1295,7 +1295,7 @@ def do_doctor_cmd(
console.print()
init_cmd(focus=InitFocus.CONFIG, skip_confirmation=True)
console.print("[green]✓[/green] Configuration files installed")
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Doctor --fix handler: wraps the whole init_cmd sub-command; a fix failure is reported and the doctor run continues.
console.print(f"[red]Failed to install configuration files: {escape(str(exc))}[/red]")
console.print()
@@ -1314,7 +1314,7 @@ def do_doctor_cmd(
# The rows below were measured before this ran, so a file this just repaired can
# still be reported as broken further down.
console.print("[dim]Re-run[/dim] [cyan]pipelex doctor[/cyan] [dim]for an updated report.[/dim]")
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Doctor --fix handler: wraps the whole migration pass; a fix failure is reported and the doctor run continues.
console.print(f"[red]Failed to migrate configuration files: {escape(str(exc))}[/red]")
console.print()
@@ -1326,7 +1326,7 @@ def do_doctor_cmd(
console.print()
init_cmd(focus=InitFocus.TELEMETRY, skip_confirmation=True)
console.print("[green]✓[/green] Telemetry configured")
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Doctor --fix handler: wraps the whole init_cmd sub-command; a fix failure is reported and the doctor run continues.
console.print(f"[red]Failed to configure telemetry: {escape(str(exc))}[/red]")
console.print()
@@ -1338,7 +1338,7 @@ def do_doctor_cmd(
console.print()
update_cmd(yes=True)
console.print("[green]✓[/green] Model deck updated")
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Doctor --fix handler: wraps the whole update_cmd sub-command; a fix failure is reported and the doctor run continues.
console.print(f"[red]Failed to update deck: {escape(str(exc))}[/red]")
console.print()
@@ -1365,7 +1365,7 @@ def do_doctor_cmd(
console.print(f"[green]✓[/green] Replaced {escape(backend_name)} backend configuration")
else:
console.print(f"[red]Failed to replace {escape(backend_name)}: Template not found or copy failed[/red]")
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Doctor --fix handler: wraps replace_backend_file; a fix failure is reported and the doctor run continues.
console.print(f"[red]Failed to replace {escape(backend_name)}: {escape(str(exc))}[/red]")
console.print()
diff --git a/pipelex/cli/commands/init/backends.py b/pipelex/cli/commands/init/backends.py
index 1618d4f7f..24d61a06f 100644
--- a/pipelex/cli/commands/init/backends.py
+++ b/pipelex/cli/commands/init/backends.py
@@ -183,7 +183,7 @@ def customize_backends_config(*, is_first_time_setup: bool = False, target_confi
)
console.print("[dim]Re-run 'pipelex init' to set up gateway again.[/dim]")
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Command-level boundary: backend customization is optional during init — any failure is reported and init continues.
console.print(f"[yellow]⚠ Warning: Failed to customize backends: {escape(str(exc))}[/yellow]")
console.print("[dim]You can manually edit .pipelex/inference/backends.toml later[/dim]")
diff --git a/pipelex/cli/commands/init/command.py b/pipelex/cli/commands/init/command.py
index 21c700c66..1bc09139f 100644
--- a/pipelex/cli/commands/init/command.py
+++ b/pipelex/cli/commands/init/command.py
@@ -597,7 +597,7 @@ def init_cmd(
except typer.Exit:
# Re-raise Exit exceptions
raise
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Command-level boundary: any unexpected init failure is reported as a warning and the command returns without crashing.
console.print(f"\n[red]⚠ Warning: Initialization failed: {escape(str(exc))}[/red]", style="bold")
if needs_config:
diff --git a/pipelex/cli/commands/init/ide_extension.py b/pipelex/cli/commands/init/ide_extension.py
index b1ff73412..9f0ec1494 100644
--- a/pipelex/cli/commands/init/ide_extension.py
+++ b/pipelex/cli/commands/init/ide_extension.py
@@ -1,7 +1,7 @@
"""IDE extension detection and installation for Pipelex."""
import shutil
-import subprocess # noqa: S404
+import subprocess # ruff: ignore[suspicious-subprocess-import]
from rich.console import Console
from rich.markup import escape
@@ -33,7 +33,7 @@ def _is_extension_installed(cmd: str) -> bool:
True if the extension is listed by --list-extensions, False otherwise.
"""
try:
- result = subprocess.run( # noqa: S603
+ result = subprocess.run( # ruff: ignore[subprocess-without-shell-equals-true]
[cmd, "--list-extensions"],
capture_output=True,
text=True,
@@ -65,7 +65,7 @@ def _install_extension(ide_name: str, *, cmd: str, console: Console) -> bool:
True if installation succeeded, False otherwise.
"""
try:
- result = subprocess.run( # noqa: S603
+ result = subprocess.run( # ruff: ignore[subprocess-without-shell-equals-true]
[cmd, "--install-extension", EXTENSION_ID],
capture_output=True,
text=True,
diff --git a/pipelex/cli/commands/init/routing.py b/pipelex/cli/commands/init/routing.py
index e82061967..7fe0ddc47 100644
--- a/pipelex/cli/commands/init/routing.py
+++ b/pipelex/cli/commands/init/routing.py
@@ -152,7 +152,7 @@ def customize_routing_profile(selected_backend_keys: list[str], *, target_config
console.print(f"[dim] {routing_profiles_toml_path}[/dim]")
console.print("[dim]You can further customize which models get used on which backend by editing the routes section.[/dim]")
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Command-level boundary: routing customization is optional during init — any failure is reported and init continues.
console.print(f"[yellow]⚠ Warning: Failed to customize routing profile: {escape(str(exc))}[/yellow]")
console.print("[dim]You can manually edit .pipelex/inference/routing_profiles.toml later[/dim]")
diff --git a/pipelex/cli/dev_cli/_dev_cli.py b/pipelex/cli/dev_cli/_dev_cli.py
index 1ab7b3856..d637169ec 100644
--- a/pipelex/cli/dev_cli/_dev_cli.py
+++ b/pipelex/cli/dev_cli/_dev_cli.py
@@ -129,7 +129,7 @@ def check_config_sync_command(
except (typer.Exit, typer.Abort):
# Typer control-flow exits carry an intended exit code — not a failure. Let them through.
raise
- except Exception: # noqa: BLE001
+ except Exception: # ruff: ignore[blind-except]
# Dev CLI command root: print a traceback for any unexpected failure and exit non-zero.
console = get_console()
console.print()
@@ -150,7 +150,7 @@ def check_rules_command(
except (typer.Exit, typer.Abort):
# Typer control-flow exits carry an intended exit code — not a failure. Let them through.
raise
- except Exception: # noqa: BLE001
+ except Exception: # ruff: ignore[blind-except]
# Dev CLI command root: print a traceback for any unexpected failure and exit non-zero.
console = get_console()
console.print()
@@ -171,7 +171,7 @@ def check_urls_command(
except (typer.Exit, typer.Abort):
# Typer control-flow exits carry an intended exit code — not a failure. Let them through.
raise
- except Exception: # noqa: BLE001
+ except Exception: # ruff: ignore[blind-except]
# Dev CLI command root: print a traceback for any unexpected failure and exit non-zero.
console = get_console()
console.print()
@@ -191,7 +191,7 @@ def generate_corpus_vocabulary_command(
except (typer.Exit, typer.Abort):
# Typer control-flow exits carry an intended exit code — not a failure. Let them through.
raise
- except Exception: # noqa: BLE001
+ except Exception: # ruff: ignore[blind-except]
# Dev CLI command root: print a traceback for any unexpected failure and exit non-zero.
console = get_console()
console.print()
@@ -213,7 +213,7 @@ def generate_error_identity_command(
except (typer.Exit, typer.Abort):
# Typer control-flow exits carry an intended exit code — not a failure. Let them through.
raise
- except Exception: # noqa: BLE001
+ except Exception: # ruff: ignore[blind-except]
# Dev CLI command root: print a traceback for any unexpected failure and exit non-zero.
console = get_console()
console.print()
@@ -235,7 +235,7 @@ def generate_error_pages_command(
except (typer.Exit, typer.Abort):
# Typer control-flow exits carry an intended exit code — not a failure. Let them through.
raise
- except Exception: # noqa: BLE001
+ except Exception: # ruff: ignore[blind-except]
# Dev CLI command root: print a traceback for any unexpected failure and exit non-zero.
console = get_console()
console.print()
@@ -257,7 +257,7 @@ def generate_mthds_schema_command(
except (typer.Exit, typer.Abort):
# Typer control-flow exits carry an intended exit code — not a failure. Let them through.
raise
- except Exception: # noqa: BLE001
+ except Exception: # ruff: ignore[blind-except]
# Dev CLI command root: print a traceback for any unexpected failure and exit non-zero.
console = get_console()
console.print()
@@ -278,7 +278,7 @@ def check_gateway_models_command(
except (typer.Exit, typer.Abort):
# Typer control-flow exits carry an intended exit code — not a failure. Let them through.
raise
- except Exception: # noqa: BLE001
+ except Exception: # ruff: ignore[blind-except]
# Dev CLI command root: print a traceback for any unexpected failure and exit non-zero.
console = get_console()
console.print()
@@ -299,7 +299,7 @@ def check_mthds_schema_command(
except (typer.Exit, typer.Abort):
# Typer control-flow exits carry an intended exit code — not a failure. Let them through.
raise
- except Exception: # noqa: BLE001
+ except Exception: # ruff: ignore[blind-except]
# Dev CLI command root: print a traceback for any unexpected failure and exit non-zero.
console = get_console()
console.print()
@@ -321,7 +321,7 @@ def check_ledger_command(
except (typer.Exit, typer.Abort):
# Typer control-flow exits carry an intended exit code — not a failure. Let them through.
raise
- except Exception: # noqa: BLE001
+ except Exception: # ruff: ignore[blind-except]
# Dev CLI command root: print a traceback for any unexpected failure and exit non-zero.
console = get_console()
console.print()
@@ -343,7 +343,7 @@ def check_migration_schemas_command(
except (typer.Exit, typer.Abort):
# Typer control-flow exits carry an intended exit code — not a failure. Let them through.
raise
- except Exception: # noqa: BLE001
+ except Exception: # ruff: ignore[blind-except]
# Dev CLI command root: print a traceback for any unexpected failure and exit non-zero.
console = get_console()
console.print()
@@ -364,7 +364,7 @@ def update_migration_schemas_command(
except (typer.Exit, typer.Abort):
# Typer control-flow exits carry an intended exit code — not a failure. Let them through.
raise
- except Exception: # noqa: BLE001
+ except Exception: # ruff: ignore[blind-except]
# Dev CLI command root: print a traceback for any unexpected failure and exit non-zero.
console = get_console()
console.print()
@@ -386,7 +386,7 @@ def check_hub_layering_command(
except (typer.Exit, typer.Abort):
# Typer control-flow exits carry an intended exit code — not a failure. Let them through.
raise
- except Exception: # noqa: BLE001
+ except Exception: # ruff: ignore[blind-except]
# Dev CLI command root: print a traceback for any unexpected failure and exit non-zero.
console = get_console()
console.print()
@@ -419,7 +419,7 @@ def check_keyword_only_command(
except (typer.Exit, typer.Abort):
# Typer control-flow exits carry an intended exit code — not a failure. Let them through.
raise
- except Exception: # noqa: BLE001
+ except Exception: # ruff: ignore[blind-except]
# Dev CLI command root: print a traceback for any unexpected failure and exit non-zero.
console = get_console()
console.print()
@@ -447,7 +447,7 @@ def subject_grant_command(
except (typer.Exit, typer.Abort):
# Typer control-flow exits carry an intended exit code — not a failure. Let them through.
raise
- except Exception: # noqa: BLE001
+ except Exception: # ruff: ignore[blind-except]
# Dev CLI command root: print a traceback for any unexpected failure and exit non-zero.
console = get_console()
console.print()
@@ -473,7 +473,7 @@ def sync_main_config_command(
except (typer.Exit, typer.Abort):
# Typer control-flow exits carry an intended exit code — not a failure. Let them through.
raise
- except Exception: # noqa: BLE001
+ except Exception: # ruff: ignore[blind-except]
# Dev CLI command root: print a traceback for any unexpected failure and exit non-zero.
console = get_console()
console.print()
@@ -494,7 +494,7 @@ def sync_kit_configs_command(
except (typer.Exit, typer.Abort):
# Typer control-flow exits carry an intended exit code — not a failure. Let them through.
raise
- except Exception: # noqa: BLE001
+ except Exception: # ruff: ignore[blind-except]
# Dev CLI command root: print a traceback for any unexpected failure and exit non-zero.
console = get_console()
console.print()
@@ -517,7 +517,7 @@ def preprocess_test_models_command(
except (typer.Exit, typer.Abort):
# Typer control-flow exits carry an intended exit code — not a failure. Let them through.
raise
- except Exception: # noqa: BLE001
+ except Exception: # ruff: ignore[blind-except]
# Dev CLI command root: print a traceback for any unexpected failure and exit non-zero.
console = get_console()
console.print()
@@ -552,7 +552,7 @@ def refresh_graph_ui_sri_command(
except (typer.Exit, typer.Abort):
# Typer control-flow exits carry an intended exit code — not a failure. Let them through.
raise
- except Exception: # noqa: BLE001
+ except Exception: # ruff: ignore[blind-except]
# Dev CLI command root: print a traceback for any unexpected failure and exit non-zero.
console = get_console()
console.print()
@@ -572,7 +572,7 @@ def update_gateway_models_command(
except (typer.Exit, typer.Abort):
# Typer control-flow exits carry an intended exit code — not a failure. Let them through.
raise
- except Exception: # noqa: BLE001
+ except Exception: # ruff: ignore[blind-except]
# Dev CLI command root: print a traceback for any unexpected failure and exit non-zero.
console = get_console()
console.print()
@@ -600,7 +600,7 @@ def store_test_durations_command(
except (typer.Exit, typer.Abort):
# Typer control-flow exits carry an intended exit code — not a failure. Let them through.
raise
- except Exception: # noqa: BLE001
+ except Exception: # ruff: ignore[blind-except]
# Dev CLI command root: print a traceback for any unexpected failure and exit non-zero.
console = get_console()
console.print()
diff --git a/pipelex/cli/dev_cli/commands/check_mthds_schema_cmd.py b/pipelex/cli/dev_cli/commands/check_mthds_schema_cmd.py
index 30b4437c3..599c5d38f 100644
--- a/pipelex/cli/dev_cli/commands/check_mthds_schema_cmd.py
+++ b/pipelex/cli/dev_cli/commands/check_mthds_schema_cmd.py
@@ -55,7 +55,7 @@ def check_mthds_schema_cmd(*, show_diff: bool = True, quiet: bool = False) -> No
# Generate expected schema
try:
schema = generate_mthds_schema()
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Dev CLI command root: any schema-generation failure is reported as a FAILED status line; exit non-zero.
if quiet:
console.print(f"[red]✗ MTHDS schema check: FAILED[/red] - Schema generation error: {escape(str(exc))}")
diff --git a/pipelex/cli/dev_cli/commands/drift/core.py b/pipelex/cli/dev_cli/commands/drift/core.py
index 5e5897221..7e82069e8 100644
--- a/pipelex/cli/dev_cli/commands/drift/core.py
+++ b/pipelex/cli/dev_cli/commands/drift/core.py
@@ -17,7 +17,7 @@ from pydantic.dataclasses import dataclass
# Runtime import (not TYPE_CHECKING): pydantic dataclasses resolve their field annotations
# (DriftAck, DriftContract) against module globals when the class is built.
-from pipelex.cli.dev_cli.commands.drift.models import DriftAck, DriftContract, DriftManifest # noqa: TC001
+from pipelex.cli.dev_cli.commands.drift.models import DriftAck, DriftContract, DriftManifest # ruff: ignore[typing-only-first-party-import]
if TYPE_CHECKING:
from collections.abc import Iterable, Mapping, Sequence
diff --git a/pipelex/cli/dev_cli/commands/drift/drift_cmd.py b/pipelex/cli/dev_cli/commands/drift/drift_cmd.py
index 1d658ed41..535d1de8d 100644
--- a/pipelex/cli/dev_cli/commands/drift/drift_cmd.py
+++ b/pipelex/cli/dev_cli/commands/drift/drift_cmd.py
@@ -8,7 +8,7 @@ report, `ack` runs verify commands then records the review.
from __future__ import annotations
import shlex
-import subprocess # noqa: S404
+import subprocess # ruff: ignore[suspicious-subprocess-import]
import sys
from datetime import UTC, datetime
from typing import TYPE_CHECKING, Annotated
@@ -175,7 +175,7 @@ def _run_verify_commands(commands: Sequence[str], *, repo_root: Path, console: C
raise DriftAckError(msg)
console.print(f" Running verify command: [cyan]{escape(command)}[/cyan]")
try:
- result = subprocess.run( # noqa: S603
+ result = subprocess.run( # ruff: ignore[subprocess-without-shell-equals-true]
argv,
cwd=repo_root,
capture_output=True,
diff --git a/pipelex/cli/dev_cli/commands/drift/git_adapter.py b/pipelex/cli/dev_cli/commands/drift/git_adapter.py
index 776c4916a..46df87ed4 100644
--- a/pipelex/cli/dev_cli/commands/drift/git_adapter.py
+++ b/pipelex/cli/dev_cli/commands/drift/git_adapter.py
@@ -7,7 +7,7 @@ digest covers exactly what would land in the commit. Working-tree bytes are neve
from __future__ import annotations
-import subprocess # noqa: S404
+import subprocess # ruff: ignore[suspicious-subprocess-import]
from pathlib import Path
from pipelex.cli.dev_cli.commands.drift.exceptions import DriftGitError
@@ -19,8 +19,8 @@ OID_PREFIX = "blob:"
def _run_git(args: list[str], *, cwd: Path) -> str:
"""Run one git plumbing command and return stdout; every failure is a DriftGitError."""
try:
- result = subprocess.run( # noqa: S603
- ["git", *args], # noqa: S607
+ result = subprocess.run( # ruff: ignore[subprocess-without-shell-equals-true]
+ ["git", *args], # ruff: ignore[start-process-with-partial-path]
cwd=cwd,
capture_output=True,
text=True,
@@ -93,7 +93,7 @@ def get_git_user_name(repo_root: Path) -> str | None:
"""The configured git user.name, or None when unset (callers must then require --by)."""
try:
result = subprocess.run(
- ["git", "config", "user.name"], # noqa: S607
+ ["git", "config", "user.name"], # ruff: ignore[start-process-with-partial-path]
cwd=repo_root,
capture_output=True,
text=True,
diff --git a/pipelex/cli/dev_cli/commands/generate_mthds_schema_cmd.py b/pipelex/cli/dev_cli/commands/generate_mthds_schema_cmd.py
index 65eda6f22..4008a26fc 100644
--- a/pipelex/cli/dev_cli/commands/generate_mthds_schema_cmd.py
+++ b/pipelex/cli/dev_cli/commands/generate_mthds_schema_cmd.py
@@ -35,7 +35,7 @@ def generate_mthds_schema_cmd(*, output: Path | None = None, quiet: bool = False
try:
schema = generate_mthds_schema()
- except Exception: # noqa: BLE001
+ except Exception: # ruff: ignore[blind-except]
# Dev CLI command root: any schema-generation failure is reported as a FAILED status line; exit non-zero.
if quiet:
console.print("[red]\u2717 MTHDS schema generation: FAILED[/red]")
diff --git a/pipelex/cli/dev_cli/commands/preprocess_test_models_cmd.py b/pipelex/cli/dev_cli/commands/preprocess_test_models_cmd.py
index 7f2a4a05b..13cfa4cdd 100644
--- a/pipelex/cli/dev_cli/commands/preprocess_test_models_cmd.py
+++ b/pipelex/cli/dev_cli/commands/preprocess_test_models_cmd.py
@@ -697,7 +697,7 @@ def preprocess_test_models_cmd(
console.print(" • Fixture generation must not proceed without fresh Gateway model specs")
console.print()
sys.exit(1)
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Dev CLI command root: any unexpected preprocessing failure is reported as a FAILED status line; exit non-zero.
if quiet:
console.print(f"[red]✗ Preprocessing failed:[/red] {escape(str(exc))}")
diff --git a/pipelex/cli/dev_cli/commands/refresh_graph_ui_sri_cmd.py b/pipelex/cli/dev_cli/commands/refresh_graph_ui_sri_cmd.py
index 99dede58b..cdb0cdb24 100644
--- a/pipelex/cli/dev_cli/commands/refresh_graph_ui_sri_cmd.py
+++ b/pipelex/cli/dev_cli/commands/refresh_graph_ui_sri_cmd.py
@@ -108,7 +108,7 @@ def _fetch(url: str, *, timeout: float = 30.0) -> bytes:
if not any(url.startswith(prefix) and url.endswith(suffix) for prefix, suffix in _ALLOWED_URL_SHAPES):
msg = f"Refusing to fetch {url}: only the jsDelivr graph viewer URLs are allowed"
raise PipelexCLIError(msg)
- with urlopen(url, timeout=timeout) as response: # noqa: S310 # URL is a known-good https jsDelivr origin (checked above)
+ with urlopen(url, timeout=timeout) as response: # ruff: ignore[suspicious-url-open-usage] # URL is a known-good https jsDelivr origin (checked above)
body: bytes = response.read()
return body
diff --git a/pipelex/cli/dev_cli/commands/store_test_durations_cmd.py b/pipelex/cli/dev_cli/commands/store_test_durations_cmd.py
index 6e1f98299..81259e562 100644
--- a/pipelex/cli/dev_cli/commands/store_test_durations_cmd.py
+++ b/pipelex/cli/dev_cli/commands/store_test_durations_cmd.py
@@ -14,7 +14,7 @@ legitimate refresh instead of a partial overwrite.
from __future__ import annotations
-import subprocess # noqa: S404
+import subprocess # ruff: ignore[suspicious-subprocess-import]
import sys
from pathlib import Path
@@ -54,7 +54,7 @@ def _collect_node_ids(*, markers: str) -> list[str]:
"""
# S603: the argv is built here from this interpreter's path and constants; `markers` comes from the
# Makefile, and this is a developer-only command that already runs the test suite it is measuring.
- completed = subprocess.run( # noqa: S603
+ completed = subprocess.run( # ruff: ignore[subprocess-without-shell-equals-true]
_pytest_command(extra=["--collect-only", "-q", "-p", "no:cacheprovider", "-m", markers]),
capture_output=True,
text=True,
@@ -92,7 +92,7 @@ def _run_and_store(*, markers: str, node_ids: list[str] | None) -> int:
]
if node_ids is not None:
extra.extend(node_ids)
- return subprocess.run(_pytest_command(extra=extra), check=False).returncode # noqa: S603
+ return subprocess.run(_pytest_command(extra=extra), check=False).returncode # ruff: ignore[subprocess-without-shell-equals-true]
def store_test_durations_cmd(*, markers: str, force: bool = False, quiet: bool = False) -> None:
diff --git a/pipelex/cogt/content_generation/render_generate.py b/pipelex/cogt/content_generation/render_generate.py
index 850f88882..09eaddb8d 100644
--- a/pipelex/cogt/content_generation/render_generate.py
+++ b/pipelex/cogt/content_generation/render_generate.py
@@ -27,7 +27,7 @@ async def render_page_views_and_store(
if render_assignment.cogt_run_params.run_mode.is_dry:
return dry_render_page_views(render_assignment)
# Deferred import: avoid pulling the pdf rendering SDK at module-load time
- from pipelex.tools.pdf.pypdfium2_renderer import pypdfium2_renderer # noqa: PLC0415
+ from pipelex.tools.pdf.pypdfium2_renderer import pypdfium2_renderer # ruff: ignore[import-outside-top-level]
page_view_images = await pypdfium2_renderer.render_pdf_pages_from_uri(
pdf_uri=render_assignment.document_uri,
diff --git a/pipelex/cogt/content_generation/schema_to_model_factory.py b/pipelex/cogt/content_generation/schema_to_model_factory.py
index 9ac512ec4..22db018dc 100644
--- a/pipelex/cogt/content_generation/schema_to_model_factory.py
+++ b/pipelex/cogt/content_generation/schema_to_model_factory.py
@@ -167,8 +167,8 @@ class SchemaToModelFactory:
@classmethod
def _generate_source_from_schema(cls, schema: dict[str, Any]) -> str:
"""Generate Python source code from a JSON schema using datamodel-code-generator."""
- from datamodel_code_generator import InputFileType, LiteralType, generate # noqa: PLC0415
- from datamodel_code_generator.enums import DataModelType # noqa: PLC0415
+ from datamodel_code_generator import InputFileType, LiteralType, generate # ruff: ignore[import-outside-top-level]
+ from datamodel_code_generator.enums import DataModelType # ruff: ignore[import-outside-top-level]
cls._reject_unsafe_schema_extensions(schema)
diff --git a/pipelex/cogt/llm/instructor_retry.py b/pipelex/cogt/llm/instructor_retry.py
index f81ba2f67..6d7381b2c 100644
--- a/pipelex/cogt/llm/instructor_retry.py
+++ b/pipelex/cogt/llm/instructor_retry.py
@@ -26,8 +26,8 @@ def make_instructor_schema_retrying(*, max_attempts: int) -> AsyncRetrying:
# `instructor` raises its own validation-error types alongside pydantic's; mirror the exact
# set `instructor` itself treats as re-askable (see `instructor.core.retry.retry_async`) so a
# genuine schema failure is still re-asked regardless of which of the two it surfaces as.
- from instructor.core import AsyncValidationError # noqa: PLC0415
- from instructor.core import ValidationError as InstructorValidationError # noqa: PLC0415
+ from instructor.core import AsyncValidationError # ruff: ignore[import-outside-top-level]
+ from instructor.core import ValidationError as InstructorValidationError # ruff: ignore[import-outside-top-level]
return AsyncRetrying(
retry=retry_if_exception_type((ValidationError, json.JSONDecodeError, AsyncValidationError, InstructorValidationError)),
diff --git a/pipelex/cogt/llm/llm_worker_abstract.py b/pipelex/cogt/llm/llm_worker_abstract.py
index b387fc96f..ae95b74a6 100644
--- a/pipelex/cogt/llm/llm_worker_abstract.py
+++ b/pipelex/cogt/llm/llm_worker_abstract.py
@@ -499,7 +499,7 @@ class LLMWorkerAbstract(InferenceWorkerAbstract, ABC):
# Cleanup result
if hasattr(object_result, "_raw_response"):
- delattr(object_result, "_raw_response")
+ delattr(object_result, "_raw_response") # ruff: ignore[del-attr-with-constant] - not a declared model field, so `del obj._attr` cannot type-check
await self._after_object_job(span=span, llm_job=llm_job, result_object=object_result)
return object_result
diff --git a/pipelex/cogt/llm/structured_output.py b/pipelex/cogt/llm/structured_output.py
index be9c5e19a..bb2cd1ede 100644
--- a/pipelex/cogt/llm/structured_output.py
+++ b/pipelex/cogt/llm/structured_output.py
@@ -48,7 +48,7 @@ class StructureMethod(StrEnum):
INSTRUCTOR_OPENROUTER_STRUCTURED_OUTPUTS = "instructor/openrouter_structured_outputs"
def as_instructor_mode(self) -> "InstructorMode":
- from instructor import Mode as InstructorMode # noqa: PLC0415
+ from instructor import Mode as InstructorMode # ruff: ignore[import-outside-top-level]
match self:
# generic
diff --git a/pipelex/cogt/model_backends/backend_factory.py b/pipelex/cogt/model_backends/backend_factory.py
index a2252f37f..061ba0c8d 100644
--- a/pipelex/cogt/model_backends/backend_factory.py
+++ b/pipelex/cogt/model_backends/backend_factory.py
@@ -50,7 +50,7 @@ class InferenceBackendFactory:
match name:
case "vertexai":
# Deferred import: avoid pulling heavy SDK at module-load time
- from pipelex.providers.openai.vertexai_factory import VertexAIFactory # noqa: PLC0415
+ from pipelex.providers.openai.vertexai_factory import VertexAIFactory # ruff: ignore[import-outside-top-level]
endpoint, api_key = VertexAIFactory.make_endpoint_and_api_key(extra_config=extra_config)
case _:
diff --git a/pipelex/core/memory/working_memory_factory.py b/pipelex/core/memory/working_memory_factory.py
index 079a7bfb4..b9463215f 100644
--- a/pipelex/core/memory/working_memory_factory.py
+++ b/pipelex/core/memory/working_memory_factory.py
@@ -233,13 +233,13 @@ class WorkingMemoryFactory(BaseModel):
for a discriminated union), picks a random subclass. Otherwise returns the class as-is.
"""
# Import here to avoid circular imports
- from pipelex.builder.pipe.pipe_spec import PipeSpec # noqa: PLC0415
+ from pipelex.builder.pipe.pipe_spec import PipeSpec # ruff: ignore[import-outside-top-level]
# Check for specific base classes that need special handling
if structure_class is PipeSpec:
# PipeSpec has many subclasses - pick one that has minimal extra required fields
# PipeBatchSpec is chosen as it's commonly used and has straightforward fields
- from pipelex.builder.pipe.pipe_batch_spec import PipeBatchSpec # noqa: PLC0415
+ from pipelex.builder.pipe.pipe_batch_spec import PipeBatchSpec # ruff: ignore[import-outside-top-level]
return PipeBatchSpec
diff --git a/pipelex/core/stuffs/composite_content.py b/pipelex/core/stuffs/composite_content.py
index eec191849..7dd6a2b2a 100644
--- a/pipelex/core/stuffs/composite_content.py
+++ b/pipelex/core/stuffs/composite_content.py
@@ -25,7 +25,7 @@ class CompositeContent(StuffContent):
"""Named sub-contents of this composite, keyed by their given names."""
return dict(self.model_extra or {})
- def __json_encode__(self) -> dict[str, Any]: # noqa: PLW3201 — kajson encoder hook, name fixed by kajson's protocol
+ def __json_encode__(self) -> dict[str, Any]: # ruff: ignore[bad-dunder-method-name] — kajson encoder hook, name fixed by kajson's protocol
"""Kajson encoding hook.
Pydantic stores `extra="allow"` fields outside `__dict__`, so kajson's default
diff --git a/pipelex/core/stuffs/date_content.py b/pipelex/core/stuffs/date_content.py
index 74c453d20..658e6fbb9 100644
--- a/pipelex/core/stuffs/date_content.py
+++ b/pipelex/core/stuffs/date_content.py
@@ -46,7 +46,7 @@ class DateContent(StuffContent):
# UTC offset — exactly the fidelity loss DT3 forbids ("no silent midnight").
if isinstance(value, datetime.datetime):
msg = "A Date takes a calendar date and a separate time of day, not a datetime; put the date in `date` and the time and offset in `time`."
- raise ValueError(msg) # noqa: TRY004 — must be ValueError so pydantic wraps it into a ValidationError
+ raise ValueError(msg) # ruff: ignore[type-check-without-type-error] — must be ValueError so pydantic wraps it into a ValidationError
if isinstance(value, (int, float)) or (isinstance(value, str) and is_numeric_string(value)): # bool is an int subclass
msg = "A Date's date/time must be an ISO 8601 string or a date/time object, never a number (no epoch-seconds)."
raise ValueError(msg)
diff --git a/pipelex/core/stuffs/image_content.py b/pipelex/core/stuffs/image_content.py
index 156d0b3a1..95fce5c14 100644
--- a/pipelex/core/stuffs/image_content.py
+++ b/pipelex/core/stuffs/image_content.py
@@ -81,7 +81,7 @@ class ImageContent(StuffContent):
self,
*,
registry: ImageRegistry,
- text_format: TextFormat, # noqa: ARG002
+ text_format: TextFormat, # ruff: ignore[unused-method-argument]
) -> str:
"""Register this image and return a token."""
image_index = registry.register_image(self)
diff --git a/pipelex/core/stuffs/stuff_content.py b/pipelex/core/stuffs/stuff_content.py
index 4524bdc8b..7caca607b 100644
--- a/pipelex/core/stuffs/stuff_content.py
+++ b/pipelex/core/stuffs/stuff_content.py
@@ -61,7 +61,7 @@ class StuffContent(PrettyRenderable, CustomBaseModel, StuffContentAbstract):
"""
return f"<pre>{self.rendered_json()}</pre>"
- def rendered_markdown(self, *, level: int = 1, is_pretty: bool = False) -> str: # noqa: ARG002
+ def rendered_markdown(self, *, level: int = 1, is_pretty: bool = False) -> str: # ruff: ignore[unused-method-argument]
"""Render content as Markdown for documentation or LLM prompts.
Defaults to JSON in a code block. Override in subclasses for custom Markdown output.
diff --git a/pipelex/core/stuffs/time_content.py b/pipelex/core/stuffs/time_content.py
index fde6ffcdd..0acff41a8 100644
--- a/pipelex/core/stuffs/time_content.py
+++ b/pipelex/core/stuffs/time_content.py
@@ -37,7 +37,7 @@ class TimeContent(StuffContent):
raise ValueError(msg)
if isinstance(value, datetime.datetime):
msg = "A Time takes a time of day alone, not a datetime; use Date for a date with a time."
- raise ValueError(msg) # noqa: TRY004 — must be ValueError so pydantic wraps it into a ValidationError
+ raise ValueError(msg) # ruff: ignore[type-check-without-type-error] — must be ValueError so pydantic wraps it into a ValidationError
# Parsing the ISO string here — rather than leaving it to the field's own validation — is what
# keeps this model usable under the strict validation instructor applies to every LLM response:
# a mode="before" validator forfeits pydantic's strict-JSON acceptance of ISO strings, because
diff --git a/pipelex/core/validation.py b/pipelex/core/validation.py
index b7f6a8ce0..e639d962d 100644
--- a/pipelex/core/validation.py
+++ b/pipelex/core/validation.py
@@ -175,7 +175,7 @@ def _pending_migration(*, surface_id: str, config_dirs: list[Path] | None) -> Mi
# this module sits in `runtime_boot`'s import closure — the kernel layer, whose stated
# property is that importing it loads zero interpreter modules. `make agent-check` would not
# catch a module-level import here; only the full `make agent-test` would.
- from pipelex.migration.run import scan_config_surface # noqa: PLC0415
+ from pipelex.migration.run import scan_config_surface # ruff: ignore[import-outside-top-level]
try:
report = scan_config_surface(surface_id=surface_id, config_dirs=config_dirs)
diff --git a/pipelex/errors/error_pages_generator.py b/pipelex/errors/error_pages_generator.py
index 8ccd2af12..006a57b8d 100644
--- a/pipelex/errors/error_pages_generator.py
+++ b/pipelex/errors/error_pages_generator.py
@@ -88,7 +88,7 @@ def _force_load_all_error_modules() -> None:
dotted = ".".join(rel.parts)
try:
importlib.import_module(dotted)
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# importlib runs the target module's top-level code — an open-ended exception surface
# (NameError, SyntaxError, …) that must be aggregated like ImportError so the dev
# sees the full list of broken modules at once instead of aborting on the first one.
diff --git a/pipelex/graph/graph_tracer.py b/pipelex/graph/graph_tracer.py
index ea4755e86..d6f13faff 100644
--- a/pipelex/graph/graph_tracer.py
+++ b/pipelex/graph/graph_tracer.py
@@ -24,7 +24,7 @@ from pipelex.graph.graphspec import (
)
from pipelex.system.data_inclusion_config import DataInclusionConfig
from pipelex.system.trace_context import TraceContext
-from pipelex.tracing.event_log_protocol import EventLogProtocol # noqa: TC001 - used in __init__ annotations
+from pipelex.tracing.event_log_protocol import EventLogProtocol # ruff: ignore[typing-only-first-party-import] - used in __init__ annotations
from pipelex.tracing.trace_events import (
BatchAggregateEvent,
BatchItemEvent,
diff --git a/pipelex/graph/graph_tracer_manager.py b/pipelex/graph/graph_tracer_manager.py
index 909953f8b..adecff66e 100644
--- a/pipelex/graph/graph_tracer_manager.py
+++ b/pipelex/graph/graph_tracer_manager.py
@@ -10,7 +10,7 @@ from pipelex.graph.graphspec import GraphSpec, GraphSpecMode, IOSpec, NodeKind
from pipelex.system.data_inclusion_config import DataInclusionConfig
from pipelex.system.registries.singleton import ABCSingletonMeta, MetaSingleton
from pipelex.system.trace_context import TraceContext
-from pipelex.tracing.event_log_protocol import EventLogProtocol # noqa: TC001 - used in open_tracer signature
+from pipelex.tracing.event_log_protocol import EventLogProtocol # ruff: ignore[typing-only-first-party-import] - used in open_tracer signature
class GraphTracerManager(metaclass=ABCSingletonMeta):
@@ -143,7 +143,7 @@ class GraphTracerManager(metaclass=ABCSingletonMeta):
log.warning(f"Tracer for key '{key}' already exists; replacing stale tracer left by a prior interrupted execution")
try:
self.close_tracer(key)
- except Exception as stale_teardown_exc: # noqa: BLE001
+ except Exception as stale_teardown_exc: # ruff: ignore[blind-except]
# Best-effort: the stale tracer's teardown runs graph assembly over arbitrary
# half-built state from the interrupted execution — its failure must never
# fail the fresh run's setup (that would be the M1 class again: worker-local
diff --git a/pipelex/graph/graph_tracer_protocol.py b/pipelex/graph/graph_tracer_protocol.py
index 4833d646c..85b7cc3fe 100644
--- a/pipelex/graph/graph_tracer_protocol.py
+++ b/pipelex/graph/graph_tracer_protocol.py
@@ -6,7 +6,7 @@ from typing_extensions import override
from pipelex.graph.graphspec import EdgeKind, GraphSpec, GraphSpecMode, IOSpec, NodeKind
from pipelex.system.data_inclusion_config import DataInclusionConfig
from pipelex.system.trace_context import TraceContext
-from pipelex.tracing.event_log_protocol import EventLogProtocol # noqa: TC001 - used in setup signature
+from pipelex.tracing.event_log_protocol import EventLogProtocol # ruff: ignore[typing-only-first-party-import] - used in setup signature
class GraphTracerProtocol(Protocol):
diff --git a/pipelex/interpreter_plugins/pipe_func/pipe_func_plugin.py b/pipelex/interpreter_plugins/pipe_func/pipe_func_plugin.py
index be2f4855f..0a7a42ccb 100644
--- a/pipelex/interpreter_plugins/pipe_func/pipe_func_plugin.py
+++ b/pipelex/interpreter_plugins/pipe_func/pipe_func_plugin.py
@@ -6,7 +6,7 @@ from pipelex.plugins.registrar import PluginRegistrar
from pipelex.system.configuration.pipe_func_config import PipeFuncConfig
-def _make_direct_pipe_func_executor(config: PipeFuncConfig) -> PipeFuncExecutorProtocol: # noqa: ARG001 — stateless; the mode carries no config
+def _make_direct_pipe_func_executor(config: PipeFuncConfig) -> PipeFuncExecutorProtocol: # ruff: ignore[unused-function-argument] — stateless; the mode carries no config
return DirectPipeFuncExecutor()
diff --git a/pipelex/kit/agent_rules/python_standards.md b/pipelex/kit/agent_rules/python_standards.md
index 865349bb3..5c26b9697 100644
--- a/pipelex/kit/agent_rules/python_standards.md
+++ b/pipelex/kit/agent_rules/python_standards.md
@@ -115,6 +115,7 @@ Once you've landed on a `BaseModel` (the default for anything that serializes),
from pydantic import BaseModel, Field
from pipelex.tools.typing.pydantic_utils import empty_list_factory_of
+
class MyModel(BaseModel):
names: list[str] = Field(default_factory=list) # OK for strings
numbers: list[int] = Field(default_factory=empty_list_factory_of(int), description="A list of numbers")
diff --git a/pipelex/libraries/library_manager.py b/pipelex/libraries/library_manager.py
index 5b2ec850d..6359d8483 100644
--- a/pipelex/libraries/library_manager.py
+++ b/pipelex/libraries/library_manager.py
@@ -195,7 +195,7 @@ class LibraryManager(LibraryManagerAbstract):
def open_fresh_library(self, library_id: str) -> Library:
try:
removed_existing = self._pop_and_teardown_library(library_id=library_id)
- except Exception as stale_teardown_exc: # noqa: BLE001
+ except Exception as stale_teardown_exc: # ruff: ignore[blind-except]
# Best-effort: the stale library's teardown runs over arbitrary half-built state
# from an interrupted execution — its failure must never fail the fresh open
# (worker-local leak state deciding setup success would be the M1 class again).
diff --git a/pipelex/libraries/library_manager_abstract.py b/pipelex/libraries/library_manager_abstract.py
index 0fc027baf..706e6f67a 100644
--- a/pipelex/libraries/library_manager_abstract.py
+++ b/pipelex/libraries/library_manager_abstract.py
@@ -48,14 +48,14 @@ class LibraryManagerAbstract(ABC):
def get_current_library(self) -> "Library":
"""Get the Library object for the current library."""
- def get_library_class_registry(self, library_id: str) -> ClassRegistry | None: # noqa: ARG002
+ def get_library_class_registry(self, library_id: str) -> ClassRegistry | None: # ruff: ignore[unused-method-argument]
"""Get the ClassRegistry associated with a library, if any.
Returns None by default. Overridden by LibraryManager.
"""
return None
- def get_pipe_source(self, pipe_code: str) -> str | None: # noqa: ARG002
+ def get_pipe_source(self, pipe_code: str) -> str | None: # ruff: ignore[unused-method-argument]
"""Get the source identifier for a pipe.
Args:
@@ -67,7 +67,7 @@ class LibraryManagerAbstract(ABC):
"""
return None
- def is_crate_loaded(self, *, library_id: str, fingerprint: str) -> bool: # noqa: ARG002
+ def is_crate_loaded(self, *, library_id: str, fingerprint: str) -> bool: # ruff: ignore[unused-method-argument]
"""Whether a crate with this fingerprint was already loaded into this library.
Returns False by default (managers that don't track crate fingerprints report
diff --git a/pipelex/pipe_operators/compose/structured_content_composer.py b/pipelex/pipe_operators/compose/structured_content_composer.py
index 5945d8b73..199c4f9de 100644
--- a/pipelex/pipe_operators/compose/structured_content_composer.py
+++ b/pipelex/pipe_operators/compose/structured_content_composer.py
@@ -122,7 +122,7 @@ class StructuredContentComposer:
mismatch_marker = "" if actual_type_name == expected_type_name else " <-- MISMATCH"
lines.append(f" {field_name}: {actual_type_name} (expected {expected_type_name}){mismatch_marker}")
return "\n".join(lines)
- except Exception: # noqa: BLE001
+ except Exception: # ruff: ignore[blind-except]
# General exception catching tolerated here because the method is purely defensive diagnostic code that builds error messages
return "Field type summary: unavailable (introspection failed)"
diff --git a/pipelex/pipe_operators/func/pipe_func_transported_entrypoint.py b/pipelex/pipe_operators/func/pipe_func_transported_entrypoint.py
index 2090e75c2..0354541c9 100644
--- a/pipelex/pipe_operators/func/pipe_func_transported_entrypoint.py
+++ b/pipelex/pipe_operators/func/pipe_func_transported_entrypoint.py
@@ -29,7 +29,7 @@ def main() -> None:
request = PipeFuncExecutionRequest.model_validate_json(request_path.read_text(encoding="utf-8"))
# Import here so module import (e.g. for tests) stays cheap and free of boot side effects.
- from pipelex.pipelex import Pipelex # noqa: PLC0415
+ from pipelex.pipelex import Pipelex # ruff: ignore[import-outside-top-level]
Pipelex.make(needs_inference=False)
try:
diff --git a/pipelex/pipe_run/delivery_executor.py b/pipelex/pipe_run/delivery_executor.py
index 9d86edc53..9da6e1553 100644
--- a/pipelex/pipe_run/delivery_executor.py
+++ b/pipelex/pipe_run/delivery_executor.py
@@ -285,7 +285,7 @@ class DeliveryExecutor:
self._add_optional_text_file(files=files, filename="mermaidflow.mmd", text=graph_outputs.mermaidflow_mmd, content_type="text/plain")
self._add_optional_text_file(files=files, filename="mermaidflow.html", text=graph_outputs.mermaidflow_html, content_type="text/html")
self._add_optional_text_file(files=files, filename="reactflow.html", text=graph_outputs.reactflow_html, content_type="text/html")
- except Exception: # noqa: BLE001
+ except Exception: # ruff: ignore[blind-except]
# Best-effort: graph generation spans a deep mermaid/reactflow render tree; a graph failure must never fail result delivery.
log.warning("Failed to generate graph outputs")
@@ -301,7 +301,7 @@ class DeliveryExecutor:
"""Await a render coroutine and store the encoded result; log a warning on failure."""
try:
text = await render
- except Exception: # noqa: BLE001
+ except Exception: # ruff: ignore[blind-except]
# Best-effort: per-format rendering (incl. jinja2 viewer); a single render failure must not drop the other result files.
log.warning(f"Failed to render {filename}")
return
diff --git a/pipelex/pipe_run/pipe_run.py b/pipelex/pipe_run/pipe_run.py
index 0bbc220eb..ebe2c7382 100644
--- a/pipelex/pipe_run/pipe_run.py
+++ b/pipelex/pipe_run/pipe_run.py
@@ -46,7 +46,7 @@ class PipeRun(PipeRunProtocol):
# output stays in-process, so stamping at every `PipeOutput(...)` site
# would be noise on ~17 constructors to serve one of them.
pipe_output.set_job_metadata(job_metadata=pipe_job.job_metadata)
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Observe-and-reraise: records FAILED status so the finally delivery sees it, then re-raises the original error below.
status = DeliveryStatus.FAILED
execution_error = exc
diff --git a/pipelex/pipeline/fixes/applier.py b/pipelex/pipeline/fixes/applier.py
index a479e6677..aa4a8dd68 100644
--- a/pipelex/pipeline/fixes/applier.py
+++ b/pipelex/pipeline/fixes/applier.py
@@ -151,7 +151,7 @@ def _rename_key_in_place(*, parent_table: dict[str, Any], key: str, new_key: str
# only the first would leave the other chunk under the old dotted name — orphaning the
# pipe's nested content in a phantom, still-invalid key. Rename in every chunk holding it.
renamed_in_any = False
- for sub_table in parent_table._tables: # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ for sub_table in parent_table._tables: # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
if key in sub_table:
_replace_key_in_container(container=sub_table.value, key=key, new_key=new_key)
renamed_in_any = True
@@ -236,7 +236,7 @@ def _renamed_key(*, previous: Key, new_key: str) -> SingleKey:
if previous.is_dotted():
# There is no public way to say "dotted": the flag is private, and tomlkit's own parser
# sets it exactly this way in ``Container._handle_dotted_key``.
- renamed._dotted = True # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ renamed._dotted = True # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
return renamed
@@ -255,7 +255,7 @@ def _rehome_key_indexes(*, container: Container, key: str, renamed: SingleKey, i
dict, holding items rather than values. Repairing one of the two would move the inconsistency
rather than end it, so the whole set of facades is one deliberate pass, not a rider on this one.
"""
- container._map[renamed] = container._map.pop(SingleKey(key)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ container._map[renamed] = container._map.pop(SingleKey(key)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
# ``dict`` explicitly on both lines — a ``Container`` is a ``MutableMapping`` *and* a ``dict``,
# so its own ``pop`` and ``[] =`` route through ``Container.__getitem__`` / ``__delitem__``,
# which read and rewrite the very body this function has just finished renaming. The stubs
@@ -264,7 +264,7 @@ def _rehome_key_indexes(*, container: Container, key: str, renamed: SingleKey, i
if isinstance(item, Table):
# The raw storage holds one entry per name, and for a key written as several chunks
# tomlkit keeps the last one appended — which is the item this is handed.
- dict.__setitem__(container, renamed.key, item.value) # noqa: PLC2801 # pyright: ignore[reportUnknownMemberType]
+ dict.__setitem__(container, renamed.key, item.value) # ruff: ignore[unnecessary-dunder-call] # pyright: ignore[reportUnknownMemberType]
# --- Comment fidelity: the trivia that introduces an item goes where the item goes -----------------
@@ -335,7 +335,7 @@ def _last_container(*, item: Item) -> Container | None:
if isinstance(item, AoT):
return item.body[-1].value if item.body else None
if isinstance(item, OutOfOrderTableProxy):
- return item._tables[-1].value # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ return item._tables[-1].value # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
return None
@@ -365,7 +365,7 @@ def _key_slot(*, parent_table: dict[str, Any], key: str) -> _Slot:
"""
candidates: list[tuple[Container, Table | None]]
if isinstance(parent_table, OutOfOrderTableProxy):
- candidates = [(sub_table.value, sub_table) for sub_table in parent_table._tables if key in sub_table] # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ candidates = [(sub_table.value, sub_table) for sub_table in parent_table._tables if key in sub_table] # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
elif isinstance(parent_table, Table):
candidates = [(parent_table.value, parent_table)]
elif isinstance(parent_table, Container):
@@ -374,7 +374,7 @@ def _key_slot(*, parent_table: dict[str, Any], key: str) -> _Slot:
msg = f"cannot locate key '{key}' in unsupported tomlkit node type '{type(parent_table).__name__}' — applier bug"
raise PipelexUnexpectedError(msg)
for container, owner in candidates:
- position = container._map.get(SingleKey(key)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ position = container._map.get(SingleKey(key)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
if position is None:
continue
positions = sorted(position) if isinstance(position, tuple) else [position]
@@ -555,7 +555,7 @@ def _introduction_of_slot(*, chain: list[_Slot]) -> _TriviaRun:
def _shift_map(*, container: Container, from_index: int, delta: int) -> None:
"""Keep the container's key→position index in step with a body insert or removal at ``from_index``."""
- key_map = container._map # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ key_map = container._map # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
for map_key, position in list(key_map.items()):
if isinstance(position, tuple):
key_map[map_key] = tuple(chunk + delta if chunk >= from_index else chunk for chunk in position)
@@ -1035,7 +1035,7 @@ def _refresh_table_headers(*, item: Any) -> None:
here is what lets a rename or move come out whole for any layout the parser accepts.
"""
if isinstance(item, OutOfOrderTableProxy):
- for chunk in item._tables: # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ for chunk in item._tables: # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
_refresh_table_headers(item=chunk)
return
if isinstance(item, Table):
diff --git a/pipelex/pipeline/fixes/file_transaction.py b/pipelex/pipeline/fixes/file_transaction.py
index e6a00647a..05af0c001 100644
--- a/pipelex/pipeline/fixes/file_transaction.py
+++ b/pipelex/pipeline/fixes/file_transaction.py
@@ -67,7 +67,7 @@ def read_file_snapshot(path: Path) -> FileSnapshot:
def write_staged_file(*, snapshot: FileSnapshot, content: bytes, label: str) -> Path:
"""Write and fsync a same-directory temp file ready for atomic replacement."""
- temp_file = tempfile.NamedTemporaryFile( # noqa: SIM115 - closed before the atomic replace
+ temp_file = tempfile.NamedTemporaryFile( # ruff: ignore[open-file-with-context-handler] - closed before the atomic replace
mode="wb",
dir=str(snapshot.path.parent),
prefix=f".{snapshot.path.name}.pipelex-fix-{label}.",
diff --git a/pipelex/providers/anthropic/anthropic_factory.py b/pipelex/providers/anthropic/anthropic_factory.py
index 2d0f94cc6..aab4f4629 100644
--- a/pipelex/providers/anthropic/anthropic_factory.py
+++ b/pipelex/providers/anthropic/anthropic_factory.py
@@ -202,7 +202,7 @@ class AnthropicFactory:
) -> 'list["ChatCompletionMessageParam"]':
"""Makes a list of messages with a system message (if provided) and followed by a user message."""
# Deferred import: avoid pulling heavy SDK at module-load time
- from openai.types.chat import ChatCompletionSystemMessageParam # noqa: PLC0415
+ from openai.types.chat import ChatCompletionSystemMessageParam # ruff: ignore[import-outside-top-level]
llm_prompt = llm_job.llm_prompt
messages: list[ChatCompletionMessageParam] = []
diff --git a/pipelex/providers/anthropic/anthropic_list.py b/pipelex/providers/anthropic/anthropic_list.py
index 4c2c91a45..97990931f 100644
--- a/pipelex/providers/anthropic/anthropic_list.py
+++ b/pipelex/providers/anthropic/anthropic_list.py
@@ -40,9 +40,9 @@ async def list_anthropic_models(
msg,
)
- from anthropic import AuthenticationError # noqa: PLC0415
+ from anthropic import AuthenticationError # ruff: ignore[import-outside-top-level]
- from pipelex.providers.anthropic.anthropic_llms import anthropic_list_available_models # noqa: PLC0415
+ from pipelex.providers.anthropic.anthropic_llms import anthropic_list_available_models # ruff: ignore[import-outside-top-level]
model_handle = ModelHandle(sdk=sdk, backend=backend_name)
try:
diff --git a/pipelex/providers/anthropic/anthropic_llm_worker.py b/pipelex/providers/anthropic/anthropic_llm_worker.py
index 1cd7e14ef..6e1e7f390 100644
--- a/pipelex/providers/anthropic/anthropic_llm_worker.py
+++ b/pipelex/providers/anthropic/anthropic_llm_worker.py
@@ -93,7 +93,7 @@ class AnthropicLLMWorker(LLMWorkerAbstract):
raise SdkTypeError(msg)
self.anthropic_async_client = sdk_instance
- from instructor import from_anthropic # noqa: PLC0415
+ from instructor import from_anthropic # ruff: ignore[import-outside-top-level]
if instructor_mode := self.inference_model.get_instructor_mode():
self.instructor_for_objects = from_anthropic(client=sdk_instance, mode=instructor_mode)
@@ -327,7 +327,7 @@ class AnthropicLLMWorker(LLMWorkerAbstract):
effective_max_tokens = min(requested_max_tokens, safe_max_tokens)
# Deferred import: avoid pulling heavy SDK at module-load time
- from instructor.core import InstructorRetryException # noqa: PLC0415
+ from instructor.core import InstructorRetryException # ruff: ignore[import-outside-top-level]
temperature_unsupported = ListedConstraint.TEMPERATURE_UNSUPPORTED in self.inference_model.listed_constraints
try:
diff --git a/pipelex/providers/anthropic/anthropic_plugin.py b/pipelex/providers/anthropic/anthropic_plugin.py
index db9058e66..7e9aa776a 100644
--- a/pipelex/providers/anthropic/anthropic_plugin.py
+++ b/pipelex/providers/anthropic/anthropic_plugin.py
@@ -24,8 +24,8 @@ def _make_anthropic_worker(
) -> InferenceWorkerAbstract:
require_sdk(spec="anthropic", extra="anthropic", msg=_ANTHROPIC_MISSING_MSG)
- from pipelex.providers.anthropic.anthropic_factory import AnthropicFactory # noqa: PLC0415
- from pipelex.providers.anthropic.anthropic_llm_worker import AnthropicLLMWorker # noqa: PLC0415
+ from pipelex.providers.anthropic.anthropic_factory import AnthropicFactory # ruff: ignore[import-outside-top-level]
+ from pipelex.providers.anthropic.anthropic_llm_worker import AnthropicLLMWorker # ruff: ignore[import-outside-top-level]
model_handle = ModelHandle.make_for_inference_model(inference_model=inference_model)
sdk_instance = sdk_clients.get_or_create(
@@ -48,9 +48,9 @@ async def _list_anthropic_models(
flat: bool,
any_listed: bool,
) -> None:
- from pipelex.cogt.exceptions import ModelListingUnsupportedError # noqa: PLC0415
- from pipelex.providers.anthropic.anthropic_exceptions import AnthropicSDKUnsupportedError # noqa: PLC0415
- from pipelex.providers.anthropic.anthropic_list import list_anthropic_models # noqa: PLC0415
+ from pipelex.cogt.exceptions import ModelListingUnsupportedError # ruff: ignore[import-outside-top-level]
+ from pipelex.providers.anthropic.anthropic_exceptions import AnthropicSDKUnsupportedError # ruff: ignore[import-outside-top-level]
+ from pipelex.providers.anthropic.anthropic_list import list_anthropic_models # ruff: ignore[import-outside-top-level]
try:
await list_anthropic_models(sdk=sdk, backend_name=backend_name, backend=backend, flat=flat, any_listed=any_listed)
diff --git a/pipelex/providers/azure_rest/azure_rest_plugin.py b/pipelex/providers/azure_rest/azure_rest_plugin.py
index 31aa78c50..c0680cea8 100644
--- a/pipelex/providers/azure_rest/azure_rest_plugin.py
+++ b/pipelex/providers/azure_rest/azure_rest_plugin.py
@@ -12,11 +12,11 @@ from pipelex.reporting.reporting_protocol import ReportingProtocol
def _make_azure_rest_img_gen_worker(
*,
inference_model: InferenceModelSpec,
- backend: InferenceBackend, # noqa: ARG001 - uniform MakeWorkerFn signature; this REST worker builds its own client
- sdk_clients: SdkClientRegistry, # noqa: ARG001 - direct construction, no SDK-client caching
+ backend: InferenceBackend, # ruff: ignore[unused-function-argument] - uniform MakeWorkerFn signature; this REST worker builds its own client
+ sdk_clients: SdkClientRegistry, # ruff: ignore[unused-function-argument] - direct construction, no SDK-client caching
reporting_delegate: ReportingProtocol | None,
) -> InferenceWorkerAbstract:
- from pipelex.providers.azure_rest.azure_img_gen_worker import AzureImgGenWorker # noqa: PLC0415
+ from pipelex.providers.azure_rest.azure_img_gen_worker import AzureImgGenWorker # ruff: ignore[import-outside-top-level]
model_handle = ModelHandle.make_for_inference_model(inference_model=inference_model)
return AzureImgGenWorker(
diff --git a/pipelex/providers/bedrock/bedrock_client_aioboto3.py b/pipelex/providers/bedrock/bedrock_client_aioboto3.py
index 9deb52552..09b3c8966 100644
--- a/pipelex/providers/bedrock/bedrock_client_aioboto3.py
+++ b/pipelex/providers/bedrock/bedrock_client_aioboto3.py
@@ -1,7 +1,6 @@
from typing import TYPE_CHECKING, Any, cast
import aioboto3
-from types_aiobotocore_bedrock_runtime.type_defs import ConverseResponseTypeDef
from typing_extensions import override
from pipelex import log
diff --git a/pipelex/providers/bedrock/bedrock_factory.py b/pipelex/providers/bedrock/bedrock_factory.py
index 3f2e4caab..b8b88b218 100644
--- a/pipelex/providers/bedrock/bedrock_factory.py
+++ b/pipelex/providers/bedrock/bedrock_factory.py
@@ -41,13 +41,13 @@ class BedrockFactory:
log.verbose(f"Using '{sdk_variant}' for BedrockClient")
match sdk_variant:
case BedrockSdkVariant.AIBOTO3:
- from pipelex.providers.bedrock.bedrock_client_aioboto3 import BedrockClientAioboto3 # noqa: PLC0415
+ from pipelex.providers.bedrock.bedrock_client_aioboto3 import BedrockClientAioboto3 # ruff: ignore[import-outside-top-level]
bedrock_async_client = BedrockClientAioboto3(
aws_region=backend.extra_config[BedrockExtraField.AWS_REGION],
)
case BedrockSdkVariant.BOTO3:
- from pipelex.providers.bedrock.bedrock_client_boto3 import BedrockClientBoto3 # noqa: PLC0415
+ from pipelex.providers.bedrock.bedrock_client_boto3 import BedrockClientBoto3 # ruff: ignore[import-outside-top-level]
bedrock_async_client = BedrockClientBoto3(
aws_region=backend.extra_config[BedrockExtraField.AWS_REGION],
diff --git a/pipelex/providers/bedrock/bedrock_list.py b/pipelex/providers/bedrock/bedrock_list.py
index bc9666694..4d4d38ce4 100644
--- a/pipelex/providers/bedrock/bedrock_list.py
+++ b/pipelex/providers/bedrock/bedrock_list.py
@@ -36,9 +36,9 @@ def list_bedrock_models(
msg,
)
- from botocore.exceptions import BotoCoreError, ClientError # noqa: PLC0415 - optional dependency, lazy import
+ from botocore.exceptions import BotoCoreError, ClientError # ruff: ignore[import-outside-top-level] - optional dependency, lazy import
- from pipelex.providers.bedrock.bedrock_llms import bedrock_list_available_models # noqa: PLC0415
+ from pipelex.providers.bedrock.bedrock_llms import bedrock_list_available_models # ruff: ignore[import-outside-top-level]
model_handle = ModelHandle(sdk=sdk, backend=backend_name)
diff --git a/pipelex/providers/bedrock/bedrock_llms.py b/pipelex/providers/bedrock/bedrock_llms.py
index f7943648c..e501053a8 100644
--- a/pipelex/providers/bedrock/bedrock_llms.py
+++ b/pipelex/providers/bedrock/bedrock_llms.py
@@ -8,9 +8,9 @@ from pipelex.tools.aws.exceptions import AwsCredentialsError
def bedrock_list_available_models(
- model_handle: ModelHandle, # noqa: ARG001
+ model_handle: ModelHandle, # ruff: ignore[unused-function-argument]
*,
- backend: InferenceBackend, # noqa: ARG001
+ backend: InferenceBackend, # ruff: ignore[unused-function-argument]
) -> list[dict[str, Any]]:
"""List available Bedrock foundation models.
@@ -33,7 +33,7 @@ def bedrock_list_available_models(
raise AwsCredentialsError(msg) from exc
try:
- import boto3 # noqa: PLC0415
+ import boto3 # ruff: ignore[import-outside-top-level]
except ImportError as exc:
lib_name = "boto3,aioboto3"
lib_extra_name = "bedrock"
diff --git a/pipelex/providers/bedrock/bedrock_plugin.py b/pipelex/providers/bedrock/bedrock_plugin.py
index fddf0fd85..fc70c6307 100644
--- a/pipelex/providers/bedrock/bedrock_plugin.py
+++ b/pipelex/providers/bedrock/bedrock_plugin.py
@@ -20,8 +20,8 @@ def _make_bedrock_worker(
) -> InferenceWorkerAbstract:
require_sdk(spec=["boto3", "aioboto3"], extra="bedrock", msg=_BEDROCK_MISSING_MSG)
- from pipelex.providers.bedrock.bedrock_factory import BedrockFactory # noqa: PLC0415
- from pipelex.providers.bedrock.bedrock_llm_worker import BedrockLLMWorker # noqa: PLC0415
+ from pipelex.providers.bedrock.bedrock_factory import BedrockFactory # ruff: ignore[import-outside-top-level]
+ from pipelex.providers.bedrock.bedrock_llm_worker import BedrockLLMWorker # ruff: ignore[import-outside-top-level]
model_handle = ModelHandle.make_for_inference_model(inference_model=inference_model)
sdk_instance = sdk_clients.get_or_create(
@@ -36,7 +36,7 @@ def _make_bedrock_worker(
# Async to satisfy the uniform ListModelsFn contract (the loop awaits it) even though Bedrock lists synchronously.
-async def _list_bedrock_models( # noqa: RUF029
+async def _list_bedrock_models( # ruff: ignore[unused-async]
*,
sdk: str,
backend_name: str,
@@ -44,7 +44,7 @@ async def _list_bedrock_models( # noqa: RUF029
flat: bool,
any_listed: bool,
) -> None:
- from pipelex.providers.bedrock.bedrock_list import list_bedrock_models # noqa: PLC0415
+ from pipelex.providers.bedrock.bedrock_list import list_bedrock_models # ruff: ignore[import-outside-top-level]
list_bedrock_models(sdk=sdk, backend_name=backend_name, backend=backend, flat=flat, any_listed=any_listed)
diff --git a/pipelex/providers/blackboxai/blackboxai_plugin.py b/pipelex/providers/blackboxai/blackboxai_plugin.py
index 7a54d63de..e56877eb2 100644
--- a/pipelex/providers/blackboxai/blackboxai_plugin.py
+++ b/pipelex/providers/blackboxai/blackboxai_plugin.py
@@ -16,9 +16,9 @@ def _make_blackboxai_img_gen_worker(
sdk_clients: SdkClientRegistry,
reporting_delegate: ReportingProtocol | None,
) -> InferenceWorkerAbstract:
- from pipelex.providers.blackboxai.blackboxai_completions_factory import BlackboxaiCompletionsFactory # noqa: PLC0415
- from pipelex.providers.openai.openai_client_factory import OpenAIClientFactory # noqa: PLC0415
- from pipelex.providers.openai.openai_completions_img_gen_worker import OpenAICompletionsImgGenWorker # noqa: PLC0415
+ from pipelex.providers.blackboxai.blackboxai_completions_factory import BlackboxaiCompletionsFactory # ruff: ignore[import-outside-top-level]
+ from pipelex.providers.openai.openai_client_factory import OpenAIClientFactory # ruff: ignore[import-outside-top-level]
+ from pipelex.providers.openai.openai_completions_img_gen_worker import OpenAICompletionsImgGenWorker # ruff: ignore[import-outside-top-level]
model_handle = ModelHandle.make_for_inference_model(inference_model=inference_model)
sdk_instance = sdk_clients.get_or_create(
diff --git a/pipelex/providers/docling/docling_factory.py b/pipelex/providers/docling/docling_factory.py
index de902cd7b..3917d7244 100644
--- a/pipelex/providers/docling/docling_factory.py
+++ b/pipelex/providers/docling/docling_factory.py
@@ -27,7 +27,7 @@ class DoclingFactory:
ExtractOutput with pages dict (0-indexed).
"""
# Deferred import: avoid pulling heavy SDK at module-load time
- from docling_core.transforms.serializer.markdown import MarkdownDocSerializer, MarkdownParams # noqa: PLC0415
+ from docling_core.transforms.serializer.markdown import MarkdownDocSerializer, MarkdownParams # ruff: ignore[import-outside-top-level]
pages: dict[int, Page] = {}
diff --git a/pipelex/providers/docling/docling_plugin.py b/pipelex/providers/docling/docling_plugin.py
index 891e5ee04..196e24abf 100644
--- a/pipelex/providers/docling/docling_plugin.py
+++ b/pipelex/providers/docling/docling_plugin.py
@@ -20,8 +20,8 @@ def _make_docling_extract_worker(
) -> InferenceWorkerAbstract:
require_sdk(spec="docling", extra="docling", msg=_DOCLING_MISSING_MSG)
- from pipelex.providers.docling.docling_extract_worker import DoclingExtractWorker # noqa: PLC0415
- from pipelex.providers.docling.docling_factory import DoclingFactory # noqa: PLC0415
+ from pipelex.providers.docling.docling_extract_worker import DoclingExtractWorker # ruff: ignore[import-outside-top-level]
+ from pipelex.providers.docling.docling_factory import DoclingFactory # ruff: ignore[import-outside-top-level]
model_handle = ModelHandle.make_for_inference_model(inference_model=inference_model)
sdk_instance = sdk_clients.get_or_create(
diff --git a/pipelex/providers/docling/docling_sdk.py b/pipelex/providers/docling/docling_sdk.py
index 922f216ca..d21cb2647 100644
--- a/pipelex/providers/docling/docling_sdk.py
+++ b/pipelex/providers/docling/docling_sdk.py
@@ -1,6 +1,6 @@
class DoclingSdk:
def __init__(self):
# Deferred import: avoid pulling heavy SDK at module-load time
- from docling.document_converter import DocumentConverter # noqa: PLC0415
+ from docling.document_converter import DocumentConverter # ruff: ignore[import-outside-top-level]
self.document_converter: DocumentConverter = DocumentConverter()
diff --git a/pipelex/providers/fal/fal_plugin.py b/pipelex/providers/fal/fal_plugin.py
index b20522505..0de7b92d9 100644
--- a/pipelex/providers/fal/fal_plugin.py
+++ b/pipelex/providers/fal/fal_plugin.py
@@ -20,9 +20,9 @@ def _make_fal_img_gen_worker(
) -> InferenceWorkerAbstract:
require_sdk(spec="fal_client", dependency_name="fal-client", extra="fal", msg=_FAL_MISSING_MSG)
- from fal_client import AsyncClient as FalAsyncClient # noqa: PLC0415
+ from fal_client import AsyncClient as FalAsyncClient # ruff: ignore[import-outside-top-level]
- from pipelex.providers.fal.fal_img_gen_worker import FalImgGenWorker # noqa: PLC0415
+ from pipelex.providers.fal.fal_img_gen_worker import FalImgGenWorker # ruff: ignore[import-outside-top-level]
model_handle = ModelHandle.make_for_inference_model(inference_model=inference_model)
sdk_instance = sdk_clients.get_or_create(
diff --git a/pipelex/providers/gateway/gateway_completions_factory.py b/pipelex/providers/gateway/gateway_completions_factory.py
index 0e8742352..8f71763ce 100644
--- a/pipelex/providers/gateway/gateway_completions_factory.py
+++ b/pipelex/providers/gateway/gateway_completions_factory.py
@@ -46,14 +46,14 @@ class GatewayCompletionsFactory(OpenAICompletionsFactory):
) -> list[ChatCompletionMessageParam]:
"""Override to use image_url format for documents which Portkey/Gateway translates correctly."""
# Deferred imports: avoid pulling heavy SDK at module-load time
- from openai.types.chat import ( # noqa: PLC0415
+ from openai.types.chat import ( # ruff: ignore[import-outside-top-level]
ChatCompletionContentPartImageParam,
ChatCompletionContentPartParam,
ChatCompletionContentPartTextParam,
ChatCompletionSystemMessageParam,
ChatCompletionUserMessageParam,
)
- from openai.types.chat.chat_completion_content_part_image_param import ImageURL as OpenAIImageURL # noqa: PLC0415
+ from openai.types.chat.chat_completion_content_part_image_param import ImageURL as OpenAIImageURL # ruff: ignore[import-outside-top-level]
llm_prompt = llm_job.llm_prompt
messages: list[ChatCompletionMessageParam] = []
@@ -108,7 +108,7 @@ class GatewayCompletionsFactory(OpenAICompletionsFactory):
backend: InferenceBackend,
) -> openai.AsyncOpenAI:
# Deferred import: avoid pulling heavy SDK at module-load time
- import openai # noqa: PLC0415
+ import openai # ruff: ignore[import-outside-top-level]
is_debug_enabled = GatewayFactory.is_debug_enabled(backend=backend)
endpoint = GatewayFactory.get_endpoint(backend=backend)
diff --git a/pipelex/providers/gateway/gateway_extract_worker.py b/pipelex/providers/gateway/gateway_extract_worker.py
index 32594ee61..060010dd0 100644
--- a/pipelex/providers/gateway/gateway_extract_worker.py
+++ b/pipelex/providers/gateway/gateway_extract_worker.py
@@ -64,18 +64,20 @@ class GatewayExtractWorker(ExtractWorkerAbstract):
loop = asyncio.get_running_loop()
task = loop.create_task(httpx_client.aclose())
task.add_done_callback(
- lambda task_result: log.debug(f"Portkey httpx client cleanup error: {task_result.exception()}")
- if not task_result.cancelled() and task_result.exception()
- else None
+ lambda task_result: (
+ log.debug(f"Portkey httpx client cleanup error: {task_result.exception()}")
+ if not task_result.cancelled() and task_result.exception()
+ else None
+ )
)
except RuntimeError:
# No running event loop, best-effort sync close
try:
asyncio.run(httpx_client.aclose())
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Best-effort: asyncio.run() runs aclose(), whose failure surface is not enumerable; teardown must never fail.
log.debug(f"Error closing portkey httpx client during teardown: {exc}")
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Best-effort cleanup boundary: teardown must never fail, whatever client/event-loop close throws.
log.debug(f"Error during GatewayExtractWorker teardown: {exc}")
diff --git a/pipelex/providers/gateway/gateway_img_gen_worker.py b/pipelex/providers/gateway/gateway_img_gen_worker.py
index 0ba5b028e..cee70c2f6 100644
--- a/pipelex/providers/gateway/gateway_img_gen_worker.py
+++ b/pipelex/providers/gateway/gateway_img_gen_worker.py
@@ -12,7 +12,7 @@ from portkey_ai import AsyncPortkey
# The vendored openai package is the one AsyncPortkey.openai_client is built from, so the
# exceptions it raises are the vendored classes (not the real `openai` package's) — there is
# no public re-export of them in portkey_ai.
-from portkey_ai._vendor import openai as portkey_vendored_openai # noqa: PLC2701
+from portkey_ai._vendor import openai as portkey_vendored_openai # ruff: ignore[import-private-name]
from portkey_ai.api_resources import exceptions as portkey_exceptions
from portkey_ai.api_resources.utils import GenericResponse
from pydantic import ValidationError
diff --git a/pipelex/providers/gateway/gateway_plugin.py b/pipelex/providers/gateway/gateway_plugin.py
index 4c87514ff..20d7e52a5 100644
--- a/pipelex/providers/gateway/gateway_plugin.py
+++ b/pipelex/providers/gateway/gateway_plugin.py
@@ -16,8 +16,8 @@ def _make_gateway_completions_worker(
sdk_clients: SdkClientRegistry,
reporting_delegate: ReportingProtocol | None,
) -> InferenceWorkerAbstract:
- from pipelex.providers.gateway.gateway_completions_factory import GatewayCompletionsFactory # noqa: PLC0415
- from pipelex.providers.openai.openai_completions_llm_worker import OpenAICompletionsLLMWorker # noqa: PLC0415
+ from pipelex.providers.gateway.gateway_completions_factory import GatewayCompletionsFactory # ruff: ignore[import-outside-top-level]
+ from pipelex.providers.openai.openai_completions_llm_worker import OpenAICompletionsLLMWorker # ruff: ignore[import-outside-top-level]
model_handle = ModelHandle.make_for_inference_model(inference_model=inference_model)
sdk_instance = sdk_clients.get_or_create(
@@ -39,8 +39,8 @@ def _make_gateway_responses_worker(
sdk_clients: SdkClientRegistry,
reporting_delegate: ReportingProtocol | None,
) -> InferenceWorkerAbstract:
- from pipelex.providers.gateway.gateway_responses_factory import GatewayResponsesFactory # noqa: PLC0415
- from pipelex.providers.openai.openai_responses_llm_worker import OpenAIResponsesLLMWorker # noqa: PLC0415
+ from pipelex.providers.gateway.gateway_responses_factory import GatewayResponsesFactory # ruff: ignore[import-outside-top-level]
+ from pipelex.providers.openai.openai_responses_llm_worker import OpenAIResponsesLLMWorker # ruff: ignore[import-outside-top-level]
model_handle = ModelHandle.make_for_inference_model(inference_model=inference_model)
sdk_instance = sdk_clients.get_or_create(
@@ -62,8 +62,8 @@ def _make_gateway_img_gen_worker(
sdk_clients: SdkClientRegistry,
reporting_delegate: ReportingProtocol | None,
) -> InferenceWorkerAbstract:
- from pipelex.providers.gateway.gateway_factory import GatewayFactory # noqa: PLC0415
- from pipelex.providers.gateway.gateway_img_gen_worker import GatewayImgGenWorker # noqa: PLC0415
+ from pipelex.providers.gateway.gateway_factory import GatewayFactory # ruff: ignore[import-outside-top-level]
+ from pipelex.providers.gateway.gateway_img_gen_worker import GatewayImgGenWorker # ruff: ignore[import-outside-top-level]
model_handle = ModelHandle.make_for_inference_model(inference_model=inference_model)
sdk_instance = sdk_clients.get_or_create(
@@ -84,8 +84,8 @@ def _make_gateway_completions_img_gen_worker(
sdk_clients: SdkClientRegistry,
reporting_delegate: ReportingProtocol | None,
) -> InferenceWorkerAbstract:
- from pipelex.providers.gateway.gateway_completions_factory import GatewayCompletionsFactory # noqa: PLC0415
- from pipelex.providers.openai.openai_completions_img_gen_worker import OpenAICompletionsImgGenWorker # noqa: PLC0415
+ from pipelex.providers.gateway.gateway_completions_factory import GatewayCompletionsFactory # ruff: ignore[import-outside-top-level]
+ from pipelex.providers.openai.openai_completions_img_gen_worker import OpenAICompletionsImgGenWorker # ruff: ignore[import-outside-top-level]
model_handle = ModelHandle.make_for_inference_model(inference_model=inference_model)
sdk_instance = sdk_clients.get_or_create(
@@ -107,8 +107,8 @@ def _make_gateway_extract_worker(
sdk_clients: SdkClientRegistry,
reporting_delegate: ReportingProtocol | None,
) -> InferenceWorkerAbstract:
- from pipelex.providers.gateway.gateway_extract_worker import GatewayExtractWorker # noqa: PLC0415
- from pipelex.providers.gateway.gateway_factory import GatewayFactory # noqa: PLC0415
+ from pipelex.providers.gateway.gateway_extract_worker import GatewayExtractWorker # ruff: ignore[import-outside-top-level]
+ from pipelex.providers.gateway.gateway_factory import GatewayFactory # ruff: ignore[import-outside-top-level]
model_handle = ModelHandle.make_for_inference_model(inference_model=inference_model)
sdk_instance = sdk_clients.get_or_create(
@@ -130,8 +130,8 @@ def _make_gateway_search_worker(
sdk_clients: SdkClientRegistry,
reporting_delegate: ReportingProtocol | None,
) -> InferenceWorkerAbstract:
- from pipelex.providers.gateway.gateway_factory import GatewayFactory # noqa: PLC0415
- from pipelex.providers.gateway.gateway_search_worker import GatewaySearchWorker # noqa: PLC0415
+ from pipelex.providers.gateway.gateway_factory import GatewayFactory # ruff: ignore[import-outside-top-level]
+ from pipelex.providers.gateway.gateway_search_worker import GatewaySearchWorker # ruff: ignore[import-outside-top-level]
model_handle = ModelHandle.make_for_inference_model(inference_model=inference_model)
sdk_instance = sdk_clients.get_or_create(
diff --git a/pipelex/providers/google/google_config.py b/pipelex/providers/google/google_config.py
index d87903f0d..779548962 100644
--- a/pipelex/providers/google/google_config.py
+++ b/pipelex/providers/google/google_config.py
@@ -36,7 +36,7 @@ class GoogleConfig(ConfigModel):
The Google ThinkingLevel enum, or None if reasoning is disabled.
"""
- from google.genai import types as genai_types # noqa: PLC0415
+ from google.genai import types as genai_types # ruff: ignore[import-outside-top-level]
level_str = get_reasoning_level_str(effort_to_level_map=self.effort_to_level_map, effort=effort)
if level_str is None:
diff --git a/pipelex/providers/google/google_img_gen_worker.py b/pipelex/providers/google/google_img_gen_worker.py
index ea1582c81..87549b853 100644
--- a/pipelex/providers/google/google_img_gen_worker.py
+++ b/pipelex/providers/google/google_img_gen_worker.py
@@ -74,10 +74,10 @@ class GoogleImgGenWorker(ImgGenWorkerAbstract):
try:
asyncio.run(self.genai_async_client.aclose())
log.verbose("Closed Google async client using asyncio.run()")
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Best-effort: asyncio.run() runs aclose(), whose failure surface is not enumerable; teardown must never fail.
log.verbose(f"Error closing Google async client during teardown: {exc}")
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Best-effort cleanup boundary: teardown must never fail, whatever client/event-loop close throws.
log.debug(f"Error during Google async client teardown: {exc}")
diff --git a/pipelex/providers/google/google_list.py b/pipelex/providers/google/google_list.py
index 425c81623..c2658249f 100644
--- a/pipelex/providers/google/google_list.py
+++ b/pipelex/providers/google/google_list.py
@@ -32,7 +32,7 @@ async def list_google_models(
msg,
)
- from pipelex.providers.google.google_factory import GoogleFactory # noqa: PLC0415
+ from pipelex.providers.google.google_factory import GoogleFactory # ruff: ignore[import-outside-top-level]
client = GoogleFactory.make_google_client(backend)
google_models: list[Any] = []
diff --git a/pipelex/providers/google/google_llm_worker.py b/pipelex/providers/google/google_llm_worker.py
index c8a468911..add79c77e 100644
--- a/pipelex/providers/google/google_llm_worker.py
+++ b/pipelex/providers/google/google_llm_worker.py
@@ -51,7 +51,7 @@ class GoogleLLMWorker(LLMWorkerAbstract):
)
genai_client: GoogleGenAiClient = sdk_instance
self.genai_async_client = genai_client.aio
- from instructor import from_genai # noqa: PLC0415
+ from instructor import from_genai # ruff: ignore[import-outside-top-level]
if instructor_mode := self.inference_model.get_instructor_mode():
self.instructor_for_objects = from_genai(client=sdk_instance, mode=instructor_mode, use_async=True)
@@ -100,10 +100,10 @@ class GoogleLLMWorker(LLMWorkerAbstract):
try:
asyncio.run(self.genai_async_client.aclose())
log.verbose("Closed Google async client using asyncio.run()")
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Best-effort: asyncio.run() runs aclose(), whose failure surface is not enumerable; teardown must never fail.
log.verbose(f"Error closing Google async client during teardown: {exc}")
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Best-effort cleanup boundary: teardown must never fail, whatever client/event-loop close throws.
log.debug(f"Error during Google async client teardown: {exc}")
@@ -260,7 +260,7 @@ class GoogleLLMWorker(LLMWorkerAbstract):
)
# Deferred import: avoid pulling heavy SDK at module-load time
- from instructor.core import InstructorRetryException # noqa: PLC0415
+ from instructor.core import InstructorRetryException # ruff: ignore[import-outside-top-level]
try:
result_object, completion = await self.instructor_for_objects.chat.completions.create_with_completion(
diff --git a/pipelex/providers/google/google_plugin.py b/pipelex/providers/google/google_plugin.py
index 78d020e67..9a54a7929 100644
--- a/pipelex/providers/google/google_plugin.py
+++ b/pipelex/providers/google/google_plugin.py
@@ -21,8 +21,8 @@ def _make_google_worker(
) -> InferenceWorkerAbstract:
require_sdk(spec="google.genai", dependency_name="google-genai", extra="google", msg=_GOOGLE_MISSING_MSG)
- from pipelex.providers.google.google_factory import GoogleFactory # noqa: PLC0415
- from pipelex.providers.google.google_llm_worker import GoogleLLMWorker # noqa: PLC0415
+ from pipelex.providers.google.google_factory import GoogleFactory # ruff: ignore[import-outside-top-level]
+ from pipelex.providers.google.google_llm_worker import GoogleLLMWorker # ruff: ignore[import-outside-top-level]
model_handle = ModelHandle.make_for_inference_model(inference_model=inference_model)
sdk_instance = sdk_clients.get_or_create(
@@ -45,8 +45,8 @@ def _make_google_img_gen_worker(
) -> InferenceWorkerAbstract:
require_sdk(spec="google.genai", dependency_name="google-genai", extra="google", msg=_GOOGLE_IMG_GEN_MISSING_MSG)
- from pipelex.providers.google.google_factory import GoogleFactory # noqa: PLC0415
- from pipelex.providers.google.google_img_gen_worker import GoogleImgGenWorker # noqa: PLC0415
+ from pipelex.providers.google.google_factory import GoogleFactory # ruff: ignore[import-outside-top-level]
+ from pipelex.providers.google.google_img_gen_worker import GoogleImgGenWorker # ruff: ignore[import-outside-top-level]
model_handle = ModelHandle.make_for_inference_model(inference_model=inference_model)
sdk_instance = sdk_clients.get_or_create(
@@ -68,7 +68,7 @@ async def _list_google_models(
flat: bool,
any_listed: bool,
) -> None:
- from pipelex.providers.google.google_list import list_google_models # noqa: PLC0415
+ from pipelex.providers.google.google_list import list_google_models # ruff: ignore[import-outside-top-level]
await list_google_models(sdk=sdk, backend_name=backend_name, backend=backend, flat=flat, any_listed=any_listed)
diff --git a/pipelex/providers/huggingface/huggingface_plugin.py b/pipelex/providers/huggingface/huggingface_plugin.py
index 6b5029867..0b1730fcd 100644
--- a/pipelex/providers/huggingface/huggingface_plugin.py
+++ b/pipelex/providers/huggingface/huggingface_plugin.py
@@ -25,10 +25,10 @@ def _make_huggingface_img_gen_worker(
) -> InferenceWorkerAbstract:
require_sdk(spec="huggingface_hub", extra="huggingface", msg=_HUGGINGFACE_MISSING_MSG)
- from huggingface_hub import AsyncInferenceClient # noqa: PLC0415
+ from huggingface_hub import AsyncInferenceClient # ruff: ignore[import-outside-top-level]
- from pipelex.providers.huggingface.huggingface_factory import HuggingFaceFactory # noqa: PLC0415
- from pipelex.providers.huggingface.huggingface_img_gen_worker import HuggingFaceImgGenWorker # noqa: PLC0415
+ from pipelex.providers.huggingface.huggingface_factory import HuggingFaceFactory # ruff: ignore[import-outside-top-level]
+ from pipelex.providers.huggingface.huggingface_img_gen_worker import HuggingFaceImgGenWorker # ruff: ignore[import-outside-top-level]
model_handle = ModelHandle.make_for_inference_model(inference_model=inference_model)
provider_literal: PROVIDER_OR_POLICY_T
diff --git a/pipelex/providers/linkup/linkup_plugin.py b/pipelex/providers/linkup/linkup_plugin.py
index 01e49623d..8f40a9bbd 100644
--- a/pipelex/providers/linkup/linkup_plugin.py
+++ b/pipelex/providers/linkup/linkup_plugin.py
@@ -15,12 +15,12 @@ def _make_linkup_extract_worker(
*,
inference_model: InferenceModelSpec,
backend: InferenceBackend,
- sdk_clients: SdkClientRegistry, # noqa: ARG001 - stateless worker, no SDK-client caching
+ sdk_clients: SdkClientRegistry, # ruff: ignore[unused-function-argument] - stateless worker, no SDK-client caching
reporting_delegate: ReportingProtocol | None,
) -> InferenceWorkerAbstract:
require_sdk(spec="linkup", extra="linkup", msg=_LINKUP_MISSING_MSG)
- from pipelex.providers.linkup.linkup_extract_worker import LinkupExtractWorker # noqa: PLC0415
+ from pipelex.providers.linkup.linkup_extract_worker import LinkupExtractWorker # ruff: ignore[import-outside-top-level]
return LinkupExtractWorker(
extra_config=backend.extra_config,
@@ -32,13 +32,13 @@ def _make_linkup_extract_worker(
def _make_linkup_search_worker(
*,
inference_model: InferenceModelSpec,
- backend: InferenceBackend, # noqa: ARG001 - uniform MakeWorkerFn signature; the search worker builds its own client
- sdk_clients: SdkClientRegistry, # noqa: ARG001 - stateless worker, no SDK-client caching
+ backend: InferenceBackend, # ruff: ignore[unused-function-argument] - uniform MakeWorkerFn signature; the search worker builds its own client
+ sdk_clients: SdkClientRegistry, # ruff: ignore[unused-function-argument] - stateless worker, no SDK-client caching
reporting_delegate: ReportingProtocol | None,
) -> InferenceWorkerAbstract:
require_sdk(spec="linkup", extra="linkup", msg=_LINKUP_SEARCH_MISSING_MSG)
- from pipelex.providers.linkup.linkup_search_worker import LinkupSearchWorker # noqa: PLC0415
+ from pipelex.providers.linkup.linkup_search_worker import LinkupSearchWorker # ruff: ignore[import-outside-top-level]
return LinkupSearchWorker(
inference_model=inference_model,
diff --git a/pipelex/providers/mistral/mistral_factory.py b/pipelex/providers/mistral/mistral_factory.py
index c93aa09c6..1acc08b48 100644
--- a/pipelex/providers/mistral/mistral_factory.py
+++ b/pipelex/providers/mistral/mistral_factory.py
@@ -143,7 +143,7 @@ class MistralFactory:
including pipelex-storage://.
"""
# Deferred imports: avoid pulling heavy SDK at module-load time
- from openai.types.chat import ( # noqa: PLC0415
+ from openai.types.chat import ( # ruff: ignore[import-outside-top-level]
ChatCompletionContentPartImageParam,
ChatCompletionContentPartParam,
ChatCompletionContentPartTextParam,
@@ -151,7 +151,7 @@ class MistralFactory:
ChatCompletionSystemMessageParam,
ChatCompletionUserMessageParam,
)
- from openai.types.chat.chat_completion_content_part_image_param import ImageURL as OpenAIImageURL # noqa: PLC0415
+ from openai.types.chat.chat_completion_content_part_image_param import ImageURL as OpenAIImageURL # ruff: ignore[import-outside-top-level]
llm_prompt = llm_job.llm_prompt
messages: list[ChatCompletionMessageParam] = []
diff --git a/pipelex/providers/mistral/mistral_list.py b/pipelex/providers/mistral/mistral_list.py
index f66354076..039c14235 100644
--- a/pipelex/providers/mistral/mistral_list.py
+++ b/pipelex/providers/mistral/mistral_list.py
@@ -32,7 +32,7 @@ def list_mistral_models(
msg,
)
- from pipelex.providers.mistral.mistral_llms import mistral_list_available_models # noqa: PLC0415
+ from pipelex.providers.mistral.mistral_llms import mistral_list_available_models # ruff: ignore[import-outside-top-level]
mistral_models = mistral_list_available_models()
diff --git a/pipelex/providers/mistral/mistral_llm_worker.py b/pipelex/providers/mistral/mistral_llm_worker.py
index 5dc3c68b0..c637b38e7 100644
--- a/pipelex/providers/mistral/mistral_llm_worker.py
+++ b/pipelex/providers/mistral/mistral_llm_worker.py
@@ -58,7 +58,7 @@ class MistralLLMWorker(LLMWorkerAbstract):
raise MistralWorkerConfigurationError(msg)
self.mistral_client_for_text: Mistral = sdk_instance
self.mistral_factory = mistral_factory
- from instructor import from_mistral # noqa: PLC0415
+ from instructor import from_mistral # ruff: ignore[import-outside-top-level]
if instructor_mode := self.inference_model.get_instructor_mode():
self.instructor_for_objects = from_mistral(client=sdk_instance, mode=instructor_mode, use_async=True)
@@ -213,7 +213,7 @@ class MistralLLMWorker(LLMWorkerAbstract):
self._validate_no_reasoning_for_structured_gen(job_params=job_params)
messages = await self.mistral_factory.make_simple_messages_openai_typed(llm_job=llm_job)
# Deferred import: avoid pulling heavy SDK at module-load time
- from instructor.core import InstructorRetryException # noqa: PLC0415
+ from instructor.core import InstructorRetryException # ruff: ignore[import-outside-top-level]
try:
result_object, completion = await self.instructor_for_objects.chat.completions.create_with_completion(
diff --git a/pipelex/providers/mistral/mistral_plugin.py b/pipelex/providers/mistral/mistral_plugin.py
index 1ae9ef7b8..64ecb64ea 100644
--- a/pipelex/providers/mistral/mistral_plugin.py
+++ b/pipelex/providers/mistral/mistral_plugin.py
@@ -25,8 +25,8 @@ def _make_mistral_worker(
) -> InferenceWorkerAbstract:
require_sdk(spec="mistralai", extra="mistral", msg=_MISTRAL_MISSING_MSG)
- from pipelex.providers.mistral.mistral_factory import MistralFactory # noqa: PLC0415
- from pipelex.providers.mistral.mistral_llm_worker import MistralLLMWorker # noqa: PLC0415
+ from pipelex.providers.mistral.mistral_factory import MistralFactory # ruff: ignore[import-outside-top-level]
+ from pipelex.providers.mistral.mistral_llm_worker import MistralLLMWorker # ruff: ignore[import-outside-top-level]
model_handle = ModelHandle.make_for_inference_model(inference_model=inference_model)
sdk_instance = sdk_clients.get_or_create(
@@ -50,8 +50,8 @@ def _make_mistral_extract_worker(
) -> InferenceWorkerAbstract:
require_sdk(spec="mistralai", extra="mistral", msg=_MISTRAL_EXTRACT_MISSING_MSG)
- from pipelex.providers.mistral.mistral_extract_worker import MistralExtractWorker # noqa: PLC0415
- from pipelex.providers.mistral.mistral_factory import MistralFactory # noqa: PLC0415
+ from pipelex.providers.mistral.mistral_extract_worker import MistralExtractWorker # ruff: ignore[import-outside-top-level]
+ from pipelex.providers.mistral.mistral_factory import MistralFactory # ruff: ignore[import-outside-top-level]
model_handle = ModelHandle.make_for_inference_model(inference_model=inference_model)
sdk_instance = sdk_clients.get_or_create(
@@ -67,15 +67,15 @@ def _make_mistral_extract_worker(
# Async to satisfy the uniform ListModelsFn contract (the loop awaits it) even though Mistral lists synchronously.
-async def _list_mistral_models( # noqa: RUF029
+async def _list_mistral_models( # ruff: ignore[unused-async]
*,
sdk: str,
backend_name: str,
- backend: InferenceBackend, # noqa: ARG001 — uniform lister signature; Mistral lists without a backend client
+ backend: InferenceBackend, # ruff: ignore[unused-function-argument] — uniform lister signature; Mistral lists without a backend client
flat: bool,
any_listed: bool,
) -> None:
- from pipelex.providers.mistral.mistral_list import list_mistral_models # noqa: PLC0415
+ from pipelex.providers.mistral.mistral_list import list_mistral_models # ruff: ignore[import-outside-top-level]
list_mistral_models(sdk=sdk, backend_name=backend_name, flat=flat, any_listed=any_listed)
diff --git a/pipelex/providers/openai/openai_completions_factory.py b/pipelex/providers/openai/openai_completions_factory.py
index 8af1f0185..3b047be30 100644
--- a/pipelex/providers/openai/openai_completions_factory.py
+++ b/pipelex/providers/openai/openai_completions_factory.py
@@ -30,7 +30,7 @@ class OpenAICompletionsFactory(BackendExtrasFactory):
) -> 'list["ChatCompletionMessageParam"]':
"""Makes a list of messages with a system message (if provided) and followed by a user message."""
# Deferred imports: avoid pulling heavy SDK at module-load time
- from openai.types.chat import ( # noqa: PLC0415
+ from openai.types.chat import ( # ruff: ignore[import-outside-top-level]
ChatCompletionContentPartImageParam,
ChatCompletionContentPartParam,
ChatCompletionContentPartTextParam,
@@ -38,8 +38,10 @@ class OpenAICompletionsFactory(BackendExtrasFactory):
ChatCompletionSystemMessageParam,
ChatCompletionUserMessageParam,
)
- from openai.types.chat.chat_completion_content_part_image_param import ImageURL as OpenAIImageURL # noqa: PLC0415
- from openai.types.chat.chat_completion_content_part_param import File as ChatCompletionContentPartFileParam # noqa: PLC0415
+ from openai.types.chat.chat_completion_content_part_image_param import ImageURL as OpenAIImageURL # ruff: ignore[import-outside-top-level]
+ from openai.types.chat.chat_completion_content_part_param import ( # ruff: ignore[import-outside-top-level]
+ File as ChatCompletionContentPartFileParam,
+ )
llm_prompt = llm_job.llm_prompt
messages: list[ChatCompletionMessageParam] = []
diff --git a/pipelex/providers/openai/openai_completions_llm_worker.py b/pipelex/providers/openai/openai_completions_llm_worker.py
index 582deb8b5..846c9688c 100644
--- a/pipelex/providers/openai/openai_completions_llm_worker.py
+++ b/pipelex/providers/openai/openai_completions_llm_worker.py
@@ -56,7 +56,7 @@ class OpenAICompletionsLLMWorker(LLMWorkerAbstract):
self.openai_client_for_text: openai.AsyncOpenAI = sdk_instance
self.openai_completions_factory = openai_completions_factory
- from instructor import from_openai # noqa: PLC0415
+ from instructor import from_openai # ruff: ignore[import-outside-top-level]
if instructor_mode := self.inference_model.get_instructor_mode():
self.instructor_for_objects = from_openai(client=sdk_instance, mode=instructor_mode)
@@ -213,7 +213,7 @@ class OpenAICompletionsLLMWorker(LLMWorkerAbstract):
self._validate_no_reasoning_for_structured_gen(job_params=job_params)
messages = await self.openai_completions_factory.make_simple_messages(llm_job=llm_job)
# Deferred import: avoid pulling heavy SDK at module-load time
- from instructor.core import InstructorRetryException # noqa: PLC0415
+ from instructor.core import InstructorRetryException # ruff: ignore[import-outside-top-level]
extra_headers, extra_body = self.openai_completions_factory.make_extras(
inference_model=self.inference_model, inference_job=llm_job, output_desc=schema.__name__
diff --git a/pipelex/providers/openai/openai_func.py b/pipelex/providers/openai/openai_func.py
index 4575cd3f7..cb321dea4 100644
--- a/pipelex/providers/openai/openai_func.py
+++ b/pipelex/providers/openai/openai_func.py
@@ -46,7 +46,7 @@ def create_openai_schema_from_function(func: Callable[..., Any]) -> dict[str, An
"""
model: type[BaseModel] = create_pydantic_model_from_function(func)
- from instructor import openai_schema # noqa: PLC0415
+ from instructor import openai_schema # ruff: ignore[import-outside-top-level]
the_openai_schema: OpenAISchema = openai_schema(model)
as_openai_schema: dict[str, Any] = the_openai_schema.openai_schema
diff --git a/pipelex/providers/openai/openai_list.py b/pipelex/providers/openai/openai_list.py
index 9dee45d84..0149f6ea1 100644
--- a/pipelex/providers/openai/openai_list.py
+++ b/pipelex/providers/openai/openai_list.py
@@ -60,7 +60,7 @@ def _display_openai_models_flat(
for model in models:
# Convert Unix timestamp to formatted date
if hasattr(model, "created") and model.created:
- created = datetime.fromtimestamp(model.created).strftime("%Y-%m-%d") # noqa: DTZ006
+ created = datetime.fromtimestamp(model.created).strftime("%Y-%m-%d") # ruff: ignore[call-datetime-fromtimestamp]
else:
created = "N/A"
owned_by = model.owned_by if hasattr(model, "owned_by") else "N/A"
@@ -87,7 +87,7 @@ def _display_openai_models_table(
for model in models:
# Convert Unix timestamp to formatted date
if hasattr(model, "created") and model.created:
- created = datetime.fromtimestamp(model.created).strftime("%Y-%m-%d") # noqa: DTZ006
+ created = datetime.fromtimestamp(model.created).strftime("%Y-%m-%d") # ruff: ignore[call-datetime-fromtimestamp]
else:
created = "N/A"
owned_by = model.owned_by if hasattr(model, "owned_by") else "N/A"
diff --git a/pipelex/providers/openai/openai_plugin.py b/pipelex/providers/openai/openai_plugin.py
index 50eba8afd..30dd192eb 100644
--- a/pipelex/providers/openai/openai_plugin.py
+++ b/pipelex/providers/openai/openai_plugin.py
@@ -16,9 +16,9 @@ def _make_openai_completions_worker(
sdk_clients: SdkClientRegistry,
reporting_delegate: ReportingProtocol | None,
) -> InferenceWorkerAbstract:
- from pipelex.providers.openai.openai_client_factory import OpenAIClientFactory # noqa: PLC0415
- from pipelex.providers.openai.openai_completions_factory import OpenAICompletionsFactory # noqa: PLC0415
- from pipelex.providers.openai.openai_completions_llm_worker import OpenAICompletionsLLMWorker # noqa: PLC0415
+ from pipelex.providers.openai.openai_client_factory import OpenAIClientFactory # ruff: ignore[import-outside-top-level]
+ from pipelex.providers.openai.openai_completions_factory import OpenAICompletionsFactory # ruff: ignore[import-outside-top-level]
+ from pipelex.providers.openai.openai_completions_llm_worker import OpenAICompletionsLLMWorker # ruff: ignore[import-outside-top-level]
model_handle = ModelHandle.make_for_inference_model(inference_model=inference_model)
sdk_instance = sdk_clients.get_or_create(
@@ -40,9 +40,9 @@ def _make_openai_responses_worker(
sdk_clients: SdkClientRegistry,
reporting_delegate: ReportingProtocol | None,
) -> InferenceWorkerAbstract:
- from pipelex.providers.openai.openai_client_factory import OpenAIClientFactory # noqa: PLC0415
- from pipelex.providers.openai.openai_responses_factory import OpenAIResponsesFactory # noqa: PLC0415
- from pipelex.providers.openai.openai_responses_llm_worker import OpenAIResponsesLLMWorker # noqa: PLC0415
+ from pipelex.providers.openai.openai_client_factory import OpenAIClientFactory # ruff: ignore[import-outside-top-level]
+ from pipelex.providers.openai.openai_responses_factory import OpenAIResponsesFactory # ruff: ignore[import-outside-top-level]
+ from pipelex.providers.openai.openai_responses_llm_worker import OpenAIResponsesLLMWorker # ruff: ignore[import-outside-top-level]
model_handle = ModelHandle.make_for_inference_model(inference_model=inference_model)
sdk_instance = sdk_clients.get_or_create(
@@ -64,8 +64,8 @@ def _make_openai_img_gen_worker(
sdk_clients: SdkClientRegistry,
reporting_delegate: ReportingProtocol | None,
) -> InferenceWorkerAbstract:
- from pipelex.providers.openai.openai_client_factory import OpenAIClientFactory # noqa: PLC0415
- from pipelex.providers.openai.openai_img_gen_worker import OpenAIImgGenWorker # noqa: PLC0415
+ from pipelex.providers.openai.openai_client_factory import OpenAIClientFactory # ruff: ignore[import-outside-top-level]
+ from pipelex.providers.openai.openai_img_gen_worker import OpenAIImgGenWorker # ruff: ignore[import-outside-top-level]
model_handle = ModelHandle.make_for_inference_model(inference_model=inference_model)
sdk_instance = sdk_clients.get_or_create(
@@ -87,7 +87,7 @@ async def _list_openai_models(
flat: bool,
any_listed: bool,
) -> None:
- from pipelex.providers.openai.openai_list import list_openai_models # noqa: PLC0415
+ from pipelex.providers.openai.openai_list import list_openai_models # ruff: ignore[import-outside-top-level]
await list_openai_models(sdk=sdk, backend_name=backend_name, backend=backend, flat=flat, any_listed=any_listed)
diff --git a/pipelex/providers/openai/openai_responses_factory.py b/pipelex/providers/openai/openai_responses_factory.py
index 81a0c662e..7a176bea5 100644
--- a/pipelex/providers/openai/openai_responses_factory.py
+++ b/pipelex/providers/openai/openai_responses_factory.py
@@ -9,7 +9,6 @@ from pipelex.cogt.document.prompt_document_utils import prep_prompt_documents
from pipelex.cogt.exceptions import LLMPromptParameterError
from pipelex.cogt.image.prompt_image import PromptImageDetail
from pipelex.cogt.image.prompt_image_utils import prep_prompt_images
-from pipelex.cogt.llm.llm_job import LLMJob
from pipelex.cogt.usage.token_category import NbTokensByCategoryDict, TokenCategory
from pipelex.plugins.backend_extras_factory import BackendExtrasFactory
from pipelex.tools.uri.prepared_file import PreparedFileBase64, PreparedFileHttpUrl, PreparedFileLocalPath
diff --git a/pipelex/providers/openai/openai_responses_llm_worker.py b/pipelex/providers/openai/openai_responses_llm_worker.py
index 0a7c65897..5517e9459 100644
--- a/pipelex/providers/openai/openai_responses_llm_worker.py
+++ b/pipelex/providers/openai/openai_responses_llm_worker.py
@@ -59,7 +59,7 @@ class OpenAIResponsesLLMWorker(LLMWorkerAbstract):
self.openai_client_for_responses: openai.AsyncOpenAI = sdk_instance
self.openai_responses_factory = openai_responses_factory
- from instructor import from_openai # noqa: PLC0415
+ from instructor import from_openai # ruff: ignore[import-outside-top-level]
if instructor_mode := self.inference_model.get_instructor_mode():
self.instructor_for_objects = from_openai(client=sdk_instance, mode=instructor_mode)
@@ -189,7 +189,7 @@ class OpenAIResponsesLLMWorker(LLMWorkerAbstract):
) -> BaseModelTypeVar:
job_params = llm_job.applied_job_params or llm_job.job_params
self._validate_no_reasoning_for_structured_gen(job_params=job_params)
- from instructor.core import InstructorRetryException # noqa: PLC0415
+ from instructor.core import InstructorRetryException # ruff: ignore[import-outside-top-level]
if not hasattr(self.instructor_for_objects, "responses"):
msg = "Instructor client is not configured for the Responses API. Set a responses-capable structure_method for this model."
diff --git a/pipelex/providers/openai/vertexai_factory.py b/pipelex/providers/openai/vertexai_factory.py
index ec7af47ac..9d8d98a3c 100644
--- a/pipelex/providers/openai/vertexai_factory.py
+++ b/pipelex/providers/openai/vertexai_factory.py
@@ -51,8 +51,8 @@ class VertexAIFactory(ConfigModel):
def _make_api_key(cls, gcp_credentials_file_path: str) -> str:
"""Get GCP credentials and return access token."""
try:
- from google.auth.transport.requests import Request # noqa: PLC0415
- from google.oauth2.service_account import Credentials # noqa: PLC0415
+ from google.auth.transport.requests import Request # ruff: ignore[import-outside-top-level]
+ from google.oauth2.service_account import Credentials # ruff: ignore[import-outside-top-level]
except ImportError as exc:
lib_name = "google-auth-oauthlib"
lib_extra_name = "google"
diff --git a/pipelex/providers/openrouter/openrouter_plugin.py b/pipelex/providers/openrouter/openrouter_plugin.py
index 7b07a29f5..f359095d5 100644
--- a/pipelex/providers/openrouter/openrouter_plugin.py
+++ b/pipelex/providers/openrouter/openrouter_plugin.py
@@ -16,9 +16,9 @@ def _make_openrouter_img_gen_worker(
sdk_clients: SdkClientRegistry,
reporting_delegate: ReportingProtocol | None,
) -> InferenceWorkerAbstract:
- from pipelex.providers.openai.openai_client_factory import OpenAIClientFactory # noqa: PLC0415
- from pipelex.providers.openai.openai_completions_img_gen_worker import OpenAICompletionsImgGenWorker # noqa: PLC0415
- from pipelex.providers.openrouter.openrouter_completions_factory import OpenRouterCompletionsFactory # noqa: PLC0415
+ from pipelex.providers.openai.openai_client_factory import OpenAIClientFactory # ruff: ignore[import-outside-top-level]
+ from pipelex.providers.openai.openai_completions_img_gen_worker import OpenAICompletionsImgGenWorker # ruff: ignore[import-outside-top-level]
+ from pipelex.providers.openrouter.openrouter_completions_factory import OpenRouterCompletionsFactory # ruff: ignore[import-outside-top-level]
model_handle = ModelHandle.make_for_inference_model(inference_model=inference_model)
sdk_instance = sdk_clients.get_or_create(
diff --git a/pipelex/providers/portkey/portkey_completions_factory.py b/pipelex/providers/portkey/portkey_completions_factory.py
index 0c2cd635a..66287d006 100644
--- a/pipelex/providers/portkey/portkey_completions_factory.py
+++ b/pipelex/providers/portkey/portkey_completions_factory.py
@@ -37,14 +37,14 @@ class PortkeyCompletionsFactory(OpenAICompletionsFactory):
) -> list[ChatCompletionMessageParam]:
"""Override to use image_url format for documents which Portkey translates correctly."""
# Deferred imports: avoid pulling heavy SDK at module-load time
- from openai.types.chat import ( # noqa: PLC0415
+ from openai.types.chat import ( # ruff: ignore[import-outside-top-level]
ChatCompletionContentPartImageParam,
ChatCompletionContentPartParam,
ChatCompletionContentPartTextParam,
ChatCompletionSystemMessageParam,
ChatCompletionUserMessageParam,
)
- from openai.types.chat.chat_completion_content_part_image_param import ImageURL as OpenAIImageURL # noqa: PLC0415
+ from openai.types.chat.chat_completion_content_part_image_param import ImageURL as OpenAIImageURL # ruff: ignore[import-outside-top-level]
llm_prompt = llm_job.llm_prompt
messages: list[ChatCompletionMessageParam] = []
@@ -99,7 +99,7 @@ class PortkeyCompletionsFactory(OpenAICompletionsFactory):
backend: InferenceBackend,
) -> openai.AsyncOpenAI:
# Deferred import: avoid pulling heavy SDK at module-load time
- import openai # noqa: PLC0415
+ import openai # ruff: ignore[import-outside-top-level]
is_debug_enabled = PortkeyFactory.is_debug_enabled(backend=backend)
endpoint = PortkeyFactory.get_endpoint(backend=backend)
diff --git a/pipelex/providers/portkey/portkey_plugin.py b/pipelex/providers/portkey/portkey_plugin.py
index f13311a22..da872a94b 100644
--- a/pipelex/providers/portkey/portkey_plugin.py
+++ b/pipelex/providers/portkey/portkey_plugin.py
@@ -16,8 +16,8 @@ def _make_portkey_completions_worker(
sdk_clients: SdkClientRegistry,
reporting_delegate: ReportingProtocol | None,
) -> InferenceWorkerAbstract:
- from pipelex.providers.openai.openai_completions_llm_worker import OpenAICompletionsLLMWorker # noqa: PLC0415
- from pipelex.providers.portkey.portkey_completions_factory import PortkeyCompletionsFactory # noqa: PLC0415
+ from pipelex.providers.openai.openai_completions_llm_worker import OpenAICompletionsLLMWorker # ruff: ignore[import-outside-top-level]
+ from pipelex.providers.portkey.portkey_completions_factory import PortkeyCompletionsFactory # ruff: ignore[import-outside-top-level]
model_handle = ModelHandle.make_for_inference_model(inference_model=inference_model)
sdk_instance = sdk_clients.get_or_create(
@@ -39,8 +39,8 @@ def _make_portkey_responses_worker(
sdk_clients: SdkClientRegistry,
reporting_delegate: ReportingProtocol | None,
) -> InferenceWorkerAbstract:
- from pipelex.providers.openai.openai_responses_llm_worker import OpenAIResponsesLLMWorker # noqa: PLC0415
- from pipelex.providers.portkey.portkey_responses_factory import PortkeyResponsesFactory # noqa: PLC0415
+ from pipelex.providers.openai.openai_responses_llm_worker import OpenAIResponsesLLMWorker # ruff: ignore[import-outside-top-level]
+ from pipelex.providers.portkey.portkey_responses_factory import PortkeyResponsesFactory # ruff: ignore[import-outside-top-level]
model_handle = ModelHandle.make_for_inference_model(inference_model=inference_model)
sdk_instance = sdk_clients.get_or_create(
diff --git a/pipelex/providers/pypdfium2/pypdfium2_plugin.py b/pipelex/providers/pypdfium2/pypdfium2_plugin.py
index cabad4eec..42babf7a3 100644
--- a/pipelex/providers/pypdfium2/pypdfium2_plugin.py
+++ b/pipelex/providers/pypdfium2/pypdfium2_plugin.py
@@ -12,10 +12,10 @@ def _make_pypdfium2_extract_worker(
*,
inference_model: InferenceModelSpec,
backend: InferenceBackend,
- sdk_clients: SdkClientRegistry, # noqa: ARG001 - stateless worker, no SDK-client caching
+ sdk_clients: SdkClientRegistry, # ruff: ignore[unused-function-argument] - stateless worker, no SDK-client caching
reporting_delegate: ReportingProtocol | None,
) -> InferenceWorkerAbstract:
- from pipelex.providers.pypdfium2.pypdfium2_worker import Pypdfium2Worker # noqa: PLC0415
+ from pipelex.providers.pypdfium2.pypdfium2_worker import Pypdfium2Worker # ruff: ignore[import-outside-top-level]
return Pypdfium2Worker(
extra_config=backend.extra_config,
diff --git a/pipelex/providers/secrets/secrets_plugin.py b/pipelex/providers/secrets/secrets_plugin.py
index 233e41320..d99025ee5 100644
--- a/pipelex/providers/secrets/secrets_plugin.py
+++ b/pipelex/providers/secrets/secrets_plugin.py
@@ -5,7 +5,7 @@ from pipelex.tools.secrets.secrets_config import SecretsProviderConfig
from pipelex.tools.secrets.secrets_provider_abstract import SecretsProviderAbstract
-def _make_env_secrets_provider(config: SecretsProviderConfig) -> SecretsProviderAbstract: # noqa: ARG001 - env provider reads no config; uniform SecretsProviderFactoryFn signature
+def _make_env_secrets_provider(config: SecretsProviderConfig) -> SecretsProviderAbstract: # ruff: ignore[unused-function-argument] - env provider reads no config; uniform SecretsProviderFactoryFn signature
return EnvSecretsProvider()
diff --git a/pipelex/runtime_boot.py b/pipelex/runtime_boot.py
index abf813c5a..c3f299909 100644
--- a/pipelex/runtime_boot.py
+++ b/pipelex/runtime_boot.py
@@ -731,7 +731,7 @@ If you need help, drop by our Discord: we're happy to assist: {URLs.discord}.
for teardown_callback in reversed(self._plugin_registrar.teardown_callbacks):
try:
teardown_callback()
- except Exception as teardown_exc: # noqa: BLE001
+ except Exception as teardown_exc: # ruff: ignore[blind-except]
# (2) a plugin-registered callback is unbounded third-party code; its exception surface
# cannot be enumerated, and the remaining callbacks still have resources to release.
log.error(f"A plugin teardown callback failed and was skipped: {teardown_exc}")
@@ -894,7 +894,7 @@ If you need help, drop by our Discord: we're happy to assist: {URLs.discord}.
if self.telemetry_manager is not None:
try:
self.telemetry_manager.teardown()
- except Exception as telemetry_exc: # noqa: BLE001
+ except Exception as telemetry_exc: # ruff: ignore[blind-except]
# (2) an injected telemetry manager is unbounded code; its exception surface cannot
# be enumerated, and the releases below must happen regardless.
log.error(f"Telemetry teardown failed while releasing a failed boot: {telemetry_exc}")
diff --git a/pipelex/runtime_bridge/direct_orchestrator.py b/pipelex/runtime_bridge/direct_orchestrator.py
index 0b7bc07fd..913bd44b0 100644
--- a/pipelex/runtime_bridge/direct_orchestrator.py
+++ b/pipelex/runtime_bridge/direct_orchestrator.py
@@ -52,7 +52,7 @@ class DirectOrchestrator:
workflow_id=None,
)
- async def start(self, *, pipe_job: PipeJob, delivery_assignment: DeliveryAssignment | None) -> PipelexPipeDispatchAck: # noqa: ARG002 — protocol signature; unreachable behind the supports_fire_and_forget gate
+ async def start(self, *, pipe_job: PipeJob, delivery_assignment: DeliveryAssignment | None) -> PipelexPipeDispatchAck: # ruff: ignore[unused-method-argument] — protocol signature; unreachable behind the supports_fire_and_forget gate
msg = (
f"DIRECT orchestrator cannot fire-and-forget pipe '{pipe_job.pipe.code}': in-process execution has no genuine async path. "
"Callers must check `supports_fire_and_forget` before dispatching a fire-and-forget job."
diff --git a/pipelex/system/configuration/config_loader.py b/pipelex/system/configuration/config_loader.py
index fadc45574..86856b64a 100644
--- a/pipelex/system/configuration/config_loader.py
+++ b/pipelex/system/configuration/config_loader.py
@@ -216,7 +216,7 @@ class ConfigLoader:
if global_dir.is_dir():
return
- from pipelex.kit.paths import GIT_IGNORED_CONFIG_FILES, get_kit_configs_dir # noqa: PLC0415
+ from pipelex.kit.paths import GIT_IGNORED_CONFIG_FILES, get_kit_configs_dir # ruff: ignore[import-outside-top-level]
config_template_dir = Path(str(get_kit_configs_dir()))
global_dir.mkdir(parents=True, exist_ok=True)
@@ -237,7 +237,7 @@ class ConfigLoader:
# Stamp the deck manifest so the boot-time staleness check has a baseline.
# Imported lazily to avoid a circular import — config_loader is loaded very early.
- from pipelex.cogt.models.deck_manifest import compute_kit_manifest, write_manifest # noqa: PLC0415
+ from pipelex.cogt.models.deck_manifest import compute_kit_manifest, write_manifest # ruff: ignore[import-outside-top-level]
write_manifest(compute_kit_manifest(), deck_dir=global_dir / "inference" / "deck")
diff --git a/pipelex/system/configuration/config_surface.py b/pipelex/system/configuration/config_surface.py
index 657ee0282..96f685656 100644
--- a/pipelex/system/configuration/config_surface.py
+++ b/pipelex/system/configuration/config_surface.py
@@ -158,7 +158,7 @@ def replay_surface_files_in_memory(*, surface_id: str, paths: Sequence[Path]) ->
# `runtime_hub`'s import closure — the kernel layer, which loads zero interpreter modules.
# Deferring it also makes the contract's "the healthy path is untouched" literal: a boot whose
# configuration validates never even imports the migration engine.
- from pipelex.migration.engine import replay_ledger_over_text # noqa: PLC0415
+ from pipelex.migration.engine import replay_ledger_over_text # ruff: ignore[import-outside-top-level]
try:
ledger = load_ledger_cached(migration_dir=packaged_migration_dir(), surface_id=surface_id)
diff --git a/pipelex/system/pipelex_service/remote_config_cache.py b/pipelex/system/pipelex_service/remote_config_cache.py
index 67e5bbf50..0888a3173 100644
--- a/pipelex/system/pipelex_service/remote_config_cache.py
+++ b/pipelex/system/pipelex_service/remote_config_cache.py
@@ -117,7 +117,7 @@ class RemoteConfigCache:
)
serialised = cached.model_dump_json()
- tmp_file = tempfile.NamedTemporaryFile( # noqa: SIM115 - we manage the handle manually for atomic replace
+ tmp_file = tempfile.NamedTemporaryFile( # ruff: ignore[open-file-with-context-handler] - we manage the handle manually for atomic replace
mode="w",
encoding="utf-8",
dir=str(cache_dir),
diff --git a/pipelex/system/registries/func_registry.py b/pipelex/system/registries/func_registry.py
index 5fd26c974..dc3f8ed3e 100644
--- a/pipelex/system/registries/func_registry.py
+++ b/pipelex/system/registries/func_registry.py
@@ -61,7 +61,7 @@ def pipe_func(name: str | None = None) -> Callable[[T], T]:
setattr(func, PIPE_FUNC_MARKER, True)
# Store custom name if provided
if name is not None:
- func._pipe_func_name = name # type: ignore[attr-defined] # noqa: SLF001
+ func._pipe_func_name = name # type: ignore[attr-defined] # ruff: ignore[private-member-access]
return func
return decorator
@@ -252,8 +252,8 @@ class FuncRegistry(RootModel[FuncRegistryDict]):
# Import here to avoid circular imports
# TODO: code-smell
- from pipelex.core.memory.working_memory import WorkingMemory # noqa: PLC0415
- from pipelex.core.stuffs.stuff_content import StuffContent # noqa: PLC0415
+ from pipelex.core.memory.working_memory import WorkingMemory # ruff: ignore[import-outside-top-level]
+ from pipelex.core.stuffs.stuff_content import StuffContent # ruff: ignore[import-outside-top-level]
# Get function signature
sig = inspect.signature(the_function)
@@ -317,8 +317,8 @@ class FuncRegistry(RootModel[FuncRegistryDict]):
the_function = cast("Callable[..., Any]", func)
# Import here to avoid circular imports
- from pipelex.core.memory.working_memory import WorkingMemory # noqa: PLC0415
- from pipelex.core.stuffs.stuff_content import StuffContent # noqa: PLC0415
+ from pipelex.core.memory.working_memory import WorkingMemory # ruff: ignore[import-outside-top-level]
+ from pipelex.core.stuffs.stuff_content import StuffContent # ruff: ignore[import-outside-top-level]
# Get function signature
try:
diff --git a/pipelex/system/telemetry/exception_capture.py b/pipelex/system/telemetry/exception_capture.py
index 47e4bd132..82187eb6d 100644
--- a/pipelex/system/telemetry/exception_capture.py
+++ b/pipelex/system/telemetry/exception_capture.py
@@ -81,7 +81,7 @@ class DualClientExceptionCapture:
if self._custom_client:
try:
self._custom_client.capture_exception(posthog_exc_info, distinct_id=self._custom_distinct_id)
- except Exception as capture_exc: # noqa: BLE001
+ except Exception as capture_exc: # ruff: ignore[blind-except]
# Telemetry must never break the app: a failed exception capture is logged at debug and swallowed.
log.debug(f"Failed to capture exception to custom PostHog: {capture_exc}")
@@ -89,6 +89,6 @@ class DualClientExceptionCapture:
if self._pipelex_client:
try:
self._pipelex_client.capture_exception(posthog_exc_info, distinct_id=self._pipelex_distinct_id)
- except Exception as capture_exc: # noqa: BLE001
+ except Exception as capture_exc: # ruff: ignore[blind-except]
# Telemetry must never break the app: a failed exception capture is logged at debug and swallowed.
log.debug(f"Failed to capture exception to Pipelex PostHog: {capture_exc}")
diff --git a/pipelex/system/telemetry/otel_constants.py b/pipelex/system/telemetry/otel_constants.py
index b8ea76b8e..999f93b10 100644
--- a/pipelex/system/telemetry/otel_constants.py
+++ b/pipelex/system/telemetry/otel_constants.py
@@ -6,7 +6,7 @@ with OpenTelemetry, following the GenAI semantic conventions.
from enum import StrEnum
-from opentelemetry.semconv._incubating.attributes import gen_ai_attributes as otel_gen_ai_attributes # noqa: PLC2701
+from opentelemetry.semconv._incubating.attributes import gen_ai_attributes as otel_gen_ai_attributes # ruff: ignore[import-private-name]
from pipelex.cogt.inference.inference_constants import InferenceOutputType
diff --git a/pipelex/system/telemetry/otel_factory.py b/pipelex/system/telemetry/otel_factory.py
index 170cb9b55..b4fae09ff 100644
--- a/pipelex/system/telemetry/otel_factory.py
+++ b/pipelex/system/telemetry/otel_factory.py
@@ -158,7 +158,7 @@ class OtelFactory:
- trace_name: Full version with pipe code (e.g., "my_pipe_abc12345")
- trace_name_redacted: Just the hash (e.g., "abc12345")
"""
- hashed_id = hashlib.md5(pipeline_run_id.encode("utf-8")).hexdigest()[:8] # noqa: S324
+ hashed_id = hashlib.md5(pipeline_run_id.encode("utf-8")).hexdigest()[:8] # ruff: ignore[hashlib-insecure-hash-function]
trace_name = f"{pipe_code}_{hashed_id}"
trace_name_redacted = hashed_id
return trace_name, trace_name_redacted
@@ -203,7 +203,7 @@ class OtelFactory:
langfuse_auth = base64.b64encode(f"{public_key}:{secret_key}".encode()).decode()
# Deferred import: avoid pulling heavy SDK at module-load time
- from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter # noqa: PLC0415
+ from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter # ruff: ignore[import-outside-top-level]
return OTLPSpanExporter(
endpoint=f"{endpoint}/api/public/otel/v1/traces",
@@ -249,14 +249,14 @@ class OtelFactory:
provider.shutdown() during teardown to flush pending spans.
"""
# Deferred imports: avoid pulling heavy SDKs at module-load time
- from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter # noqa: PLC0415
- from opentelemetry.sdk.resources import Resource as OTelResource # noqa: PLC0415
- from opentelemetry.sdk.trace import TracerProvider as OTelTracerProvider # noqa: PLC0415
- from opentelemetry.sdk.trace.export import BatchSpanProcessor as OTelBatchSpanProcessor # noqa: PLC0415
- from opentelemetry.semconv._incubating.attributes import deployment_attributes # noqa: PLC0415, PLC2701
- from opentelemetry.semconv.attributes import service_attributes # noqa: PLC0415
-
- from pipelex.system.telemetry.posthog_span_exporter import PostHogSpanExporter # noqa: PLC0415
+ from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter # ruff: ignore[import-outside-top-level]
+ from opentelemetry.sdk.resources import Resource as OTelResource # ruff: ignore[import-outside-top-level]
+ from opentelemetry.sdk.trace import TracerProvider as OTelTracerProvider # ruff: ignore[import-outside-top-level]
+ from opentelemetry.sdk.trace.export import BatchSpanProcessor as OTelBatchSpanProcessor # ruff: ignore[import-outside-top-level]
+ from opentelemetry.semconv._incubating.attributes import deployment_attributes # ruff: ignore[import-outside-top-level, import-private-name]
+ from opentelemetry.semconv.attributes import service_attributes # ruff: ignore[import-outside-top-level]
+
+ from pipelex.system.telemetry.posthog_span_exporter import PostHogSpanExporter # ruff: ignore[import-outside-top-level]
# Define Resource (Identity)
resource = OTelResource.create(
diff --git a/pipelex/system/telemetry/posthog_span_exporter.py b/pipelex/system/telemetry/posthog_span_exporter.py
index d83bac707..e6164d3c5 100644
--- a/pipelex/system/telemetry/posthog_span_exporter.py
+++ b/pipelex/system/telemetry/posthog_span_exporter.py
@@ -367,7 +367,7 @@ class PostHogSpanExporter(SpanExporter):
case SpanCategory.PIPE:
self._export_pipe_span(span=span, attributes=attributes)
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Fail silently to avoid breaking app
log.debug(f"Failed to export span to PostHog: {exc}")
diff --git a/pipelex/system/telemetry/telemetry_factory.py b/pipelex/system/telemetry/telemetry_factory.py
index b84e9e65d..7a7fa2b0e 100644
--- a/pipelex/system/telemetry/telemetry_factory.py
+++ b/pipelex/system/telemetry/telemetry_factory.py
@@ -50,7 +50,7 @@ class TelemetryFactory:
allows_custom_telemetry = telemetry_config.is_custom_telemetry_allowed_for_mode(integration_mode)
# Deferred import: avoid pulling heavy SDK at module-load time
- from pipelex.system.telemetry.telemetry_manager import TelemetryManager # noqa: PLC0415
+ from pipelex.system.telemetry.telemetry_manager import TelemetryManager # ruff: ignore[import-outside-top-level]
chosen_telemetry_manager: TelemetryManagerAbstract
if allows_custom_telemetry or is_pipelex_telemetry_enabled:
diff --git a/pipelex/system/telemetry/telemetry_manager.py b/pipelex/system/telemetry/telemetry_manager.py
index 1e852633d..8daa5670a 100644
--- a/pipelex/system/telemetry/telemetry_manager.py
+++ b/pipelex/system/telemetry/telemetry_manager.py
@@ -200,7 +200,7 @@ class TelemetryManager(TelemetryManagerAbstract):
if self._exception_capture:
try:
self._exception_capture.close()
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Telemetry teardown must never break the app: a close failure is logged at debug and swallowed.
log.debug(f"Error closing exception capture: {exc}")
@@ -211,7 +211,7 @@ class TelemetryManager(TelemetryManagerAbstract):
log.verbose("Shutting down OTel TracerProvider (flushing pending spans)...")
self._tracer_provider.shutdown()
log.verbose("OTel TracerProvider shutdown complete")
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Suppress any shutdown errors to avoid cascading failures
log.debug(f"Error during TracerProvider shutdown: {exc}")
@@ -219,7 +219,7 @@ class TelemetryManager(TelemetryManagerAbstract):
if self.custom_posthog_client:
try:
self.custom_posthog_client.shutdown()
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Suppress any shutdown errors to avoid cascading failures
log.debug(f"Error during custom PostHog shutdown: {exc}")
@@ -227,7 +227,7 @@ class TelemetryManager(TelemetryManagerAbstract):
if self.pipelex_posthog_client:
try:
self.pipelex_posthog_client.shutdown()
- except Exception as exc: # noqa: BLE001
+ except Exception as exc: # ruff: ignore[blind-except]
# Suppress any shutdown errors to avoid cascading failures
log.debug(f"Error during Pipelex PostHog shutdown: {exc}")
diff --git a/pipelex/test_extras/shared_pytest_plugins.py b/pipelex/test_extras/shared_pytest_plugins.py
index dfbee621f..cf9e8b5c3 100644
--- a/pipelex/test_extras/shared_pytest_plugins.py
+++ b/pipelex/test_extras/shared_pytest_plugins.py
@@ -109,8 +109,8 @@ def pytest_configure(config: Config) -> None:
return
# Import here to avoid circular imports during pytest startup
- from pipelex.system.configuration.config_loader import config_manager # noqa: PLC0415
- from pipelex.system.pipelex_service.pipelex_service_config import ( # noqa: PLC0415
+ from pipelex.system.configuration.config_loader import config_manager # ruff: ignore[import-outside-top-level]
+ from pipelex.system.pipelex_service.pipelex_service_config import ( # ruff: ignore[import-outside-top-level]
is_pipelex_gateway_enabled,
load_pipelex_service_config_if_exists,
)
@@ -241,7 +241,7 @@ def needs_inference_in_pipelex(request: FixtureRequest) -> bool:
needs_inference=needs_inference_in_pipelex(request),
)
- Yield:
+ yield
pipelex_instance.teardown()
Args:
diff --git a/pipelex/tools/log/log_dispatch.py b/pipelex/tools/log/log_dispatch.py
index 28a437776..ee83c9eaf 100644
--- a/pipelex/tools/log/log_dispatch.py
+++ b/pipelex/tools/log/log_dispatch.py
@@ -31,12 +31,12 @@ class LogDispatch:
def _log_config(self) -> LogConfig:
"""Retrieves the log configuration.
- Raises:
- RuntimeError: If LogConfig is not set.
-
Returns:
LogConfig: The current log configuration.
+ Raises:
+ RuntimeError: If LogConfig is not set.
+
"""
if self._log_config_instance is None:
msg = "LogConfig is not set. You must call runtime_hub.set_config()."
diff --git a/pipelex/tools/misc/hash_utils.py b/pipelex/tools/misc/hash_utils.py
index e5a0e76a2..b955ac19d 100644
--- a/pipelex/tools/misc/hash_utils.py
+++ b/pipelex/tools/misc/hash_utils.py
@@ -33,4 +33,4 @@ def hash_md5_to_int(string: str) -> int:
Returns:
A 128-bit integer derived from the MD5 hash of the input string.
"""
- return int(hashlib.md5(string.encode("utf-8")).hexdigest(), 16) # noqa: S324
+ return int(hashlib.md5(string.encode("utf-8")).hexdigest(), 16) # ruff: ignore[hashlib-insecure-hash-function]
diff --git a/pipelex/tools/misc/string_utils.py b/pipelex/tools/misc/string_utils.py
index e60be6dbe..80d673173 100644
--- a/pipelex/tools/misc/string_utils.py
+++ b/pipelex/tools/misc/string_utils.py
@@ -75,7 +75,7 @@ def can_inject_text(value: Any | None) -> bool:
return False
try:
return has_text(f"{value}")
- except Exception: # noqa: BLE001
+ except Exception: # ruff: ignore[blind-except]
# f-string formatting invokes arbitrary __str__/__format__ on type-uncertain input; this helper is contractually safe for such input.
return False
diff --git a/pipelex/tools/misc/toml_sync.py b/pipelex/tools/misc/toml_sync.py
index 9ba205e38..4fefe608d 100644
--- a/pipelex/tools/misc/toml_sync.py
+++ b/pipelex/tools/misc/toml_sync.py
@@ -110,7 +110,7 @@ def set_nested_value(doc: TOMLDocument | Table | dict[str, Any], *, key_path: st
if existing_trivia is not None:
new_item: Any = current[final_key] # type: ignore[assignment]
if isinstance(new_item, Item):
- new_item._trivia = existing_trivia # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ new_item._trivia = existing_trivia # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
return True
diff --git a/pipelex/tools/network/ssrf_guard.py b/pipelex/tools/network/ssrf_guard.py
index 93da785de..cdabc7e77 100644
--- a/pipelex/tools/network/ssrf_guard.py
+++ b/pipelex/tools/network/ssrf_guard.py
@@ -38,7 +38,7 @@ async def resolve_to_allowed_ips(
host: str,
*,
port: int,
- timeout: float | None = None, # noqa: ASYNC109 — propagates httpcore's connect timeout to bound DNS resolution
+ timeout: float | None = None, # ruff: ignore[async-function-with-timeout] — propagates httpcore's connect timeout to bound DNS resolution
) -> list[str]:
"""Resolve ``host`` and return every IP that passes the disallowed-host rule.
@@ -101,7 +101,7 @@ class SsrfGuardedBackend(httpcore.AsyncNetworkBackend):
self,
host: str,
port: int,
- timeout: float | None = None, # noqa: ASYNC109 — mandated by the AsyncNetworkBackend interface being overridden
+ timeout: float | None = None,
local_address: str | None = None,
socket_options: Iterable[SOCKET_OPTION] | None = None,
) -> httpcore.AsyncNetworkStream:
@@ -138,7 +138,7 @@ class SsrfGuardedBackend(httpcore.AsyncNetworkBackend):
async def connect_unix_socket(
self,
path: str,
- timeout: float | None = None, # noqa: ASYNC109 — mandated by the AsyncNetworkBackend interface being overridden
+ timeout: float | None = None,
socket_options: Iterable[SOCKET_OPTION] | None = None,
) -> httpcore.AsyncNetworkStream:
return await self._inner.connect_unix_socket(path, timeout=timeout, socket_options=socket_options)
@@ -160,4 +160,4 @@ class SsrfGuardedTransport(httpx.AsyncHTTPTransport):
super().__init__()
# httpx 0.28.1 exposes no public seam to inject a network backend, so wrap
# the connection pool's backend in place (before any connection is built).
- self._pool._network_backend = SsrfGuardedBackend(self._pool._network_backend) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ self._pool._network_backend = SsrfGuardedBackend(self._pool._network_backend) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
diff --git a/pipelex/tools/storage/gcp_storage_provider.py b/pipelex/tools/storage/gcp_storage_provider.py
index 5001459c9..ed76ef938 100644
--- a/pipelex/tools/storage/gcp_storage_provider.py
+++ b/pipelex/tools/storage/gcp_storage_provider.py
@@ -67,7 +67,7 @@ class GcpStorageProvider(StorageProviderAbstract):
msg,
)
- from google.cloud import storage # type: ignore[import-untyped] # noqa: PLC0415
+ from google.cloud import storage # type: ignore[import-untyped] # ruff: ignore[import-outside-top-level]
credentials_path = Path(self._credentials_file_path)
if not credentials_path.exists():
@@ -96,7 +96,7 @@ class GcpStorageProvider(StorageProviderAbstract):
"""
bucket = self._get_bucket()
- from google.api_core.exceptions import ( # type: ignore[import-untyped] # noqa: PLC0415 - optional dependency, lazy import
+ from google.api_core.exceptions import ( # type: ignore[import-untyped] # ruff: ignore[import-outside-top-level] - optional dependency, lazy import
GoogleAPIError,
NotFound,
)
@@ -144,7 +144,9 @@ class GcpStorageProvider(StorageProviderAbstract):
"""
bucket = self._get_bucket()
- from google.api_core.exceptions import GoogleAPIError # type: ignore[import-untyped] # noqa: PLC0415 - optional dependency, lazy import
+ from google.api_core.exceptions import ( # type: ignore[import-untyped] # ruff: ignore[import-outside-top-level] - optional dependency, lazy import
+ GoogleAPIError,
+ )
try:
blob = bucket.blob(key)
@@ -189,7 +191,9 @@ class GcpStorageProvider(StorageProviderAbstract):
"""
bucket = self._get_bucket()
- from google.api_core.exceptions import GoogleAPIError # type: ignore[import-untyped] # noqa: PLC0415 - optional dependency, lazy import
+ from google.api_core.exceptions import ( # type: ignore[import-untyped] # ruff: ignore[import-outside-top-level] - optional dependency, lazy import
+ GoogleAPIError,
+ )
try:
blob = bucket.blob(key)
diff --git a/pipelex/tools/storage/s3_storage_provider.py b/pipelex/tools/storage/s3_storage_provider.py
index c4a8362ab..c0d21ce54 100644
--- a/pipelex/tools/storage/s3_storage_provider.py
+++ b/pipelex/tools/storage/s3_storage_provider.py
@@ -62,7 +62,7 @@ class S3StorageProvider(StorageProviderAbstract):
self._check_dependency()
if self._session is None:
- import aioboto3 # noqa: PLC0415 - optional dependency, lazy import
+ import aioboto3 # ruff: ignore[import-outside-top-level] - optional dependency, lazy import
self._session = aioboto3.Session() # pyright: ignore[reportUnknownMemberType]
return self._session
@@ -73,7 +73,7 @@ class S3StorageProvider(StorageProviderAbstract):
Returns:
Dictionary of client configuration parameters.
"""
- from botocore.config import Config # noqa: PLC0415 - optional dependency, lazy import
+ from botocore.config import Config # ruff: ignore[import-outside-top-level] - optional dependency, lazy import
endpoint_url = f"https://s3.{self._region}.amazonaws.com"
config = Config(signature_version="s3v4") # pyright: ignore[reportUnknownArgumentType]
@@ -99,7 +99,7 @@ class S3StorageProvider(StorageProviderAbstract):
StorageFileNotFoundError: If the object does not exist.
StorageS3Error: If the S3 operation fails (any ClientError or BotoCoreError).
"""
- from botocore.exceptions import ( # noqa: PLC0415 - optional dependency, lazy import
+ from botocore.exceptions import ( # ruff: ignore[import-outside-top-level] - optional dependency, lazy import
BotoCoreError,
ClientError,
)
@@ -144,7 +144,7 @@ class S3StorageProvider(StorageProviderAbstract):
Raises:
StorageS3Error: If the S3 operation fails (any ClientError or BotoCoreError).
"""
- from botocore.exceptions import ( # noqa: PLC0415 - optional dependency, lazy import
+ from botocore.exceptions import ( # ruff: ignore[import-outside-top-level] - optional dependency, lazy import
BotoCoreError,
ClientError,
)
@@ -194,7 +194,7 @@ class S3StorageProvider(StorageProviderAbstract):
Returns:
Presigned URL if signed_urls_lifespan is configured, otherwise a public URL.
"""
- from botocore.exceptions import ( # noqa: PLC0415 - optional dependency, lazy import
+ from botocore.exceptions import ( # ruff: ignore[import-outside-top-level] - optional dependency, lazy import
BotoCoreError,
ClientError,
)
diff --git a/pipelex/tracing/dynamodb_event_log.py b/pipelex/tracing/dynamodb_event_log.py
index 8c1e50e81..7608b2423 100644
--- a/pipelex/tracing/dynamodb_event_log.py
+++ b/pipelex/tracing/dynamodb_event_log.py
@@ -62,7 +62,7 @@ class DynamoDBEventLog(EventLogProtocol):
# Translate construction-time botocore failures (e.g. a misconfigured region) into our
# domain EventLogSetupError, mirroring the read_events boundary. Best-effort callers
# (tracing assembly) catch the EventLogError base and degrade rather than aborting the run.
- from botocore.exceptions import ( # noqa: PLC0415 - optional dependency, lazy import
+ from botocore.exceptions import ( # ruff: ignore[import-outside-top-level] - optional dependency, lazy import
BotoCoreError,
ClientError,
)
@@ -126,7 +126,7 @@ class DynamoDBEventLog(EventLogProtocol):
gracefully without catching raw botocore exceptions. Individual
unparseable items are skipped with a warning rather than failing the read.
"""
- from botocore.exceptions import ( # noqa: PLC0415 - optional dependency, lazy import
+ from botocore.exceptions import ( # ruff: ignore[import-outside-top-level] - optional dependency, lazy import
BotoCoreError,
ClientError,
)
diff --git a/pipelex/tracing/ndjson_event_log.py b/pipelex/tracing/ndjson_event_log.py
index d2dae0df9..e8a1cb4ca 100644
--- a/pipelex/tracing/ndjson_event_log.py
+++ b/pipelex/tracing/ndjson_event_log.py
@@ -108,7 +108,7 @@ class NdjsonEventLog(EventLogProtocol):
run_dir = self._traces_dir / event.pipeline_run_id
run_dir.mkdir(parents=True, exist_ok=True)
file_path = run_dir / self._file_name_for(event.workflow_id, writer_id=event.writer_id)
- handle = open(file_path, "a", encoding="utf-8") # noqa: SIM115
+ handle = open(file_path, "a", encoding="utf-8") # ruff: ignore[open-file-with-context-handler]
self._file_handles[cache_key] = handle
handle.write(event.model_dump_json() + "\n")
@@ -186,6 +186,6 @@ class NdjsonEventLog(EventLogProtocol):
def __del__(self) -> None:
try:
self.close()
- except Exception: # noqa: BLE001, S110
+ except Exception: # ruff: ignore[blind-except, try-except-pass]
# Safety net during interpreter shutdown — logging may not be available
pass
diff --git a/pyproject.toml b/pyproject.toml
index 49aa0cec4..e8ed6f977 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -31,7 +31,7 @@ dependencies = [
"json2html>=1.3.0",
"kajson==0.7.0",
"markdown>=3.6",
- "mthds>=0.8.0",
+ "mthds>=0.8.2",
"networkx>=3.4.2",
"openai>=2.0.0",
"opentelemetry-api",
@@ -128,7 +128,7 @@ dev = [
"pytest-timeout>=2.3.1",
"pytest-split>=0.10.0",
"pytest-xdist>= 3.6.1",
- "ruff==0.14.13",
+ "ruff==0.16.4",
"types-aioboto3[bedrock,bedrock-runtime]>=13.4.0",
"types-aiofiles>=24.1.0.20240626",
"types-jsonschema>=4.20.0",
@@ -349,120 +349,122 @@ target-version = "py311"
preview = true
select = ["ALL"]
ignore = [
- "ANN201", # Missing return type annotation for public function `my_func`
- "ANN202", # Missing return type annotation for private function `my_func`
- "ANN204", # Missing return type annotation for special method `my_func`
- "ANN206", # Missing return type annotation for classmethod `my_func`
- "ANN401", # Dynamically typed expressions (typing.Any) are disallowed in `...`
- "ASYNC230", # Async functions should not open files with blocking methods like `open`
- "ASYNC240", # Async functions should not use pathlib.Path methods, use trio.Path or anyio.path
-
- "B903", # Class could be dataclass or namedtuple
-
- "C901", # Is to complex
- "COM812", # Checks for the absence of trailing commas.
-
- "CPY001", # Missing copyright notice at top of file
-
- "D100", # Missing docstring in public module
- "D101", # Missing docstring in public class
- "D102", # Missing docstring in public method
- "D103", # Missing docstring in public function
- "D104", # Missing docstring in public package
- "D105", # Missing docstring in magic method
- "D107", # Missing docstring in __init__
- "D205", # 1 blank line required between summary line and description
- "D400", # First line should end with a period
- "D401", # First line of docstring should be in imperative mood: "My docstring...."
- "D404", # First word of the docstring should not be "This"
- "D415", # First line should end with a period, question mark, or exclamation point
-
- "DOC201", # `return` is not documented in docstring
- "DOC202", # Docstring should not have a returns section because the function doesn't return anything
- "DOC402", # `yield` is not documented in docstring
- "DOC502", # Raised exception is not explicitly raised: `FileNotFoundError`
- "DOC501", # Raised exception `ModuleFileError` missing from docstring
-
- "DTZ001", # `datetime.datetime()` called without a `tzinfo` argument
- "DTZ005", # `datetime.datetime.now()` called without a `tz` argument
-
- "ERA001", # Found commented-out code
-
- "FBT001", # Boolean-typed positional argument in function definition
- "FBT002", # Boolean default positional argument in function definition
- "FBT003", #Boolean positional value in function call
-
- "FIX002", # Line contains TODO, consider resolving the issue
-
- "FURB101", # `open` and `read` should be replaced by `Path(file_path.path).read_text(encoding="utf-8")`
- "FURB113", # Checks for consecutive calls to append.
- "FURB152", # Checks for literals that are similar to constants in math module.
-
- "LOG004", # `.exception()` call outside exception handlers
-
- "PLC0105", # `TypeVar` name "SomethingType" does not reflect its covariance; consider renaming it to "SomethingType_co"
- "PLC1901", # Checks for comparisons to empty strings.
-
- "PLR0904", # Too many public methods ( > 20)
- "PLR0911", # Too many return statements (/6)
- "PLR0912", # Too many branches (/12)
- "PLR0913", # Too many arguments in function definition (/5)
- "PLR0914", # Too many local variables ( /15)
- "PLR0915", # Too many statements (/50)
- "PLR0917", # Too many positional arguments ( /5)
- "PLR2004", # Magic value used in comparison, consider replacing `2` with a constant variable
- "PLR6301", # Too many return statements in `for` loop
- "PLR1702", # Too many nested blocks ( > 5)
-
- "PT013", # Incorrect import of `pytest`; use `import pytest` instead
-
- "PTH100", # `os.path.abspath()` should be replaced by `Path.resolve()`
- "PTH103", # `os.makedirs()` should be replaced by `Path.mkdir(parents=True)`
- "PTH107", # `os.remove()` should be replaced by `Path.unlink()`
- "PTH109", # `os.getcwd()` should be replaced by `Path.cwd()`
- "PTH118", # `os.path.join()` should be replaced by `Path` with `/` operator
- "PTH120", # `os.path.dirname()` should be replaced by `Path.parent`
- "PTH110", # `os.path.exists()` should be replaced by `Path.exists()`
- "PTH112", # `os.path.isdir()` should be replaced by `Path.is_dir()`
- "PTH119", # `os.path.basename()` should be replaced by `Path.name`
- "PTH123", # `open()` should be replaced by `Path.open()`
- "PTH208", # Use `pathlib.Path.iterdir()` instead.
-
- "PYI051", # `Literal["auto"]` is redundant in a union with `str`
-
- "RET505", # superfluous-else-return
-
- "RUF001", # String contains ambiguous `′` (PRIME). Did you mean ``` (GRAVE ACCENT)?
- "RUF003", # Comment contains ambiguous `’` (RIGHT SINGLE QUOTATION MARK). Did you mean ``` (GRAVE ACCENT)?
- "RUF022", # Checks for __all__ definitions that are not ordered according to an "isort-style" sort.
-
- "SIM105", # Use `contextlib.suppress(ValueError)` instead of `try`-`except`-`pass`
- "SIM108", # Use ternary operator `description = func.__doc__.strip().split("\n")[0] if func.__doc__ else func.__name__` instead of `if`-`else`-block
-
- "S101", # Use of `assert` detected
- "S102", # Use of `exec` detected
- "S106", # Possible hardcoded password assigned to argument: "secret"
- "S105", # Possible hardcoded password assigned to: "child_secret"
-
- "S311", # Cryptographically weak pseudo-random number generator
-
- "TD002", # Missing author in TODO; try: `# TODO(<author_name>): ...` or `# TODO @<author_name>: ...`
- "TD003", # Missing issue link for this TODO
-
- "T201", # `print` found
+ "missing-return-type-undocumented-public-function", # Missing return type annotation for public function `my_func`
+ "missing-return-type-private-function", # Missing return type annotation for private function `my_func`
+ "missing-return-type-special-method", # Missing return type annotation for special method `my_func`
+ "missing-return-type-class-method", # Missing return type annotation for classmethod `my_func`
+ "any-type", # Dynamically typed expressions (typing.Any) are disallowed in `...`
+ "blocking-open-call-in-async-function", # Async functions should not open files with blocking methods like `open`
+ "blocking-path-method-in-async-function", # Async functions should not use pathlib.Path methods, use trio.Path or anyio.path
+
+ "class-as-data-structure", # Class could be dataclass or namedtuple
+
+ "complex-structure", # Is to complex
+ "missing-trailing-comma", # Checks for the absence of trailing commas.
+
+ "missing-copyright-notice", # Missing copyright notice at top of file
+
+ "undocumented-public-module", # Missing docstring in public module
+ "undocumented-public-class", # Missing docstring in public class
+ "undocumented-public-method", # Missing docstring in public method
+ "undocumented-public-function", # Missing docstring in public function
+ "undocumented-public-package", # Missing docstring in public package
+ "undocumented-magic-method", # Missing docstring in magic method
+ "undocumented-public-init", # Missing docstring in __init__
+ "missing-blank-line-after-summary", # 1 blank line required between summary line and description
+ "missing-trailing-period", # First line should end with a period
+ "non-imperative-mood", # First line of docstring should be in imperative mood: "My docstring...."
+ "docstring-starts-with-this", # First word of the docstring should not be "This"
+ "property-docstring-starts-with-verb", # Our property docstrings read as noun phrases describing the value ("The resolved config."), which is how they render in reference docs
+ "missing-terminal-punctuation", # First line should end with a period, question mark, or exclamation point
+
+ "docstring-missing-returns", # `return` is not documented in docstring
+ "docstring-extraneous-returns", # Docstring should not have a returns section because the function doesn't return anything
+ "docstring-missing-yields", # `yield` is not documented in docstring
+ "docstring-extraneous-exception", # Raised exception is not explicitly raised: `FileNotFoundError`
+ "docstring-missing-exception", # Raised exception `ModuleFileError` missing from docstring
+
+ "call-datetime-without-tzinfo", # `datetime.datetime()` called without a `tzinfo` argument
+ "call-datetime-now-without-tzinfo", # `datetime.datetime.now()` called without a `tz` argument
+
+ "commented-out-code", # Found commented-out code
+
+ "boolean-type-hint-positional-argument", # Boolean-typed positional argument in function definition
+ "boolean-default-value-positional-argument", # Boolean default positional argument in function definition
+ "boolean-positional-value-in-call", #Boolean positional value in function call
+
+ "line-contains-todo", # Line contains TODO, consider resolving the issue
+
+ "read-whole-file", # `open` and `read` should be replaced by `Path(file_path.path).read_text(encoding="utf-8")`
+ "repeated-append", # Checks for consecutive calls to append.
+ "math-constant", # Checks for literals that are similar to constants in math module.
+
+ "log-exception-outside-except-handler", # `.exception()` call outside exception handlers
+
+ "type-name-incorrect-variance", # `TypeVar` name "SomethingType" does not reflect its covariance; consider renaming it to "SomethingType_co"
+ "compare-to-empty-string", # Checks for comparisons to empty strings.
+
+ "too-many-public-methods", # Too many public methods ( > 20)
+ "too-many-return-statements", # Too many return statements (/6)
+ "too-many-branches", # Too many branches (/12)
+ "too-many-arguments", # Too many arguments in function definition (/5)
+ "too-many-locals", # Too many local variables ( /15)
+ "too-many-statements", # Too many statements (/50)
+ "too-many-positional-arguments", # Too many positional arguments ( /5)
+ "magic-value-comparison", # Magic value used in comparison, consider replacing `2` with a constant variable
+ "no-self-use", # Too many return statements in `for` loop
+ "too-many-nested-blocks", # Too many nested blocks ( > 5)
+ "too-many-statements-in-try-clause", # Shrinking an existing try clause changes which statements are covered by its handlers: an error-handling refactor, not lint cleanup
+
+ "pytest-incorrect-pytest-import", # Incorrect import of `pytest`; use `import pytest` instead
+
+ "os-path-abspath", # `os.path.abspath()` should be replaced by `Path.resolve()`
+ "os-makedirs", # `os.makedirs()` should be replaced by `Path.mkdir(parents=True)`
+ "os-remove", # `os.remove()` should be replaced by `Path.unlink()`
+ "os-getcwd", # `os.getcwd()` should be replaced by `Path.cwd()`
+ "os-path-join", # `os.path.join()` should be replaced by `Path` with `/` operator
+ "os-path-dirname", # `os.path.dirname()` should be replaced by `Path.parent`
+ "os-path-exists", # `os.path.exists()` should be replaced by `Path.exists()`
+ "os-path-isdir", # `os.path.isdir()` should be replaced by `Path.is_dir()`
+ "os-path-basename", # `os.path.basename()` should be replaced by `Path.name`
+ "builtin-open", # `open()` should be replaced by `Path.open()`
+ "os-listdir", # Use `pathlib.Path.iterdir()` instead.
+
+ "redundant-literal-union", # `Literal["auto"]` is redundant in a union with `str`
+
+ "superfluous-else-return", # superfluous-else-return
+
+ "ambiguous-unicode-character-string", # String contains ambiguous `′` (PRIME). Did you mean ``` (GRAVE ACCENT)?
+ "ambiguous-unicode-character-comment", # Comment contains ambiguous `’` (RIGHT SINGLE QUOTATION MARK). Did you mean ``` (GRAVE ACCENT)?
+ "unsorted-dunder-all", # Checks for __all__ definitions that are not ordered according to an "isort-style" sort.
+
+ "suppressible-exception", # Use `contextlib.suppress(ValueError)` instead of `try`-`except`-`pass`
+ "if-else-block-instead-of-if-exp", # Use ternary operator `description = func.__doc__.strip().split("\n")[0] if func.__doc__ else func.__name__` instead of `if`-`else`-block
+
+ "assert", # Use of `assert` detected
+ "exec-builtin", # Use of `exec` detected
+ "hardcoded-password-func-arg", # Possible hardcoded password assigned to argument: "secret"
+ "hardcoded-password-string", # Possible hardcoded password assigned to: "child_secret"
+
+ "suspicious-non-cryptographic-random-usage", # Cryptographically weak pseudo-random number generator
+
+ "missing-todo-author", # Missing author in TODO; try: `# TODO(<author_name>): ...` or `# TODO @<author_name>: ...`
+ "missing-todo-link", # Missing issue link for this TODO
+
+ "print", # `print` found
# TODO: stop ignoring these rules
- "B027", # Checks for empty methods in abstract base classes without an abstract decorator.
- "UP007", # Use `X | Y` for type annotations
- "UP036", # Version block is outdated for minimum Python version
- "SIM102", # Use a single `if` statement instead of nested `if` statements
- "S701", # Using jinja2 templates with `autoescape=False` is dangerous and can lead to XSS. Ensure `autoescape=True` or use the `select_autoescape` function.
- "TRY301", # Abstract `raise` to an inner function
- "PERF401", # Use a list comprehension to create a transformed list
- "PLW2901", # `for` loop variable `line` overwritten by assignment target
- "TRY300", # Consider moving this statement to an `else` block
- "UP035", # `typing.List` is deprecated, use `list` instead
- "RET503", # Missing explicit `return` at the end of function able to return non-`None` value
+ "empty-method-without-abstract-decorator", # Checks for empty methods in abstract base classes without an abstract decorator.
+ "non-pep604-annotation-union", # Use `X | Y` for type annotations
+ "outdated-version-block", # Version block is outdated for minimum Python version
+ "collapsible-if", # Use a single `if` statement instead of nested `if` statements
+ "jinja2-autoescape-false", # Using jinja2 templates with `autoescape=False` is dangerous and can lead to XSS. Ensure `autoescape=True` or use the `select_autoescape` function.
+ "raise-within-try", # Abstract `raise` to an inner function
+ "manual-list-comprehension", # Use a list comprehension to create a transformed list
+ "redefined-loop-name", # `for` loop variable `line` overwritten by assignment target
+ "try-consider-else", # Consider moving this statement to an `else` block
+ "deprecated-import", # `typing.List` is deprecated, use `list` instead
+ "implicit-return", # Missing explicit `return` at the end of function able to return non-`None` value
]
[tool.ruff.lint.pydocstyle]
@@ -480,8 +482,21 @@ runtime-evaluated-base-classes = [
[tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = [
- "INP001", # Allow test files to not have __init__.py in their directories (avoids namespace collisions)
- "BLE001", # Broad `except Exception` is acceptable in tests (asserting failure modes, defensive fixtures)
+ "implicit-namespace-package", # Allow test files to not have __init__.py in their directories (avoids namespace collisions)
+ "blind-except", # Broad `except Exception` is acceptable in tests (asserting failure modes, defensive fixtures)
+ "float-equality-comparison", # Tests assert exact float literals that round-trip exactly; `pytest.approx` would only add noise
+ "import-private-name", # Tests reach into private `_core` modules on purpose, to exercise the logic behind a CLI command without going through the CLI
+]
+
+# The usage example in `needs_inference_in_pipelex` is a pytest fixture, so it contains a bare `yield`
+# line. Ruff's Google-style parser reads any line starting with `yield` as a section header, wherever it
+# is indented, and its autofixes then rewrite it into a literal `Yield:` section that breaks the example.
+# The diagnostics land inside the docstring body, so no suppression comment can reach them.
+"pipelex/test_extras/shared_pytest_plugins.py" = [
+ "incorrect-section-order",
+ "overindented-section",
+ "non-capitalized-section-name",
+ "missing-section-name-colon",
]
[tool.uv]
diff --git a/tests/conftest.py b/tests/conftest.py
index 050a28d0d..2352d8ae1 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -36,7 +36,7 @@ _remote_config_cache: dict[str, RemoteConfig] = {}
_original_fetch_remote_config = RemoteConfigFetcher.fetch_remote_config
-def _cached_fetch_remote_config(require_fresh: bool = False) -> "RemoteConfigResult": # noqa: ARG001
+def _cached_fetch_remote_config(require_fresh: bool = False) -> "RemoteConfigResult": # ruff: ignore[unused-function-argument]
"""Wrapper that caches the remote config for the entire test session.
The ``require_fresh`` arg matches the new fetcher signature; ignored here because the
@@ -82,7 +82,7 @@ def _fast_telemetry_teardown(self: "TelemetryManager") -> None:
if self._tracer_provider: # pyright: ignore[reportPrivateUsage]
try:
self._tracer_provider.shutdown() # pyright: ignore[reportPrivateUsage]
- except Exception: # noqa: S110
+ except Exception: # ruff: ignore[try-except-pass]
pass # Suppress all shutdown errors; logging may already be torn down
TelemetryManagerAbstract.clear_instance()
@@ -98,7 +98,7 @@ def cache_configs_for_session(session_mocker: MockerFixture):
_cached_load_pipelex_service_config,
)
# Skip expensive telemetry shutdown (OTel + PostHog flush) during tests
- from pipelex.system.telemetry.telemetry_manager import TelemetryManager # noqa: PLC0415
+ from pipelex.system.telemetry.telemetry_manager import TelemetryManager # ruff: ignore[import-outside-top-level]
session_mocker.patch.object(TelemetryManager, "teardown", _fast_telemetry_teardown)
diff --git a/tests/e2e/agent_cli/test_fix_bundle.py b/tests/e2e/agent_cli/test_fix_bundle.py
index 9147c42d7..3c2ee8565 100644
--- a/tests/e2e/agent_cli/test_fix_bundle.py
+++ b/tests/e2e/agent_cli/test_fix_bundle.py
@@ -3,7 +3,7 @@
from __future__ import annotations
import json
-import subprocess # noqa: S404 - invokes the real pipelex-agent binary for E2E coverage
+import subprocess # ruff: ignore[suspicious-subprocess-import] - invokes the real pipelex-agent binary for E2E coverage
from typing import TYPE_CHECKING
import pytest
@@ -49,7 +49,7 @@ prompt = "Say hi to $name"
def _run_fix_bundle(bundle_path: Path, *, env: dict[str, str], cwd: Path) -> subprocess.CompletedProcess[str]:
- return subprocess.run( # noqa: S603
+ return subprocess.run( # ruff: ignore[subprocess-without-shell-equals-true]
[
str(PIPELEX_AGENT_BIN),
"fix",
diff --git a/tests/e2e/agent_cli/test_offline_run_dry.py b/tests/e2e/agent_cli/test_offline_run_dry.py
index 29ff6de73..36306c7dd 100644
--- a/tests/e2e/agent_cli/test_offline_run_dry.py
+++ b/tests/e2e/agent_cli/test_offline_run_dry.py
@@ -11,7 +11,7 @@ from __future__ import annotations
import json
import shutil
-import subprocess # noqa: S404 — invokes the real pipelex-agent binary for E2E coverage
+import subprocess # ruff: ignore[suspicious-subprocess-import] — invokes the real pipelex-agent binary for E2E coverage
from typing import TYPE_CHECKING, cast
import pytest
@@ -47,7 +47,7 @@ def _run_agent_bundle(bundle_dir: Path, env: dict[str, str], cwd: Path) -> subpr
repository's project-level one. ``bundle_dir`` SHOULD be a staged copy (see
``_stage_bundle``) — the CLI writes ``dry_run.json`` next to the bundle file.
"""
- return subprocess.run( # noqa: S603
+ return subprocess.run( # ruff: ignore[subprocess-without-shell-equals-true]
[
str(PIPELEX_AGENT_BIN),
"run",
diff --git a/tests/e2e/agent_cli/test_stdout_is_clean_json.py b/tests/e2e/agent_cli/test_stdout_is_clean_json.py
index 987b2a825..203422453 100644
--- a/tests/e2e/agent_cli/test_stdout_is_clean_json.py
+++ b/tests/e2e/agent_cli/test_stdout_is_clean_json.py
@@ -30,7 +30,7 @@ If anyone flips the kit-template / package default back to stdout, or adds a
from __future__ import annotations
import json
-import subprocess # noqa: S404 — invokes the real pipelex-agent binary for E2E coverage
+import subprocess # ruff: ignore[suspicious-subprocess-import] — invokes the real pipelex-agent binary for E2E coverage
from typing import TYPE_CHECKING, cast
import pytest
@@ -147,7 +147,7 @@ class TestAgentCliStdoutIsCleanJson:
"""
_set_pipelex_package_log_level_to_debug(hermetic_home / ".pipelex" / "pipelex.toml")
- result = subprocess.run( # noqa: S603
+ result = subprocess.run( # ruff: ignore[subprocess-without-shell-equals-true]
[
str(PIPELEX_AGENT_BIN),
"models",
@@ -200,7 +200,7 @@ class TestAgentCliStdoutIsCleanJson:
for package_name in ("anthropic", "httpx", "botocore", "openai"):
_set_package_log_level(pipelex_toml, package_name=package_name, level="DEBUG")
- result = subprocess.run( # noqa: S603
+ result = subprocess.run( # ruff: ignore[subprocess-without-shell-equals-true]
[
str(PIPELEX_AGENT_BIN),
"models",
@@ -246,7 +246,7 @@ class TestAgentCliStdoutIsCleanJson:
_set_pipelex_package_log_level_to_debug(pipelex_toml)
_set_console_targets(pipelex_toml, log_target="stdout", print_target="stdout")
- result = subprocess.run( # noqa: S603
+ result = subprocess.run( # ruff: ignore[subprocess-without-shell-equals-true]
[
str(PIPELEX_AGENT_BIN),
"models",
diff --git a/tests/e2e/pipelex/cli/conftest.py b/tests/e2e/pipelex/cli/conftest.py
index c98ad52bc..1f8658c2c 100644
--- a/tests/e2e/pipelex/cli/conftest.py
+++ b/tests/e2e/pipelex/cli/conftest.py
@@ -4,7 +4,7 @@ Re-exports the hermetic-HOME subprocess harness of the agent-CLI E2E suite so hu
subprocess tests (e.g. ``pipelex fix bundle``) run against the same isolated config tree.
"""
-from tests.e2e.agent_cli.conftest import ( # noqa: F401 - fixtures re-exported for this directory
+from tests.e2e.agent_cli.conftest import ( # ruff: ignore[unused-import] - fixtures re-exported for this directory
hermetic_home,
offline_subprocess_env,
)
diff --git a/tests/e2e/pipelex/cli/test_csv_run.py b/tests/e2e/pipelex/cli/test_csv_run.py
index 3a91be0fc..f55452617 100644
--- a/tests/e2e/pipelex/cli/test_csv_run.py
+++ b/tests/e2e/pipelex/cli/test_csv_run.py
@@ -16,7 +16,7 @@ from __future__ import annotations
import csv
import os
import shutil
-import subprocess # noqa: S404 — invokes the real pipelex binary for E2E coverage
+import subprocess # ruff: ignore[suspicious-subprocess-import] — invokes the real pipelex binary for E2E coverage
from inspect import signature
from pathlib import Path
from typing import TYPE_CHECKING
@@ -69,7 +69,7 @@ class TestCsvRun:
@pytest.mark.gha_disabled
def test_save_csv_writes_file_at_literal_path(self, tmp_path: Path) -> None:
staged = _stage_bundle(tmp_path)
- result = subprocess.run( # noqa: S603
+ result = subprocess.run( # ruff: ignore[subprocess-without-shell-equals-true]
[
str(PIPELEX_BIN),
"run",
@@ -111,7 +111,7 @@ class TestCsvRun:
# (not a list), so the run must fail cleanly with the "not a list" guard, framed as a
# --save-csv failure (not a pipeline failure) and with no raw traceback.
staged = _stage_bundle(tmp_path)
- result = subprocess.run( # noqa: S603
+ result = subprocess.run( # ruff: ignore[subprocess-without-shell-equals-true]
[
str(PIPELEX_BIN),
"run",
@@ -147,7 +147,7 @@ class TestCsvRun:
'{ "people": { "concept": "csv_demo.Person", "content": { "url": "nope.csv" } } }',
encoding="utf-8",
)
- result = subprocess.run( # noqa: S603
+ result = subprocess.run( # ruff: ignore[subprocess-without-shell-equals-true]
[
str(PIPELEX_BIN),
"run",
diff --git a/tests/e2e/pipelex/cli/test_date_inputs_run.py b/tests/e2e/pipelex/cli/test_date_inputs_run.py
index 23e8f579e..aac0ea9b7 100644
--- a/tests/e2e/pipelex/cli/test_date_inputs_run.py
+++ b/tests/e2e/pipelex/cli/test_date_inputs_run.py
@@ -14,7 +14,7 @@ from __future__ import annotations
import os
import shutil
-import subprocess # noqa: S404 — invokes the real pipelex binary for E2E coverage
+import subprocess # ruff: ignore[suspicious-subprocess-import] — invokes the real pipelex binary for E2E coverage
from pathlib import Path
import pytest
@@ -41,7 +41,7 @@ class TestDateInputsRun:
inputs_toml = staged / "inputs.toml"
inputs_toml.write_text(INPUTS_TOML, encoding="utf-8")
- result = subprocess.run( # noqa: S603
+ result = subprocess.run( # ruff: ignore[subprocess-without-shell-equals-true]
[
str(PIPELEX_BIN),
"run",
diff --git a/tests/e2e/pipelex/cli/test_fix_bundle_cmd.py b/tests/e2e/pipelex/cli/test_fix_bundle_cmd.py
index cec1e14f3..e604109ad 100644
--- a/tests/e2e/pipelex/cli/test_fix_bundle_cmd.py
+++ b/tests/e2e/pipelex/cli/test_fix_bundle_cmd.py
@@ -7,7 +7,7 @@ boot, the fix loop, human rendering, and exit codes.
from __future__ import annotations
-import subprocess # noqa: S404 - invokes the real pipelex binary for E2E coverage
+import subprocess # ruff: ignore[suspicious-subprocess-import] - invokes the real pipelex binary for E2E coverage
from typing import TYPE_CHECKING
import pytest
@@ -55,7 +55,7 @@ prompt = "Say hi to $name"
def _run_fix_bundle(bundle_path: Path, *, env: dict[str, str], cwd: Path) -> subprocess.CompletedProcess[str]:
- return subprocess.run( # noqa: S603
+ return subprocess.run( # ruff: ignore[subprocess-without-shell-equals-true]
[
str(PIPELEX_BIN),
"--no-logo",
diff --git a/tests/e2e/pipelex/cli/test_migrate_commands.py b/tests/e2e/pipelex/cli/test_migrate_commands.py
index ea9bb89bb..5d47ac0a3 100644
--- a/tests/e2e/pipelex/cli/test_migrate_commands.py
+++ b/tests/e2e/pipelex/cli/test_migrate_commands.py
@@ -38,7 +38,7 @@ never reads it.
from __future__ import annotations
import json
-import subprocess # noqa: S404 - invokes the real pipelex binaries for E2E coverage
+import subprocess # ruff: ignore[suspicious-subprocess-import] - invokes the real pipelex binaries for E2E coverage
from typing import TYPE_CHECKING, Any
from pipelex.migration.backup import existing_backups_of
@@ -316,7 +316,7 @@ def _run(*, args: list[str], env: dict[str, str], cwd: Path, answers: str | None
# `answers` feeds an interactive command's prompts. Every confirmation the doctor asks defaults
# to yes, so a run of bare newlines accepts each one in turn without this having to know how
# many there will be or what order they come in.
- return subprocess.run( # noqa: S603
+ return subprocess.run( # ruff: ignore[subprocess-without-shell-equals-true]
args,
env={**env, "COLUMNS": "400"},
cwd=str(cwd),
@@ -409,7 +409,7 @@ class TestTheHumanMigrateCommand:
def test_the_two_write_flags_contradict_each_other_and_are_refused(
self,
- hermetic_home: Path, # noqa: ARG002 - the fixture is what makes HOME hermetic for the subprocess
+ hermetic_home: Path, # ruff: ignore[unused-method-argument] - the fixture is what makes HOME hermetic for the subprocess
offline_subprocess_env: dict[str, str],
) -> None:
refused = _run(
@@ -478,7 +478,7 @@ class TestTheAgentMigrateLoop:
def test_the_two_write_flags_contradict_each_other_and_are_refused(
self,
- hermetic_home: Path, # noqa: ARG002 - the fixture is what makes HOME hermetic for the subprocess
+ hermetic_home: Path, # ruff: ignore[unused-method-argument] - the fixture is what makes HOME hermetic for the subprocess
offline_subprocess_env: dict[str, str],
) -> None:
refused = _run(
diff --git a/tests/e2e/pipelex/cli/test_toml_inputs_build.py b/tests/e2e/pipelex/cli/test_toml_inputs_build.py
index 06f02020f..699d0ceb4 100644
--- a/tests/e2e/pipelex/cli/test_toml_inputs_build.py
+++ b/tests/e2e/pipelex/cli/test_toml_inputs_build.py
@@ -21,7 +21,7 @@ from __future__ import annotations
import os
import shutil
-import subprocess # noqa: S404 — invokes the real pipelex binary for E2E coverage
+import subprocess # ruff: ignore[suspicious-subprocess-import] — invokes the real pipelex binary for E2E coverage
from pathlib import Path
from typing import Any, cast
@@ -43,7 +43,7 @@ class TestTomlInputsBuild:
def _build(self, staged: Path, tmp_path: Path, *, extra_args: list[str]) -> None:
"""Run ``build inputs bundle --format toml`` (plus extra args) on the staged bundle."""
- build_result = subprocess.run( # noqa: S603
+ build_result = subprocess.run( # ruff: ignore[subprocess-without-shell-equals-true]
[
str(PIPELEX_BIN),
"build",
@@ -67,7 +67,7 @@ class TestTomlInputsBuild:
def _dry_run(self, staged: Path, tmp_path: Path, inputs_toml: Path) -> None:
"""Feed the generated inputs.toml straight into ``run --dry-run`` — the round trip."""
- run_result = subprocess.run( # noqa: S603
+ run_result = subprocess.run( # ruff: ignore[subprocess-without-shell-equals-true]
[
str(PIPELEX_BIN),
"run",
diff --git a/tests/e2e/pipelex/cli/test_toml_inputs_run.py b/tests/e2e/pipelex/cli/test_toml_inputs_run.py
index 76369d052..ecb09f47a 100644
--- a/tests/e2e/pipelex/cli/test_toml_inputs_run.py
+++ b/tests/e2e/pipelex/cli/test_toml_inputs_run.py
@@ -15,7 +15,7 @@ from __future__ import annotations
import os
import shutil
-import subprocess # noqa: S404 — invokes the real pipelex binary for E2E coverage
+import subprocess # ruff: ignore[suspicious-subprocess-import] — invokes the real pipelex binary for E2E coverage
from pathlib import Path
import pytest
@@ -40,7 +40,7 @@ class TestTomlInputsRun:
inputs_toml = staged / "inputs.toml"
inputs_toml.write_text(INPUTS_TOML, encoding="utf-8")
- result = subprocess.run( # noqa: S603
+ result = subprocess.run( # ruff: ignore[subprocess-without-shell-equals-true]
[
str(PIPELEX_BIN),
"run",
diff --git a/tests/e2e/pipelex/cli/test_validate_cmd.py b/tests/e2e/pipelex/cli/test_validate_cmd.py
index 5e55ec007..74b4fc037 100644
--- a/tests/e2e/pipelex/cli/test_validate_cmd.py
+++ b/tests/e2e/pipelex/cli/test_validate_cmd.py
@@ -16,7 +16,7 @@ whole-directory path: many bundles merged into one library, then dry-run togethe
import shutil
from pathlib import Path
-from pipelex.cli.commands.validate._validate_core import do_validate_all_libraries_and_dry_run # noqa: PLC2701
+from pipelex.cli.commands.validate._validate_core import do_validate_all_libraries_and_dry_run
from pipelex.test_extras.mthds_corpus.loader import iter_entries
from pipelex.test_extras.mthds_corpus.manifest import EntryValidity
diff --git a/tests/e2e/pipelex/cli/test_yes_no_inputs_run.py b/tests/e2e/pipelex/cli/test_yes_no_inputs_run.py
index f0cc22c8a..538b28d65 100644
--- a/tests/e2e/pipelex/cli/test_yes_no_inputs_run.py
+++ b/tests/e2e/pipelex/cli/test_yes_no_inputs_run.py
@@ -14,7 +14,7 @@ from __future__ import annotations
import os
import shutil
-import subprocess # noqa: S404 — invokes the real pipelex binary for E2E coverage
+import subprocess # ruff: ignore[suspicious-subprocess-import] — invokes the real pipelex binary for E2E coverage
from pathlib import Path
import pytest
@@ -43,7 +43,7 @@ class TestYesNoInputsRun:
inputs_toml = staged / "inputs.toml"
inputs_toml.write_text(INPUTS_TOML, encoding="utf-8")
- result = subprocess.run( # noqa: S603
+ result = subprocess.run( # ruff: ignore[subprocess-without-shell-equals-true]
[
str(PIPELEX_BIN),
"run",
diff --git a/tests/e2e/pipelex/pipes/optionals/guarded_condition/guarded_condition_funcs.py b/tests/e2e/pipelex/pipes/optionals/guarded_condition/guarded_condition_funcs.py
index 903ab83de..26e96d5d9 100644
--- a/tests/e2e/pipelex/pipes/optionals/guarded_condition/guarded_condition_funcs.py
+++ b/tests/e2e/pipelex/pipes/optionals/guarded_condition/guarded_condition_funcs.py
@@ -8,10 +8,10 @@ from pipelex.system.registries.func_registry import pipe_func
@pipe_func()
-async def ogc_make_flagged_note(working_memory: WorkingMemory) -> TextContent: # noqa: ARG001,RUF029
+async def ogc_make_flagged_note(working_memory: WorkingMemory) -> TextContent: # ruff: ignore[unused-function-argument, unused-async]
return TextContent(text="flagged-branch")
@pipe_func()
-async def ogc_make_plain_note(working_memory: WorkingMemory) -> TextContent: # noqa: ARG001,RUF029
+async def ogc_make_plain_note(working_memory: WorkingMemory) -> TextContent: # ruff: ignore[unused-function-argument, unused-async]
return TextContent(text="plain-branch")
diff --git a/tests/e2e/pipelex/pipes/optionals/lift_parity/lift_parity_funcs.py b/tests/e2e/pipelex/pipes/optionals/lift_parity/lift_parity_funcs.py
index bc7382d7a..0be9db1de 100644
--- a/tests/e2e/pipelex/pipes/optionals/lift_parity/lift_parity_funcs.py
+++ b/tests/e2e/pipelex/pipes/optionals/lift_parity/lift_parity_funcs.py
@@ -8,10 +8,10 @@ from pipelex.system.registries.func_registry import pipe_func
@pipe_func()
-async def opar_make_analysis(working_memory: WorkingMemory) -> TextContent: # noqa: RUF029
+async def opar_make_analysis(working_memory: WorkingMemory) -> TextContent: # ruff: ignore[unused-async]
return TextContent(text=f"analysis of {working_memory.get_stuff_as_str(name='source')}")
@pipe_func()
-async def opar_summarize(working_memory: WorkingMemory) -> TextContent: # noqa: RUF029
+async def opar_summarize(working_memory: WorkingMemory) -> TextContent: # ruff: ignore[unused-async]
return TextContent(text=f"summary: {working_memory.get_stuff_as_str(name='analysis')}")
diff --git a/tests/e2e/pipelex/pipes/optionals/optionals_showcase/optionals_showcase_funcs.py b/tests/e2e/pipelex/pipes/optionals/optionals_showcase/optionals_showcase_funcs.py
index 0df7c5f90..b9165676e 100644
--- a/tests/e2e/pipelex/pipes/optionals/optionals_showcase/optionals_showcase_funcs.py
+++ b/tests/e2e/pipelex/pipes/optionals/optionals_showcase/optionals_showcase_funcs.py
@@ -8,20 +8,20 @@ from pipelex.system.registries.func_registry import pipe_func
@pipe_func()
-async def oshow_analyze_clause(working_memory: WorkingMemory) -> TextContent: # noqa: RUF029
+async def oshow_analyze_clause(working_memory: WorkingMemory) -> TextContent: # ruff: ignore[unused-async]
return TextContent(text=f"analysis of {working_memory.get_stuff_as_str(name='clause')}")
@pipe_func()
-async def oshow_summarize_analysis(working_memory: WorkingMemory) -> TextContent: # noqa: RUF029
+async def oshow_summarize_analysis(working_memory: WorkingMemory) -> TextContent: # ruff: ignore[unused-async]
return TextContent(text=f"summary: {working_memory.get_stuff_as_str(name='analysis')}")
@pipe_func()
-async def oshow_flag_risk(working_memory: WorkingMemory) -> TextContent: # noqa: ARG001,RUF029
+async def oshow_flag_risk(working_memory: WorkingMemory) -> TextContent: # ruff: ignore[unused-function-argument, unused-async]
return TextContent(text="penalty risk detected")
@pipe_func()
-async def oshow_force_extract(working_memory: WorkingMemory) -> TextContent: # noqa: RUF029
+async def oshow_force_extract(working_memory: WorkingMemory) -> TextContent: # ruff: ignore[unused-async]
return TextContent(text=f"extracted: {working_memory.get_stuff_as_str(name='clause')}")
diff --git a/tests/e2e/pipelex/pipes/optionals/test_optionals_showcase_mthds.py b/tests/e2e/pipelex/pipes/optionals/test_optionals_showcase_mthds.py
index fb68d7d59..917160a7c 100644
--- a/tests/e2e/pipelex/pipes/optionals/test_optionals_showcase_mthds.py
+++ b/tests/e2e/pipelex/pipes/optionals/test_optionals_showcase_mthds.py
@@ -9,7 +9,7 @@ from pathlib import Path
import pytest
-from pipelex.cli.commands.run._run_core import _execute_run # noqa: PLC2701 # pyright: ignore[reportPrivateUsage]
+from pipelex.cli.commands.run._run_core import _execute_run # pyright: ignore[reportPrivateUsage]
from pipelex.config import get_config
from pipelex.core.memory.absence import AbsenceKind
from pipelex.core.pipes.inputs.exceptions import OptionalValueAbsentError
diff --git a/tests/e2e/test_signature_validation_cli.py b/tests/e2e/test_signature_validation_cli.py
index 5b64a095f..349c111b5 100644
--- a/tests/e2e/test_signature_validation_cli.py
+++ b/tests/e2e/test_signature_validation_cli.py
@@ -6,7 +6,9 @@ from pathlib import Path
import pytest
import typer
-from pipelex.cli.commands.validate._validate_core import _validate_pipe_or_bundle # noqa: PLC2701 # pyright: ignore[reportPrivateUsage]
+from pipelex.cli.commands.validate._validate_core import (
+ _validate_pipe_or_bundle, # pyright: ignore[reportPrivateUsage]
+)
_FIXTURE_DIR = Path(__file__).parent / "fixtures" / "signature_bundles"
_SIGNATURE_ONLY = _FIXTURE_DIR / "signature_only.mthds"
diff --git a/tests/integration/pipelex/cli/agent_cli/test_run_cost_report.py b/tests/integration/pipelex/cli/agent_cli/test_run_cost_report.py
index b8a7f2971..35cce8720 100644
--- a/tests/integration/pipelex/cli/agent_cli/test_run_cost_report.py
+++ b/tests/integration/pipelex/cli/agent_cli/test_run_cost_report.py
@@ -10,7 +10,7 @@ from pathlib import Path
import pytest
from pytest_mock import MockerFixture
-from pipelex.cli.agent_cli.commands.run._run_core import run_pipeline_core # noqa: PLC2701 # pyright: ignore[reportPrivateUsage]
+from pipelex.cli.agent_cli.commands.run._run_core import run_pipeline_core # pyright: ignore[reportPrivateUsage]
from pipelex.cogt.llm.llm_report import LLMTokensUsage
from pipelex.cogt.usage.cost_category import CostCategory
from pipelex.cogt.usage.token_category import TokenCategory
diff --git a/tests/integration/pipelex/cli/commands/init/test_cache_priming.py b/tests/integration/pipelex/cli/commands/init/test_cache_priming.py
index 95e73689d..c84f5610c 100644
--- a/tests/integration/pipelex/cli/commands/init/test_cache_priming.py
+++ b/tests/integration/pipelex/cli/commands/init/test_cache_priming.py
@@ -15,7 +15,7 @@ from __future__ import annotations
import json
from datetime import UTC, datetime
-from pathlib import Path # noqa: TC003 — referenced by pytest fixture type hints at runtime
+from pathlib import Path # ruff: ignore[typing-only-standard-library-import] — referenced by pytest fixture type hints at runtime
from typing import TYPE_CHECKING
import httpx
diff --git a/tests/integration/pipelex/cli/commands/test_build_runner_flow.py b/tests/integration/pipelex/cli/commands/test_build_runner_flow.py
index 8f3a1625e..910aff555 100644
--- a/tests/integration/pipelex/cli/commands/test_build_runner_flow.py
+++ b/tests/integration/pipelex/cli/commands/test_build_runner_flow.py
@@ -11,7 +11,9 @@ from pathlib import Path
import pytest
-from pipelex.cli.commands.build.runner._runner_core import _prepare_runner_core # noqa: PLC2701 # pyright: ignore[reportPrivateUsage]
+from pipelex.cli.commands.build.runner._runner_core import (
+ _prepare_runner_core, # pyright: ignore[reportPrivateUsage]
+)
from pipelex.codegen.lock import CODEGEN_LOCK_FILENAME
from pipelex.interpreter_hub import clear_current_library, get_current_library_id_or_none, get_library_manager
diff --git a/tests/integration/pipelex/cli/test_agent_validate_defaults_strict.py b/tests/integration/pipelex/cli/test_agent_validate_defaults_strict.py
index 6628d5b7c..d5b3bf434 100644
--- a/tests/integration/pipelex/cli/test_agent_validate_defaults_strict.py
+++ b/tests/integration/pipelex/cli/test_agent_validate_defaults_strict.py
@@ -7,7 +7,7 @@ from typing import TYPE_CHECKING
import pytest
-from pipelex.cli.agent_cli.commands.validate._validate_core import validate_bundle_core # noqa: PLC2701
+from pipelex.cli.agent_cli.commands.validate._validate_core import validate_bundle_core
if TYPE_CHECKING:
from collections.abc import Iterator
diff --git a/tests/integration/pipelex/cli/test_agent_validate_pipe_core_library_lifecycle.py b/tests/integration/pipelex/cli/test_agent_validate_pipe_core_library_lifecycle.py
index 7cbfefcde..b5b4010ce 100644
--- a/tests/integration/pipelex/cli/test_agent_validate_pipe_core_library_lifecycle.py
+++ b/tests/integration/pipelex/cli/test_agent_validate_pipe_core_library_lifecycle.py
@@ -18,7 +18,7 @@ from pathlib import Path
import pytest
from pytest_mock import MockerFixture
-from pipelex.cli.agent_cli.commands.validate._validate_core import validate_pipe_core # noqa: PLC2701
+from pipelex.cli.agent_cli.commands.validate._validate_core import validate_pipe_core
from pipelex.interpreter_hub import clear_current_library, get_current_library_id_or_none, get_library_manager, set_current_library
from pipelex.libraries.pipe.exceptions import PipeNotFoundError
diff --git a/tests/integration/pipelex/cli/test_agent_validate_pipe_in_bundle.py b/tests/integration/pipelex/cli/test_agent_validate_pipe_in_bundle.py
index 9a6d43c1d..e3e6bbeba 100644
--- a/tests/integration/pipelex/cli/test_agent_validate_pipe_in_bundle.py
+++ b/tests/integration/pipelex/cli/test_agent_validate_pipe_in_bundle.py
@@ -8,8 +8,8 @@ from typing import TYPE_CHECKING
import pytest
from pipelex.cli.agent_cli.commands.validate._validate_core import (
- validate_bundle_core, # noqa: PLC2701
- validate_pipe_in_bundle_core, # noqa: PLC2701
+ validate_bundle_core,
+ validate_pipe_in_bundle_core,
)
from pipelex.libraries.pipe.exceptions import PipeNotFoundError
diff --git a/tests/integration/pipelex/cli/test_validate_signatures_cli.py b/tests/integration/pipelex/cli/test_validate_signatures_cli.py
index f0b3cafff..0fe0452fb 100644
--- a/tests/integration/pipelex/cli/test_validate_signatures_cli.py
+++ b/tests/integration/pipelex/cli/test_validate_signatures_cli.py
@@ -9,8 +9,8 @@ import pytest
import typer
from pipelex.cli.commands.validate._validate_core import (
- _validate_pipe_or_bundle, # noqa: PLC2701 # pyright: ignore[reportPrivateUsage]
- do_validate_all_libraries_and_dry_run, # noqa: PLC2701
+ _validate_pipe_or_bundle, # pyright: ignore[reportPrivateUsage]
+ do_validate_all_libraries_and_dry_run,
)
if TYPE_CHECKING:
diff --git a/tests/integration/pipelex/cli/test_validate_signatures_summary.py b/tests/integration/pipelex/cli/test_validate_signatures_summary.py
index cd181fd7f..93d9d7aab 100644
--- a/tests/integration/pipelex/cli/test_validate_signatures_summary.py
+++ b/tests/integration/pipelex/cli/test_validate_signatures_summary.py
@@ -8,8 +8,8 @@ from typing import TYPE_CHECKING
import pytest
from pipelex.cli.commands.validate._validate_core import (
- _validate_pipe_or_bundle, # noqa: PLC2701 # pyright: ignore[reportPrivateUsage]
- do_validate_all_libraries_and_dry_run, # noqa: PLC2701
+ _validate_pipe_or_bundle, # pyright: ignore[reportPrivateUsage]
+ do_validate_all_libraries_and_dry_run,
)
if TYPE_CHECKING:
diff --git a/tests/integration/pipelex/codegen/test_emitted_python_typechecks.py b/tests/integration/pipelex/codegen/test_emitted_python_typechecks.py
index 2ec571cc7..f74a7d6c9 100644
--- a/tests/integration/pipelex/codegen/test_emitted_python_typechecks.py
+++ b/tests/integration/pipelex/codegen/test_emitted_python_typechecks.py
@@ -10,7 +10,7 @@ generated files and asserts zero errors, and (2) imports them so the classes are
import importlib.util
import json
-import subprocess # noqa: S404 -- runs the venv's own pyright on generated files with a fixed, trusted argv
+import subprocess # ruff: ignore[suspicious-subprocess-import] -- runs the venv's own pyright on generated files with a fixed, trusted argv
import sys
from pathlib import Path
@@ -67,7 +67,7 @@ def _run_strict_pyright(*, directory: Path) -> tuple[int, str]:
pyright = Path(sys.executable).parent / "pyright"
failures: list[str] = []
for attempt_index in range(2):
- completed = subprocess.run( # noqa: S603 -- fixed, trusted argv (the venv's pyright over a tmp dir)
+ completed = subprocess.run( # ruff: ignore[subprocess-without-shell-equals-true] -- fixed, trusted argv (the venv's pyright over a tmp dir)
[str(pyright), "--pythonpath", sys.executable, "--project", str(directory), "--outputjson"],
capture_output=True,
text=True,
diff --git a/tests/integration/pipelex/cogt/test_llm_gen_text.py b/tests/integration/pipelex/cogt/test_llm_gen_text.py
index bf547defc..598d1d81e 100644
--- a/tests/integration/pipelex/cogt/test_llm_gen_text.py
+++ b/tests/integration/pipelex/cogt/test_llm_gen_text.py
@@ -64,14 +64,14 @@ class TestLLMGenText:
pretty_print(generated_text)
@pytest.mark.parametrize(("topic", "prompt_text"), LLMTestCases.SINGLE_TEXT)
- async def test_gen_text_using_llm_preset(self, job_metadata: JobMetadata, llm_preset_id: str, topic: str, prompt_text: str): # noqa: ARG002
+ async def test_gen_text_using_llm_preset(self, job_metadata: JobMetadata, llm_preset_id: str, topic: str, prompt_text: str): # ruff: ignore[unused-method-argument]
llm_worker, llm_job = get_worker_and_job(llm_preset_id=llm_preset_id, user_text=prompt_text, job_metadata=job_metadata)
generated_text = await llm_worker.gen_text(llm_job=llm_job)
assert generated_text
pretty_print(generated_text)
@pytest.mark.parametrize(("topic", "prompt_text"), LLMTestCases.SINGLE_TEXT)
- async def test_gen_text_multiple_using_llm_preset(self, job_metadata: JobMetadata, llm_preset_id: str, topic: str, prompt_text: str): # noqa: ARG002
+ async def test_gen_text_multiple_using_llm_preset(self, job_metadata: JobMetadata, llm_preset_id: str, topic: str, prompt_text: str): # ruff: ignore[unused-method-argument]
llm_worker, llm_job = get_worker_and_job(llm_preset_id=llm_preset_id, user_text=prompt_text, job_metadata=job_metadata)
job_params_base = llm_job.job_params
max_tokens = 30
diff --git a/tests/integration/pipelex/cogt/test_llm_report.py b/tests/integration/pipelex/cogt/test_llm_report.py
index 98fc7d6f1..03502547b 100644
--- a/tests/integration/pipelex/cogt/test_llm_report.py
+++ b/tests/integration/pipelex/cogt/test_llm_report.py
@@ -16,7 +16,7 @@ from tests.integration.pipelex.cogt.test_data import LLMTestCases
@pytest.mark.asyncio(loop_scope="class")
class TestLLMReport:
@pytest.mark.parametrize(("topic", "prompt_text"), LLMTestCases.SINGLE_TEXT)
- async def test_llm_report_single(self, job_metadata: JobMetadata, llm_preset_id: str, topic: str, prompt_text: str): # noqa: ARG002
+ async def test_llm_report_single(self, job_metadata: JobMetadata, llm_preset_id: str, topic: str, prompt_text: str): # ruff: ignore[unused-method-argument]
llm_worker, llm_job = self._get_async_worker_and_job(llm_preset_id=llm_preset_id, prompt_text=prompt_text, job_metadata=job_metadata)
generated_text = await llm_worker.gen_text(llm_job=llm_job)
assert generated_text
diff --git a/tests/integration/pipelex/csv/test_csv_input_detection.py b/tests/integration/pipelex/csv/test_csv_input_detection.py
index 3761ee4de..b23f35cf1 100644
--- a/tests/integration/pipelex/csv/test_csv_input_detection.py
+++ b/tests/integration/pipelex/csv/test_csv_input_detection.py
@@ -18,7 +18,7 @@ from typing import TYPE_CHECKING, Any, cast
import pytest
-from pipelex.cli.commands.run._inputs_path_resolver import resolve_inputs_paths # noqa: PLC2701
+from pipelex.cli.commands.run._inputs_path_resolver import resolve_inputs_paths
from pipelex.core.memory.working_memory_factory import WorkingMemoryFactory
from pipelex.core.stuffs.list_content import ListContent
from pipelex.interpreter_hub import get_concept_library
diff --git a/tests/integration/pipelex/fixtures/model_selection.py b/tests/integration/pipelex/fixtures/model_selection.py
index 9f3b0ca76..ea973274c 100644
--- a/tests/integration/pipelex/fixtures/model_selection.py
+++ b/tests/integration/pipelex/fixtures/model_selection.py
@@ -11,7 +11,7 @@ from pathlib import Path
import pytest
-from tests.integration.pipelex.fixtures.model_combo import ModelCombo # noqa: TC001
+from tests.integration.pipelex.fixtures.model_combo import ModelCombo # ruff: ignore[typing-only-first-party-import]
# Path to generated fixtures file
GENERATED_FIXTURES_PATH = Path(__file__).parent / "_generated_model_sets.py"
@@ -51,8 +51,8 @@ def get_llm_combos() -> list[ModelCombo]:
FileNotFoundError: If the generated fixtures file does not exist.
"""
_ensure_generated_fixtures_exist()
- from tests.integration.pipelex.fixtures._generated_model_sets import ( # noqa: PLC0415
- LLM_COMBOS, # noqa: PLC2701
+ from tests.integration.pipelex.fixtures._generated_model_sets import ( # ruff: ignore[import-outside-top-level]
+ LLM_COMBOS,
)
return _or_skip(list(LLM_COMBOS), "LLM")
@@ -69,8 +69,8 @@ def get_img_gen_combos() -> list[ModelCombo]:
FileNotFoundError: If the generated fixtures file does not exist.
"""
_ensure_generated_fixtures_exist()
- from tests.integration.pipelex.fixtures._generated_model_sets import ( # noqa: PLC0415
- IMG_GEN_COMBOS, # noqa: PLC2701
+ from tests.integration.pipelex.fixtures._generated_model_sets import ( # ruff: ignore[import-outside-top-level]
+ IMG_GEN_COMBOS,
)
return _or_skip(list(IMG_GEN_COMBOS), "image generation")
@@ -87,8 +87,8 @@ def get_extract_combos() -> list[ModelCombo]:
FileNotFoundError: If the generated fixtures file does not exist.
"""
_ensure_generated_fixtures_exist()
- from tests.integration.pipelex.fixtures._generated_model_sets import ( # noqa: PLC0415
- EXTRACT_COMBOS, # noqa: PLC2701
+ from tests.integration.pipelex.fixtures._generated_model_sets import ( # ruff: ignore[import-outside-top-level]
+ EXTRACT_COMBOS,
)
return _or_skip(list(EXTRACT_COMBOS), "extraction")
@@ -105,8 +105,8 @@ def get_search_combos() -> list[ModelCombo]:
FileNotFoundError: If the generated fixtures file does not exist.
"""
_ensure_generated_fixtures_exist()
- from tests.integration.pipelex.fixtures._generated_model_sets import ( # noqa: PLC0415
- SEARCH_COMBOS, # noqa: PLC2701
+ from tests.integration.pipelex.fixtures._generated_model_sets import ( # ruff: ignore[import-outside-top-level]
+ SEARCH_COMBOS,
)
return _or_skip(list(SEARCH_COMBOS), "search")
diff --git a/tests/integration/pipelex/fixtures/pipe_job_helpers.py b/tests/integration/pipelex/fixtures/pipe_job_helpers.py
index a51e866ce..a5a3a84ca 100644
--- a/tests/integration/pipelex/fixtures/pipe_job_helpers.py
+++ b/tests/integration/pipelex/fixtures/pipe_job_helpers.py
@@ -86,8 +86,8 @@ def pipe_job_from_library(
library_manager = get_library_manager()
library_id, library = library_manager.open_library()
if isolated_registry:
- from kajson.class_registry import ClassRegistry # noqa: PLC0415
- from kajson.kajson_manager import KajsonManager # noqa: PLC0415
+ from kajson.class_registry import ClassRegistry # ruff: ignore[import-outside-top-level]
+ from kajson.kajson_manager import KajsonManager # ruff: ignore[import-outside-top-level]
# Pre-seed from global so core framework classes (PipeSequenceFactory, etc.)
# are available. Dynamic concept classes added during load_fn() will go to
diff --git a/tests/integration/pipelex/kit/test_sync_agent_rules_cleanup.py b/tests/integration/pipelex/kit/test_sync_agent_rules_cleanup.py
index c40e834e3..2853693af 100644
--- a/tests/integration/pipelex/kit/test_sync_agent_rules_cleanup.py
+++ b/tests/integration/pipelex/kit/test_sync_agent_rules_cleanup.py
@@ -30,7 +30,7 @@ class TestSyncAgentRulesCleanup:
fake_config.kit.preferred_agent_targets = [AgentTarget.CLAUDE, AgentTarget.AGENTS]
mocker.patch.object(kit_cmd, "get_config", return_value=fake_config)
- kit_cmd._sync_agent_rules( # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ kit_cmd._sync_agent_rules( # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
repo_root=repo_root,
agent_set="all",
cleanup=True,
diff --git a/tests/integration/pipelex/pipe_signature/test_pipe_signature.py b/tests/integration/pipelex/pipe_signature/test_pipe_signature.py
index 4defc9471..57d327c2c 100644
--- a/tests/integration/pipelex/pipe_signature/test_pipe_signature.py
+++ b/tests/integration/pipelex/pipe_signature/test_pipe_signature.py
@@ -144,7 +144,7 @@ class TestPipeSignature:
runtime = _make_runtime(blueprint, pipe_code="sig_live_fail")
working_memory = WorkingMemoryFactory.make_empty()
with pytest.raises(PipeSignatureNotExecutableError) as exc_info:
- await runtime._live_run_pipe( # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await runtime._live_run_pipe( # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
job_metadata=JobMetadata(
run_metadata=RunMetadata(storage_scope="test/scope", user_id=DRY_RUN_USER_ID, pipeline_run_id=SpecialPipelineId.UNTITLED)
),
diff --git a/tests/integration/pipelex/pipeline/test_pipeline_run_setup_characterization.py b/tests/integration/pipelex/pipeline/test_pipeline_run_setup_characterization.py
index f6199aabf..81f598f86 100644
--- a/tests/integration/pipelex/pipeline/test_pipeline_run_setup_characterization.py
+++ b/tests/integration/pipelex/pipeline/test_pipeline_run_setup_characterization.py
@@ -252,7 +252,7 @@ class TestPipelineRunSetupCharacterization:
# cleared it. Assert against THIS run's key rather than global emptiness — _event_log_contexts is a
# process-global singleton that sibling tests on the same xdist worker can populate.
if isinstance(delegate, ReportingManager):
- assert response.pipeline_run_id not in delegate._event_log_contexts # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ assert response.pipeline_run_id not in delegate._event_log_contexts # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
async def test_failure_after_acquire_restores_outer_current_library(self, load_empty_library: Callable[[], str]) -> None:
# acquire_library restores the outer current-library on its own load failure; the wrapper's
diff --git a/tests/integration/pipelex/pipeline/test_validate_bundle_source_threading.py b/tests/integration/pipelex/pipeline/test_validate_bundle_source_threading.py
index 1e2dfdd26..b129cbb36 100644
--- a/tests/integration/pipelex/pipeline/test_validate_bundle_source_threading.py
+++ b/tests/integration/pipelex/pipeline/test_validate_bundle_source_threading.py
@@ -25,7 +25,10 @@ from pytest_mock import MockerFixture
from pipelex.base_exceptions import PipelexUnexpectedError, ValidationErrorCategory, ValidationErrorItem
from pipelex.core.pipes.exceptions import PipeValidationError
from pipelex.pipeline.exceptions import ValidateBundleError
-from pipelex.pipeline.validate_bundle import _backfill_pipe_error_source, validate_bundle # noqa: PLC2701 # pyright: ignore[reportPrivateUsage]
+from pipelex.pipeline.validate_bundle import (
+ _backfill_pipe_error_source, # pyright: ignore[reportPrivateUsage]
+ validate_bundle,
+)
from pipelex.validation_error_types import PipeValidationErrorType
_VALID_MTHDS = """
diff --git a/tests/integration/pipelex/pipes/operator/pipe_img_gen/test_pipe_img_gen_run.py b/tests/integration/pipelex/pipes/operator/pipe_img_gen/test_pipe_img_gen_run.py
index ec3a79d56..e023a1d5a 100644
--- a/tests/integration/pipelex/pipes/operator/pipe_img_gen/test_pipe_img_gen_run.py
+++ b/tests/integration/pipelex/pipes/operator/pipe_img_gen/test_pipe_img_gen_run.py
@@ -28,7 +28,7 @@ class TestPipeImgGenRun:
job_metadata: JobMetadata,
pipe_run_mode: PipeRunMode,
img_gen_combo: ModelCombo,
- topic: str, # noqa: ARG002
+ topic: str, # ruff: ignore[unused-method-argument]
prompt: str,
negative_prompt: str | None,
load_empty_library: Callable[[], None],
@@ -61,7 +61,7 @@ class TestPipeImgGenRun:
job_metadata: JobMetadata,
pipe_run_mode: PipeRunMode,
img_gen_combo: ModelCombo,
- topic: str, # noqa: ARG002
+ topic: str, # ruff: ignore[unused-method-argument]
image_desc: str,
negative_prompt: str | None,
load_empty_library: Callable[[], None],
diff --git a/tests/integration/pipelex/system/pipelex_service/test_offline_baseline.py b/tests/integration/pipelex/system/pipelex_service/test_offline_baseline.py
index 2cffb8048..1ef97b27e 100644
--- a/tests/integration/pipelex/system/pipelex_service/test_offline_baseline.py
+++ b/tests/integration/pipelex/system/pipelex_service/test_offline_baseline.py
@@ -9,7 +9,7 @@ These tests describe the behaviour that must NOT regress:
from __future__ import annotations
-from pathlib import Path # noqa: TC003 — referenced by pytest fixture type hints at runtime
+from pathlib import Path # ruff: ignore[typing-only-standard-library-import] — referenced by pytest fixture type hints at runtime
from typing import TYPE_CHECKING
import httpx
diff --git a/tests/integration/pipelex/system/pipelex_service/test_remote_config_fetcher.py b/tests/integration/pipelex/system/pipelex_service/test_remote_config_fetcher.py
index fda256312..f8b8c4793 100644
--- a/tests/integration/pipelex/system/pipelex_service/test_remote_config_fetcher.py
+++ b/tests/integration/pipelex/system/pipelex_service/test_remote_config_fetcher.py
@@ -14,7 +14,7 @@ These tests pin the post-refactor semantics:
from __future__ import annotations
import json
-from pathlib import Path # noqa: TC003 — referenced by pytest fixture type hints at runtime
+from pathlib import Path # ruff: ignore[typing-only-standard-library-import] — referenced by pytest fixture type hints at runtime
from typing import TYPE_CHECKING, Any
import httpx
diff --git a/tests/integration/pipelex/system/pipelex_service/test_setup_with_cache.py b/tests/integration/pipelex/system/pipelex_service/test_setup_with_cache.py
index 50cb15d7e..ef900f5ac 100644
--- a/tests/integration/pipelex/system/pipelex_service/test_setup_with_cache.py
+++ b/tests/integration/pipelex/system/pipelex_service/test_setup_with_cache.py
@@ -17,7 +17,7 @@ from __future__ import annotations
import warnings
from datetime import UTC, datetime
-from pathlib import Path # noqa: TC003 — referenced by pytest fixture type hints at runtime
+from pathlib import Path # ruff: ignore[typing-only-standard-library-import] — referenced by pytest fixture type hints at runtime
from typing import TYPE_CHECKING
import httpx
diff --git a/tests/integration/pipelex/test_extras/test_mthds_corpus_packaging.py b/tests/integration/pipelex/test_extras/test_mthds_corpus_packaging.py
index 3508b6d1f..8346fd8f9 100644
--- a/tests/integration/pipelex/test_extras/test_mthds_corpus_packaging.py
+++ b/tests/integration/pipelex/test_extras/test_mthds_corpus_packaging.py
@@ -18,7 +18,7 @@ silent pass. It runs in GitHub Actions, which is where a packaging regression ha
"""
import shutil
-import subprocess # noqa: S404 — builds the real wheel; inspecting a hand-rolled file list would prove nothing
+import subprocess # ruff: ignore[suspicious-subprocess-import] — builds the real wheel; inspecting a hand-rolled file list would prove nothing
import zipfile
from pathlib import Path
@@ -40,7 +40,7 @@ class TestMthdsCorpusPackaging:
# packaging gate that quietly passes when it could not build anything is worse than no gate.
assert uv_path is not None, "uv is not on PATH, so the wheel cannot be built and the packaging gate cannot run"
- build = subprocess.run( # noqa: S603
+ build = subprocess.run( # ruff: ignore[subprocess-without-shell-equals-true]
[uv_path, "build", "--wheel", "--out-dir", str(tmp_path)],
cwd=str(_REPO_ROOT),
capture_output=True,
diff --git a/tests/integration/pipelex/tools/storage/conftest.py b/tests/integration/pipelex/tools/storage/conftest.py
index e0dd0de2d..9af40af8f 100644
--- a/tests/integration/pipelex/tools/storage/conftest.py
+++ b/tests/integration/pipelex/tools/storage/conftest.py
@@ -52,20 +52,20 @@ def s3_mock(mocker: MockerFixture) -> dict[str, Any]:
mock_exceptions.NoSuchBucket = type("NoSuchBucket", (Exception,), {})
mock_exceptions.ClientError = type("ClientError", (Exception,), {})
- def mock_get_object(Bucket: str, Key: str) -> dict[str, Any]: # noqa: ARG001, N803
+ def mock_get_object(Bucket: str, Key: str) -> dict[str, Any]: # ruff: ignore[unused-function-argument, invalid-argument-name]
if Key not in mock_data_storage:
msg = f"Key {Key} not found"
raise mock_exceptions.NoSuchKey(msg)
return {"Body": create_mock_stream(Key)}
- def mock_put_object(Bucket: str, Key: str, Body: bytes, **kwargs: Any) -> dict[str, Any]: # noqa: ARG001, N803
+ def mock_put_object(Bucket: str, Key: str, Body: bytes, **kwargs: Any) -> dict[str, Any]: # ruff: ignore[unused-function-argument, invalid-argument-name]
mock_data_storage[Key] = Body
return {}
def mock_generate_presigned_url(
- method: str, # noqa: ARG001
- Params: dict[str, str], # noqa: N803
- ExpiresIn: int, # noqa: ARG001, N803
+ method: str, # ruff: ignore[unused-function-argument]
+ Params: dict[str, str], # ruff: ignore[invalid-argument-name]
+ ExpiresIn: int, # ruff: ignore[unused-function-argument, invalid-argument-name]
) -> str:
key = Params.get("Key", "")
return f"https://{S3_TEST_BUCKET}.s3.{S3_TEST_REGION}.amazonaws.com/{key}?X-Amz-Signature=mock"
@@ -103,7 +103,7 @@ def gcp_mock(tmp_path: Path, mocker: MockerFixture) -> dict[str, Any]:
Creates a mock that simulates GCS behavior using an in-memory dict.
"""
# Import the module first so it can be patched
- from google.cloud import storage # type: ignore[import-untyped] # noqa: PLC0415
+ from google.cloud import storage # type: ignore[import-untyped] # ruff: ignore[import-outside-top-level]
# Create mock credentials file
credentials_path = tmp_path / "gcp_credentials.json"
@@ -117,7 +117,7 @@ def gcp_mock(tmp_path: Path, mocker: MockerFixture) -> dict[str, Any]:
blob: MockType = mocker.MagicMock()
blob.exists.side_effect = lambda: key in mock_data_storage
blob.download_as_bytes.side_effect = lambda: mock_data_storage[key]
- blob.upload_from_string.side_effect = lambda data, content_type=None: mock_data_storage.__setitem__(key, data) # noqa: ARG005 # pyright: ignore[reportUnknownLambdaType,reportUnknownArgumentType]
+ blob.upload_from_string.side_effect = lambda data, content_type=None: mock_data_storage.__setitem__(key, data) # ruff: ignore[unused-lambda-argument] # pyright: ignore[reportUnknownLambdaType,reportUnknownArgumentType]
blob.generate_signed_url.return_value = f"https://storage.googleapis.com/{GCP_TEST_BUCKET}/{key}?signed=true"
return blob
diff --git a/tests/unit/pipelex/builder/pipe/pipe_controller/pipe_batch/test_pipe_batch.py b/tests/unit/pipelex/builder/pipe/pipe_controller/pipe_batch/test_pipe_batch.py
index 8b05c0291..ebec38bd7 100644
--- a/tests/unit/pipelex/builder/pipe/pipe_controller/pipe_batch/test_pipe_batch.py
+++ b/tests/unit/pipelex/builder/pipe/pipe_controller/pipe_batch/test_pipe_batch.py
@@ -13,7 +13,7 @@ class TestPipeBatchBlueprintConversion:
)
def test_pipe_batch_spec_to_blueprint(
self,
- test_name: str, # noqa: ARG002
+ test_name: str, # ruff: ignore[unused-method-argument]
pipe_spec: PipeBatchSpec,
expected_blueprint: PipeBatchBlueprint,
):
diff --git a/tests/unit/pipelex/builder/pipe/pipe_controller/pipe_condition/test_pipe_condition.py b/tests/unit/pipelex/builder/pipe/pipe_controller/pipe_condition/test_pipe_condition.py
index 4fece994d..82a301cf4 100644
--- a/tests/unit/pipelex/builder/pipe/pipe_controller/pipe_condition/test_pipe_condition.py
+++ b/tests/unit/pipelex/builder/pipe/pipe_controller/pipe_condition/test_pipe_condition.py
@@ -12,7 +12,7 @@ class TestPipeConditionBlueprintConversion:
)
def test_pipe_condition_spec_to_blueprint(
self,
- test_name: str, # noqa: ARG002
+ test_name: str, # ruff: ignore[unused-method-argument]
pipe_spec: PipeConditionSpec,
expected_blueprint: PipeConditionBlueprint,
):
diff --git a/tests/unit/pipelex/builder/pipe/pipe_controller/pipe_parallel/test_data.py b/tests/unit/pipelex/builder/pipe/pipe_controller/pipe_parallel/test_data.py
index b8aac68fb..358b972e7 100644
--- a/tests/unit/pipelex/builder/pipe/pipe_controller/pipe_parallel/test_data.py
+++ b/tests/unit/pipelex/builder/pipe/pipe_controller/pipe_parallel/test_data.py
@@ -31,7 +31,7 @@ class PipeParallelTestCases:
SubPipeBlueprint(pipe="validate_data", result="validation"),
],
add_each_output=True,
- source="tests/unit/pipelex/libraries/pipelines/builder/pipe/pipe_controllers/pipe_parallel/test_data.py PipeParallelTestCases.PARALLEL_WITH_EACH_OUTPUT", # noqa: E501
+ source="tests/unit/pipelex/libraries/pipelines/builder/pipe/pipe_controllers/pipe_parallel/test_data.py PipeParallelTestCases.PARALLEL_WITH_EACH_OUTPUT", # ruff: ignore[line-too-long]
),
)
@@ -57,7 +57,7 @@ class PipeParallelTestCases:
SubPipeBlueprint(pipe="pipe2", result="result2"),
],
add_each_output=False,
- source="tests/unit/pipelex/libraries/pipelines/builder/pipe/pipe_controllers/pipe_parallel/test_data.py PipeParallelTestCases.PARALLEL_WITHOUT_EACH_OUTPUT", # noqa: E501
+ source="tests/unit/pipelex/libraries/pipelines/builder/pipe/pipe_controllers/pipe_parallel/test_data.py PipeParallelTestCases.PARALLEL_WITHOUT_EACH_OUTPUT", # ruff: ignore[line-too-long]
),
)
@@ -82,7 +82,7 @@ class PipeParallelTestCases:
SubPipeBlueprint(pipe="pipe2", result="result2"),
],
add_each_output=False,
- source="tests/unit/pipelex/libraries/pipelines/builder/pipe/pipe_controllers/pipe_parallel/test_data.py PipeParallelTestCases.PARALLEL_OMITTING_ADD_EACH_OUTPUT", # noqa: E501
+ source="tests/unit/pipelex/libraries/pipelines/builder/pipe/pipe_controllers/pipe_parallel/test_data.py PipeParallelTestCases.PARALLEL_OMITTING_ADD_EACH_OUTPUT", # ruff: ignore[line-too-long]
),
)
diff --git a/tests/unit/pipelex/builder/pipe/pipe_controller/pipe_sequence/test_pipe_sequence.py b/tests/unit/pipelex/builder/pipe/pipe_controller/pipe_sequence/test_pipe_sequence.py
index 6cd1fee7e..3f80e9c2f 100644
--- a/tests/unit/pipelex/builder/pipe/pipe_controller/pipe_sequence/test_pipe_sequence.py
+++ b/tests/unit/pipelex/builder/pipe/pipe_controller/pipe_sequence/test_pipe_sequence.py
@@ -12,7 +12,7 @@ class TestPipeSequenceBlueprintConversion:
)
def test_pipe_sequence_spec_to_blueprint(
self,
- test_name: str, # noqa: ARG002
+ test_name: str, # ruff: ignore[unused-method-argument]
pipe_spec: PipeSequenceSpec,
expected_blueprint: PipeSequenceBlueprint,
):
diff --git a/tests/unit/pipelex/builder/pipe/pipe_operator/pipe_func/test_pipe_func.py b/tests/unit/pipelex/builder/pipe/pipe_operator/pipe_func/test_pipe_func.py
index 59496b93f..0efcb5745 100644
--- a/tests/unit/pipelex/builder/pipe/pipe_operator/pipe_func/test_pipe_func.py
+++ b/tests/unit/pipelex/builder/pipe/pipe_operator/pipe_func/test_pipe_func.py
@@ -12,7 +12,7 @@ class TestPipeFuncBlueprintConversion:
)
def test_pipe_func_spec_to_blueprint(
self,
- test_name: str, # noqa: ARG002
+ test_name: str, # ruff: ignore[unused-method-argument]
pipe_spec: PipeFuncSpec,
expected_blueprint: PipeFuncBlueprint,
):
diff --git a/tests/unit/pipelex/builder/pipe/pipe_operator/pipe_img_gen/test_pipe_img_gen.py b/tests/unit/pipelex/builder/pipe/pipe_operator/pipe_img_gen/test_pipe_img_gen.py
index e29dbf9d2..4626ca9b3 100644
--- a/tests/unit/pipelex/builder/pipe/pipe_operator/pipe_img_gen/test_pipe_img_gen.py
+++ b/tests/unit/pipelex/builder/pipe/pipe_operator/pipe_img_gen/test_pipe_img_gen.py
@@ -12,7 +12,7 @@ class TestPipeImgGenBlueprintConversion:
)
def test_pipe_img_gen_spec_to_blueprint(
self,
- test_name: str, # noqa: ARG002
+ test_name: str, # ruff: ignore[unused-method-argument]
pipe_spec: PipeImgGenSpec,
expected_blueprint: PipeImgGenBlueprint,
):
diff --git a/tests/unit/pipelex/builder/pipe/test_inputs_blueprint.py b/tests/unit/pipelex/builder/pipe/test_inputs_blueprint.py
index 57fcba7a7..ad9f50692 100644
--- a/tests/unit/pipelex/builder/pipe/test_inputs_blueprint.py
+++ b/tests/unit/pipelex/builder/pipe/test_inputs_blueprint.py
@@ -10,7 +10,7 @@ class TestInputRequirementBlueprintConversion:
)
def test_input_requirement_spec_to_string(
self,
- test_name: str, # noqa: ARG002
+ test_name: str, # ruff: ignore[unused-method-argument]
input_spec: str,
expected_string: str,
):
diff --git a/tests/unit/pipelex/builder/pipe/test_pipe_blueprint.py b/tests/unit/pipelex/builder/pipe/test_pipe_blueprint.py
index 755510930..4028fbaca 100644
--- a/tests/unit/pipelex/builder/pipe/test_pipe_blueprint.py
+++ b/tests/unit/pipelex/builder/pipe/test_pipe_blueprint.py
@@ -12,7 +12,7 @@ class TestPipeBlueprintConversion:
)
def test_pipe_blueprint_to_core(
self,
- test_name: str, # noqa: ARG002
+ test_name: str, # ruff: ignore[unused-method-argument]
pipe_spec: PipeSpec,
expected_blueprint: PipeBlueprint,
):
diff --git a/tests/unit/pipelex/builder/pipe/test_sub_pipe_blueprint.py b/tests/unit/pipelex/builder/pipe/test_sub_pipe_blueprint.py
index 5b21da5fb..f4d5b2e31 100644
--- a/tests/unit/pipelex/builder/pipe/test_sub_pipe_blueprint.py
+++ b/tests/unit/pipelex/builder/pipe/test_sub_pipe_blueprint.py
@@ -10,6 +10,6 @@ class TestSubPipeBlueprintConversion:
("test_name", "sub_pipe_spec", "expected_blueprint"),
SubPipeTestCases.TEST_CASES,
)
- def test_sub_pipe_to_core(self, test_name: str, sub_pipe_spec: SubPipeSpec, expected_blueprint: SubPipeBlueprint): # noqa: ARG002
+ def test_sub_pipe_to_core(self, test_name: str, sub_pipe_spec: SubPipeSpec, expected_blueprint: SubPipeBlueprint): # ruff: ignore[unused-method-argument]
result = sub_pipe_spec.to_blueprint()
assert result == expected_blueprint
diff --git a/tests/unit/pipelex/cli/agent_cli/commands/test_plxt_passthrough.py b/tests/unit/pipelex/cli/agent_cli/commands/test_plxt_passthrough.py
index 358fdc166..1a076bb3c 100644
--- a/tests/unit/pipelex/cli/agent_cli/commands/test_plxt_passthrough.py
+++ b/tests/unit/pipelex/cli/agent_cli/commands/test_plxt_passthrough.py
@@ -3,7 +3,7 @@
from __future__ import annotations
import json
-import subprocess # noqa: S404
+import subprocess # ruff: ignore[suspicious-subprocess-import]
from typing import TYPE_CHECKING
import pytest
@@ -60,7 +60,7 @@ class TestPlxtPassthrough:
def test_run_plxt_propagates_exit_code(
self,
mocker: MockerFixture,
- topic: str, # noqa: ARG002
+ topic: str, # ruff: ignore[unused-method-argument]
exit_code: int,
) -> None:
"""run_plxt propagates the subprocess exit code via typer.Exit."""
diff --git a/tests/unit/pipelex/cli/agent_cli/test_inputs_template_format_toml.py b/tests/unit/pipelex/cli/agent_cli/test_inputs_template_format_toml.py
index b953480c8..9c97d1499 100644
--- a/tests/unit/pipelex/cli/agent_cli/test_inputs_template_format_toml.py
+++ b/tests/unit/pipelex/cli/agent_cli/test_inputs_template_format_toml.py
@@ -7,7 +7,7 @@ from typing import TYPE_CHECKING, Any
import tomli
-from pipelex.cli.agent_cli.commands.inputs._inputs_core import emit_inputs_result # noqa: PLC2701
+from pipelex.cli.agent_cli.commands.inputs._inputs_core import emit_inputs_result
from pipelex.cli.agent_cli.commands.inputs.pipe_cmd import inputs_pipe_cmd
from pipelex.core.pipes.inputs.exceptions import NoInputsRequiredError
from pipelex.pipe_machinery.rendering.input_renderer import InputsTemplateFormat
diff --git a/tests/unit/pipelex/cli/agent_cli/test_run_core_absent_output.py b/tests/unit/pipelex/cli/agent_cli/test_run_core_absent_output.py
index b6cee7ee3..5b19985e6 100644
--- a/tests/unit/pipelex/cli/agent_cli/test_run_core_absent_output.py
+++ b/tests/unit/pipelex/cli/agent_cli/test_run_core_absent_output.py
@@ -10,8 +10,10 @@ import json
from types import SimpleNamespace
from typing import TYPE_CHECKING, Any
-from pipelex.cli.agent_cli.commands.run._output_helpers import format_run_markdown # noqa: PLC2701 # pyright: ignore[reportPrivateUsage]
-from pipelex.cli.agent_cli.commands.run._run_core import run_pipeline_core # noqa: PLC2701 # pyright: ignore[reportPrivateUsage]
+from pipelex.cli.agent_cli.commands.run._output_helpers import (
+ format_run_markdown, # pyright: ignore[reportPrivateUsage]
+)
+from pipelex.cli.agent_cli.commands.run._run_core import run_pipeline_core # pyright: ignore[reportPrivateUsage]
from pipelex.core.memory.absence import AbsenceKind, AbsenceRecord
from pipelex.core.memory.working_memory import WorkingMemory
diff --git a/tests/unit/pipelex/cli/agent_cli/test_run_core_inputs_base_dir.py b/tests/unit/pipelex/cli/agent_cli/test_run_core_inputs_base_dir.py
index a3cfef24e..127daabd6 100644
--- a/tests/unit/pipelex/cli/agent_cli/test_run_core_inputs_base_dir.py
+++ b/tests/unit/pipelex/cli/agent_cli/test_run_core_inputs_base_dir.py
@@ -11,7 +11,7 @@ from typing import TYPE_CHECKING, Any
import pytest
from pipelex.base_exceptions import PipelexError
-from pipelex.cli.agent_cli.commands.run._run_core import run_pipeline_core # noqa: PLC2701 # pyright: ignore[reportPrivateUsage]
+from pipelex.cli.agent_cli.commands.run._run_core import run_pipeline_core # pyright: ignore[reportPrivateUsage]
if TYPE_CHECKING:
from pathlib import Path
diff --git a/tests/unit/pipelex/cli/agent_cli/test_validate_bundle_error_format.py b/tests/unit/pipelex/cli/agent_cli/test_validate_bundle_error_format.py
index f31266cdc..58e932311 100644
--- a/tests/unit/pipelex/cli/agent_cli/test_validate_bundle_error_format.py
+++ b/tests/unit/pipelex/cli/agent_cli/test_validate_bundle_error_format.py
@@ -15,7 +15,7 @@ import typer
from pipelex.base_exceptions import ValidationErrorCategory, ValidationErrorItem
from pipelex.cli.agent_cli.commands.agent_output import (
CliOutputFormat,
- _render_validate_bundle_markdown, # noqa: PLC2701 # pyright: ignore[reportPrivateUsage]
+ _render_validate_bundle_markdown, # pyright: ignore[reportPrivateUsage]
agent_error_validate_bundle,
set_agent_cli_error_format,
)
diff --git a/tests/unit/pipelex/cli/commands/build/test_inputs_core.py b/tests/unit/pipelex/cli/commands/build/test_inputs_core.py
index ffcec7f72..97c827665 100644
--- a/tests/unit/pipelex/cli/commands/build/test_inputs_core.py
+++ b/tests/unit/pipelex/cli/commands/build/test_inputs_core.py
@@ -9,7 +9,9 @@ from typing import TYPE_CHECKING, Any
import pytest
import typer
-from pipelex.cli.commands.build.inputs._inputs_core import _generate_inputs_core # noqa: PLC2701 # pyright: ignore[reportPrivateUsage]
+from pipelex.cli.commands.build.inputs._inputs_core import (
+ _generate_inputs_core, # pyright: ignore[reportPrivateUsage]
+)
from pipelex.core.pipes.inputs.exceptions import NoInputsRequiredError
from pipelex.pipeline.exceptions import ValidateBundleError
diff --git a/tests/unit/pipelex/cli/commands/build/test_inputs_core_toml.py b/tests/unit/pipelex/cli/commands/build/test_inputs_core_toml.py
index 49908a658..21081417d 100644
--- a/tests/unit/pipelex/cli/commands/build/test_inputs_core_toml.py
+++ b/tests/unit/pipelex/cli/commands/build/test_inputs_core_toml.py
@@ -8,7 +8,9 @@ from typing import TYPE_CHECKING, Any
import pytest
-from pipelex.cli.commands.build.inputs._inputs_core import _generate_inputs_core # noqa: PLC2701 # pyright: ignore[reportPrivateUsage]
+from pipelex.cli.commands.build.inputs._inputs_core import (
+ _generate_inputs_core, # pyright: ignore[reportPrivateUsage]
+)
from pipelex.pipe_machinery.rendering.input_renderer import InputsTemplateFormat
if TYPE_CHECKING:
diff --git a/tests/unit/pipelex/cli/commands/build/test_output_core.py b/tests/unit/pipelex/cli/commands/build/test_output_core.py
index 1e5811756..33416f442 100644
--- a/tests/unit/pipelex/cli/commands/build/test_output_core.py
+++ b/tests/unit/pipelex/cli/commands/build/test_output_core.py
@@ -9,7 +9,9 @@ from typing import TYPE_CHECKING, Any
import pytest
import typer
-from pipelex.cli.commands.build.output._output_core import _generate_output_core # noqa: PLC2701 # pyright: ignore[reportPrivateUsage]
+from pipelex.cli.commands.build.output._output_core import (
+ _generate_output_core, # pyright: ignore[reportPrivateUsage]
+)
from pipelex.core.concepts.concept_representation_generator import ConceptRepresentationFormat
from pipelex.pipeline.exceptions import ValidateBundleError
diff --git a/tests/unit/pipelex/cli/commands/build/test_runner_core.py b/tests/unit/pipelex/cli/commands/build/test_runner_core.py
index c5b4bb54d..6745e28e6 100644
--- a/tests/unit/pipelex/cli/commands/build/test_runner_core.py
+++ b/tests/unit/pipelex/cli/commands/build/test_runner_core.py
@@ -14,7 +14,9 @@ from typing import TYPE_CHECKING, Any
import pytest
import typer
-from pipelex.cli.commands.build.runner._runner_core import _prepare_runner_core # noqa: PLC2701 # pyright: ignore[reportPrivateUsage]
+from pipelex.cli.commands.build.runner._runner_core import (
+ _prepare_runner_core, # pyright: ignore[reportPrivateUsage]
+)
from pipelex.pipeline.exceptions import ValidateBundleError
if TYPE_CHECKING:
diff --git a/tests/unit/pipelex/cli/commands/fix/test_diff_sandbox.py b/tests/unit/pipelex/cli/commands/fix/test_diff_sandbox.py
index a700fc2ea..4495976a4 100644
--- a/tests/unit/pipelex/cli/commands/fix/test_diff_sandbox.py
+++ b/tests/unit/pipelex/cli/commands/fix/test_diff_sandbox.py
@@ -4,7 +4,7 @@ from __future__ import annotations
from typing import TYPE_CHECKING
-from pipelex.cli.commands.fix._diff_sandbox import mirror_bundle_for_preview # noqa: PLC2701
+from pipelex.cli.commands.fix._diff_sandbox import mirror_bundle_for_preview
if TYPE_CHECKING:
from pathlib import Path
diff --git a/tests/unit/pipelex/cli/commands/fix/test_fix_bundle_human_format.py b/tests/unit/pipelex/cli/commands/fix/test_fix_bundle_human_format.py
index cbb668f5e..149350608 100644
--- a/tests/unit/pipelex/cli/commands/fix/test_fix_bundle_human_format.py
+++ b/tests/unit/pipelex/cli/commands/fix/test_fix_bundle_human_format.py
@@ -14,8 +14,8 @@ import typer
from rich.console import Console
from pipelex.base_exceptions import ValidationErrorCategory, ValidationErrorItem
-from pipelex.cli.commands.fix._diff_sandbox import PreviewSandbox # noqa: PLC2701
-from pipelex.cli.commands.fix._fix_core import _remap_result_to_originals # pyright: ignore[reportPrivateUsage] # noqa: PLC2701
+from pipelex.cli.commands.fix._diff_sandbox import PreviewSandbox
+from pipelex.cli.commands.fix._fix_core import _remap_result_to_originals # pyright: ignore[reportPrivateUsage]
from pipelex.cli.commands.fix.bundle_cmd import fix_bundle_cmd
from pipelex.pipeline.fixes.fix_loop import FixBundleResult
from pipelex.suggested_fix import FixSafety, SuggestedFix
diff --git a/tests/unit/pipelex/cli/commands/run/test_inputs_arg_resolution.py b/tests/unit/pipelex/cli/commands/run/test_inputs_arg_resolution.py
index ada5a8915..9a0d26db1 100644
--- a/tests/unit/pipelex/cli/commands/run/test_inputs_arg_resolution.py
+++ b/tests/unit/pipelex/cli/commands/run/test_inputs_arg_resolution.py
@@ -4,7 +4,9 @@ from __future__ import annotations
from pathlib import Path
-from pipelex.cli.commands.run._inputs_file_loader import resolve_inputs_arg_against_dir # noqa: PLC2701 # pyright: ignore[reportPrivateUsage]
+from pipelex.cli.commands.run._inputs_file_loader import (
+ resolve_inputs_arg_against_dir, # pyright: ignore[reportPrivateUsage]
+)
class TestResolveInputsArgAgainstDir:
diff --git a/tests/unit/pipelex/cli/commands/run/test_inputs_file_loader.py b/tests/unit/pipelex/cli/commands/run/test_inputs_file_loader.py
index 80ebbf076..9d0ae12c8 100644
--- a/tests/unit/pipelex/cli/commands/run/test_inputs_file_loader.py
+++ b/tests/unit/pipelex/cli/commands/run/test_inputs_file_loader.py
@@ -8,7 +8,9 @@ from typing import TYPE_CHECKING
import pytest
-from pipelex.cli.commands.run._inputs_file_loader import load_inputs_dict_from_path # noqa: PLC2701 # pyright: ignore[reportPrivateUsage]
+from pipelex.cli.commands.run._inputs_file_loader import (
+ load_inputs_dict_from_path, # pyright: ignore[reportPrivateUsage]
+)
from pipelex.core.stuffs.date_content import DateContent
from pipelex.core.stuffs.time_content import TimeContent
from pipelex.tools.misc.exceptions import JsonTypeError, TomlError
diff --git a/tests/unit/pipelex/cli/commands/run/test_inputs_file_probe.py b/tests/unit/pipelex/cli/commands/run/test_inputs_file_probe.py
index 733785804..e7c23c4ef 100644
--- a/tests/unit/pipelex/cli/commands/run/test_inputs_file_probe.py
+++ b/tests/unit/pipelex/cli/commands/run/test_inputs_file_probe.py
@@ -6,7 +6,9 @@ from typing import TYPE_CHECKING
import pytest
-from pipelex.cli.commands.run._inputs_file_loader import find_default_inputs_file # noqa: PLC2701 # pyright: ignore[reportPrivateUsage]
+from pipelex.cli.commands.run._inputs_file_loader import (
+ find_default_inputs_file, # pyright: ignore[reportPrivateUsage]
+)
from pipelex.cli.commands.run.exceptions import AmbiguousInputsFilesError
if TYPE_CHECKING:
diff --git a/tests/unit/pipelex/cli/commands/run/test_inputs_template_roundtrip.py b/tests/unit/pipelex/cli/commands/run/test_inputs_template_roundtrip.py
index c54dc34cd..f74a9f134 100644
--- a/tests/unit/pipelex/cli/commands/run/test_inputs_template_roundtrip.py
+++ b/tests/unit/pipelex/cli/commands/run/test_inputs_template_roundtrip.py
@@ -12,7 +12,9 @@ from __future__ import annotations
import json
from typing import TYPE_CHECKING
-from pipelex.cli.commands.run._inputs_file_loader import load_inputs_dict_from_path # noqa: PLC2701 # pyright: ignore[reportPrivateUsage]
+from pipelex.cli.commands.run._inputs_file_loader import (
+ load_inputs_dict_from_path, # pyright: ignore[reportPrivateUsage]
+)
from pipelex.pipe_machinery.rendering.input_renderer import serialize_inputs_template_to_toml
if TYPE_CHECKING:
diff --git a/tests/unit/pipelex/cli/dev/conftest.py b/tests/unit/pipelex/cli/dev/conftest.py
index 6e4b8f5ac..7d18df76a 100644
--- a/tests/unit/pipelex/cli/dev/conftest.py
+++ b/tests/unit/pipelex/cli/dev/conftest.py
@@ -2,7 +2,7 @@
from __future__ import annotations
-import subprocess # noqa: S404
+import subprocess # ruff: ignore[suspicious-subprocess-import]
from typing import TYPE_CHECKING
import pytest
@@ -21,8 +21,8 @@ class GitRepo:
self.root = root
def git(self, *args: str) -> str:
- result = subprocess.run( # noqa: S603
- ["git", *args], # noqa: S607
+ result = subprocess.run( # ruff: ignore[subprocess-without-shell-equals-true]
+ ["git", *args], # ruff: ignore[start-process-with-partial-path]
cwd=self.root,
capture_output=True,
text=True,
diff --git a/tests/unit/pipelex/cli/dev/test_drift_git_adapter.py b/tests/unit/pipelex/cli/dev/test_drift_git_adapter.py
index 4ff0e0481..54e5f5ae3 100644
--- a/tests/unit/pipelex/cli/dev/test_drift_git_adapter.py
+++ b/tests/unit/pipelex/cli/dev/test_drift_git_adapter.py
@@ -2,7 +2,7 @@
from __future__ import annotations
-import subprocess # noqa: S404
+import subprocess # ruff: ignore[suspicious-subprocess-import]
from typing import TYPE_CHECKING
import pytest
diff --git a/tests/unit/pipelex/cli/dev/test_preprocess_test_models_cmd.py b/tests/unit/pipelex/cli/dev/test_preprocess_test_models_cmd.py
index e73f30afe..435f984b1 100644
--- a/tests/unit/pipelex/cli/dev/test_preprocess_test_models_cmd.py
+++ b/tests/unit/pipelex/cli/dev/test_preprocess_test_models_cmd.py
@@ -4,7 +4,7 @@ import pytest
from pytest_mock import MockerFixture
from pipelex.cli.dev_cli.commands.preprocess_test_models_cmd import (
- _fetch_gateway_models, # noqa: PLC2701 # pyright: ignore[reportPrivateUsage]
+ _fetch_gateway_models, # pyright: ignore[reportPrivateUsage]
)
from pipelex.system.pipelex_service.exceptions import RemoteConfigUnavailableError, RemoteConfigValidationError
from pipelex.system.pipelex_service.remote_config_fetcher import RemoteConfigFetcher
diff --git a/tests/unit/pipelex/cli/dev/test_refresh_graph_ui_sri.py b/tests/unit/pipelex/cli/dev/test_refresh_graph_ui_sri.py
index 23d1edd7a..63c6c845a 100644
--- a/tests/unit/pipelex/cli/dev/test_refresh_graph_ui_sri.py
+++ b/tests/unit/pipelex/cli/dev/test_refresh_graph_ui_sri.py
@@ -9,7 +9,7 @@ import pytest
from pytest_mock import MockerFixture
from pipelex.cli.dev_cli.commands.refresh_graph_ui_sri_cmd import (
- _validate_sri, # noqa: PLC2701 # pyright: ignore[reportPrivateUsage]
+ _validate_sri, # pyright: ignore[reportPrivateUsage]
refresh_graph_ui_sri_cmd,
)
from pipelex.cli.exceptions import PipelexCLIError
@@ -31,7 +31,7 @@ class TestRefreshGraphUiSri:
"https://cdn.jsdelivr.net/npm/[email protected]/lib/elk.bundled.js": self._ELKJS_BYTES,
}
- def fake_urlopen(url: str, timeout: float = 30.0): # noqa: ARG001
+ def fake_urlopen(url: str, timeout: float = 30.0): # ruff: ignore[unused-function-argument]
return io.BytesIO(payloads[url])
mocker.patch("pipelex.cli.dev_cli.commands.refresh_graph_ui_sri_cmd.urlopen", side_effect=fake_urlopen)
diff --git a/tests/unit/pipelex/cli/dev/test_store_test_durations_cmd.py b/tests/unit/pipelex/cli/dev/test_store_test_durations_cmd.py
index 8241a97a9..515f87a6c 100644
--- a/tests/unit/pipelex/cli/dev/test_store_test_durations_cmd.py
+++ b/tests/unit/pipelex/cli/dev/test_store_test_durations_cmd.py
@@ -6,14 +6,14 @@ modules; what is tested here is how the command reads pytest's exit codes.
from __future__ import annotations
-import subprocess # noqa: S404
+import subprocess # ruff: ignore[suspicious-subprocess-import]
from typing import TYPE_CHECKING
import pytest
from pipelex.cli.dev_cli.commands.store_test_durations_cmd import (
PYTEST_EXIT_NO_TESTS_COLLECTED,
- _collect_node_ids, # noqa: PLC2701 # pyright: ignore[reportPrivateUsage]
+ _collect_node_ids, # pyright: ignore[reportPrivateUsage]
)
if TYPE_CHECKING:
diff --git a/tests/unit/pipelex/cli/test_agent_doctor_cmd.py b/tests/unit/pipelex/cli/test_agent_doctor_cmd.py
index c2a08abc1..46a561f5e 100644
--- a/tests/unit/pipelex/cli/test_agent_doctor_cmd.py
+++ b/tests/unit/pipelex/cli/test_agent_doctor_cmd.py
@@ -399,7 +399,7 @@ class TestAgentDoctorCmd:
same as the broken-config short-circuit — mark models as skipped, surface the
translated message under checks.models, keep every other check in the envelope.
"""
- from pipelex.base_exceptions import PipelexConfigError # noqa: PLC0415
+ from pipelex.base_exceptions import PipelexConfigError # ruff: ignore[import-outside-top-level]
mocker.patch(
"pipelex.cli.agent_cli.commands.doctor_cmd.setup_doctor_runtime",
diff --git a/tests/unit/pipelex/cli/test_agent_output.py b/tests/unit/pipelex/cli/test_agent_output.py
index b27878a2b..609bd71a9 100644
--- a/tests/unit/pipelex/cli/test_agent_output.py
+++ b/tests/unit/pipelex/cli/test_agent_output.py
@@ -11,12 +11,12 @@ import typer
from typer.testing import CliRunner
from pipelex.base_exceptions import PipelexConfigError, PipelexError
-from pipelex.cli.agent_cli._agent_cli import app # noqa: PLC2701
+from pipelex.cli.agent_cli._agent_cli import app
from pipelex.cli.agent_cli.commands.agent_output import (
AGENT_ERROR_DOMAINS,
AGENT_ERROR_HINTS,
CliOutputFormat,
- _build_error_source, # noqa: PLC2701 # pyright: ignore[reportPrivateUsage]
+ _build_error_source, # pyright: ignore[reportPrivateUsage]
agent_error,
agent_success,
consume_setup_warnings,
diff --git a/tests/unit/pipelex/cli/test_check_rules_sync_cmd.py b/tests/unit/pipelex/cli/test_check_rules_sync_cmd.py
index 9ccdb9929..24305e8e1 100644
--- a/tests/unit/pipelex/cli/test_check_rules_sync_cmd.py
+++ b/tests/unit/pipelex/cli/test_check_rules_sync_cmd.py
@@ -7,8 +7,8 @@ from typing import TYPE_CHECKING
import pytest
from pipelex.cli.dev_cli.commands.check_rules_sync_cmd import (
- _DEFAULT_TARGETS, # noqa: PLC2701 # pyright: ignore[reportPrivateUsage]
- _get_preferred_targets_from_toml, # noqa: PLC2701 # pyright: ignore[reportPrivateUsage]
+ _DEFAULT_TARGETS, # pyright: ignore[reportPrivateUsage]
+ _get_preferred_targets_from_toml, # pyright: ignore[reportPrivateUsage]
check_rules_sync_cmd,
)
from pipelex.system.configuration.configs import AgentTarget
diff --git a/tests/unit/pipelex/cli/test_cli_entrypoint_smoke.py b/tests/unit/pipelex/cli/test_cli_entrypoint_smoke.py
index 85b955633..ab5006ce4 100644
--- a/tests/unit/pipelex/cli/test_cli_entrypoint_smoke.py
+++ b/tests/unit/pipelex/cli/test_cli_entrypoint_smoke.py
@@ -22,7 +22,7 @@ Two things make this test catch the bug where the existing CLI tests did not:
from __future__ import annotations
import shutil
-import subprocess # noqa: S404 -- invokes the real pipelex binary on purpose
+import subprocess # ruff: ignore[suspicious-subprocess-import] -- invokes the real pipelex binary on purpose
import sys
from pathlib import Path
@@ -65,7 +65,7 @@ class TestCliEntrypointStarts:
bin_path = PIPELEX_BIN
if bin_path is None:
pytest.fail("`pipelex` console script not found next to the interpreter or on PATH; install the package before running this test.")
- result = subprocess.run( # noqa: S603 -- fixed, trusted argv
+ result = subprocess.run( # ruff: ignore[subprocess-without-shell-equals-true] -- fixed, trusted argv
[bin_path, *args],
capture_output=True,
text=True,
diff --git a/tests/unit/pipelex/cli/test_doctor_cmd.py b/tests/unit/pipelex/cli/test_doctor_cmd.py
index e3f9a98c6..bfaf70d2c 100644
--- a/tests/unit/pipelex/cli/test_doctor_cmd.py
+++ b/tests/unit/pipelex/cli/test_doctor_cmd.py
@@ -110,7 +110,7 @@ class TestDoctorLayeredResolution:
setup_doctor_runtime, and the user deserves the friendly translation in the report
rather than a generic failure message.
"""
- from pipelex.base_exceptions import PipelexConfigError # noqa: PLC0415
+ from pipelex.base_exceptions import PipelexConfigError # ruff: ignore[import-outside-top-level]
mock_setup = mocker.patch(
"pipelex.cli.commands.doctor_cmd.setup_doctor_runtime",
diff --git a/tests/unit/pipelex/cli/test_format_doctor_markdown.py b/tests/unit/pipelex/cli/test_format_doctor_markdown.py
index 09252450a..e4ada1877 100644
--- a/tests/unit/pipelex/cli/test_format_doctor_markdown.py
+++ b/tests/unit/pipelex/cli/test_format_doctor_markdown.py
@@ -5,7 +5,7 @@ from __future__ import annotations
from typing import Any, ClassVar
from pipelex.cli.agent_cli.commands.doctor_cmd import (
- _format_doctor_markdown, # noqa: PLC2701 # pyright: ignore[reportPrivateUsage]
+ _format_doctor_markdown, # pyright: ignore[reportPrivateUsage]
)
diff --git a/tests/unit/pipelex/cli/test_format_run_markdown.py b/tests/unit/pipelex/cli/test_format_run_markdown.py
index 79ac94ad2..651251873 100644
--- a/tests/unit/pipelex/cli/test_format_run_markdown.py
+++ b/tests/unit/pipelex/cli/test_format_run_markdown.py
@@ -7,7 +7,7 @@ from typing import Any
from kajson import kajson
-from pipelex.cli.agent_cli.commands.run._output_helpers import format_run_markdown # noqa: PLC2701
+from pipelex.cli.agent_cli.commands.run._output_helpers import format_run_markdown
class TestFormatRunMarkdown:
diff --git a/tests/unit/pipelex/cli/test_inputs_path_resolver.py b/tests/unit/pipelex/cli/test_inputs_path_resolver.py
index ebd63c798..34cc0f337 100644
--- a/tests/unit/pipelex/cli/test_inputs_path_resolver.py
+++ b/tests/unit/pipelex/cli/test_inputs_path_resolver.py
@@ -7,7 +7,7 @@ from typing import Any, ClassVar
import pytest
-from pipelex.cli.commands.run._inputs_path_resolver import resolve_inputs_paths, resolve_url_in_value # noqa: PLC2701
+from pipelex.cli.commands.run._inputs_path_resolver import resolve_inputs_paths, resolve_url_in_value
from pipelex.tools.uri.uri_resolver import is_relative_local_path
@@ -254,7 +254,7 @@ class TestInputsPathResolver:
_ResolveInputsPathsCases.NO_URL_KEYS,
],
)
- def test_resolve_inputs_paths(self, topic: str, inputs_dict: dict[str, Any], expected: dict[str, Any]) -> None: # noqa: ARG002
+ def test_resolve_inputs_paths(self, topic: str, inputs_dict: dict[str, Any], expected: dict[str, Any]) -> None: # ruff: ignore[unused-method-argument]
"""Resolves relative url paths in various input structures."""
result = resolve_inputs_paths(inputs_dict, base_dir=_ResolveInputsPathsCases.BASE_DIR)
assert result == expected
diff --git a/tests/unit/pipelex/cli/test_make_context.py b/tests/unit/pipelex/cli/test_make_context.py
index 7491cf83c..83177227f 100644
--- a/tests/unit/pipelex/cli/test_make_context.py
+++ b/tests/unit/pipelex/cli/test_make_context.py
@@ -8,7 +8,7 @@ from __future__ import annotations
import click
-from pipelex.cli._cli import PipelexCLI # noqa: PLC2701
+from pipelex.cli._cli import PipelexCLI
class TestPipelexCLIMakeContext:
diff --git a/tests/unit/pipelex/cli/test_output_helpers.py b/tests/unit/pipelex/cli/test_output_helpers.py
index afeef0561..9f56c1dec 100644
--- a/tests/unit/pipelex/cli/test_output_helpers.py
+++ b/tests/unit/pipelex/cli/test_output_helpers.py
@@ -4,7 +4,7 @@ from __future__ import annotations
from typing import Any
-from pipelex.cli.agent_cli.commands.run._output_helpers import build_run_output # noqa: PLC2701
+from pipelex.cli.agent_cli.commands.run._output_helpers import build_run_output
class TestBuildRunOutput:
diff --git a/tests/unit/pipelex/cli/test_pipe_cmd.py b/tests/unit/pipelex/cli/test_pipe_cmd.py
index 63467335c..9506019ca 100644
--- a/tests/unit/pipelex/cli/test_pipe_cmd.py
+++ b/tests/unit/pipelex/cli/test_pipe_cmd.py
@@ -17,7 +17,7 @@ import typer
from pipelex.builder.operations.pipe_ops import parse_pipe_spec
from pipelex.cli.agent_cli.commands.pipe_cmd import (
- _pipe_spec_to_toml, # noqa: PLC2701 # pyright: ignore[reportPrivateUsage]
+ _pipe_spec_to_toml, # pyright: ignore[reportPrivateUsage]
pipe_cmd,
)
diff --git a/tests/unit/pipelex/cli/test_readiness.py b/tests/unit/pipelex/cli/test_readiness.py
index 880f95841..771866137 100644
--- a/tests/unit/pipelex/cli/test_readiness.py
+++ b/tests/unit/pipelex/cli/test_readiness.py
@@ -12,9 +12,9 @@ from rich.console import Console
import pipelex
from pipelex.cli.exceptions import ReadinessCheckError
from pipelex.cli.readiness import (
- _find_venv_directories, # noqa: PLC2701 # pyright: ignore[reportPrivateUsage]
- _is_development_install, # noqa: PLC2701 # pyright: ignore[reportPrivateUsage]
- _is_in_virtual_environment, # noqa: PLC2701 # pyright: ignore[reportPrivateUsage]
+ _find_venv_directories, # pyright: ignore[reportPrivateUsage]
+ _is_development_install, # pyright: ignore[reportPrivateUsage]
+ _is_in_virtual_environment, # pyright: ignore[reportPrivateUsage]
check_readiness,
)
diff --git a/tests/unit/pipelex/cli/test_run_core_execution.py b/tests/unit/pipelex/cli/test_run_core_execution.py
index 75a237645..b15aade8a 100644
--- a/tests/unit/pipelex/cli/test_run_core_execution.py
+++ b/tests/unit/pipelex/cli/test_run_core_execution.py
@@ -16,7 +16,7 @@ import pytest
import typer
from rich.console import Console
-from pipelex.cli.commands.run._run_core import _execute_run # noqa: PLC2701 # pyright: ignore[reportPrivateUsage]
+from pipelex.cli.commands.run._run_core import _execute_run # pyright: ignore[reportPrivateUsage]
from pipelex.core.concepts.exceptions import ConceptValueError
from pipelex.core.stuffs.list_content import ListContent
from pipelex.core.stuffs.text_content import TextContent
@@ -102,8 +102,8 @@ class TestRunCoreExecution:
def _make_absent_main_pipe_output(self) -> Any:
"""A pipe output whose main output resolved absent (real WorkingMemory, recorded absence)."""
- from pipelex.core.memory.absence import AbsenceKind, AbsenceRecord # noqa: PLC0415
- from pipelex.core.memory.working_memory import WorkingMemory # noqa: PLC0415
+ from pipelex.core.memory.absence import AbsenceKind, AbsenceRecord # ruff: ignore[import-outside-top-level]
+ from pipelex.core.memory.working_memory import WorkingMemory # ruff: ignore[import-outside-top-level]
memory = WorkingMemory()
memory.record_new_main_absence(
diff --git a/tests/unit/pipelex/cli/test_run_core_wrapper.py b/tests/unit/pipelex/cli/test_run_core_wrapper.py
index 6972283a9..4877b5856 100644
--- a/tests/unit/pipelex/cli/test_run_core_wrapper.py
+++ b/tests/unit/pipelex/cli/test_run_core_wrapper.py
@@ -12,7 +12,7 @@ import typer
from rich.console import Console
from pipelex.base_exceptions import PipelexError
-from pipelex.cli.commands.run._run_core import execute_run # noqa: PLC2701
+from pipelex.cli.commands.run._run_core import execute_run
from pipelex.cli.error_handlers import ErrorContext
from pipelex.cogt.model_backends.model_type import ModelType
from pipelex.core.pipes.exceptions import PipeOperatorModelChoiceError
diff --git a/tests/unit/pipelex/cli/test_run_flag_combination.py b/tests/unit/pipelex/cli/test_run_flag_combination.py
index 25b1d68e7..a2bb5ba4e 100644
--- a/tests/unit/pipelex/cli/test_run_flag_combination.py
+++ b/tests/unit/pipelex/cli/test_run_flag_combination.py
@@ -9,7 +9,7 @@ pin the full truth table of the validator itself.
import pytest
import typer
-from pipelex.cli.commands.run._run_core import validate_run_flag_combination # noqa: PLC2701
+from pipelex.cli.commands.run._run_core import validate_run_flag_combination
class TestRunFlagCombination:
diff --git a/tests/unit/pipelex/cli/test_traceback_flag_run_core.py b/tests/unit/pipelex/cli/test_traceback_flag_run_core.py
index 2f2e4ab94..e8fa4c149 100644
--- a/tests/unit/pipelex/cli/test_traceback_flag_run_core.py
+++ b/tests/unit/pipelex/cli/test_traceback_flag_run_core.py
@@ -20,7 +20,7 @@ if TYPE_CHECKING:
from pytest_mock import MockerFixture
-from pipelex.cli.commands.run._run_core import _execute_run # noqa: PLC2701 # pyright: ignore[reportPrivateUsage]
+from pipelex.cli.commands.run._run_core import _execute_run # pyright: ignore[reportPrivateUsage]
from pipelex.pipeline.exceptions import PipelineExecutionError
from pipelex.system.pipe_run_mode import PipeRunMode
diff --git a/tests/unit/pipelex/codegen/test_emitted_artifacts_are_lint_clean.py b/tests/unit/pipelex/codegen/test_emitted_artifacts_are_lint_clean.py
index 716a105e1..db257650f 100644
--- a/tests/unit/pipelex/codegen/test_emitted_artifacts_are_lint_clean.py
+++ b/tests/unit/pipelex/codegen/test_emitted_artifacts_are_lint_clean.py
@@ -28,7 +28,7 @@ See `render_import_block` in `pipelex/codegen/emitters/python_common.py`.
import re
import shutil
-import subprocess # noqa: S404
+import subprocess # ruff: ignore[suspicious-subprocess-import]
import sys
from collections.abc import Callable
from pathlib import Path
@@ -83,7 +83,7 @@ def _collect_kinds(resolved_type: ResolvedType) -> set[ResolvedTypeKind]:
def _write_artifacts(*, emitted: list[EmittedFile], tmp_path: Path) -> None:
"""Write the artifacts out, skipping the test when the current interpreter has no ruff."""
try:
- subprocess.run([sys.executable, "-m", "ruff", "--version"], check=True, capture_output=True) # noqa: S603
+ subprocess.run([sys.executable, "-m", "ruff", "--version"], check=True, capture_output=True)
except (subprocess.CalledProcessError, FileNotFoundError):
pytest.skip("ruff not available in current interpreter")
@@ -101,7 +101,7 @@ def _label(*, target: str, line_length: int | None) -> str:
def _assert_ruff_format_stable(*, tmp_path: Path, target: str, line_length: int | None = None) -> None:
"""Require `ruff format --check` to find nothing — the property byte-reproducibility rests on."""
- formatted = subprocess.run( # noqa: S603
+ formatted = subprocess.run( # ruff: ignore[subprocess-without-shell-equals-true]
[sys.executable, "-m", "ruff", "format", "--check", str(tmp_path), "--config", str(_PYPROJECT), *_width_config(line_length)],
capture_output=True,
text=True,
@@ -115,7 +115,7 @@ def _assert_ruff_clean(*, emitted: list[EmittedFile], tmp_path: Path, target: st
"""Write the artifacts out and require both `ruff check` and `ruff format --check` to find nothing."""
_write_artifacts(emitted=emitted, tmp_path=tmp_path)
- check = subprocess.run( # noqa: S603
+ check = subprocess.run( # ruff: ignore[subprocess-without-shell-equals-true]
[sys.executable, "-m", "ruff", "check", str(tmp_path), *_CONSUMER_LINT_CONFIG, *_width_config(line_length)],
capture_output=True,
text=True,
@@ -315,7 +315,7 @@ class TestEmittedArtifactsAreLintClean:
for emitted_file in emit_ts_zod(resolve_concepts_from_crate(every_type_kind_crate)):
(tmp_path / emitted_file.filename).write_text(emitted_file.content, encoding="utf-8")
- checked = subprocess.run( # noqa: S603
+ checked = subprocess.run( # ruff: ignore[subprocess-without-shell-equals-true]
[prettier, "--check", str(tmp_path / "*.ts")],
capture_output=True,
text=True,
diff --git a/tests/unit/pipelex/cogt/content_generation/test_schema_to_model.py b/tests/unit/pipelex/cogt/content_generation/test_schema_to_model.py
index 4c8f1e5d6..93e828659 100644
--- a/tests/unit/pipelex/cogt/content_generation/test_schema_to_model.py
+++ b/tests/unit/pipelex/cogt/content_generation/test_schema_to_model.py
@@ -279,8 +279,8 @@ class TestSchemaToModel:
fresh codegen). Saves and restores the class-level cache to keep the test isolated.
"""
# Snapshot then clear class-level state so this test is hermetic.
- saved_cache = SchemaToModelFactory._schema_cache.copy() # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
- SchemaToModelFactory._schema_cache.clear() # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ saved_cache = SchemaToModelFactory._schema_cache.copy() # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
+ SchemaToModelFactory._schema_cache.clear() # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
mocker.patch.object(SchemaToModelFactory, "_SCHEMA_CACHE_MAX_SIZE", 3)
spy = mocker.spy(SchemaToModelFactory, "_generate_source_from_schema")
@@ -292,10 +292,10 @@ class TestSchemaToModel:
schema["title"] = title
schemas.append((title, schema))
SchemaToModelFactory.make_from_json_schema(schema, class_name=title)
- assert len(SchemaToModelFactory._schema_cache) <= 3 # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ assert len(SchemaToModelFactory._schema_cache) <= 3 # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert spy.call_count == 4
- assert len(SchemaToModelFactory._schema_cache) == 3 # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ assert len(SchemaToModelFactory._schema_cache) == 3 # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
# Oldest schema (index 0) must have been evicted: re-requesting it triggers fresh codegen.
oldest_title, oldest_schema = schemas[0]
@@ -307,14 +307,14 @@ class TestSchemaToModel:
SchemaToModelFactory.make_from_json_schema(recent_schema, class_name=recent_title)
assert spy.call_count == 5
finally:
- SchemaToModelFactory._schema_cache.clear() # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
- SchemaToModelFactory._schema_cache.update(saved_cache) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ SchemaToModelFactory._schema_cache.clear() # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
+ SchemaToModelFactory._schema_cache.update(saved_cache) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
def test_exec_blocks_dangerous_builtins(self) -> None:
"""The restricted exec namespace blocks open(), eval(), exec(), and compile()."""
malicious_source = "from pydantic import BaseModel\nclass Innocent(BaseModel):\n name: str = 'ok'\nleaked = open('/etc/passwd')\n"
with pytest.raises(NameError, match="open"):
- SchemaToModelFactory._exec_and_extract_class(malicious_source, class_name="Innocent") # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ SchemaToModelFactory._exec_and_extract_class(malicious_source, class_name="Innocent") # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
# ---- Layer 1: schema sanitization (x-python-* extensions are rejected) ----
@@ -427,13 +427,13 @@ class TestSchemaToModel:
"""Even bypassing Layer 1, the restricted __import__ blocks `import subprocess`."""
malicious_source = "from pydantic import BaseModel\nimport subprocess\nclass Innocent(BaseModel):\n name: str = 'ok'\n"
with pytest.raises(ImportError, match="subprocess"):
- SchemaToModelFactory._exec_and_extract_class(malicious_source, class_name="Innocent") # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ SchemaToModelFactory._exec_and_extract_class(malicious_source, class_name="Innocent") # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
def test_exec_blocks_direct_dunder_import_call(self) -> None:
"""A direct __import__('subprocess') call is also blocked."""
malicious_source = "from pydantic import BaseModel\nclass Innocent(BaseModel):\n name: str = 'ok'\n_leak = __import__('subprocess')\n"
with pytest.raises(ImportError, match="subprocess"):
- SchemaToModelFactory._exec_and_extract_class(malicious_source, class_name="Innocent") # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ SchemaToModelFactory._exec_and_extract_class(malicious_source, class_name="Innocent") # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
@pytest.mark.parametrize(
("import_line", "expected_module"),
@@ -448,7 +448,7 @@ class TestSchemaToModel:
"""A range of dangerous stdlib imports is blocked by the allowlist."""
malicious_source = f"from pydantic import BaseModel\n{import_line}\nclass Innocent(BaseModel):\n name: str = 'ok'\n"
with pytest.raises(ImportError, match=expected_module):
- SchemaToModelFactory._exec_and_extract_class(malicious_source, class_name="Innocent") # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ SchemaToModelFactory._exec_and_extract_class(malicious_source, class_name="Innocent") # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
@pytest.mark.parametrize(
"import_line",
@@ -468,5 +468,5 @@ class TestSchemaToModel:
def test_exec_allowlisted_imports_succeed(self, import_line: str) -> None:
"""Allowlisted imports required by datamodel-code-generator output continue to work."""
source = f"{import_line}\nfrom pydantic import BaseModel\nclass Innocent(BaseModel):\n name: str = 'ok'\n"
- result_class = SchemaToModelFactory._exec_and_extract_class(source, class_name="Innocent") # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ result_class = SchemaToModelFactory._exec_and_extract_class(source, class_name="Innocent") # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert result_class.__name__ == "Innocent"
diff --git a/tests/unit/pipelex/cogt/extract/test_extract_worker_usage_capture.py b/tests/unit/pipelex/cogt/extract/test_extract_worker_usage_capture.py
index 1cec28067..ab58fb7f4 100644
--- a/tests/unit/pipelex/cogt/extract/test_extract_worker_usage_capture.py
+++ b/tests/unit/pipelex/cogt/extract/test_extract_worker_usage_capture.py
@@ -61,7 +61,7 @@ def _make_extract_model() -> InferenceModelSpec:
def _make_extract_job() -> ExtractJob:
return ExtractJob(
- extract_input=ExtractInput(document_uri="/tmp/test.pdf"), # noqa: S108
+ extract_input=ExtractInput(document_uri="/tmp/test.pdf"), # ruff: ignore[hardcoded-temp-file]
job_params=ExtractJobParams.make_default_extract_job_params(),
job_config=ExtractJobConfig(),
job_report=ExtractJobReport(),
diff --git a/tests/unit/pipelex/cogt/img_gen/test_img_gen_mapping_neutrality.py b/tests/unit/pipelex/cogt/img_gen/test_img_gen_mapping_neutrality.py
index ec9962bf0..9b5bc0cbc 100644
--- a/tests/unit/pipelex/cogt/img_gen/test_img_gen_mapping_neutrality.py
+++ b/tests/unit/pipelex/cogt/img_gen/test_img_gen_mapping_neutrality.py
@@ -19,7 +19,7 @@
from __future__ import annotations
import ast
-import subprocess # noqa: S404
+import subprocess # ruff: ignore[suspicious-subprocess-import]
import sys
import textwrap
from pathlib import Path
@@ -100,7 +100,7 @@ class TestImgGenMappingNeutrality:
assert MAPPING_MODULE_QNAMES, f"no img_gen_*_mapping.py found under {_MAPPING_DIR} — this check measures nothing"
try:
- result = subprocess.run( # noqa: S603
+ result = subprocess.run( # ruff: ignore[subprocess-without-shell-equals-true]
[sys.executable, "-c", _CLOSURE_SCRIPT, *MAPPING_MODULE_QNAMES],
capture_output=True,
text=True,
diff --git a/tests/unit/pipelex/cogt/img_gen/test_img_gen_worker_input_images_guard.py b/tests/unit/pipelex/cogt/img_gen/test_img_gen_worker_input_images_guard.py
index 75bb942d9..1ee14dafe 100644
--- a/tests/unit/pipelex/cogt/img_gen/test_img_gen_worker_input_images_guard.py
+++ b/tests/unit/pipelex/cogt/img_gen/test_img_gen_worker_input_images_guard.py
@@ -59,21 +59,21 @@ class TestImgGenWorkerInputImagesGuard:
job = _make_img_gen_job(mocker, input_images=[mocker.MagicMock()])
with pytest.raises(ImgGenParameterError, match="nano-banana-test"):
- worker._check_can_perform_job(img_gen_job=job) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ worker._check_can_perform_job(img_gen_job=job) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
def test_input_images_on_img2img_model_passes(self, mocker: MockerFixture) -> None:
"""Input images on an img2img-capable model pass the guard."""
worker = _make_worker(mocker, is_img2img_supported=True)
job = _make_img_gen_job(mocker, input_images=[mocker.MagicMock()])
- worker._check_can_perform_job(img_gen_job=job) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ worker._check_can_perform_job(img_gen_job=job) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
def test_no_input_images_on_text_only_model_passes(self, mocker: MockerFixture) -> None:
"""A plain text-to-image job on a text-only model passes the guard."""
worker = _make_worker(mocker, is_img2img_supported=False)
job = _make_img_gen_job(mocker, input_images=None)
- worker._check_can_perform_job(img_gen_job=job) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ worker._check_can_perform_job(img_gen_job=job) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
@pytest.mark.asyncio
async def test_gen_image_rejects_before_provider_call(self, mocker: MockerFixture) -> None:
diff --git a/tests/unit/pipelex/cogt/models/test_collect_deck_referenced_handles.py b/tests/unit/pipelex/cogt/models/test_collect_deck_referenced_handles.py
index 8db5eb19b..6620e81a4 100644
--- a/tests/unit/pipelex/cogt/models/test_collect_deck_referenced_handles.py
+++ b/tests/unit/pipelex/cogt/models/test_collect_deck_referenced_handles.py
@@ -25,8 +25,8 @@ from pipelex.system.runtime import ProblemReaction
# Both methods are private leaves of the membership resolver; aliasing them keeps the call
# sites in the tests free of repeated noqa/ignore pragmas.
-_collect_deck_referenced_handles = ModelManager._collect_deck_referenced_handles # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
-_extract_choice_handle = ModelManager._extract_choice_handle # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+_collect_deck_referenced_handles = ModelManager._collect_deck_referenced_handles # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
+_extract_choice_handle = ModelManager._extract_choice_handle # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
def _make_deck(
diff --git a/tests/unit/pipelex/cogt/models/test_resolve_terminal_candidates.py b/tests/unit/pipelex/cogt/models/test_resolve_terminal_candidates.py
index 81a72790a..d3dd7ba38 100644
--- a/tests/unit/pipelex/cogt/models/test_resolve_terminal_candidates.py
+++ b/tests/unit/pipelex/cogt/models/test_resolve_terminal_candidates.py
@@ -23,7 +23,7 @@ from pipelex.cogt.models.model_reference import ModelReference
# ``_collect_candidates`` is the pure-logic leaf of the membership resolver; testing it
# directly keeps the unit tests free of ModelDeck setup boilerplate.
-_collect_candidates = ModelManager._collect_candidates # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+_collect_candidates = ModelManager._collect_candidates # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
class TestResolveTerminalCandidates:
diff --git a/tests/unit/pipelex/core/concepts/structure_generation/test_structure_generator.py b/tests/unit/pipelex/core/concepts/structure_generation/test_structure_generator.py
index b8e7ac9f5..50e429e77 100644
--- a/tests/unit/pipelex/core/concepts/structure_generation/test_structure_generator.py
+++ b/tests/unit/pipelex/core/concepts/structure_generation/test_structure_generator.py
@@ -1008,10 +1008,10 @@ class Question(TextContent):
assert generated_code == expected_code
# Verify the generated class is valid
- from pipelex.core.stuffs.text_content import TextContent # noqa: PLC0415
+ from pipelex.core.stuffs.text_content import TextContent # ruff: ignore[import-outside-top-level]
assert issubclass(generated_class, TextContent)
- from pipelex.core.stuffs.stuff_content import StuffContent # noqa: PLC0415
+ from pipelex.core.stuffs.stuff_content import StuffContent # ruff: ignore[import-outside-top-level]
assert issubclass(generated_class, StuffContent)
@@ -1071,10 +1071,10 @@ class TableScreenshot(ImageContent):
assert generated_code == expected_code
# Verify the generated class is valid
- from pipelex.core.stuffs.image_content import ImageContent # noqa: PLC0415
+ from pipelex.core.stuffs.image_content import ImageContent # ruff: ignore[import-outside-top-level]
assert issubclass(generated_class, ImageContent)
- from pipelex.core.stuffs.stuff_content import StuffContent # noqa: PLC0415
+ from pipelex.core.stuffs.stuff_content import StuffContent # ruff: ignore[import-outside-top-level]
assert issubclass(generated_class, StuffContent)
@@ -1124,10 +1124,10 @@ class Temperature(NumberContent):
assert generated_code == expected_code
# Verify the generated class is valid
- from pipelex.core.stuffs.number_content import NumberContent # noqa: PLC0415
+ from pipelex.core.stuffs.number_content import NumberContent # ruff: ignore[import-outside-top-level]
assert issubclass(generated_class, NumberContent)
- from pipelex.core.stuffs.stuff_content import StuffContent # noqa: PLC0415
+ from pipelex.core.stuffs.stuff_content import StuffContent # ruff: ignore[import-outside-top-level]
assert issubclass(generated_class, StuffContent)
@@ -1177,10 +1177,10 @@ class ConfigData(JSONContent):
assert generated_code == expected_code
# Verify the generated class is valid
- from pipelex.core.stuffs.json_content import JSONContent # noqa: PLC0415
+ from pipelex.core.stuffs.json_content import JSONContent # ruff: ignore[import-outside-top-level]
assert issubclass(generated_class, JSONContent)
- from pipelex.core.stuffs.stuff_content import StuffContent # noqa: PLC0415
+ from pipelex.core.stuffs.stuff_content import StuffContent # ruff: ignore[import-outside-top-level]
assert issubclass(generated_class, StuffContent)
@@ -1223,10 +1223,10 @@ class EnhancedText(TextContent):
assert generated_code == expected_code
# Verify the generated class is valid
- from pipelex.core.stuffs.text_content import TextContent # noqa: PLC0415
+ from pipelex.core.stuffs.text_content import TextContent # ruff: ignore[import-outside-top-level]
assert issubclass(generated_class, TextContent)
- from pipelex.core.stuffs.stuff_content import StuffContent # noqa: PLC0415
+ from pipelex.core.stuffs.stuff_content import StuffContent # ruff: ignore[import-outside-top-level]
assert issubclass(generated_class, StuffContent)
@@ -1280,16 +1280,16 @@ class Invoice(DocumentContent):
assert generated_code == expected_code
# Verify the generated class is valid
- from pipelex.core.stuffs.document_content import DocumentContent # noqa: PLC0415
+ from pipelex.core.stuffs.document_content import DocumentContent # ruff: ignore[import-outside-top-level]
assert issubclass(generated_class, DocumentContent)
- from pipelex.core.stuffs.stuff_content import StuffContent # noqa: PLC0415
+ from pipelex.core.stuffs.stuff_content import StuffContent # ruff: ignore[import-outside-top-level]
assert issubclass(generated_class, StuffContent)
def test_multiple_inheritance_scenarios(self):
"""Test multiple classes with different inheritance scenarios."""
- from pipelex.core.stuffs.stuff_content import StuffContent # noqa: PLC0415
+ from pipelex.core.stuffs.stuff_content import StuffContent # ruff: ignore[import-outside-top-level]
test_cases = [
("TextContent", "text_content", "Question", {"source": "The source of the question"}),
diff --git a/tests/unit/pipelex/core/concepts/structure_generation/test_structure_generator_wrapping.py b/tests/unit/pipelex/core/concepts/structure_generation/test_structure_generator_wrapping.py
index d771ef485..5a112b612 100644
--- a/tests/unit/pipelex/core/concepts/structure_generation/test_structure_generator_wrapping.py
+++ b/tests/unit/pipelex/core/concepts/structure_generation/test_structure_generator_wrapping.py
@@ -12,7 +12,7 @@ Generated structure files must stay under the project's ruff line-length limit
For short descriptions, both fall back to the compact single-line form.
"""
-import subprocess # noqa: S404
+import subprocess # ruff: ignore[suspicious-subprocess-import]
import sys
from pathlib import Path
@@ -132,7 +132,7 @@ class TestStructureGeneratorWrapping:
hanging-indent paren block get joined by ruff format, defeating the wrap.
"""
try:
- subprocess.run([sys.executable, "-m", "ruff", "--version"], check=True, capture_output=True) # noqa: S603
+ subprocess.run([sys.executable, "-m", "ruff", "--version"], check=True, capture_output=True)
except (subprocess.CalledProcessError, FileNotFoundError):
pytest.skip("ruff not available in current interpreter")
@@ -157,7 +157,7 @@ class TestStructureGeneratorWrapping:
target.write_text(code)
# Use --isolated so ruff ignores any pyproject.toml in the path above tmp_path,
# and run via the current interpreter to ensure we use the project's pinned ruff.
- subprocess.run( # noqa: S603
+ subprocess.run( # ruff: ignore[subprocess-without-shell-equals-true]
[sys.executable, "-m", "ruff", "format", "--isolated", str(target)],
check=True,
capture_output=True,
diff --git a/tests/unit/pipelex/core/concepts/test_concept_representation_generator.py b/tests/unit/pipelex/core/concepts/test_concept_representation_generator.py
index a0d659686..dae071d5f 100644
--- a/tests/unit/pipelex/core/concepts/test_concept_representation_generator.py
+++ b/tests/unit/pipelex/core/concepts/test_concept_representation_generator.py
@@ -494,7 +494,7 @@ class TestIncludeOptionalParameter:
def test_image_content_only_url_required(self) -> None:
"""ImageContent should only have url when include_optional=False."""
- from pipelex.core.stuffs.image_content import ImageContent # noqa: PLC0415
+ from pipelex.core.stuffs.image_content import ImageContent # ruff: ignore[import-outside-top-level]
generator = ConceptRepresentationGenerator(ConceptRepresentationFormat.JSON)
result = generator.generate_class_representation(ImageContent, include_optional=False)
@@ -602,7 +602,7 @@ class TestNumberContentRepresentation:
def test_number_content_json_representation(self) -> None:
"""NumberContent generates proper numeric value in JSON format."""
- from pipelex.core.stuffs.number_content import NumberContent # noqa: PLC0415
+ from pipelex.core.stuffs.number_content import NumberContent # ruff: ignore[import-outside-top-level]
generator = ConceptRepresentationGenerator(ConceptRepresentationFormat.JSON)
result = generator.generate_class_representation(NumberContent)
@@ -614,7 +614,7 @@ class TestNumberContentRepresentation:
def test_number_content_python_representation(self) -> None:
"""NumberContent generates proper numeric value in Python format."""
- from pipelex.core.stuffs.number_content import NumberContent # noqa: PLC0415
+ from pipelex.core.stuffs.number_content import NumberContent # ruff: ignore[import-outside-top-level]
generator = ConceptRepresentationGenerator(ConceptRepresentationFormat.PYTHON)
result = generator.generate_class_representation(NumberContent)
@@ -640,7 +640,7 @@ class TestDateContentRepresentation:
def test_date_content_json_representation_round_trips(self) -> None:
"""The JSON template for a Date input parses back into a DateContent."""
- from pipelex.core.stuffs.date_content import DateContent # noqa: PLC0415
+ from pipelex.core.stuffs.date_content import DateContent # ruff: ignore[import-outside-top-level]
generator = ConceptRepresentationGenerator(ConceptRepresentationFormat.JSON)
result = generator.generate_representation("native.Date", structure_class=DateContent, include_optional=False)
@@ -657,7 +657,7 @@ class TestDateContentRepresentation:
def test_date_content_python_representation_has_no_placeholder(self) -> None:
"""The Python template for a Date input carries no 'date_date' placeholder."""
- from pipelex.core.stuffs.date_content import DateContent # noqa: PLC0415
+ from pipelex.core.stuffs.date_content import DateContent # ruff: ignore[import-outside-top-level]
generator = ConceptRepresentationGenerator(ConceptRepresentationFormat.PYTHON)
result = generator.generate_representation("native.Date", structure_class=DateContent, include_optional=False)
diff --git a/tests/unit/pipelex/core/memory/input_shaper/data.py b/tests/unit/pipelex/core/memory/input_shaper/data.py
index 077d1fa13..8c8ddace6 100644
--- a/tests/unit/pipelex/core/memory/input_shaper/data.py
+++ b/tests/unit/pipelex/core/memory/input_shaper/data.py
@@ -98,7 +98,7 @@ def build_input_specs(entries: list[tuple[str, str, VariableMultiplicity | None]
Concepts are resolved against the current concept library, so this must run after the
``shaper_library`` fixture has registered the test concepts.
"""
- from pipelex.interpreter_hub import get_concept_library # noqa: PLC0415
+ from pipelex.interpreter_hub import get_concept_library # ruff: ignore[import-outside-top-level]
library = get_concept_library()
root: dict[str, StuffSpec] = {}
diff --git a/tests/unit/pipelex/core/stuffs/date_content/test_date_content_renders.py b/tests/unit/pipelex/core/stuffs/date_content/test_date_content_renders.py
index f6aa607bf..f51a45fde 100644
--- a/tests/unit/pipelex/core/stuffs/date_content/test_date_content_renders.py
+++ b/tests/unit/pipelex/core/stuffs/date_content/test_date_content_renders.py
@@ -170,7 +170,7 @@ class TestDateContentRenders:
"""The base rendered_pretty feeds smart_dump()'s real date objects to stdlib json and crashes;
DateContent overrides it to render the ISO form. Guard against a regression to the base path.
"""
- from pipelex.tools.misc.pretty import pretty_print # noqa: PLC0415 — local import keeps the render dep test-local
+ from pipelex.tools.misc.pretty import pretty_print # ruff: ignore[import-outside-top-level] — local import keeps the render dep test-local
pretty_print(DateContent(date=TestData.SAMPLE_DATE, time=TestData.SAMPLE_TIME_OFFSET))
diff --git a/tests/unit/pipelex/core/stuffs/test_stuff_viewer.py b/tests/unit/pipelex/core/stuffs/test_stuff_viewer.py
index 11930c4c3..4696239b1 100644
--- a/tests/unit/pipelex/core/stuffs/test_stuff_viewer.py
+++ b/tests/unit/pipelex/core/stuffs/test_stuff_viewer.py
@@ -4,7 +4,7 @@ import pytest
from pipelex.core.stuffs.stuff_template_set import STUFF_TEMPLATE_SET
from pipelex.core.stuffs.stuff_viewer import (
- _get_html_tab_label, # noqa: PLC2701 # pyright: ignore[reportPrivateUsage]
+ _get_html_tab_label, # pyright: ignore[reportPrivateUsage]
render_stuff_content_viewer,
render_stuff_viewer,
)
diff --git a/tests/unit/pipelex/core/test_data/pipes/operators/llm/pipe_llm.py b/tests/unit/pipelex/core/test_data/pipes/operators/llm/pipe_llm.py
index 210a92aa4..893252160 100644
--- a/tests/unit/pipelex/core/test_data/pipes/operators/llm/pipe_llm.py
+++ b/tests/unit/pipelex/core/test_data/pipes/operators/llm/pipe_llm.py
@@ -1,4 +1,4 @@
-# ruff: noqa: E501
+# ruff: file-ignore[line-too-long]
from pipelex.core.concepts.native.concept_native import NativeConceptCode
from pipelex.mthds_parsing.pipelex_bundle_blueprint import PipelexBundleBlueprint
from pipelex.pipe_operators.llm.pipe_llm_blueprint import PipeLLMBlueprint
diff --git a/tests/unit/pipelex/errors/test_error_class_location_convention.py b/tests/unit/pipelex/errors/test_error_class_location_convention.py
index 0af588730..920e90d01 100644
--- a/tests/unit/pipelex/errors/test_error_class_location_convention.py
+++ b/tests/unit/pipelex/errors/test_error_class_location_convention.py
@@ -35,7 +35,7 @@ from pathlib import Path
import pipelex
from pipelex.base_exceptions import PipelexError
from pipelex.errors.error_pages_generator import (
- _FIXTURE_DIR_NAMES, # noqa: PLC2701 # pyright: ignore[reportPrivateUsage]
+ _FIXTURE_DIR_NAMES, # pyright: ignore[reportPrivateUsage]
iter_pipelex_error_subclasses,
)
diff --git a/tests/unit/pipelex/errors/test_error_pages_generator.py b/tests/unit/pipelex/errors/test_error_pages_generator.py
index c4e5f35d0..59620061f 100644
--- a/tests/unit/pipelex/errors/test_error_pages_generator.py
+++ b/tests/unit/pipelex/errors/test_error_pages_generator.py
@@ -9,12 +9,12 @@ import pytest
from pipelex.base_exceptions import PipelexError
from pipelex.errors.error_pages_generator import (
- _MACRO_SECTIONS, # noqa: PLC2701 # pyright: ignore[reportPrivateUsage]
+ _MACRO_SECTIONS, # pyright: ignore[reportPrivateUsage]
AUTHORED_MARKER,
GENERATED_MARKER,
INDEX_STEM,
ErrorPagesReport,
- _force_load_all_error_modules, # noqa: PLC2701 # pyright: ignore[reportPrivateUsage]
+ _force_load_all_error_modules, # pyright: ignore[reportPrivateUsage]
generate_error_pages,
has_authored_marker,
iter_pipelex_error_subclasses,
@@ -152,7 +152,7 @@ class TestErrorPagesGenerator:
# Deliberately no `Error` suffix: the collision can only arise for a name that kebabs
# onto a reserved listing-page stem, and an ``…Error`` name always kebabs to ``…-error``.
- class PlatformAndTooling(PipelexError): # noqa: N818
+ class PlatformAndTooling(PipelexError): # ruff: ignore[error-suffix-on-exception-name]
pass
with pytest.raises(RuntimeError, match="Reserved-slug collision on 'platform-and-tooling'"):
diff --git a/tests/unit/pipelex/kernel/test_func_ops.py b/tests/unit/pipelex/kernel/test_func_ops.py
index 4ae173141..8bb849b86 100644
--- a/tests/unit/pipelex/kernel/test_func_ops.py
+++ b/tests/unit/pipelex/kernel/test_func_ops.py
@@ -33,11 +33,11 @@ RESULT_NAME = "func_output"
# Being a coroutine function with nothing to await is the point: it is what selects the awaited arm.
-async def _async_producer(working_memory: WorkingMemory) -> TextContent: # noqa: ARG001, RUF029
+async def _async_producer(working_memory: WorkingMemory) -> TextContent: # ruff: ignore[unused-function-argument, unused-async]
return TextContent(text=ASYNC_TEXT)
-def _sync_producer(working_memory: WorkingMemory) -> TextContent: # noqa: ARG001
+def _sync_producer(working_memory: WorkingMemory) -> TextContent: # ruff: ignore[unused-function-argument]
return TextContent(text=SYNC_TEXT)
diff --git a/tests/unit/pipelex/kernel/test_kernel_boot_contract.py b/tests/unit/pipelex/kernel/test_kernel_boot_contract.py
index 0f5f32397..f7520706a 100644
--- a/tests/unit/pipelex/kernel/test_kernel_boot_contract.py
+++ b/tests/unit/pipelex/kernel/test_kernel_boot_contract.py
@@ -48,7 +48,7 @@ interpreter-group orchestrator is never registered and the existing gate rejects
Neither remedy the earlier analysis proposed was built.
"""
-import subprocess # noqa: S404
+import subprocess # ruff: ignore[suspicious-subprocess-import]
import sys
import textwrap
@@ -418,7 +418,7 @@ CONTROL_PACKAGE_THE_KERNEL_ALWAYS_LOADS = "cogt"
def _run_kernel_call(*, interpreter_packages: tuple[str, ...]) -> subprocess.CompletedProcess[str]:
"""Boot the kernel layer in a fresh interpreter, call the kernel, and return the verdict."""
try:
- return subprocess.run( # noqa: S603
+ return subprocess.run( # ruff: ignore[subprocess-without-shell-equals-true]
[sys.executable, "-c", _KERNEL_CALL_SCRIPT, *interpreter_packages],
capture_output=True,
text=True,
diff --git a/tests/unit/pipelex/libraries/test_dependency_multi_file_reconciliation.py b/tests/unit/pipelex/libraries/test_dependency_multi_file_reconciliation.py
index a7ec3abf6..dd1a6eb11 100644
--- a/tests/unit/pipelex/libraries/test_dependency_multi_file_reconciliation.py
+++ b/tests/unit/pipelex/libraries/test_dependency_multi_file_reconciliation.py
@@ -109,7 +109,7 @@ class TestDependencyMultiFileReconciliation:
mocker.patch.object(library_manager, "get_current_library", return_value=library)
manager = LibraryManager()
- manager._load_single_dependency( # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ manager._load_single_dependency( # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
library=library,
resolved_dep=self._build_resolved_dep(
tmp_path=tmp_path,
@@ -137,7 +137,7 @@ class TestDependencyMultiFileReconciliation:
mocker.patch.object(library_manager, "get_current_library", return_value=library)
manager = LibraryManager()
- manager._load_single_dependency( # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ manager._load_single_dependency( # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
library=library,
resolved_dep=self._build_resolved_dep(
tmp_path=tmp_path,
@@ -162,7 +162,7 @@ class TestDependencyMultiFileReconciliation:
manager = LibraryManager()
with pytest.raises(PipeLibraryError):
- manager._load_single_dependency( # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ manager._load_single_dependency( # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
library=library,
resolved_dep=self._build_resolved_dep(
tmp_path=tmp_path,
diff --git a/tests/unit/pipelex/libraries/test_dependency_preliminary_text_export.py b/tests/unit/pipelex/libraries/test_dependency_preliminary_text_export.py
index ac62d5c7d..511233e3e 100644
--- a/tests/unit/pipelex/libraries/test_dependency_preliminary_text_export.py
+++ b/tests/unit/pipelex/libraries/test_dependency_preliminary_text_export.py
@@ -73,7 +73,7 @@ class TestDependencyPreliminaryTextExport:
mocker.patch.object(library_manager, "get_current_library", return_value=library)
manager = LibraryManager()
- manager._load_single_dependency( # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ manager._load_single_dependency( # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
library=library,
resolved_dep=self._build_resolved_dep(tmp_path=tmp_path, exported={"make_review"}),
)
@@ -99,7 +99,7 @@ class TestDependencyPreliminaryTextExport:
mocker.patch.object(library_manager, "get_current_library", return_value=library)
manager = LibraryManager()
- manager._load_single_dependency( # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ manager._load_single_dependency( # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
library=library,
resolved_dep=self._build_resolved_dep(tmp_path=tmp_path, exported=set()),
)
diff --git a/tests/unit/pipelex/libraries/test_dependency_ref_qualification.py b/tests/unit/pipelex/libraries/test_dependency_ref_qualification.py
index 3bf5d93ed..6a4aa6ff1 100644
--- a/tests/unit/pipelex/libraries/test_dependency_ref_qualification.py
+++ b/tests/unit/pipelex/libraries/test_dependency_ref_qualification.py
@@ -72,7 +72,7 @@ class TestDependencyRefQualification:
mthds_files.append(mthds_file)
manager = LibraryManager()
- manager._load_single_dependency( # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ manager._load_single_dependency( # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
library=library,
resolved_dep=ResolvedDependency(
alias="charts_dep",
diff --git a/tests/unit/pipelex/libraries/test_library_crate_accumulation.py b/tests/unit/pipelex/libraries/test_library_crate_accumulation.py
index 1227570c1..190f639b4 100644
--- a/tests/unit/pipelex/libraries/test_library_crate_accumulation.py
+++ b/tests/unit/pipelex/libraries/test_library_crate_accumulation.py
@@ -191,7 +191,7 @@ class TestLibraryCrateAccumulation:
# Fingerprint must NOT be cached — a retry should attempt loading again
concrete_manager = cast("LibraryManager", library_manager)
- loaded_set = concrete_manager._loaded_fingerprints.get(target_library_id, set()) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ loaded_set = concrete_manager._loaded_fingerprints.get(target_library_id, set()) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert crate.fingerprint not in loaded_set
finally:
library_manager.teardown(library_id=target_library_id)
diff --git a/tests/unit/pipelex/libraries/test_library_isolation.py b/tests/unit/pipelex/libraries/test_library_isolation.py
index 7996dee56..92533bc5b 100644
--- a/tests/unit/pipelex/libraries/test_library_isolation.py
+++ b/tests/unit/pipelex/libraries/test_library_isolation.py
@@ -156,7 +156,7 @@ class TestLibraryIsolation:
mock_pipe.pipe_dependencies.return_value = ["scoring_dep->pkg_test_scoring_dep.pkg_test_compute_score"]
# Even though the pipe isn't in the main pipe library, the alias has a child library
- assert library._has_unresolved_cross_package_deps(mock_pipe) is False # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ assert library._has_unresolved_cross_package_deps(mock_pipe) is False # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
def test_has_unresolved_cross_package_deps_without_child_library(self, mocker: MockerFixture):
"""_has_unresolved_cross_package_deps returns True when alias has no child library."""
@@ -165,4 +165,4 @@ class TestLibraryIsolation:
mock_pipe = mocker.MagicMock()
mock_pipe.pipe_dependencies.return_value = ["unknown_dep->domain.pipe"]
- assert library._has_unresolved_cross_package_deps(mock_pipe) is True # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ assert library._has_unresolved_cross_package_deps(mock_pipe) is True # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
diff --git a/tests/unit/pipelex/libraries/test_mthds_version_warning.py b/tests/unit/pipelex/libraries/test_mthds_version_warning.py
index 8dd33b380..0178952f8 100644
--- a/tests/unit/pipelex/libraries/test_mthds_version_warning.py
+++ b/tests/unit/pipelex/libraries/test_mthds_version_warning.py
@@ -17,7 +17,7 @@ class TestMthdsVersionWarning:
mock_log = mocker.patch("pipelex.libraries.library_manager.log")
manager = LibraryManager()
- manager._warn_if_mthds_version_unsatisfied( # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ manager._warn_if_mthds_version_unsatisfied( # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
mthds_version_constraint="^2.0.0",
package_address="github.com/org/pkg",
)
@@ -34,7 +34,7 @@ class TestMthdsVersionWarning:
mock_log = mocker.patch("pipelex.libraries.library_manager.log")
manager = LibraryManager()
- manager._warn_if_mthds_version_unsatisfied( # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ manager._warn_if_mthds_version_unsatisfied( # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
mthds_version_constraint="^1.0.0",
package_address="github.com/org/pkg",
)
@@ -46,7 +46,7 @@ class TestMthdsVersionWarning:
mock_log = mocker.patch("pipelex.libraries.library_manager.log")
manager = LibraryManager()
- manager._warn_if_mthds_version_unsatisfied( # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ manager._warn_if_mthds_version_unsatisfied( # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
mthds_version_constraint=">>>garbage",
package_address="github.com/org/pkg",
)
@@ -82,7 +82,7 @@ class TestMthdsVersionWarning:
manager = LibraryManager()
library = LibraryFactory.make_empty()
- manager._load_single_dependency( # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ manager._load_single_dependency( # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
library=library,
resolved_dep=resolved_dep,
)
diff --git a/tests/unit/pipelex/libraries/test_standalone_reserved_domains.py b/tests/unit/pipelex/libraries/test_standalone_reserved_domains.py
index 4613dd476..e44390ec7 100644
--- a/tests/unit/pipelex/libraries/test_standalone_reserved_domains.py
+++ b/tests/unit/pipelex/libraries/test_standalone_reserved_domains.py
@@ -40,7 +40,7 @@ class TestStandaloneReservedDomains:
manager = LibraryManager()
with pytest.raises(LibraryLoadingError, match="Reserved domain violations"):
- manager._check_package_visibility( # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ manager._check_package_visibility( # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
blueprints=[blueprint],
mthds_paths=[dummy_path],
)
@@ -62,7 +62,7 @@ class TestStandaloneReservedDomains:
dummy_path.touch()
manager = LibraryManager()
- result = manager._check_package_visibility( # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ result = manager._check_package_visibility( # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
blueprints=[blueprint],
mthds_paths=[dummy_path],
)
@@ -98,7 +98,7 @@ class TestStandaloneReservedDomains:
manager = LibraryManager()
with pytest.raises(LibraryLoadingError, match="Reserved domain violations"):
- manager._check_package_visibility( # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ manager._check_package_visibility( # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
blueprints=[blueprint],
mthds_paths=[dummy_path],
)
@@ -123,7 +123,7 @@ class TestStandaloneReservedDomains:
dummy_path.touch()
manager = LibraryManager()
- result = manager._check_package_visibility( # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ result = manager._check_package_visibility( # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
blueprints=[blueprint],
mthds_paths=[dummy_path],
)
diff --git a/tests/unit/pipelex/libraries/test_unresolved_dependency_message_arms.py b/tests/unit/pipelex/libraries/test_unresolved_dependency_message_arms.py
index e4eb18f06..20d3cc5a1 100644
--- a/tests/unit/pipelex/libraries/test_unresolved_dependency_message_arms.py
+++ b/tests/unit/pipelex/libraries/test_unresolved_dependency_message_arms.py
@@ -11,7 +11,7 @@ message from telling a fiction:
"""
from pipelex.libraries.library import (
- _describe_unresolved_pipe_dependency, # noqa: PLC2701 # pyright: ignore[reportPrivateUsage]
+ _describe_unresolved_pipe_dependency, # pyright: ignore[reportPrivateUsage]
)
from pipelex.libraries.pipe.exceptions import PipeLibraryError, PipeNotFoundError
diff --git a/tests/unit/pipelex/pipe_controllers/condition/test_pipe_condition_input.py b/tests/unit/pipelex/pipe_controllers/condition/test_pipe_condition_input.py
index 228d22262..9e5bd4145 100644
--- a/tests/unit/pipelex/pipe_controllers/condition/test_pipe_condition_input.py
+++ b/tests/unit/pipelex/pipe_controllers/condition/test_pipe_condition_input.py
@@ -49,7 +49,7 @@ class TestPipeConditionValidateInputs:
load_empty_library()
log.verbose(f"Testing error case: {test_id}")
- with pytest.raises((PipeValidationError, ValueError)) as exc_info: # noqa: PT012
+ with pytest.raises((PipeValidationError, ValueError)) as exc_info: # ruff: ignore[pytest-raises-with-multiple-statements]
# Construct blueprint from dict at test time to trigger validation
blueprint = PipeConditionBlueprint.model_validate(blueprint_dict)
pipe_condition = PipeFactory[PipeCondition].make_from_blueprint(
diff --git a/tests/unit/pipelex/pipe_controllers/parallel/test_pipe_parallel_input.py b/tests/unit/pipelex/pipe_controllers/parallel/test_pipe_parallel_input.py
index 5e3cbf943..156004c46 100644
--- a/tests/unit/pipelex/pipe_controllers/parallel/test_pipe_parallel_input.py
+++ b/tests/unit/pipelex/pipe_controllers/parallel/test_pipe_parallel_input.py
@@ -49,7 +49,7 @@ class TestPipeParallelValidateInputs:
load_empty_library()
log.verbose(f"Testing error case: {test_id}")
- with pytest.raises((PipeValidationError, ValueError)) as exc_info: # noqa: PT012
+ with pytest.raises((PipeValidationError, ValueError)) as exc_info: # ruff: ignore[pytest-raises-with-multiple-statements]
# Construct blueprint from dict at test time to trigger validation
blueprint = PipeParallelBlueprint.model_validate(blueprint_dict)
pipe_parallel = PipeFactory[PipeParallel].make_from_blueprint(
diff --git a/tests/unit/pipelex/pipe_controllers/sequence/test_pipe_sequence_input.py b/tests/unit/pipelex/pipe_controllers/sequence/test_pipe_sequence_input.py
index 20654c844..eea91096f 100644
--- a/tests/unit/pipelex/pipe_controllers/sequence/test_pipe_sequence_input.py
+++ b/tests/unit/pipelex/pipe_controllers/sequence/test_pipe_sequence_input.py
@@ -49,7 +49,7 @@ class TestPipeSequenceValidateInputs:
load_empty_library()
log.verbose(f"Testing error case: {test_id}")
- with pytest.raises((PipeValidationError, ValueError)) as exc_info: # noqa: PT012
+ with pytest.raises((PipeValidationError, ValueError)) as exc_info: # ruff: ignore[pytest-raises-with-multiple-statements]
# Construct blueprint from dict at test time to trigger validation
blueprint = PipeSequenceBlueprint.model_validate(blueprint_dict)
pipe_sequence = PipeFactory[PipeSequence].make_from_blueprint(
diff --git a/tests/unit/pipelex/pipe_machinery/rendering/test_input_renderer_light.py b/tests/unit/pipelex/pipe_machinery/rendering/test_input_renderer_light.py
index 72bdc81bd..8f826a3a3 100644
--- a/tests/unit/pipelex/pipe_machinery/rendering/test_input_renderer_light.py
+++ b/tests/unit/pipelex/pipe_machinery/rendering/test_input_renderer_light.py
@@ -22,7 +22,7 @@ import tomli
from pipelex.core.memory.input_shaper import InputKind
from pipelex.pipe_machinery.rendering.input_renderer import (
- _delighten_entry, # noqa: PLC2701 # pyright: ignore[reportPrivateUsage]
+ _delighten_entry, # pyright: ignore[reportPrivateUsage]
serialize_inputs_template_to_toml,
)
diff --git a/tests/unit/pipelex/pipe_machinery/rendering/test_output_renderer_collect_condition.py b/tests/unit/pipelex/pipe_machinery/rendering/test_output_renderer_collect_condition.py
index f97fa36fa..04f9a31c1 100644
--- a/tests/unit/pipelex/pipe_machinery/rendering/test_output_renderer_collect_condition.py
+++ b/tests/unit/pipelex/pipe_machinery/rendering/test_output_renderer_collect_condition.py
@@ -6,7 +6,9 @@ from pytest_mock import MockerFixture
from pipelex.core.concepts.concept_representation_generator import ConceptRepresentationFormat
from pipelex.core.concepts.exceptions import ConceptError
from pipelex.libraries.concept.concept_library import ConceptLibrary
-from pipelex.pipe_machinery.rendering.output_renderer import _collect_possible_outputs # noqa: PLC2701 # pyright: ignore[reportPrivateUsage]
+from pipelex.pipe_machinery.rendering.output_renderer import (
+ _collect_possible_outputs, # pyright: ignore[reportPrivateUsage]
+)
GET_REQUIRED_PIPE_TARGET = "pipelex.pipe_machinery.rendering.output_renderer.get_required_pipe"
diff --git a/tests/unit/pipelex/pipe_machinery/rendering/test_output_renderer_collect_sequence.py b/tests/unit/pipelex/pipe_machinery/rendering/test_output_renderer_collect_sequence.py
index ebb688730..db974aa0a 100644
--- a/tests/unit/pipelex/pipe_machinery/rendering/test_output_renderer_collect_sequence.py
+++ b/tests/unit/pipelex/pipe_machinery/rendering/test_output_renderer_collect_sequence.py
@@ -6,7 +6,9 @@ from pytest_mock import MockerFixture
from pipelex.core.concepts.concept_representation_generator import ConceptRepresentationFormat
from pipelex.core.concepts.exceptions import ConceptError
from pipelex.libraries.concept.concept_library import ConceptLibrary
-from pipelex.pipe_machinery.rendering.output_renderer import _collect_possible_outputs # noqa: PLC2701 # pyright: ignore[reportPrivateUsage]
+from pipelex.pipe_machinery.rendering.output_renderer import (
+ _collect_possible_outputs, # pyright: ignore[reportPrivateUsage]
+)
GET_REQUIRED_PIPE_TARGET = "pipelex.pipe_machinery.rendering.output_renderer.get_required_pipe"
diff --git a/tests/unit/pipelex/pipe_operators/pipe_compose/test_structured_content_composer.py b/tests/unit/pipelex/pipe_operators/pipe_compose/test_structured_content_composer.py
index 4a1a3dd62..8e38fe73d 100644
--- a/tests/unit/pipelex/pipe_operators/pipe_compose/test_structured_content_composer.py
+++ b/tests/unit/pipelex/pipe_operators/pipe_compose/test_structured_content_composer.py
@@ -584,7 +584,7 @@ class TestGetNestedFieldClassOptionalSyntaxes:
)
# Directly test the private method (noqa needed for testing internal behavior)
- result = composer._get_nested_field_class("headquarters") # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ result = composer._get_nested_field_class("headquarters") # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert result is Address, f"Expected Address, got {result}"
@@ -614,7 +614,7 @@ class TestGetNestedFieldClassOptionalSyntaxes:
)
# Directly test the private method (noqa needed for testing internal behavior)
- result = composer._get_nested_field_class("headquarters") # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ result = composer._get_nested_field_class("headquarters") # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert result is Address, f"Expected Address, got {result}"
@@ -647,8 +647,8 @@ class TestGetNestedFieldClassOptionalSyntaxes:
)
# Ignore lint/type errors: testing internal behavior directly
- result_typing = composer_typing_optional._get_nested_field_class("headquarters") # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
- result_union = composer_union_syntax._get_nested_field_class("headquarters") # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ result_typing = composer_typing_optional._get_nested_field_class("headquarters") # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
+ result_union = composer_union_syntax._get_nested_field_class("headquarters") # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert result_typing is Address
assert result_union is Address
@@ -706,7 +706,7 @@ class TestGetNestedFieldClassGenericTypes:
)
# Directly test the private method (noqa needed for testing internal behavior)
- result = composer._get_nested_field_class("branches") # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ result = composer._get_nested_field_class("branches") # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
# The bug would have returned Address here instead of list[Address]
assert result is not Address, "list[Address] should NOT be unwrapped to Address"
@@ -735,7 +735,7 @@ class TestGetNestedFieldClassGenericTypes:
)
# Directly test the private method (noqa needed for testing internal behavior)
- result = composer._get_nested_field_class("offices") # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ result = composer._get_nested_field_class("offices") # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
# The bug would have returned str here instead of dict[str, Address]
assert result is not str, "dict[str, Address] should NOT be unwrapped to str"
diff --git a/tests/unit/pipelex/pipe_operators/pipe_func/data.py b/tests/unit/pipelex/pipe_operators/pipe_func/data.py
index 38f6c3330..d3b660a8e 100644
--- a/tests/unit/pipelex/pipe_operators/pipe_func/data.py
+++ b/tests/unit/pipelex/pipe_operators/pipe_func/data.py
@@ -8,7 +8,7 @@ from pipelex.system.registries.func_registry import pipe_func
# Register test functions for validation tests
@pipe_func(name="my_function")
-def my_function(working_memory: WorkingMemory) -> TextContent: # noqa: ARG001 # pyright: ignore[reportUnusedParameter]
+def my_function(working_memory: WorkingMemory) -> TextContent: # ruff: ignore[unused-function-argument] # pyright: ignore[reportUnusedParameter]
"""Test function with no inputs."""
return TextContent(text="test output")
diff --git a/tests/unit/pipelex/pipe_operators/pipe_func/test_direct_executor_workdir.py b/tests/unit/pipelex/pipe_operators/pipe_func/test_direct_executor_workdir.py
index 28daef588..0930a5952 100644
--- a/tests/unit/pipelex/pipe_operators/pipe_func/test_direct_executor_workdir.py
+++ b/tests/unit/pipelex/pipe_operators/pipe_func/test_direct_executor_workdir.py
@@ -67,12 +67,12 @@ class TestDirectExecutorWorkdir:
pipe_run_params=PipeRunParams(run_mode=PipeRunMode.DRY, pipe_stack_limit=10, batch_max_concurrency=None),
)
- with scoped_current_library(library_id=direct_pipe_func_executor._TRANSPORTED_LIBRARY_ID): # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ with scoped_current_library(library_id=direct_pipe_func_executor._TRANSPORTED_LIBRARY_ID): # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
try:
with pytest.raises((PipelexError, ValidationError)):
await DirectPipeFuncExecutor().run_pipe_func_transported(request=request)
finally:
- get_library_manager().teardown(library_id=direct_pipe_func_executor._TRANSPORTED_LIBRARY_ID) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ get_library_manager().teardown(library_id=direct_pipe_func_executor._TRANSPORTED_LIBRARY_ID) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert not workdir.exists()
@@ -92,12 +92,12 @@ class TestDirectExecutorWorkdir:
pipe_run_params=PipeRunParams(run_mode=PipeRunMode.DRY, pipe_stack_limit=10, batch_max_concurrency=None),
)
- with scoped_current_library(library_id=direct_pipe_func_executor._TRANSPORTED_LIBRARY_ID): # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ with scoped_current_library(library_id=direct_pipe_func_executor._TRANSPORTED_LIBRARY_ID): # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
try:
with pytest.raises((PipelexError, ValidationError)):
await DirectPipeFuncExecutor().run_pipe_func_transported(request=request)
finally:
- get_library_manager().teardown(library_id=direct_pipe_func_executor._TRANSPORTED_LIBRARY_ID) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ get_library_manager().teardown(library_id=direct_pipe_func_executor._TRANSPORTED_LIBRARY_ID) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
stale_entries = [entry for entry in sys.path if Path(entry).is_relative_to(workdir)]
assert stale_entries == []
@@ -144,12 +144,12 @@ class TestDirectExecutorWorkdir:
pipe_run_params=PipeRunParams(run_mode=PipeRunMode.DRY, pipe_stack_limit=10, batch_max_concurrency=None),
)
- with scoped_current_library(library_id=direct_pipe_func_executor._TRANSPORTED_LIBRARY_ID): # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ with scoped_current_library(library_id=direct_pipe_func_executor._TRANSPORTED_LIBRARY_ID): # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
try:
# No raise = the func registered = `from structures import Greeting` resolved against the
# generated structures.py. Before the fix this raised "Function 'greet_it' not found in registry".
response = await DirectPipeFuncExecutor().run_pipe_func_transported(request=request)
finally:
- get_library_manager().teardown(library_id=direct_pipe_func_executor._TRANSPORTED_LIBRARY_ID) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ get_library_manager().teardown(library_id=direct_pipe_func_executor._TRANSPORTED_LIBRARY_ID) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert response.function_qualname == "greet_it"
diff --git a/tests/unit/pipelex/pipe_operators/pipe_func/test_pipe_func_hosted_mode.py b/tests/unit/pipelex/pipe_operators/pipe_func/test_pipe_func_hosted_mode.py
index 0f0dd5e1c..d613b6bad 100644
--- a/tests/unit/pipelex/pipe_operators/pipe_func/test_pipe_func_hosted_mode.py
+++ b/tests/unit/pipelex/pipe_operators/pipe_func/test_pipe_func_hosted_mode.py
@@ -87,7 +87,7 @@ class TestPipeFuncHostedMode:
blueprint=blueprint,
)
- pipe_output = await pipe_func._dry_run_operator_pipe( # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ pipe_output = await pipe_func._dry_run_operator_pipe( # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
job_metadata=JobMetadata(run_metadata=RunMetadata(storage_scope="test/scope", user_id="user", pipeline_run_id="run")),
working_memory=WorkingMemoryFactory.make_empty(),
pipe_run_params=PipeRunParams(run_mode=PipeRunMode.DRY, pipe_stack_limit=10, batch_max_concurrency=None),
diff --git a/tests/unit/pipelex/pipe_operators/pipe_func/test_pipe_func_transported_ref.py b/tests/unit/pipelex/pipe_operators/pipe_func/test_pipe_func_transported_ref.py
index 2153a85f2..a81c85cdd 100644
--- a/tests/unit/pipelex/pipe_operators/pipe_func/test_pipe_func_transported_ref.py
+++ b/tests/unit/pipelex/pipe_operators/pipe_func/test_pipe_func_transported_ref.py
@@ -25,7 +25,7 @@ from pipelex.system.pipe_run_mode import PipeRunMode
from pipelex.system.registries.func_registry import func_registry
-def transported_ref_probe_func(working_memory: WorkingMemory) -> TextContent: # noqa: ARG001 # pyright: ignore[reportUnusedParameter]
+def transported_ref_probe_func(working_memory: WorkingMemory) -> TextContent: # ruff: ignore[unused-function-argument] # pyright: ignore[reportUnusedParameter]
"""Registered in the test so the PipeFunc validators accept the blueprint in local mode."""
return TextContent(text="probe")
@@ -55,7 +55,7 @@ class TestPipeFuncTransportedRef:
executor.run_pipe_func = mocker.AsyncMock(return_value=PipeFuncExecutionResult(content=TextContent(text="probe")))
mocker.patch("pipelex.pipe_operators.func.pipe_func.get_pipe_func_executor", return_value=executor)
- await the_pipe_func._live_run_operator_pipe( # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await the_pipe_func._live_run_operator_pipe( # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
job_metadata=JobMetadata(run_metadata=RunMetadata(storage_scope="test/scope", user_id="user", pipeline_run_id="run")),
working_memory=WorkingMemoryFactory.make_empty(),
pipe_run_params=PipeRunParams(run_mode=PipeRunMode.LIVE, pipe_stack_limit=10, batch_max_concurrency=None),
diff --git a/tests/unit/pipelex/pipe_operators/pipe_llm/test_prompt_rendering_purity.py b/tests/unit/pipelex/pipe_operators/pipe_llm/test_prompt_rendering_purity.py
index 0793595d8..d01de271f 100644
--- a/tests/unit/pipelex/pipe_operators/pipe_llm/test_prompt_rendering_purity.py
+++ b/tests/unit/pipelex/pipe_operators/pipe_llm/test_prompt_rendering_purity.py
@@ -141,7 +141,7 @@ class TestPromptRenderingPurity:
)
snapshot = pipe_llm.model_dump()
- await pipe_llm._dry_run_operator_pipe( # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await pipe_llm._dry_run_operator_pipe( # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
job_metadata=JobMetadata(
run_metadata=RunMetadata(storage_scope="test/scope", user_id="pytest", pipeline_run_id="test_prompt_rendering_purity")
),
diff --git a/tests/unit/pipelex/pipe_run/test_delivery_executor.py b/tests/unit/pipelex/pipe_run/test_delivery_executor.py
index 758bca6be..e120efe92 100644
--- a/tests/unit/pipelex/pipe_run/test_delivery_executor.py
+++ b/tests/unit/pipelex/pipe_run/test_delivery_executor.py
@@ -380,8 +380,8 @@ class TestDeliveryExecutor:
assert usage_doc == {"tokens_usages": None, "usage_assembly_error": "usage event read failed"}
async def test_try_local_hydrate_stuff_returns_typed_for_builtin(self) -> None:
- from pipelex.core.stuffs.text_content import TextContent # noqa: PLC0415
- from pipelex.runtime_hub import get_class_registry # noqa: PLC0415
+ from pipelex.core.stuffs.text_content import TextContent # ruff: ignore[import-outside-top-level]
+ from pipelex.runtime_hub import get_class_registry # ruff: ignore[import-outside-top-level]
registry = get_class_registry()
if not registry.has_class(name="TextContent"):
@@ -406,7 +406,7 @@ class TestDeliveryExecutor:
assert result.content.text == "Hello!"
async def test_try_local_hydrate_stuff_returns_none_for_missing_class(self, mocker: MockerFixture) -> None:
- from pipelex import log as pipelex_log # noqa: PLC0415
+ from pipelex import log as pipelex_log # ruff: ignore[import-outside-top-level]
warn_spy = mocker.spy(pipelex_log, "warning")
@@ -429,7 +429,7 @@ class TestDeliveryExecutor:
assert "Local hydration failed" in str(warn_spy.call_args)
async def test_try_local_hydrate_stuff_returns_none_for_malformed_dict(self, mocker: MockerFixture) -> None:
- from pipelex import log as pipelex_log # noqa: PLC0415
+ from pipelex import log as pipelex_log # ruff: ignore[import-outside-top-level]
warn_spy = mocker.spy(pipelex_log, "warning")
@@ -493,10 +493,10 @@ class TestDeliveryExecutor:
delivery activity blows up with `TypeError: Object of type PageContent is not JSON
serializable`. This test pins that scenario.
"""
- from pipelex.core.stuffs.image_content import ImageContent # noqa: PLC0415
- from pipelex.core.stuffs.page_content import PageContent # noqa: PLC0415
- from pipelex.core.stuffs.text_and_images_content import TextAndImagesContent # noqa: PLC0415
- from pipelex.core.stuffs.text_content import TextContent # noqa: PLC0415
+ from pipelex.core.stuffs.image_content import ImageContent # ruff: ignore[import-outside-top-level]
+ from pipelex.core.stuffs.page_content import PageContent # ruff: ignore[import-outside-top-level]
+ from pipelex.core.stuffs.text_and_images_content import TextAndImagesContent # ruff: ignore[import-outside-top-level]
+ from pipelex.core.stuffs.text_content import TextContent # ruff: ignore[import-outside-top-level]
page = PageContent(
text_and_images=TextAndImagesContent(
@@ -637,7 +637,7 @@ class TestDeliveryExecutor:
async def test_storage_completion_log_includes_request_id_when_set(self, mocker: MockerFixture) -> None:
"""The ``Storage delivery completed`` log line carries the originating ``request_id`` for cross-phase correlation."""
- from pipelex import log as pipelex_log # noqa: PLC0415
+ from pipelex import log as pipelex_log # ruff: ignore[import-outside-top-level]
info_spy = mocker.spy(pipelex_log, "info")
@@ -670,7 +670,7 @@ class TestDeliveryExecutor:
async def test_webhook_completion_log_includes_request_id_when_set(self, mocker: MockerFixture) -> None:
"""The ``Webhook delivery completed`` log line carries the originating ``request_id`` for cross-phase correlation."""
- from pipelex import log as pipelex_log # noqa: PLC0415
+ from pipelex import log as pipelex_log # ruff: ignore[import-outside-top-level]
info_spy = mocker.spy(pipelex_log, "info")
@@ -707,7 +707,7 @@ class TestDeliveryExecutor:
delivery log line — so a future refactor that split the FAILED and COMPLETED webhook code
paths cannot drop the correlation id from the failure surface.
"""
- from pipelex import log as pipelex_log # noqa: PLC0415
+ from pipelex import log as pipelex_log # ruff: ignore[import-outside-top-level]
info_spy = mocker.spy(pipelex_log, "info")
@@ -759,7 +759,7 @@ class TestDeliveryExecutor:
async def test_completion_logs_omit_request_id_when_unset(self, mocker: MockerFixture) -> None:
"""When ``request_id`` is None (run dispatched without an inbound id), the log lines do NOT print a stray ``request_id=None``."""
- from pipelex import log as pipelex_log # noqa: PLC0415
+ from pipelex import log as pipelex_log # ruff: ignore[import-outside-top-level]
info_spy = mocker.spy(pipelex_log, "info")
@@ -813,7 +813,7 @@ class TestDeliveryExecutor:
)
async def test_webhook_failure_raises(self, mocker: MockerFixture) -> None:
- import httpx # noqa: PLC0415
+ import httpx # ruff: ignore[import-outside-top-level]
mock_client = mocker.AsyncMock()
mock_client.__aenter__ = mocker.AsyncMock(return_value=mock_client)
diff --git a/tests/unit/pipelex/pipe_run/test_pipe_run.py b/tests/unit/pipelex/pipe_run/test_pipe_run.py
index 8e5acc449..85f2eb246 100644
--- a/tests/unit/pipelex/pipe_run/test_pipe_run.py
+++ b/tests/unit/pipelex/pipe_run/test_pipe_run.py
@@ -171,7 +171,7 @@ class TestPipeRun:
mock_router = mocker.AsyncMock()
- async def failing_run(*_args: object, **_kwargs: object) -> None: # noqa: RUF029
+ async def failing_run(*_args: object, **_kwargs: object) -> None: # ruff: ignore[unused-async]
call_order.append("router.run")
raise PipeRouterError(
message="fail",
@@ -187,7 +187,7 @@ class TestPipeRun:
"pipelex.pipe_run.pipe_run.DeliveryExecutor",
)
- async def mock_execute(*_args: object, **_kwargs: object) -> None: # noqa: RUF029
+ async def mock_execute(*_args: object, **_kwargs: object) -> None: # ruff: ignore[unused-async]
call_order.append("delivery.execute")
mock_executor.return_value.execute = mock_execute
diff --git a/tests/unit/pipelex/pipeline/fixes/test_fix_file_transaction.py b/tests/unit/pipelex/pipeline/fixes/test_fix_file_transaction.py
index 9257fd9b2..9d53efd5d 100644
--- a/tests/unit/pipelex/pipeline/fixes/test_fix_file_transaction.py
+++ b/tests/unit/pipelex/pipeline/fixes/test_fix_file_transaction.py
@@ -14,8 +14,8 @@ from pipelex.pipeline.fixes.file_transaction import (
read_file_snapshot,
)
from pipelex.pipeline.fixes.fix_loop import (
- _bind_fixes_to_snapshots, # pyright: ignore[reportPrivateUsage] # noqa: PLC2701
- _snapshot_loaded_sources, # pyright: ignore[reportPrivateUsage] # noqa: PLC2701
+ _bind_fixes_to_snapshots, # pyright: ignore[reportPrivateUsage]
+ _snapshot_loaded_sources, # pyright: ignore[reportPrivateUsage]
)
from pipelex.suggested_fix import FixSafety, SuggestedFix
diff --git a/tests/unit/pipelex/pipeline/test_bundle_graph_rendering_dry_run.py b/tests/unit/pipelex/pipeline/test_bundle_graph_rendering_dry_run.py
index 8f0f05b1e..f4a1deadf 100644
--- a/tests/unit/pipelex/pipeline/test_bundle_graph_rendering_dry_run.py
+++ b/tests/unit/pipelex/pipeline/test_bundle_graph_rendering_dry_run.py
@@ -7,7 +7,7 @@ from typing import TYPE_CHECKING
import pytest
from pipelex.pipeline.bundle_graph_rendering import (
- _dry_run_bundle, # noqa: PLC2701 # pyright: ignore[reportPrivateUsage]
+ _dry_run_bundle, # pyright: ignore[reportPrivateUsage]
)
if TYPE_CHECKING:
diff --git a/tests/unit/pipelex/pipeline/test_bundle_graph_rendering_sanitize.py b/tests/unit/pipelex/pipeline/test_bundle_graph_rendering_sanitize.py
index e9d77f051..9f1929520 100644
--- a/tests/unit/pipelex/pipeline/test_bundle_graph_rendering_sanitize.py
+++ b/tests/unit/pipelex/pipeline/test_bundle_graph_rendering_sanitize.py
@@ -3,7 +3,7 @@
from __future__ import annotations
from pipelex.pipeline.bundle_graph_rendering import (
- _sanitize_graph_name, # noqa: PLC2701 # pyright: ignore[reportPrivateUsage]
+ _sanitize_graph_name, # pyright: ignore[reportPrivateUsage]
)
diff --git a/tests/unit/pipelex/plugins/test_import_light_boot.py b/tests/unit/pipelex/plugins/test_import_light_boot.py
index 2b8129f07..222fb8df2 100644
--- a/tests/unit/pipelex/plugins/test_import_light_boot.py
+++ b/tests/unit/pipelex/plugins/test_import_light_boot.py
@@ -5,7 +5,7 @@ Enforced in a subprocess whose meta-path finder raises on those SDKs, which is d
where an in-process sys.modules check is not.
"""
-import subprocess # noqa: S404
+import subprocess # ruff: ignore[suspicious-subprocess-import]
import sys
import textwrap
@@ -80,7 +80,7 @@ _GUARD_SCRIPT = textwrap.dedent(
class TestImportLightBoot:
def test_building_registrar_imports_no_backend_sdk(self) -> None:
- result = subprocess.run( # noqa: S603
+ result = subprocess.run( # ruff: ignore[subprocess-without-shell-equals-true]
[sys.executable, "-c", _GUARD_SCRIPT],
capture_output=True,
text=True,
diff --git a/tests/unit/pipelex/plugins/test_installed_plugin_group_isolation.py b/tests/unit/pipelex/plugins/test_installed_plugin_group_isolation.py
index e70ecd7ad..1f505bf20 100644
--- a/tests/unit/pipelex/plugins/test_installed_plugin_group_isolation.py
+++ b/tests/unit/pipelex/plugins/test_installed_plugin_group_isolation.py
@@ -23,7 +23,7 @@ to success.
from __future__ import annotations
import os
-import subprocess # noqa: S404
+import subprocess # ruff: ignore[suspicious-subprocess-import]
import sys
import textwrap
from typing import TYPE_CHECKING
@@ -137,7 +137,7 @@ class TestInstalledPluginGroupIsolation:
)
sentinel = tmp_path / "imported.sentinel"
- result = subprocess.run( # noqa: S603
+ result = subprocess.run( # ruff: ignore[subprocess-without-shell-equals-true]
[sys.executable, "-c", _DISCOVERY_SCRIPT, str(site_dir), str(sentinel), _ENTRY_POINT_NAME],
capture_output=True,
text=True,
diff --git a/tests/unit/pipelex/plugins/test_plugin_discovery.py b/tests/unit/pipelex/plugins/test_plugin_discovery.py
index 36e121153..83a839466 100644
--- a/tests/unit/pipelex/plugins/test_plugin_discovery.py
+++ b/tests/unit/pipelex/plugins/test_plugin_discovery.py
@@ -119,7 +119,7 @@ def _build_registrar_with(
class TestPluginDiscovery:
def test_builtin_plugins_satisfy_the_protocol(self) -> None:
"""Every shipped built-in is a structural PipelexPlugin; a bare object is not."""
- from pipelex.interpreter_plugins.builtins import BUILTIN_PLUGINS # noqa: PLC0415
+ from pipelex.interpreter_plugins.builtins import BUILTIN_PLUGINS # ruff: ignore[import-outside-top-level]
for plugin in BUILTIN_PLUGINS:
assert isinstance(plugin, PipelexPlugin)
@@ -133,13 +133,16 @@ class TestPluginDiscovery:
failure mode this pins is a half silently dropping out of the composition, which would present
as a plugin quietly missing at boot rather than as an import error.
"""
- from pipelex.interpreter_plugins.builtins import ( # noqa: PLC0415
+ from pipelex.interpreter_plugins.builtins import ( # ruff: ignore[import-outside-top-level]
BUILTIN_PLUGINS,
CORE_UNCONDITIONAL_PLUGIN_NAMES,
INTERPRETER_BUILTIN_PLUGINS,
INTERPRETER_CORE_UNCONDITIONAL_PLUGIN_NAMES,
)
- from pipelex.providers.builtins import KERNEL_BUILTIN_PLUGINS, KERNEL_CORE_UNCONDITIONAL_PLUGIN_NAMES # noqa: PLC0415
+ from pipelex.providers.builtins import ( # ruff: ignore[import-outside-top-level]
+ KERNEL_BUILTIN_PLUGINS,
+ KERNEL_CORE_UNCONDITIONAL_PLUGIN_NAMES,
+ )
assert [*INTERPRETER_BUILTIN_PLUGINS, *KERNEL_BUILTIN_PLUGINS] == BUILTIN_PLUGINS
assert CORE_UNCONDITIONAL_PLUGIN_NAMES == INTERPRETER_CORE_UNCONDITIONAL_PLUGIN_NAMES | KERNEL_CORE_UNCONDITIONAL_PLUGIN_NAMES
@@ -151,7 +154,7 @@ class TestPluginDiscovery:
"""A registered backend is retrievable by (family, sdk) and is the exact callable."""
registrar = _build_registrar_with(mocker=mocker, plugins=[_InferencePlugin(name="synthetic", sdk="synthetic_sdk")])
- from pipelex.plugins.inference_backend_registry import InferenceBackendRegistry # noqa: PLC0415
+ from pipelex.plugins.inference_backend_registry import InferenceBackendRegistry # ruff: ignore[import-outside-top-level]
registry = InferenceBackendRegistry(registrar.inference_backends)
assert registry.lookup(family=InferenceFamily.LLM, sdk="synthetic_sdk") is _noop_make_worker
@@ -251,7 +254,7 @@ class TestPluginDiscovery:
@pytest.mark.parametrize("plugin_name", ["direct", "pipe_func", "storage", "secrets", "openai"])
def test_disabling_core_unconditional_plugin_raises(self, plugin_name: str) -> None:
"""Denylisting any plugin core requires unconditionally (pipe_func/storage/secrets included) is a startup error."""
- from pipelex.interpreter_plugins.builtins import BUILTIN_PLUGINS, CORE_UNCONDITIONAL_PLUGIN_NAMES # noqa: PLC0415
+ from pipelex.interpreter_plugins.builtins import BUILTIN_PLUGINS, CORE_UNCONDITIONAL_PLUGIN_NAMES # ruff: ignore[import-outside-top-level]
with pytest.raises(CoreUnconditionalPluginDisabledError) as exc_info:
build_registrar(
@@ -265,7 +268,7 @@ class TestPluginDiscovery:
def test_discoveries_describe_builtins(self) -> None:
"""build_registrar records each built-in with origin/status/contributions for `plugins list`."""
- from pipelex.interpreter_plugins.builtins import BUILTIN_PLUGINS, CORE_UNCONDITIONAL_PLUGIN_NAMES # noqa: PLC0415
+ from pipelex.interpreter_plugins.builtins import BUILTIN_PLUGINS, CORE_UNCONDITIONAL_PLUGIN_NAMES # ruff: ignore[import-outside-top-level]
registrar = build_registrar(
config=_fake_config([]),
diff --git a/tests/unit/pipelex/providers/anthropic/test_anthropic_reasoning.py b/tests/unit/pipelex/providers/anthropic/test_anthropic_reasoning.py
index 8db9f7856..9bd392ad8 100644
--- a/tests/unit/pipelex/providers/anthropic/test_anthropic_reasoning.py
+++ b/tests/unit/pipelex/providers/anthropic/test_anthropic_reasoning.py
@@ -65,7 +65,7 @@ class TestAnthropicReasoning:
budget_mock = mocker.MagicMock(return_value=expected_budget)
_mock_config(mocker, budget_mock=budget_mock)
job_params = LLMJobParams(temperature=0.5, reasoning_effort=effort)
- result = worker._build_thinking_params(job_params=job_params, max_tokens=100000) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ result = worker._build_thinking_params(job_params=job_params, max_tokens=100000) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert result.thinking == {"type": "enabled", "budget_tokens": expected_budget}
assert result.suppress_temperature is True
budget_mock.assert_called_once_with(family="anthropic", effort=effort)
@@ -76,7 +76,7 @@ class TestAnthropicReasoning:
budget_mock = mocker.MagicMock()
_mock_config(mocker, budget_mock=budget_mock)
job_params = LLMJobParams(temperature=0.5, reasoning_effort=ReasoningEffort.NONE)
- result = worker._build_thinking_params(job_params=job_params, max_tokens=100000) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ result = worker._build_thinking_params(job_params=job_params, max_tokens=100000) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert result.thinking is None
assert result.suppress_temperature is False
budget_mock.assert_not_called()
@@ -87,14 +87,14 @@ class TestAnthropicReasoning:
budget_mock = mocker.MagicMock(return_value=16384)
_mock_config(mocker, budget_mock=budget_mock)
job_params = LLMJobParams(temperature=0.5, reasoning_effort=ReasoningEffort.HIGH)
- result = worker._build_thinking_params(job_params=job_params, max_tokens=2000) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ result = worker._build_thinking_params(job_params=job_params, max_tokens=2000) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert result.thinking == {"type": "enabled", "budget_tokens": 1999}
def test_explicit_budget_passes_through(self, mocker: MockerFixture):
"""Explicit reasoning_budget passes through directly as budget_tokens in MANUAL mode."""
worker = _make_worker(mocker, thinking_mode=ThinkingMode.MANUAL)
job_params = LLMJobParams(temperature=0.5, reasoning_budget=8192)
- result = worker._build_thinking_params(job_params=job_params, max_tokens=100000) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ result = worker._build_thinking_params(job_params=job_params, max_tokens=100000) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert result.thinking == {"type": "enabled", "budget_tokens": 8192}
assert result.suppress_temperature is True
@@ -103,4 +103,4 @@ class TestAnthropicReasoning:
worker = _make_worker(mocker, thinking_mode=ThinkingMode.NONE)
job_params = LLMJobParams(temperature=0.5, reasoning_effort=ReasoningEffort.HIGH)
with pytest.raises(LLMCapabilityError, match="does not support reasoning"):
- worker._build_thinking_params(job_params=job_params, max_tokens=100000) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ worker._build_thinking_params(job_params=job_params, max_tokens=100000) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
diff --git a/tests/unit/pipelex/providers/anthropic/test_anthropic_worker_error_handling.py b/tests/unit/pipelex/providers/anthropic/test_anthropic_worker_error_handling.py
index ae5cb174e..7d6db8b6c 100644
--- a/tests/unit/pipelex/providers/anthropic/test_anthropic_worker_error_handling.py
+++ b/tests/unit/pipelex/providers/anthropic/test_anthropic_worker_error_handling.py
@@ -121,7 +121,7 @@ class TestAnthropicWorkerErrorHandling:
worker.anthropic_async_client.messages.stream.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_text(llm_job=_make_llm_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_text(llm_job=_make_llm_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is expected_category
assert exc_info.value.__cause__ is sdk_exc
@@ -138,7 +138,7 @@ class TestAnthropicWorkerErrorHandling:
worker.anthropic_async_client.messages.stream.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_text(llm_job=_make_llm_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_text(llm_job=_make_llm_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENT
assert exc_info.value.__cause__ is sdk_exc
@@ -163,7 +163,7 @@ class TestAnthropicWorkerErrorHandling:
worker.anthropic_async_client.messages.stream.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_text(llm_job=_make_llm_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_text(llm_job=_make_llm_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is expected_category
assert exc_info.value.__cause__ is sdk_exc
@@ -180,7 +180,7 @@ class TestAnthropicWorkerErrorHandling:
worker.anthropic_async_client.messages.stream.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_text(llm_job=_make_llm_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_text(llm_job=_make_llm_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENT
assert exc_info.value.__cause__ is sdk_exc
@@ -192,7 +192,7 @@ class TestAnthropicWorkerErrorHandling:
worker.anthropic_async_client.messages.stream.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_text(llm_job=_make_llm_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_text(llm_job=_make_llm_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATION
assert exc_info.value.user_action is not None
@@ -208,7 +208,7 @@ class TestAnthropicWorkerErrorHandling:
worker.anthropic_async_client.messages.stream.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_text(llm_job=_make_llm_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_text(llm_job=_make_llm_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CAPACITY
@@ -219,7 +219,7 @@ class TestAnthropicWorkerErrorHandling:
worker.anthropic_async_client.messages.stream.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_text(llm_job=_make_llm_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_text(llm_job=_make_llm_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATION
@@ -232,7 +232,7 @@ class TestAnthropicWorkerErrorHandling:
worker.anthropic_async_client.messages.stream.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_text(llm_job=_make_llm_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_text(llm_job=_make_llm_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENT
assert exc_info.value.__cause__ is sdk_exc
@@ -247,7 +247,7 @@ class TestAnthropicWorkerErrorHandling:
worker.anthropic_async_client.messages.stream.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_text(llm_job=_make_llm_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_text(llm_job=_make_llm_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATION
assert exc_info.value.__cause__ is sdk_exc
@@ -264,7 +264,7 @@ class TestAnthropicWorkerErrorHandling:
worker.anthropic_async_client.messages.stream.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMModelNotFoundError) as exc_info:
- await worker._gen_text(llm_job=_make_llm_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_text(llm_job=_make_llm_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATION
assert exc_info.value.model_handle == "claude-sonnet-4"
@@ -279,7 +279,7 @@ class TestAnthropicWorkerErrorHandling:
worker.anthropic_async_client.messages.stream.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_text(llm_job=_make_llm_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_text(llm_job=_make_llm_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
report = exc_info.value.to_error_report()
assert report.error_category == "transient"
diff --git a/tests/unit/pipelex/providers/anthropic/test_anthropic_worker_object_error_handling.py b/tests/unit/pipelex/providers/anthropic/test_anthropic_worker_object_error_handling.py
index d11dab43e..192827830 100644
--- a/tests/unit/pipelex/providers/anthropic/test_anthropic_worker_object_error_handling.py
+++ b/tests/unit/pipelex/providers/anthropic/test_anthropic_worker_object_error_handling.py
@@ -112,7 +112,7 @@ class TestAnthropicWorkerObjectErrorHandling:
worker.instructor_for_objects.chat.completions.create_with_completion.side_effect = wrapped # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENT
assert exc_info.value.user_action is not None
@@ -133,7 +133,7 @@ class TestAnthropicWorkerObjectErrorHandling:
worker.instructor_for_objects.chat.completions.create_with_completion.side_effect = wrapped # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CAPACITY
assert exc_info.value.user_action is not None
@@ -151,7 +151,7 @@ class TestAnthropicWorkerObjectErrorHandling:
worker.instructor_for_objects.chat.completions.create_with_completion.side_effect = wrapped # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENT
@@ -163,7 +163,7 @@ class TestAnthropicWorkerObjectErrorHandling:
worker.instructor_for_objects.chat.completions.create_with_completion.side_effect = wrapped # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONTENT
assert exc_info.value.user_action is not None
@@ -181,7 +181,7 @@ class TestAnthropicWorkerObjectErrorHandling:
worker.instructor_for_objects.chat.completions.create_with_completion.side_effect = wrapped # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENT
@@ -192,7 +192,7 @@ class TestAnthropicWorkerObjectErrorHandling:
worker.instructor_for_objects.chat.completions.create_with_completion.side_effect = wrapped # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATION
assert exc_info.value.user_action is not None
@@ -205,7 +205,7 @@ class TestAnthropicWorkerObjectErrorHandling:
worker.instructor_for_objects.chat.completions.create_with_completion.side_effect = wrapped # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CAPACITY
assert exc_info.value.user_action is not None
@@ -219,7 +219,7 @@ class TestAnthropicWorkerObjectErrorHandling:
worker.instructor_for_objects.chat.completions.create_with_completion.side_effect = wrapped # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENT
assert exc_info.value.user_action is not None
@@ -237,7 +237,7 @@ class TestAnthropicWorkerObjectErrorHandling:
worker.instructor_for_objects.chat.completions.create_with_completion.side_effect = wrapped # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATION
assert exc_info.value.user_action is not None
@@ -255,7 +255,7 @@ class TestAnthropicWorkerObjectErrorHandling:
worker.instructor_for_objects.chat.completions.create_with_completion.side_effect = wrapped # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMModelNotFoundError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATION
assert exc_info.value.user_action is not None
@@ -274,7 +274,7 @@ class TestAnthropicWorkerObjectErrorHandling:
worker.instructor_for_objects.chat.completions.create_with_completion.side_effect = wrapped # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.UNKNOWN
assert exc_info.value.__cause__ is wrapped
@@ -290,7 +290,7 @@ class TestAnthropicWorkerObjectErrorHandling:
worker.instructor_for_objects.chat.completions.create_with_completion.side_effect = wrapped # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
report = exc_info.value.to_error_report()
report_dict = report.to_dict()
@@ -312,7 +312,7 @@ class TestAnthropicWorkerObjectErrorHandling:
transport error and does NOT wrap it in ``InstructorRetryException``. It propagates as
the raw SDK exception, which the worker's ``except`` clause classifies as TRANSIENT.
"""
- import instructor # noqa: PLC0415 # imported here to mirror runtime usage
+ import instructor # ruff: ignore[import-outside-top-level] # imported here to mirror runtime usage
_patch_gen_object_dependencies(mocker)
worker = _make_worker(mocker)
@@ -323,7 +323,7 @@ class TestAnthropicWorkerObjectErrorHandling:
worker.instructor_for_objects = instructor.from_anthropic(anthropic_client)
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENT
# The raw SDK exception propagates and chains directly — instructor no longer wraps it.
@@ -353,7 +353,7 @@ class TestAnthropicWorkerObjectErrorHandling:
worker.instructor_for_objects.chat.completions.create_with_completion.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is expected_category
assert exc_info.value.__cause__ is sdk_exc
diff --git a/tests/unit/pipelex/providers/azure_rest/test_azure_img_gen_worker_edit_routing.py b/tests/unit/pipelex/providers/azure_rest/test_azure_img_gen_worker_edit_routing.py
index 6b02008ff..aa4560ea1 100644
--- a/tests/unit/pipelex/providers/azure_rest/test_azure_img_gen_worker_edit_routing.py
+++ b/tests/unit/pipelex/providers/azure_rest/test_azure_img_gen_worker_edit_routing.py
@@ -71,7 +71,7 @@ class TestAzureImgGenWorkerEditRouting:
worker = _make_worker(mocker)
mock_client = _patch_httpx_success(mocker, args_dict={"quality": "medium", "image": [_PNG_FILE_TUPLE]})
- await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
call_args = mock_client.post.call_args
assert call_args.args[0] == "https://test.azure.com/openai/deployments/gpt-image-1/images/edits?api-version=2025-04-01-preview"
@@ -83,7 +83,7 @@ class TestAzureImgGenWorkerEditRouting:
worker = _make_worker(mocker)
mock_client = _patch_httpx_success(mocker, args_dict={"image": [_PNG_FILE_TUPLE, _PNG_FILE_TUPLE_2]})
- await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
files = mock_client.post.call_args.kwargs["files"]
assert files == [("image[]", _PNG_FILE_TUPLE), ("image[]", _PNG_FILE_TUPLE_2)]
@@ -92,7 +92,7 @@ class TestAzureImgGenWorkerEditRouting:
worker = _make_worker(mocker)
mock_client = _patch_httpx_success(mocker, args_dict={"quality": "medium"})
- await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
call_args = mock_client.post.call_args
assert call_args.args[0] == "https://test.azure.com/openai/deployments/gpt-image-1/images/generations?api-version=2025-04-01-preview"
diff --git a/tests/unit/pipelex/providers/azure_rest/test_azure_img_gen_worker_error_handling.py b/tests/unit/pipelex/providers/azure_rest/test_azure_img_gen_worker_error_handling.py
index 54bbce85a..3d07b5b0c 100644
--- a/tests/unit/pipelex/providers/azure_rest/test_azure_img_gen_worker_error_handling.py
+++ b/tests/unit/pipelex/providers/azure_rest/test_azure_img_gen_worker_error_handling.py
@@ -127,7 +127,7 @@ class TestAzureImgGenWorkerSemantic:
_patch_httpx_status_error(mocker, sdk_exc)
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENT
assert exc_info.value.user_action is not None
@@ -143,7 +143,7 @@ class TestAzureImgGenWorkerSemantic:
_patch_httpx_status_error(mocker, sdk_exc)
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CAPACITY
assert exc_info.value.user_action is not None
@@ -155,7 +155,7 @@ class TestAzureImgGenWorkerSemantic:
_patch_httpx_status_error(mocker, sdk_exc)
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATION
assert exc_info.value.user_action is not None
@@ -167,7 +167,7 @@ class TestAzureImgGenWorkerSemantic:
_patch_httpx_status_error(mocker, sdk_exc)
with pytest.raises(ImgGenModelNotFoundError) as exc_info:
- await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATION
assert exc_info.value.user_action is not None
@@ -180,7 +180,7 @@ class TestAzureImgGenWorkerSemantic:
_patch_httpx_status_error(mocker, sdk_exc)
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONTENT
assert exc_info.value.user_action is not None
@@ -193,7 +193,7 @@ class TestAzureImgGenWorkerSemantic:
_patch_httpx_status_error(mocker, sdk_exc)
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONTENT
assert exc_info.value.user_action is not None
@@ -208,7 +208,7 @@ class TestAzureImgGenWorkerSemantic:
_patch_httpx_status_error(mocker, sdk_exc)
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.AMBIGUOUS
assert exc_info.value.user_action is not None
@@ -223,7 +223,7 @@ class TestAzureImgGenWorkerSemantic:
_patch_httpx_malformed_json(mocker, raw_body=raw_body)
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.UNKNOWN
assert exc_info.value.user_action is not None
@@ -241,7 +241,7 @@ class TestAzureImgGenWorkerSemantic:
_patch_httpx_status_error(mocker, sdk_exc)
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert secret_body not in exc_info.value.message
assert secret_body not in str(exc_info.value)
@@ -283,7 +283,7 @@ class TestAzureImgGenWorkerSemantic:
_patch_httpx_post_raises(mocker, sdk_exc)
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is expected_category
assert exc_info.value.user_action is not None
@@ -304,7 +304,7 @@ class TestAzureImgGenWorkerSemantic:
)
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.UNKNOWN
assert exc_info.value.user_action is not None
diff --git a/tests/unit/pipelex/providers/azure_rest/test_azure_worker_error_handling.py b/tests/unit/pipelex/providers/azure_rest/test_azure_worker_error_handling.py
index cb4deab43..07d5ba414 100644
--- a/tests/unit/pipelex/providers/azure_rest/test_azure_worker_error_handling.py
+++ b/tests/unit/pipelex/providers/azure_rest/test_azure_worker_error_handling.py
@@ -83,7 +83,7 @@ class TestAzureWorkerErrorHandling:
)
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is expected_category
assert exc_info.value.user_action is not None
@@ -119,7 +119,7 @@ class TestAzureWorkerErrorHandling:
)
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is expected_category
assert exc_info.value.user_action is not None
@@ -157,7 +157,7 @@ class TestAzureWorkerErrorHandling:
)
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is expected_category
assert exc_info.value.user_action is not None
@@ -184,7 +184,7 @@ class TestAzureWorkerErrorHandling:
)
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
report = exc_info.value.to_error_report()
assert report.error_category == "transient"
diff --git a/tests/unit/pipelex/providers/bedrock/test_bedrock_reasoning.py b/tests/unit/pipelex/providers/bedrock/test_bedrock_reasoning.py
index c4b52d3e2..a41768cba 100644
--- a/tests/unit/pipelex/providers/bedrock/test_bedrock_reasoning.py
+++ b/tests/unit/pipelex/providers/bedrock/test_bedrock_reasoning.py
@@ -22,7 +22,7 @@ class TestBedrockReasoning:
"""Validation passes when no reasoning params are set."""
worker = _make_worker(mocker)
job_params = LLMJobParams(temperature=0.5)
- worker._validate_no_reasoning_params(job_params=job_params) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ worker._validate_no_reasoning_params(job_params=job_params) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
@pytest.mark.parametrize(
"effort",
@@ -40,11 +40,11 @@ class TestBedrockReasoning:
worker = _make_worker(mocker)
job_params = LLMJobParams(temperature=0.5, reasoning_effort=effort)
with pytest.raises(LLMCapabilityError, match="does not support reasoning parameters"):
- worker._validate_no_reasoning_params(job_params=job_params) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ worker._validate_no_reasoning_params(job_params=job_params) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
def test_reasoning_budget_raises_capability_error(self, mocker: MockerFixture):
"""reasoning_budget should raise LLMCapabilityError for Bedrock."""
worker = _make_worker(mocker)
job_params = LLMJobParams(temperature=0.5, reasoning_budget=4096)
with pytest.raises(LLMCapabilityError, match="does not support reasoning parameters"):
- worker._validate_no_reasoning_params(job_params=job_params) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ worker._validate_no_reasoning_params(job_params=job_params) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
diff --git a/tests/unit/pipelex/providers/bedrock/test_bedrock_worker_error_handling.py b/tests/unit/pipelex/providers/bedrock/test_bedrock_worker_error_handling.py
index 503d81250..eaac87004 100644
--- a/tests/unit/pipelex/providers/bedrock/test_bedrock_worker_error_handling.py
+++ b/tests/unit/pipelex/providers/bedrock/test_bedrock_worker_error_handling.py
@@ -88,7 +88,7 @@ class TestBedrockWorkerErrorHandling:
)
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_text(llm_job=_make_llm_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_text(llm_job=_make_llm_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is expected_category
assert exc_info.value.__cause__ is sdk_exc
@@ -112,7 +112,7 @@ class TestBedrockWorkerErrorHandling:
)
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_text(llm_job=_make_llm_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_text(llm_job=_make_llm_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
report = exc_info.value.to_error_report()
assert report.error_category == "transient"
@@ -133,7 +133,7 @@ class TestBedrockWorkerErrorHandling:
)
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_text(llm_job=_make_llm_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_text(llm_job=_make_llm_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
report = exc_info.value.to_error_report()
assert report.error_category == "capacity"
@@ -153,7 +153,7 @@ class TestBedrockWorkerErrorHandling:
)
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_text(llm_job=_make_llm_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_text(llm_job=_make_llm_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
report = exc_info.value.to_error_report()
assert report.error_category == "configuration"
diff --git a/tests/unit/pipelex/providers/bedrock/test_bedrock_worker_semantic.py b/tests/unit/pipelex/providers/bedrock/test_bedrock_worker_semantic.py
index ee5302d82..394192ac3 100644
--- a/tests/unit/pipelex/providers/bedrock/test_bedrock_worker_semantic.py
+++ b/tests/unit/pipelex/providers/bedrock/test_bedrock_worker_semantic.py
@@ -96,7 +96,7 @@ class TestBedrockWorkerSemantic:
)
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_text(llm_job=_make_llm_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_text(llm_job=_make_llm_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is expected_category
assert exc_info.value.user_action is not None
@@ -123,7 +123,7 @@ class TestBedrockWorkerSemantic:
)
with pytest.raises(LLMModelNotFoundError) as exc_info:
- await worker._gen_text(llm_job=_make_llm_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_text(llm_job=_make_llm_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATION
assert exc_info.value.user_action is not None
diff --git a/tests/unit/pipelex/providers/docling/test_docling_worker_error_handling.py b/tests/unit/pipelex/providers/docling/test_docling_worker_error_handling.py
index 2d85f0e81..400b8b8f0 100644
--- a/tests/unit/pipelex/providers/docling/test_docling_worker_error_handling.py
+++ b/tests/unit/pipelex/providers/docling/test_docling_worker_error_handling.py
@@ -60,7 +60,7 @@ class TestDoclingWorkerErrorHandling:
side_effect=sdk_exc,
)
# Mock prepare_file_from_uri to return a local path that the match statement can handle
- mock_prepared_file = PreparedFileLocalPath(path="/tmp/test.pdf") # noqa: S108
+ mock_prepared_file = PreparedFileLocalPath(path="/tmp/test.pdf") # ruff: ignore[hardcoded-temp-file]
mocker.patch(
"pipelex.providers.docling.docling_extract_worker.prepare_file_from_uri",
new_callable=mocker.AsyncMock,
@@ -68,7 +68,7 @@ class TestDoclingWorkerErrorHandling:
)
with pytest.raises(ExtractJobFailureError) as exc_info:
- await worker._extract_from_source(source_uri="/tmp/test.pdf") # noqa: SLF001, S108 # pyright: ignore[reportPrivateUsage]
+ await worker._extract_from_source(source_uri="/tmp/test.pdf") # ruff: ignore[private-member-access, hardcoded-temp-file] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is expected_category
assert exc_info.value.__cause__ is sdk_exc
@@ -84,7 +84,7 @@ class TestDoclingWorkerErrorHandling:
"pipelex.providers.docling.docling_extract_worker.asyncio.to_thread",
side_effect=sdk_exc,
)
- mock_prepared_file = PreparedFileLocalPath(path="/tmp/test.pdf") # noqa: S108
+ mock_prepared_file = PreparedFileLocalPath(path="/tmp/test.pdf") # ruff: ignore[hardcoded-temp-file]
mocker.patch(
"pipelex.providers.docling.docling_extract_worker.prepare_file_from_uri",
new_callable=mocker.AsyncMock,
@@ -92,7 +92,7 @@ class TestDoclingWorkerErrorHandling:
)
with pytest.raises(ExtractJobFailureError) as exc_info:
- await worker._extract_from_source(source_uri="/tmp/test.pdf") # noqa: SLF001, S108 # pyright: ignore[reportPrivateUsage]
+ await worker._extract_from_source(source_uri="/tmp/test.pdf") # ruff: ignore[private-member-access, hardcoded-temp-file] # pyright: ignore[reportPrivateUsage]
report = exc_info.value.to_error_report()
assert report.error_category == "content"
@@ -108,7 +108,7 @@ class TestDoclingWorkerErrorHandling:
"pipelex.providers.docling.docling_extract_worker.asyncio.to_thread",
side_effect=sdk_exc,
)
- mock_prepared_file = PreparedFileLocalPath(path="/tmp/test.pdf") # noqa: S108
+ mock_prepared_file = PreparedFileLocalPath(path="/tmp/test.pdf") # ruff: ignore[hardcoded-temp-file]
mocker.patch(
"pipelex.providers.docling.docling_extract_worker.prepare_file_from_uri",
new_callable=mocker.AsyncMock,
@@ -116,7 +116,7 @@ class TestDoclingWorkerErrorHandling:
)
with pytest.raises(ExtractJobFailureError) as exc_info:
- await worker._extract_from_source(source_uri="/tmp/test.pdf") # noqa: SLF001, S108 # pyright: ignore[reportPrivateUsage]
+ await worker._extract_from_source(source_uri="/tmp/test.pdf") # ruff: ignore[private-member-access, hardcoded-temp-file] # pyright: ignore[reportPrivateUsage]
report = exc_info.value.to_error_report()
assert report.error_category == "transient"
diff --git a/tests/unit/pipelex/providers/docling/test_docling_worker_semantic.py b/tests/unit/pipelex/providers/docling/test_docling_worker_semantic.py
index e40ef80a9..8a7728596 100644
--- a/tests/unit/pipelex/providers/docling/test_docling_worker_semantic.py
+++ b/tests/unit/pipelex/providers/docling/test_docling_worker_semantic.py
@@ -28,7 +28,7 @@ def _make_worker(mocker: MockerFixture) -> DoclingExtractWorker:
def _make_extract_job(mocker: MockerFixture) -> Any:
job = mocker.MagicMock()
job.extract_input.image_uri = None
- job.extract_input.document_uri = "/tmp/test.pdf" # noqa: S108
+ job.extract_input.document_uri = "/tmp/test.pdf" # ruff: ignore[hardcoded-temp-file]
job.job_params.max_nb_images = 0
job.job_report.extract_tokens_usage = None
return job
@@ -58,12 +58,12 @@ class TestDoclingWorkerSemantic:
worker = _make_worker(mocker)
sdk_exc = exception_class(exception_message)
- from pipelex.tools.uri.prepared_file import PreparedFileLocalPath # noqa: PLC0415
+ from pipelex.tools.uri.prepared_file import PreparedFileLocalPath # ruff: ignore[import-outside-top-level]
mocker.patch(
"pipelex.providers.docling.docling_extract_worker.prepare_file_from_uri",
new_callable=mocker.AsyncMock,
- return_value=PreparedFileLocalPath(path="/tmp/test.pdf"), # noqa: S108
+ return_value=PreparedFileLocalPath(path="/tmp/test.pdf"), # ruff: ignore[hardcoded-temp-file]
)
mocker.patch(
"pipelex.providers.docling.docling_extract_worker.asyncio.to_thread",
@@ -72,7 +72,7 @@ class TestDoclingWorkerSemantic:
)
with pytest.raises(ExtractJobFailureError) as exc_info:
- await worker._extract_pages(extract_job=_make_extract_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._extract_pages(extract_job=_make_extract_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is expected_category
assert exc_info.value.user_action is not None
diff --git a/tests/unit/pipelex/providers/fal/test_fal_img_gen_worker_semantic.py b/tests/unit/pipelex/providers/fal/test_fal_img_gen_worker_semantic.py
index 0f41011c8..886b8386a 100644
--- a/tests/unit/pipelex/providers/fal/test_fal_img_gen_worker_semantic.py
+++ b/tests/unit/pipelex/providers/fal/test_fal_img_gen_worker_semantic.py
@@ -80,7 +80,7 @@ class TestFalImgGenWorkerSemantic:
)
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._submit_and_get_result(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._submit_and_get_result(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is expected_category
assert exc_info.value.user_action is not None
@@ -102,7 +102,7 @@ class TestFalImgGenWorkerSemantic:
)
with pytest.raises(ImgGenModelNotFoundError) as exc_info:
- await worker._submit_and_get_result(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._submit_and_get_result(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATION
assert exc_info.value.user_action is not None
@@ -123,7 +123,7 @@ class TestFalImgGenWorkerSemantic:
)
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._submit_and_get_result(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._submit_and_get_result(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENT
assert exc_info.value.user_action is not None
@@ -143,7 +143,7 @@ class TestFalImgGenWorkerSemantic:
)
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._submit_and_get_result(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._submit_and_get_result(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENT
assert exc_info.value.user_action is not None
diff --git a/tests/unit/pipelex/providers/fal/test_fal_worker_error_handling.py b/tests/unit/pipelex/providers/fal/test_fal_worker_error_handling.py
index fb8303ddf..d299d60b8 100644
--- a/tests/unit/pipelex/providers/fal/test_fal_worker_error_handling.py
+++ b/tests/unit/pipelex/providers/fal/test_fal_worker_error_handling.py
@@ -94,7 +94,7 @@ class TestFalWorkerErrorHandling:
)
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._submit_and_get_result(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._submit_and_get_result(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is expected_category
assert exc_info.value.user_action is not None
@@ -124,7 +124,7 @@ class TestFalWorkerErrorHandling:
)
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._submit_and_get_result(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._submit_and_get_result(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is expected_category
assert exc_info.value.user_action is not None
@@ -154,7 +154,7 @@ class TestFalWorkerErrorHandling:
)
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._submit_and_get_result(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._submit_and_get_result(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is expected_category
assert exc_info.value.user_action is not None
@@ -184,7 +184,7 @@ class TestFalWorkerErrorHandling:
)
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._submit_and_get_result(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._submit_and_get_result(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is expected_category
assert exc_info.value.user_action is not None
@@ -204,7 +204,7 @@ class TestFalWorkerErrorHandling:
)
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._submit_and_get_result(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._submit_and_get_result(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
report = exc_info.value.to_error_report()
assert report.error_category == "capacity"
diff --git a/tests/unit/pipelex/providers/gateway/test_gateway_completions_extract_output.py b/tests/unit/pipelex/providers/gateway/test_gateway_completions_extract_output.py
index b0238187a..6c65c4e68 100644
--- a/tests/unit/pipelex/providers/gateway/test_gateway_completions_extract_output.py
+++ b/tests/unit/pipelex/providers/gateway/test_gateway_completions_extract_output.py
@@ -91,7 +91,7 @@ class TestGatewayCompletionsExtractOutput:
page_dicts = [{"index": 0, "markdown": "hello"}, {"index": 1, "markdown": "world"}]
response = _choices_response(json.dumps(page_dicts))
- result = GatewayCompletionsFactory._extract_pages_from_choices_content(response=response) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ result = GatewayCompletionsFactory._extract_pages_from_choices_content(response=response) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert result == page_dicts
@@ -113,7 +113,7 @@ class TestGatewayCompletionsExtractOutput:
"""Every malformed or missing choices/message/content shape returns None, never raises."""
response = _response(payload)
- result = GatewayCompletionsFactory._extract_pages_from_choices_content(response=response) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ result = GatewayCompletionsFactory._extract_pages_from_choices_content(response=response) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert result is None
@@ -149,7 +149,7 @@ class TestGatewayCompletionsExtractOutput:
},
)
- extract_output = GatewayCompletionsFactory._make_extract_output_from_response_azure(response=response) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ extract_output = GatewayCompletionsFactory._make_extract_output_from_response_azure(response=response) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert list(extract_output.pages.keys()) == [2]
page = extract_output.pages[2]
@@ -169,7 +169,7 @@ class TestGatewayCompletionsExtractOutput:
page_dicts: list[dict[str, Any]] = [{"index": 0, "markdown": "Fallback page", "images": []}]
response = _choices_response(json.dumps(page_dicts))
- extract_output = GatewayCompletionsFactory._make_extract_output_from_response_azure(response=response) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ extract_output = GatewayCompletionsFactory._make_extract_output_from_response_azure(response=response) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert list(extract_output.pages.keys()) == [0]
assert extract_output.pages[0].text == "Fallback page"
@@ -178,21 +178,21 @@ class TestGatewayCompletionsExtractOutput:
def test_azure_without_pages_anywhere_raises(self) -> None:
"""Neither a top-level pages field nor a choices fallback means the response is unusable."""
with pytest.raises(GatewayExtractResponseError, match="does not have pages"):
- GatewayCompletionsFactory._make_extract_output_from_response_azure(response=_response({"success": True})) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ GatewayCompletionsFactory._make_extract_output_from_response_azure(response=_response({"success": True})) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
def test_azure_page_schema_violation_is_wrapped(self) -> None:
"""A page dict failing GatewayExtractPageAzure validation is wrapped in GatewayExtractResponseError."""
response = _response({"pages": [{"index": 0, "images": []}]})
with pytest.raises(GatewayExtractResponseError, match="Azure schema"):
- GatewayCompletionsFactory._make_extract_output_from_response_azure(response=response) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ GatewayCompletionsFactory._make_extract_output_from_response_azure(response=response) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
# ---- Mistral Doc AI ----
def test_mistral_without_pages_raises(self) -> None:
"""A response with no pages attribute is rejected (Mistral has no choices fallback)."""
with pytest.raises(GatewayExtractResponseError, match="does not have pages"):
- GatewayCompletionsFactory._make_extract_output_from_response_mistral(response=_response({"success": True})) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ GatewayCompletionsFactory._make_extract_output_from_response_mistral(response=_response({"success": True})) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
def test_mistral_pages_with_images_corner_handling(self) -> None:
"""Images without base64 are skipped; full corner coords build a BoundingBox; partial coords leave it None."""
@@ -219,7 +219,7 @@ class TestGatewayCompletionsExtractOutput:
},
)
- extract_output = GatewayCompletionsFactory._make_extract_output_from_response_mistral(response=response) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ extract_output = GatewayCompletionsFactory._make_extract_output_from_response_mistral(response=response) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert list(extract_output.pages.keys()) == [0]
page = extract_output.pages[0]
@@ -248,7 +248,7 @@ class TestGatewayCompletionsExtractOutput:
response = _response({"pages": [{"index": 0, "markdown": "missing images field"}]})
with pytest.raises(GatewayExtractResponseError, match="Mistral schema"):
- GatewayCompletionsFactory._make_extract_output_from_response_mistral(response=response) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ GatewayCompletionsFactory._make_extract_output_from_response_mistral(response=response) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
# ---- DeepSeek OCR ----
@@ -256,7 +256,7 @@ class TestGatewayCompletionsExtractOutput:
"""Top-level pages parse into text-only Pages with no extracted images."""
response = _response({"pages": [{"index": 1, "markdown": "## Page two"}]})
- extract_output = GatewayCompletionsFactory._make_extract_output_from_response_deepseek(response=response) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ extract_output = GatewayCompletionsFactory._make_extract_output_from_response_deepseek(response=response) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert list(extract_output.pages.keys()) == [1]
assert extract_output.pages[1].text == "## Page two"
@@ -281,7 +281,7 @@ class TestGatewayCompletionsExtractOutput:
},
)
- extract_output = GatewayCompletionsFactory._make_extract_output_from_response_deepseek(response=response) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ extract_output = GatewayCompletionsFactory._make_extract_output_from_response_deepseek(response=response) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert extract_output.pages[0].text == "Scaled page"
mock_log.warning.assert_called_once()
@@ -294,7 +294,7 @@ class TestGatewayCompletionsExtractOutput:
page_dicts = [{"index": 0, "markdown": "Fallback md"}]
response = _choices_response(json.dumps(page_dicts))
- extract_output = GatewayCompletionsFactory._make_extract_output_from_response_deepseek(response=response) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ extract_output = GatewayCompletionsFactory._make_extract_output_from_response_deepseek(response=response) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert list(extract_output.pages.keys()) == [0]
assert extract_output.pages[0].text == "Fallback md"
@@ -302,14 +302,14 @@ class TestGatewayCompletionsExtractOutput:
def test_deepseek_without_pages_anywhere_raises(self) -> None:
"""Neither a top-level pages field nor a choices fallback means the response is unusable."""
with pytest.raises(GatewayExtractResponseError, match="does not have pages"):
- GatewayCompletionsFactory._make_extract_output_from_response_deepseek(response=_response({"success": True})) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ GatewayCompletionsFactory._make_extract_output_from_response_deepseek(response=_response({"success": True})) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
def test_deepseek_page_schema_violation_is_wrapped(self) -> None:
"""A page dict failing GatewayExtractPageDeepseek validation is wrapped in GatewayExtractResponseError."""
response = _response({"pages": [{"markdown": "missing index"}]})
with pytest.raises(GatewayExtractResponseError, match="Deepseek schema"):
- GatewayCompletionsFactory._make_extract_output_from_response_deepseek(response=response) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ GatewayCompletionsFactory._make_extract_output_from_response_deepseek(response=response) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
# ---- Linkup fetch ----
@@ -327,7 +327,7 @@ class TestGatewayCompletionsExtractOutput:
}
response = _choices_response(json.dumps(fetch_payload))
- extract_output = GatewayCompletionsFactory._make_extract_output_from_response_linkup_fetch(response=response) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ extract_output = GatewayCompletionsFactory._make_extract_output_from_response_linkup_fetch(response=response) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert list(extract_output.pages.keys()) == [0]
page = extract_output.pages[0]
@@ -352,14 +352,14 @@ class TestGatewayCompletionsExtractOutput:
)
def test_extract_content_string_falsy_paths_return_none(self, payload: dict[str, Any]) -> None:
"""Malformed message/content shapes yield None from the content-string extractor."""
- result = GatewayCompletionsFactory._extract_content_string_from_response(response=_response(payload)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ result = GatewayCompletionsFactory._extract_content_string_from_response(response=_response(payload)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert result is None
def test_linkup_fetch_without_content_raises(self) -> None:
"""A response with no usable choices content cannot be parsed as a fetch result."""
with pytest.raises(GatewayExtractResponseError, match="does not contain content"):
- GatewayCompletionsFactory._make_extract_output_from_response_linkup_fetch(response=_response({"success": True})) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ GatewayCompletionsFactory._make_extract_output_from_response_linkup_fetch(response=_response({"success": True})) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
@pytest.mark.parametrize(
"invalid_content",
@@ -371,4 +371,4 @@ class TestGatewayCompletionsExtractOutput:
response = _choices_response(invalid_content)
with pytest.raises(GatewayExtractResponseError, match="Error parsing Gateway fetch response"):
- GatewayCompletionsFactory._make_extract_output_from_response_linkup_fetch(response=response) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ GatewayCompletionsFactory._make_extract_output_from_response_linkup_fetch(response=response) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
diff --git a/tests/unit/pipelex/providers/gateway/test_gateway_extract_worker_semantic.py b/tests/unit/pipelex/providers/gateway/test_gateway_extract_worker_semantic.py
index 60702aeab..bfa83a3f4 100644
--- a/tests/unit/pipelex/providers/gateway/test_gateway_extract_worker_semantic.py
+++ b/tests/unit/pipelex/providers/gateway/test_gateway_extract_worker_semantic.py
@@ -95,7 +95,7 @@ class TestGatewayExtractWorkerSemantic:
)
with pytest.raises(ExtractJobFailureError) as exc_info:
- await worker._extract_web_fetch(extract_job=_make_extract_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._extract_web_fetch(extract_job=_make_extract_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is expected_category
assert exc_info.value.user_action is not None
@@ -123,7 +123,7 @@ class TestGatewayExtractWorkerSemantic:
)
with pytest.raises(ExtractModelNotFoundError) as exc_info:
- await worker._extract_web_fetch(extract_job=_make_extract_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._extract_web_fetch(extract_job=_make_extract_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATION
assert exc_info.value.user_action is not None
diff --git a/tests/unit/pipelex/providers/gateway/test_gateway_img_gen_worker_edit_routing.py b/tests/unit/pipelex/providers/gateway/test_gateway_img_gen_worker_edit_routing.py
index 3ab57afe1..ee596b4cc 100644
--- a/tests/unit/pipelex/providers/gateway/test_gateway_img_gen_worker_edit_routing.py
+++ b/tests/unit/pipelex/providers/gateway/test_gateway_img_gen_worker_edit_routing.py
@@ -96,7 +96,7 @@ class TestGatewayImgGenWorkerEditRouting:
mock_edits_post.return_value = _make_edits_http_response(mocker)
_patch_args(mocker, args_dict={"prompt": "edit me", "n": 1, "size": "1024x1024", "image": [_PNG_FILE_TUPLE]})
- await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
# The edit call goes through the vendored AsyncOpenAI client the AsyncPortkey carries
# (portkey_ai's AsyncAPIClient silently drops 'files'); the portkey post must not be used.
@@ -121,7 +121,7 @@ class TestGatewayImgGenWorkerEditRouting:
mock_edits_post.return_value = _make_edits_http_response(mocker)
_patch_args(mocker, args_dict={"prompt": "edit me", "image": [_PNG_FILE_TUPLE, _PNG_FILE_TUPLE_2]})
- await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
mock_generations_post.assert_not_called()
multipart_files: list[tuple[str, Any]] = mock_edits_post.call_args.kwargs["files"]
@@ -133,7 +133,7 @@ class TestGatewayImgGenWorkerEditRouting:
mock_generations_post.return_value = GenericResponse.model_validate(_success_response_dict())
_patch_args(mocker, args_dict={"prompt": "generate me", "n": 1})
- await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
mock_edits_post.assert_not_called()
call_kwargs = mock_generations_post.call_args.kwargs
@@ -148,6 +148,6 @@ class TestGatewayImgGenWorkerEditRouting:
_patch_args(mocker, args_dict={"prompt": "edit me", "image": [_PNG_FILE_TUPLE]})
with pytest.raises(ImgGenParameterError):
- await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
mock_edits_post.assert_not_called()
diff --git a/tests/unit/pipelex/providers/gateway/test_gateway_img_gen_worker_malformed_body.py b/tests/unit/pipelex/providers/gateway/test_gateway_img_gen_worker_malformed_body.py
index cfbb28c37..1c57827e6 100644
--- a/tests/unit/pipelex/providers/gateway/test_gateway_img_gen_worker_malformed_body.py
+++ b/tests/unit/pipelex/providers/gateway/test_gateway_img_gen_worker_malformed_body.py
@@ -96,7 +96,7 @@ class TestGatewayImgGenWorkerMalformedBody:
_patch_gateway_success(mocker, worker, response)
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.UNKNOWN
assert exc_info.value.user_action is not None
@@ -119,7 +119,7 @@ class TestGatewayImgGenWorkerMalformedBody:
_patch_gateway_success(mocker, worker, response)
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.UNKNOWN
assert exc_info.value.user_action is not None
diff --git a/tests/unit/pipelex/providers/gateway/test_gateway_img_gen_worker_semantic.py b/tests/unit/pipelex/providers/gateway/test_gateway_img_gen_worker_semantic.py
index 27f4fa64b..d3c0d3908 100644
--- a/tests/unit/pipelex/providers/gateway/test_gateway_img_gen_worker_semantic.py
+++ b/tests/unit/pipelex/providers/gateway/test_gateway_img_gen_worker_semantic.py
@@ -90,7 +90,7 @@ class TestGatewayImgGenWorkerSemantic:
)
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is expected_category
assert exc_info.value.user_action is not None
@@ -116,7 +116,7 @@ class TestGatewayImgGenWorkerSemantic:
)
with pytest.raises(ImgGenModelNotFoundError) as exc_info:
- await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATION
assert exc_info.value.user_action is not None
@@ -149,7 +149,7 @@ class TestGatewayImgGenWorkerSemantic:
)
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CAPACITY
assert exc_info.value.user_action is not None
diff --git a/tests/unit/pipelex/providers/gateway/test_gateway_quota_detection.py b/tests/unit/pipelex/providers/gateway/test_gateway_quota_detection.py
index b76fea174..32dcb2988 100644
--- a/tests/unit/pipelex/providers/gateway/test_gateway_quota_detection.py
+++ b/tests/unit/pipelex/providers/gateway/test_gateway_quota_detection.py
@@ -125,7 +125,7 @@ class TestGatewayQuotaDetection:
img_gen_job.job_report.img_gen_tokens_usage = None
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image_list(img_gen_job=img_gen_job, nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image_list(img_gen_job=img_gen_job, nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENT
assert exc_info.value.user_action is not None
@@ -147,7 +147,7 @@ class TestGatewayQuotaDetection:
)
with pytest.raises(SearchJobFailureError) as exc_info:
- await worker._call_relay(model="linkup/standard", content='{"query": "test"}') # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._call_relay(model="linkup/standard", content='{"query": "test"}') # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATION
assert exc_info.value.__cause__ is sdk_exc
@@ -177,7 +177,7 @@ class TestGatewayQuotaDetection:
extract_job = mocker.MagicMock()
extract_job.extract_input.image_uri = None
- extract_job.extract_input.document_uri = "/tmp/test.pdf" # noqa: S108
+ extract_job.extract_input.document_uri = "/tmp/test.pdf" # ruff: ignore[hardcoded-temp-file]
extract_job.job_params.max_nb_images = 0
extract_job.job_params.should_caption_images = False
@@ -190,7 +190,7 @@ class TestGatewayQuotaDetection:
)
with pytest.raises(ExtractJobFailureError) as exc_info:
- await worker._extract_document(extract_job=extract_job) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._extract_document(extract_job=extract_job) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CAPACITY
assert exc_info.value.__cause__ is sdk_exc
diff --git a/tests/unit/pipelex/providers/gateway/test_gateway_search_worker_semantic.py b/tests/unit/pipelex/providers/gateway/test_gateway_search_worker_semantic.py
index 037637b6d..e688fe180 100644
--- a/tests/unit/pipelex/providers/gateway/test_gateway_search_worker_semantic.py
+++ b/tests/unit/pipelex/providers/gateway/test_gateway_search_worker_semantic.py
@@ -91,7 +91,7 @@ class TestGatewaySearchWorkerSemantic:
)
with pytest.raises(SearchJobFailureError) as exc_info:
- await worker._search_sourced_answer(search_job=_make_search_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._search_sourced_answer(search_job=_make_search_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is expected_category
assert exc_info.value.user_action is not None
@@ -115,7 +115,7 @@ class TestGatewaySearchWorkerSemantic:
)
with pytest.raises(SearchModelNotFoundError) as exc_info:
- await worker._search_sourced_answer(search_job=_make_search_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._search_sourced_answer(search_job=_make_search_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATION
assert exc_info.value.user_action is not None
diff --git a/tests/unit/pipelex/providers/gateway/test_gateway_structured_search_contract.py b/tests/unit/pipelex/providers/gateway/test_gateway_structured_search_contract.py
index a4099da9e..9143d04fc 100644
--- a/tests/unit/pipelex/providers/gateway/test_gateway_structured_search_contract.py
+++ b/tests/unit/pipelex/providers/gateway/test_gateway_structured_search_contract.py
@@ -86,7 +86,7 @@ class TestGatewayStructuredSearchContract:
content = json.dumps({"data": payload, "sources": [{"name": "src", "url": "https://example.com", "snippet": "…"}]})
worker = _make_worker(mocker, content=content)
- result = await worker._search_structured(search_job=_make_search_job(mocker), schema=TopicSummary) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ result = await worker._search_structured(search_job=_make_search_job(mocker), schema=TopicSummary) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert result == payload
# The payload validates against the caller's output structure class — the envelope never could.
@@ -102,7 +102,7 @@ class TestGatewayStructuredSearchContract:
payload = {"title": "pipelex", "summary": "a language"}
worker = _make_worker(mocker, content=json.dumps(payload))
- result = await worker._search_structured(search_job=_make_search_job(mocker), schema=TopicSummary) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ result = await worker._search_structured(search_job=_make_search_job(mocker), schema=TopicSummary) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert result == payload
@@ -111,7 +111,7 @@ class TestGatewayStructuredSearchContract:
payload = {"data": {"nested": "value"}, "sources": ["a"]}
worker = _make_worker(mocker, content=json.dumps(payload))
- result = await worker._search_structured(search_job=_make_search_job(mocker), schema=DataAndSources) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ result = await worker._search_structured(search_job=_make_search_job(mocker), schema=DataAndSources) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert result == payload, "the caller's own {data, sources} output is its payload, not an envelope around one"
@@ -127,7 +127,7 @@ class TestGatewayStructuredSearchContract:
payload = {"data": {"nested": "value"}, "sources": ["a"]}
worker = _make_worker(mocker, content=json.dumps(payload))
- result = await worker._search_structured(search_job=_make_search_job(mocker), schema=AliasedDataAndSources) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ result = await worker._search_structured(search_job=_make_search_job(mocker), schema=AliasedDataAndSources) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert result == payload, "an aliased {data, sources} output class owns those names as much as one that spells them out"
assert AliasedDataAndSources.model_validate(result).body == {"nested": "value"}
@@ -143,7 +143,7 @@ class TestGatewayStructuredSearchContract:
content = json.dumps({"data": payload, "sources": [{"name": "src", "url": "https://example.com", "snippet": "…"}]})
worker = _make_worker(mocker, content=content)
- result = await worker._search_structured(search_job=_make_search_job(mocker), schema=SerializationAliasedTopicSummary) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ result = await worker._search_structured(search_job=_make_search_job(mocker), schema=SerializationAliasedTopicSummary) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert result == payload
@@ -152,18 +152,18 @@ class TestGatewayStructuredSearchContract:
worker = _make_worker(mocker, content=json.dumps({"data": None, "sources": []}))
with pytest.raises(GatewaySearchEmptyResultError, match="empty structured result"):
- await worker._search_structured(search_job=_make_search_job(mocker), schema=TopicSummary) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._search_structured(search_job=_make_search_job(mocker), schema=TopicSummary) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
async def test_a_non_object_response_raises_a_classified_search_error(self, mocker: MockerFixture) -> None:
"""A response that is not a JSON object at all is malformed, and says so."""
worker = _make_worker(mocker, content=json.dumps(["not", "an", "object"]))
with pytest.raises(GatewaySearchResponseError, match="non-object payload"):
- await worker._search_structured(search_job=_make_search_job(mocker), schema=TopicSummary) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._search_structured(search_job=_make_search_job(mocker), schema=TopicSummary) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
async def test_a_non_json_body_raises_a_classified_search_error(self, mocker: MockerFixture) -> None:
"""The likeliest way the relay contract breaks must not escape as a bare JSONDecodeError."""
worker = _make_worker(mocker, content="<html>502 Bad Gateway</html>")
with pytest.raises(GatewaySearchResponseError, match="not valid JSON"):
- await worker._search_structured(search_job=_make_search_job(mocker), schema=TopicSummary) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._search_structured(search_job=_make_search_job(mocker), schema=TopicSummary) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
diff --git a/tests/unit/pipelex/providers/google/test_google_img_gen_worker_error_handling.py b/tests/unit/pipelex/providers/google/test_google_img_gen_worker_error_handling.py
index 848e34bf3..d3d88b3ea 100644
--- a/tests/unit/pipelex/providers/google/test_google_img_gen_worker_error_handling.py
+++ b/tests/unit/pipelex/providers/google/test_google_img_gen_worker_error_handling.py
@@ -72,7 +72,7 @@ class TestGoogleImgGenWorkerErrorHandling:
worker.genai_async_client.models.generate_content.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(ImgGenModelNotFoundError) as exc_info:
- await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATION
assert exc_info.value.user_action is not None
@@ -88,7 +88,7 @@ class TestGoogleImgGenWorkerErrorHandling:
worker.genai_async_client.models.generate_content.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATION
assert exc_info.value.user_action is not None
@@ -102,7 +102,7 @@ class TestGoogleImgGenWorkerErrorHandling:
worker.genai_async_client.models.generate_content.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATION
assert exc_info.value.user_action is not None
@@ -114,7 +114,7 @@ class TestGoogleImgGenWorkerErrorHandling:
worker.genai_async_client.models.generate_content.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CAPACITY
assert exc_info.value.user_action is not None
@@ -126,7 +126,7 @@ class TestGoogleImgGenWorkerErrorHandling:
worker.genai_async_client.models.generate_content.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENT
assert exc_info.value.user_action is not None
@@ -138,7 +138,7 @@ class TestGoogleImgGenWorkerErrorHandling:
worker.genai_async_client.models.generate_content.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONTENT
assert exc_info.value.user_action is not None
@@ -150,7 +150,7 @@ class TestGoogleImgGenWorkerErrorHandling:
worker.genai_async_client.models.generate_content.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONTENT
assert exc_info.value.user_action is not None
@@ -163,7 +163,7 @@ class TestGoogleImgGenWorkerErrorHandling:
worker.genai_async_client.models.generate_content.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATION
assert exc_info.value.user_action is not None
@@ -175,7 +175,7 @@ class TestGoogleImgGenWorkerErrorHandling:
worker.genai_async_client.models.generate_content.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENT
assert exc_info.value.user_action is not None
@@ -207,7 +207,7 @@ class TestGoogleImgGenWorkerErrorHandling:
worker.genai_async_client.models.generate_content.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENT
assert exc_info.value.user_action is not None
@@ -224,7 +224,7 @@ class TestGoogleImgGenWorkerErrorHandling:
worker.genai_async_client.models.generate_content.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
report = exc_info.value.to_error_report()
assert report.error_category == "capacity"
diff --git a/tests/unit/pipelex/providers/google/test_google_img_gen_worker_payload.py b/tests/unit/pipelex/providers/google/test_google_img_gen_worker_payload.py
index 0a8833ce5..3356a6c34 100644
--- a/tests/unit/pipelex/providers/google/test_google_img_gen_worker_payload.py
+++ b/tests/unit/pipelex/providers/google/test_google_img_gen_worker_payload.py
@@ -74,7 +74,7 @@ class TestGoogleImgGenWorkerPayload:
worker = _make_worker(mocker)
job = _make_img_gen_job(mocker, aspect_ratio=AspectRatio.SQUARE, size=SizeTier.TWO_K)
- details = await worker._gen_image(img_gen_job=job) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ details = await worker._gen_image(img_gen_job=job) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
image_config = _sent_image_config(worker)
assert image_config.aspect_ratio == "1:1"
@@ -86,7 +86,7 @@ class TestGoogleImgGenWorkerPayload:
worker = _make_worker(mocker)
job = _make_img_gen_job(mocker, aspect_ratio=AspectRatio.LANDSCAPE_16_9, size=None)
- details = await worker._gen_image(img_gen_job=job) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ details = await worker._gen_image(img_gen_job=job) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
image_config = _sent_image_config(worker)
assert image_config.aspect_ratio == "16:9"
@@ -98,7 +98,7 @@ class TestGoogleImgGenWorkerPayload:
worker = _make_worker(mocker)
job = _make_img_gen_job(mocker, aspect_ratio=AspectRatio.SQUARE, size=ImageSize(width=2752, height=1536))
- details = await worker._gen_image(img_gen_job=job) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ details = await worker._gen_image(img_gen_job=job) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
image_config = _sent_image_config(worker)
assert image_config.aspect_ratio == "16:9"
diff --git a/tests/unit/pipelex/providers/google/test_google_llm_worker_object_error_handling.py b/tests/unit/pipelex/providers/google/test_google_llm_worker_object_error_handling.py
index 8cbf1c6cf..6c4485101 100644
--- a/tests/unit/pipelex/providers/google/test_google_llm_worker_object_error_handling.py
+++ b/tests/unit/pipelex/providers/google/test_google_llm_worker_object_error_handling.py
@@ -86,7 +86,7 @@ class TestGoogleLLMWorkerObjectErrorHandling:
worker.instructor_for_objects.chat.completions.create_with_completion.side_effect = wrapped # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENT
assert exc_info.value.user_action is not None
@@ -109,7 +109,7 @@ class TestGoogleLLMWorkerObjectErrorHandling:
worker.instructor_for_objects.chat.completions.create_with_completion.side_effect = wrapped # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENT
assert exc_info.value.user_action is not None
@@ -132,7 +132,7 @@ class TestGoogleLLMWorkerObjectErrorHandling:
worker.instructor_for_objects.chat.completions.create_with_completion.side_effect = wrapped # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CAPACITY
assert exc_info.value.user_action is not None
@@ -150,7 +150,7 @@ class TestGoogleLLMWorkerObjectErrorHandling:
worker.instructor_for_objects.chat.completions.create_with_completion.side_effect = wrapped # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONTENT
assert exc_info.value.user_action is not None
@@ -167,7 +167,7 @@ class TestGoogleLLMWorkerObjectErrorHandling:
worker.instructor_for_objects.chat.completions.create_with_completion.side_effect = wrapped # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONTENT
assert exc_info.value.user_action is not None
@@ -183,7 +183,7 @@ class TestGoogleLLMWorkerObjectErrorHandling:
worker.instructor_for_objects.chat.completions.create_with_completion.side_effect = wrapped # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATION
assert exc_info.value.user_action is not None
@@ -199,7 +199,7 @@ class TestGoogleLLMWorkerObjectErrorHandling:
worker.instructor_for_objects.chat.completions.create_with_completion.side_effect = wrapped # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATION
assert exc_info.value.user_action is not None
@@ -215,7 +215,7 @@ class TestGoogleLLMWorkerObjectErrorHandling:
worker.instructor_for_objects.chat.completions.create_with_completion.side_effect = wrapped # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMModelNotFoundError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATION
assert exc_info.value.user_action is not None
@@ -231,7 +231,7 @@ class TestGoogleLLMWorkerObjectErrorHandling:
worker.instructor_for_objects.chat.completions.create_with_completion.side_effect = wrapped # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.UNKNOWN
assert exc_info.value.__cause__ is wrapped
@@ -246,15 +246,15 @@ class TestGoogleLLMWorkerObjectErrorHandling:
and does NOT wrap it in ``InstructorRetryException``. It propagates as the raw
``ClientError``, which the worker classifies as TRANSIENT with provider metadata.
"""
- import instructor # noqa: PLC0415
- from google.genai import Client as GoogleGenAiClient # noqa: PLC0415
+ import instructor # ruff: ignore[import-outside-top-level]
+ from google.genai import Client as GoogleGenAiClient # ruff: ignore[import-outside-top-level]
worker = _make_worker(mocker)
# Override the conftest-style empty contents with a real ``Content`` —
# instructor's gemini message converter rejects a bare ``list`` (which is
# what the empty default produces once wrapped in ``messages=[...]``).
- from google.genai import types as genai_types # noqa: PLC0415
+ from google.genai import types as genai_types # ruff: ignore[import-outside-top-level]
user_content = genai_types.Content(role="user", parts=[genai_types.Part.from_text(text="hi")])
mocker.patch(
@@ -269,7 +269,7 @@ class TestGoogleLLMWorkerObjectErrorHandling:
worker.instructor_for_objects = instructor.from_genai(client=genai_client, use_async=True)
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENT
assert exc_info.value.user_action is not None
@@ -305,7 +305,7 @@ class TestGoogleLLMWorkerObjectErrorHandling:
worker.instructor_for_objects.chat.completions.create_with_completion.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is expected_category
assert exc_info.value.__cause__ is sdk_exc
diff --git a/tests/unit/pipelex/providers/google/test_google_reasoning.py b/tests/unit/pipelex/providers/google/test_google_reasoning.py
index 1d9119835..aa0788e16 100644
--- a/tests/unit/pipelex/providers/google/test_google_reasoning.py
+++ b/tests/unit/pipelex/providers/google/test_google_reasoning.py
@@ -80,7 +80,7 @@ class TestGoogleReasoning:
),
)
job_params = LLMJobParams(temperature=0.5, reasoning_effort=effort)
- result = worker._build_thinking_config(job_params=job_params, max_tokens=100000) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ result = worker._build_thinking_config(job_params=job_params, max_tokens=100000) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert result is not None
assert result.thinking_budget == expected_budget
budget_mock.assert_called_once_with(family="gemini", effort=effort)
@@ -106,7 +106,7 @@ class TestGoogleReasoning:
worker = _make_worker(mocker, thinking_mode=ThinkingMode.ADAPTIVE)
_mock_config_for_adaptive(mocker)
job_params = LLMJobParams(temperature=0.5, reasoning_effort=effort)
- result = worker._build_thinking_config(job_params=job_params, max_tokens=100000) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ result = worker._build_thinking_config(job_params=job_params, max_tokens=100000) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert result is not None
assert result.thinking_level == expected_level
@@ -125,7 +125,7 @@ class TestGoogleReasoning:
),
)
job_params = LLMJobParams(temperature=0.5, reasoning_effort=ReasoningEffort.NONE)
- result = worker._build_thinking_config(job_params=job_params, max_tokens=100000) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ result = worker._build_thinking_config(job_params=job_params, max_tokens=100000) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert result is not None
assert result.thinking_budget == 0
@@ -134,7 +134,7 @@ class TestGoogleReasoning:
worker = _make_worker(mocker, thinking_mode=ThinkingMode.ADAPTIVE)
_mock_config_for_adaptive(mocker)
job_params = LLMJobParams(temperature=0.5, reasoning_effort=ReasoningEffort.NONE)
- result = worker._build_thinking_config(job_params=job_params, max_tokens=100000) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ result = worker._build_thinking_config(job_params=job_params, max_tokens=100000) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert result is not None
assert result.thinking_budget == 0
@@ -150,7 +150,7 @@ class TestGoogleReasoning:
"""Explicit reasoning_budget passes through directly as thinking_budget."""
worker = _make_worker(mocker, thinking_mode=thinking_mode)
job_params = LLMJobParams(temperature=0.5, reasoning_budget=8192)
- result = worker._build_thinking_config(job_params=job_params, max_tokens=100000) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ result = worker._build_thinking_config(job_params=job_params, max_tokens=100000) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert result is not None
assert result.thinking_budget == 8192
@@ -158,7 +158,7 @@ class TestGoogleReasoning:
"""When neither reasoning_effort nor reasoning_budget is set, returns None."""
worker = _make_worker(mocker, thinking_mode=ThinkingMode.MANUAL)
job_params = LLMJobParams(temperature=0.5)
- result = worker._build_thinking_config(job_params=job_params, max_tokens=100000) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ result = worker._build_thinking_config(job_params=job_params, max_tokens=100000) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert result is None
def test_thinking_mode_none_raises_capability_error(self, mocker: MockerFixture):
@@ -166,20 +166,20 @@ class TestGoogleReasoning:
worker = _make_worker(mocker, thinking_mode=ThinkingMode.NONE)
job_params = LLMJobParams(temperature=0.5, reasoning_effort=ReasoningEffort.HIGH)
with pytest.raises(LLMCapabilityError, match="does not support reasoning"):
- worker._build_thinking_config(job_params=job_params, max_tokens=100000) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ worker._build_thinking_config(job_params=job_params, max_tokens=100000) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
def test_reasoning_budget_with_thinking_mode_none_raises(self, mocker: MockerFixture):
"""reasoning_budget with thinking_mode=none should raise LLMCapabilityError."""
worker = _make_worker(mocker, thinking_mode=ThinkingMode.NONE)
job_params = LLMJobParams(temperature=0.5, reasoning_budget=4096)
with pytest.raises(LLMCapabilityError, match="does not support reasoning"):
- worker._build_thinking_config(job_params=job_params, max_tokens=100000) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ worker._build_thinking_config(job_params=job_params, max_tokens=100000) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
def test_explicit_budget_capped_by_max_tokens(self, mocker: MockerFixture):
"""Explicit reasoning_budget is capped to max_tokens - 1."""
worker = _make_worker(mocker, thinking_mode=ThinkingMode.MANUAL)
job_params = LLMJobParams(temperature=0.5, reasoning_budget=8192)
- result = worker._build_thinking_config(job_params=job_params, max_tokens=4000) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ result = worker._build_thinking_config(job_params=job_params, max_tokens=4000) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert result is not None
assert result.thinking_budget == 3999
@@ -199,6 +199,6 @@ class TestGoogleReasoning:
),
)
job_params = LLMJobParams(temperature=0.5, reasoning_effort=ReasoningEffort.HIGH)
- result = worker._build_thinking_config(job_params=job_params, max_tokens=2000) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ result = worker._build_thinking_config(job_params=job_params, max_tokens=2000) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert result is not None
assert result.thinking_budget == 1999
diff --git a/tests/unit/pipelex/providers/google/test_google_worker_error_handling.py b/tests/unit/pipelex/providers/google/test_google_worker_error_handling.py
index 4f4e3992e..5265287c1 100644
--- a/tests/unit/pipelex/providers/google/test_google_worker_error_handling.py
+++ b/tests/unit/pipelex/providers/google/test_google_worker_error_handling.py
@@ -139,7 +139,7 @@ class TestGoogleWorkerErrorHandling:
worker.genai_async_client.models.generate_content.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_text(llm_job=_make_llm_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_text(llm_job=_make_llm_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is expected_category
assert exc_info.value.__cause__ is sdk_exc
@@ -156,7 +156,7 @@ class TestGoogleWorkerErrorHandling:
worker.genai_async_client.models.generate_content.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_text(llm_job=_make_llm_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_text(llm_job=_make_llm_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENT
assert exc_info.value.__cause__ is sdk_exc
@@ -170,7 +170,7 @@ class TestGoogleWorkerErrorHandling:
worker.genai_async_client.models.generate_content.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMModelNotFoundError) as exc_info:
- await worker._gen_text(llm_job=_make_llm_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_text(llm_job=_make_llm_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATION
assert exc_info.value.user_action is not None
@@ -198,7 +198,7 @@ class TestGoogleWorkerErrorHandling:
worker.genai_async_client.models.generate_content.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is expected_category
assert exc_info.value.__cause__ is sdk_exc
@@ -215,7 +215,7 @@ class TestGoogleWorkerErrorHandling:
worker.genai_async_client.models.generate_content.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(ImgGenModelNotFoundError) as exc_info:
- await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATION
assert exc_info.value.user_action is not None
@@ -232,7 +232,7 @@ class TestGoogleWorkerErrorHandling:
worker.genai_async_client.models.generate_content.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENT
assert exc_info.value.__cause__ is sdk_exc
@@ -246,7 +246,7 @@ class TestGoogleWorkerErrorHandling:
worker.genai_async_client.models.generate_content.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_text(llm_job=_make_llm_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_text(llm_job=_make_llm_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
report = exc_info.value.to_error_report()
assert report.error_category == "transient"
@@ -260,7 +260,7 @@ class TestGoogleWorkerErrorHandling:
worker.genai_async_client.models.generate_content.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_text(llm_job=_make_llm_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_text(llm_job=_make_llm_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
report = exc_info.value.to_error_report()
assert report.error_category == "capacity"
diff --git a/tests/unit/pipelex/providers/huggingface/test_hf_worker_error_handling.py b/tests/unit/pipelex/providers/huggingface/test_hf_worker_error_handling.py
index 4aa947030..7ee5ebf1d 100644
--- a/tests/unit/pipelex/providers/huggingface/test_hf_worker_error_handling.py
+++ b/tests/unit/pipelex/providers/huggingface/test_hf_worker_error_handling.py
@@ -90,7 +90,7 @@ class TestHuggingFaceWorkerErrorHandling:
)
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._generate_single_image(img_gen_job=_make_img_gen_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._generate_single_image(img_gen_job=_make_img_gen_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is expected_category
assert exc_info.value.user_action is not None
@@ -120,7 +120,7 @@ class TestHuggingFaceWorkerErrorHandling:
)
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._generate_single_image(img_gen_job=_make_img_gen_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._generate_single_image(img_gen_job=_make_img_gen_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is expected_category
assert exc_info.value.user_action is not None
@@ -140,7 +140,7 @@ class TestHuggingFaceWorkerErrorHandling:
)
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._generate_single_image(img_gen_job=_make_img_gen_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._generate_single_image(img_gen_job=_make_img_gen_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
report = exc_info.value.to_error_report()
assert report.error_category == "configuration"
diff --git a/tests/unit/pipelex/providers/huggingface/test_huggingface_img_gen_worker_semantic.py b/tests/unit/pipelex/providers/huggingface/test_huggingface_img_gen_worker_semantic.py
index ecc3324c7..4f6e3e980 100644
--- a/tests/unit/pipelex/providers/huggingface/test_huggingface_img_gen_worker_semantic.py
+++ b/tests/unit/pipelex/providers/huggingface/test_huggingface_img_gen_worker_semantic.py
@@ -83,7 +83,7 @@ class TestHuggingFaceImgGenWorkerSemantic:
)
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._generate_single_image(img_gen_job=_make_img_gen_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._generate_single_image(img_gen_job=_make_img_gen_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is expected_category
assert exc_info.value.user_action is not None
@@ -105,7 +105,7 @@ class TestHuggingFaceImgGenWorkerSemantic:
)
with pytest.raises(ImgGenModelNotFoundError) as exc_info:
- await worker._generate_single_image(img_gen_job=_make_img_gen_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._generate_single_image(img_gen_job=_make_img_gen_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATION
assert exc_info.value.user_action is not None
@@ -126,7 +126,7 @@ class TestHuggingFaceImgGenWorkerSemantic:
)
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._generate_single_image(img_gen_job=_make_img_gen_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._generate_single_image(img_gen_job=_make_img_gen_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENT
assert exc_info.value.user_action is not None
diff --git a/tests/unit/pipelex/providers/linkup/test_linkup_extract_worker_semantic.py b/tests/unit/pipelex/providers/linkup/test_linkup_extract_worker_semantic.py
index bc5730c44..9aca3d647 100644
--- a/tests/unit/pipelex/providers/linkup/test_linkup_extract_worker_semantic.py
+++ b/tests/unit/pipelex/providers/linkup/test_linkup_extract_worker_semantic.py
@@ -35,7 +35,7 @@ def _make_worker(mocker: MockerFixture) -> LinkupExtractWorker:
worker.inference_model = mock_model
mock_client = mocker.MagicMock()
mock_client.async_fetch = mocker.AsyncMock()
- setattr(worker, "_linkup_client", mock_client) # noqa: B010
+ setattr(worker, "_linkup_client", mock_client) # ruff: ignore[set-attr-with-constant]
return worker
@@ -78,11 +78,11 @@ class TestLinkupExtractWorkerSemantic:
) -> None:
worker = _make_worker(mocker)
sdk_exc = exception_class(f"{exception_class.__name__} happened")
- client: Any = getattr(worker, "_linkup_client") # noqa: B009
+ client: Any = getattr(worker, "_linkup_client") # ruff: ignore[get-attr-with-constant]
client.async_fetch.side_effect = sdk_exc
with pytest.raises(ExtractJobFailureError) as exc_info:
- await worker._extract_pages(extract_job=_make_extract_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._extract_pages(extract_job=_make_extract_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is expected_category
assert exc_info.value.user_action is not None
diff --git a/tests/unit/pipelex/providers/linkup/test_linkup_search_worker_semantic.py b/tests/unit/pipelex/providers/linkup/test_linkup_search_worker_semantic.py
index 5ae1d2b26..f825c8897 100644
--- a/tests/unit/pipelex/providers/linkup/test_linkup_search_worker_semantic.py
+++ b/tests/unit/pipelex/providers/linkup/test_linkup_search_worker_semantic.py
@@ -32,7 +32,7 @@ def _make_worker(mocker: MockerFixture) -> LinkupSearchWorker:
worker.inference_model = mock_model
mock_client = mocker.MagicMock()
mock_client.async_search = mocker.AsyncMock()
- setattr(worker, "_linkup_client", mock_client) # noqa: B010
+ setattr(worker, "_linkup_client", mock_client) # ruff: ignore[set-attr-with-constant]
return worker
@@ -75,11 +75,11 @@ class TestLinkupSearchWorkerSemantic:
) -> None:
worker = _make_worker(mocker)
sdk_exc = exception_class(f"{exception_class.__name__} happened")
- client: Any = getattr(worker, "_linkup_client") # noqa: B009
+ client: Any = getattr(worker, "_linkup_client") # ruff: ignore[get-attr-with-constant]
client.async_search.side_effect = sdk_exc
with pytest.raises(SearchJobFailureError) as exc_info:
- await worker._search_sourced_answer(search_job=_make_search_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._search_sourced_answer(search_job=_make_search_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is expected_category
assert exc_info.value.user_action is not None
diff --git a/tests/unit/pipelex/providers/linkup/test_linkup_structured_search_contract.py b/tests/unit/pipelex/providers/linkup/test_linkup_structured_search_contract.py
index 5908a4459..e006be7df 100644
--- a/tests/unit/pipelex/providers/linkup/test_linkup_structured_search_contract.py
+++ b/tests/unit/pipelex/providers/linkup/test_linkup_structured_search_contract.py
@@ -56,7 +56,7 @@ def _make_worker(mocker: MockerFixture, *, sdk_result: Any) -> LinkupSearchWorke
worker.inference_model = mock_model
mock_client = mocker.MagicMock()
mock_client.async_search = mocker.AsyncMock(return_value=sdk_result)
- setattr(worker, "_linkup_client", mock_client) # noqa: B010
+ setattr(worker, "_linkup_client", mock_client) # ruff: ignore[set-attr-with-constant]
return worker
@@ -79,9 +79,9 @@ class TestLinkupStructuredSearchContract:
async def test_the_callers_own_schema_crosses_as_json_without_the_class(self, mocker: MockerFixture) -> None:
"""The request carries the caller's real schema, and the SDK gets no class to instantiate."""
worker = _make_worker(mocker, sdk_result={"title": "pipelex", "summary": "a language"})
- client: Any = getattr(worker, "_linkup_client") # noqa: B009
+ client: Any = getattr(worker, "_linkup_client") # ruff: ignore[get-attr-with-constant]
- await worker._search_structured(search_job=_make_search_job(mocker), schema=TopicSummary) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._search_structured(search_job=_make_search_job(mocker), schema=TopicSummary) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
sent_schema = client.async_search.await_args.kwargs["structured_output_schema"]
assert isinstance(sent_schema, str), "a class would make the SDK validate the response itself"
@@ -93,9 +93,9 @@ class TestLinkupStructuredSearchContract:
async def test_sources_are_not_requested(self, mocker: MockerFixture) -> None:
"""Asking for sources wraps the payload in an envelope the output structure class cannot accept."""
worker = _make_worker(mocker, sdk_result={"title": "pipelex", "summary": "a language"})
- client: Any = getattr(worker, "_linkup_client") # noqa: B009
+ client: Any = getattr(worker, "_linkup_client") # ruff: ignore[get-attr-with-constant]
- await worker._search_structured(search_job=_make_search_job(mocker), schema=TopicSummary) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._search_structured(search_job=_make_search_job(mocker), schema=TopicSummary) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert client.async_search.await_args.kwargs["include_sources"] is False
@@ -103,7 +103,7 @@ class TestLinkupStructuredSearchContract:
"""The dict is the structured payload itself, un-normalized: the leaf's validation is the first one."""
worker = _make_worker(mocker, sdk_result={"title": "pipelex", "summary": "a language"})
- result = await worker._search_structured(search_job=_make_search_job(mocker), schema=TopicSummary) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ result = await worker._search_structured(search_job=_make_search_job(mocker), schema=TopicSummary) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert result == {"title": "pipelex", "summary": "a language"}
# The caller's transforming validator has not run yet — it runs once, when the leaf validates.
@@ -124,7 +124,7 @@ class TestLinkupStructuredSearchContract:
envelope = {"data": payload, "sources": [{"name": "src", "url": "https://example.com", "snippet": "…"}]}
worker = _make_worker(mocker, sdk_result=envelope)
- result = await worker._search_structured(search_job=_make_search_job(mocker), schema=AllDefaults) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ result = await worker._search_structured(search_job=_make_search_job(mocker), schema=AllDefaults) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert result == payload
# What the guard prevents: validating the envelope instead would have succeeded and thrown the
@@ -136,11 +136,11 @@ class TestLinkupStructuredSearchContract:
worker = _make_worker(mocker, sdk_result={"data": None, "sources": []})
with pytest.raises(LinkupSearchEmptyResultError, match="empty structured result"):
- await worker._search_structured(search_job=_make_search_job(mocker), schema=TopicSummary) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._search_structured(search_job=_make_search_job(mocker), schema=TopicSummary) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
async def test_a_non_object_payload_raises_a_classified_search_error(self, mocker: MockerFixture) -> None:
"""The SDK returns the provider's JSON verbatim, so a non-object payload must surface here as a classified error, not at the leaf."""
worker = _make_worker(mocker, sdk_result=["not", "an", "object"])
with pytest.raises(LinkupSearchResponseError, match="list"):
- await worker._search_structured(search_job=_make_search_job(mocker), schema=TopicSummary) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._search_structured(search_job=_make_search_job(mocker), schema=TopicSummary) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
diff --git a/tests/unit/pipelex/providers/linkup/test_linkup_worker_error_handling.py b/tests/unit/pipelex/providers/linkup/test_linkup_worker_error_handling.py
index 48323dbad..8b8e3bd79 100644
--- a/tests/unit/pipelex/providers/linkup/test_linkup_worker_error_handling.py
+++ b/tests/unit/pipelex/providers/linkup/test_linkup_worker_error_handling.py
@@ -28,7 +28,7 @@ def _make_linkup_extract_worker(mocker: MockerFixture) -> LinkupExtractWorker:
mock_client = mocker.MagicMock()
mock_client.async_fetch = mocker.AsyncMock()
- setattr(worker, "_linkup_client", mock_client) # noqa: B010
+ setattr(worker, "_linkup_client", mock_client) # ruff: ignore[set-attr-with-constant]
return worker
@@ -44,14 +44,14 @@ def _make_linkup_search_worker(mocker: MockerFixture) -> LinkupSearchWorker:
mock_client = mocker.MagicMock()
mock_client.async_search = mocker.AsyncMock()
- setattr(worker, "_linkup_client", mock_client) # noqa: B010
+ setattr(worker, "_linkup_client", mock_client) # ruff: ignore[set-attr-with-constant]
return worker
def _get_linkup_client(worker: Any) -> Any:
"""Access the _linkup_client attribute via object.__getattribute__ to avoid linter complaints."""
- return worker._linkup_client # noqa: SLF001
+ return worker._linkup_client # ruff: ignore[private-member-access]
def _make_extract_job(mocker: MockerFixture) -> Any:
@@ -106,7 +106,7 @@ class TestLinkupWorkerErrorHandling:
_get_linkup_client(worker).async_fetch.side_effect = sdk_exc
with pytest.raises(ExtractJobFailureError) as exc_info:
- await worker._extract_pages(extract_job=_make_extract_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._extract_pages(extract_job=_make_extract_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is expected_category
assert exc_info.value.__cause__ is sdk_exc
@@ -134,7 +134,7 @@ class TestLinkupWorkerErrorHandling:
_get_linkup_client(worker).async_search.side_effect = sdk_exc
with pytest.raises(SearchJobFailureError) as exc_info:
- await worker._search_sourced_answer(search_job=_make_search_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._search_sourced_answer(search_job=_make_search_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is expected_category
assert exc_info.value.__cause__ is sdk_exc
@@ -163,7 +163,7 @@ class TestLinkupWorkerErrorHandling:
_get_linkup_client(worker).async_search.side_effect = sdk_exc
with pytest.raises(SearchJobFailureError) as exc_info:
- await worker._search_sourced_answer(search_job=_make_search_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._search_sourced_answer(search_job=_make_search_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.user_action is not None
assert exc_info.value.user_action.kind is expected_kind
@@ -177,7 +177,7 @@ class TestLinkupWorkerErrorHandling:
_get_linkup_client(worker).async_fetch.side_effect = sdk_exc
with pytest.raises(ExtractJobFailureError) as exc_info:
- await worker._extract_pages(extract_job=_make_extract_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._extract_pages(extract_job=_make_extract_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
report = exc_info.value.to_error_report()
assert report.error_category == "configuration"
@@ -191,7 +191,7 @@ class TestLinkupWorkerErrorHandling:
_get_linkup_client(worker).async_search.side_effect = sdk_exc
with pytest.raises(SearchJobFailureError) as exc_info:
- await worker._search_sourced_answer(search_job=_make_search_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._search_sourced_answer(search_job=_make_search_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
report = exc_info.value.to_error_report()
assert report.error_category == "transient"
@@ -204,7 +204,7 @@ class TestLinkupWorkerErrorHandling:
_get_linkup_client(worker).async_search.side_effect = sdk_exc
with pytest.raises(SearchJobFailureError) as exc_info:
- await worker._search_sourced_answer(search_job=_make_search_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._search_sourced_answer(search_job=_make_search_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
report = exc_info.value.to_error_report()
assert report.error_category == "content"
@@ -217,7 +217,7 @@ class TestLinkupWorkerErrorHandling:
_get_linkup_client(worker).async_fetch.side_effect = sdk_exc
with pytest.raises(ExtractJobFailureError) as exc_info:
- await worker._extract_pages(extract_job=_make_extract_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._extract_pages(extract_job=_make_extract_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
report = exc_info.value.to_error_report()
assert report.error_category == "content"
diff --git a/tests/unit/pipelex/providers/mistral/test_mistral_extract_worker_semantic.py b/tests/unit/pipelex/providers/mistral/test_mistral_extract_worker_semantic.py
index f6fde4030..304656d00 100644
--- a/tests/unit/pipelex/providers/mistral/test_mistral_extract_worker_semantic.py
+++ b/tests/unit/pipelex/providers/mistral/test_mistral_extract_worker_semantic.py
@@ -76,7 +76,7 @@ class TestMistralExtractWorkerSemantic:
)
with pytest.raises(ExtractJobFailureError) as exc_info:
- await worker._extract_page_from_image(image_uri="https://example.com/test.png") # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._extract_page_from_image(image_uri="https://example.com/test.png") # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is expected_category
assert exc_info.value.user_action is not None
@@ -117,7 +117,7 @@ class TestMistralExtractWorkerSemantic:
)
with pytest.raises(ExtractJobFailureError) as exc_info:
- await worker._extract_page_from_image(image_uri="https://example.com/test.png") # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._extract_page_from_image(image_uri="https://example.com/test.png") # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENT
assert exc_info.value.user_action is not None
@@ -153,7 +153,7 @@ class TestMistralExtractWorkerSemantic:
extract_job_params.image_min_size = None
with pytest.raises(ExtractJobFailureError) as exc_info:
- await worker._extract_pages_from_document( # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._extract_pages_from_document( # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
document_uri="https://example.com/doc.pdf",
extract_job_params=extract_job_params,
)
@@ -180,7 +180,7 @@ class TestMistralExtractWorkerSemantic:
)
with pytest.raises(ExtractModelNotFoundError) as exc_info:
- await worker._extract_page_from_image(image_uri="https://example.com/test.png") # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._extract_page_from_image(image_uri="https://example.com/test.png") # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATION
assert exc_info.value.user_action is not None
diff --git a/tests/unit/pipelex/providers/mistral/test_mistral_factory_extract_output.py b/tests/unit/pipelex/providers/mistral/test_mistral_factory_extract_output.py
index 78d6bdc4c..657a56b9a 100644
--- a/tests/unit/pipelex/providers/mistral/test_mistral_factory_extract_output.py
+++ b/tests/unit/pipelex/providers/mistral/test_mistral_factory_extract_output.py
@@ -49,7 +49,7 @@ class TestMistralFactoryExtractOutput:
def test_clean_base64_already_clean_returned_unchanged(self, _topic: str, raw_bytes: bytes) -> None:
"""Data already starting with a JPEG or PNG magic number is returned as the exact same base64 string."""
base64_str = _encode(raw_bytes)
- cleaned = MistralFactory._clean_mistral_image_base64(base64_str) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ cleaned = MistralFactory._clean_mistral_image_base64(base64_str) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert cleaned == base64_str
@pytest.mark.parametrize(
@@ -62,7 +62,7 @@ class TestMistralFactoryExtractOutput:
def test_clean_base64_strips_prepended_metadata(self, _topic: str, image_body: bytes) -> None:
"""Metadata bytes prepended before the image magic number are stripped, leaving exactly the image bytes."""
base64_str = _encode(b"METADATA" + image_body)
- cleaned = MistralFactory._clean_mistral_image_base64(base64_str) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ cleaned = MistralFactory._clean_mistral_image_base64(base64_str) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert base64.b64decode(cleaned) == image_body
@pytest.mark.parametrize(
@@ -75,13 +75,13 @@ class TestMistralFactoryExtractOutput:
def test_clean_base64_no_magic_in_window_returns_original(self, _topic: str, raw_bytes: bytes) -> None:
"""When no image magic number appears in the first 32 bytes, the original string is returned untouched."""
base64_str = _encode(raw_bytes)
- cleaned = MistralFactory._clean_mistral_image_base64(base64_str) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ cleaned = MistralFactory._clean_mistral_image_base64(base64_str) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert cleaned == base64_str
def test_clean_base64_invalid_input_returns_original(self) -> None:
"""An input that fails base64 decoding is returned unmodified (ValueError branch)."""
invalid_base64 = "not-valid-base64!!!"
- cleaned = MistralFactory._clean_mistral_image_base64(invalid_base64) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ cleaned = MistralFactory._clean_mistral_image_base64(invalid_base64) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert cleaned == invalid_base64
# ---- make_extracted_image_from_page_from_mistral_ocr_image_obj ----
diff --git a/tests/unit/pipelex/providers/mistral/test_mistral_llm_worker_object_error_handling.py b/tests/unit/pipelex/providers/mistral/test_mistral_llm_worker_object_error_handling.py
index a74a711d3..561698354 100644
--- a/tests/unit/pipelex/providers/mistral/test_mistral_llm_worker_object_error_handling.py
+++ b/tests/unit/pipelex/providers/mistral/test_mistral_llm_worker_object_error_handling.py
@@ -76,7 +76,7 @@ class TestMistralLLMWorkerObjectErrorHandling:
worker.instructor_for_objects.chat.completions.create_with_completion.side_effect = wrapped # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENT
assert exc_info.value.user_action is not None
@@ -102,7 +102,7 @@ class TestMistralLLMWorkerObjectErrorHandling:
worker.instructor_for_objects.chat.completions.create_with_completion.side_effect = wrapped # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CAPACITY
assert exc_info.value.user_action is not None
@@ -119,7 +119,7 @@ class TestMistralLLMWorkerObjectErrorHandling:
worker.instructor_for_objects.chat.completions.create_with_completion.side_effect = wrapped # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CAPACITY
assert exc_info.value.user_action is not None
@@ -135,7 +135,7 @@ class TestMistralLLMWorkerObjectErrorHandling:
worker.instructor_for_objects.chat.completions.create_with_completion.side_effect = wrapped # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONTENT
assert exc_info.value.user_action is not None
@@ -152,7 +152,7 @@ class TestMistralLLMWorkerObjectErrorHandling:
worker.instructor_for_objects.chat.completions.create_with_completion.side_effect = wrapped # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONTENT
assert exc_info.value.user_action is not None
@@ -168,7 +168,7 @@ class TestMistralLLMWorkerObjectErrorHandling:
worker.instructor_for_objects.chat.completions.create_with_completion.side_effect = wrapped # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATION
assert exc_info.value.user_action is not None
@@ -184,7 +184,7 @@ class TestMistralLLMWorkerObjectErrorHandling:
worker.instructor_for_objects.chat.completions.create_with_completion.side_effect = wrapped # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMModelNotFoundError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATION
assert exc_info.value.user_action is not None
@@ -200,7 +200,7 @@ class TestMistralLLMWorkerObjectErrorHandling:
worker.instructor_for_objects.chat.completions.create_with_completion.side_effect = wrapped # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENT
assert exc_info.value.user_action is not None
@@ -216,7 +216,7 @@ class TestMistralLLMWorkerObjectErrorHandling:
worker.instructor_for_objects.chat.completions.create_with_completion.side_effect = wrapped # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.UNKNOWN
assert exc_info.value.__cause__ is wrapped
@@ -231,7 +231,7 @@ class TestMistralLLMWorkerObjectErrorHandling:
and does NOT wrap it in ``InstructorRetryException``. It propagates as the raw
``MistralError``, which the worker classifies as TRANSIENT with provider metadata.
"""
- import instructor # noqa: PLC0415
+ import instructor # ruff: ignore[import-outside-top-level]
worker = _make_worker(mocker)
@@ -241,7 +241,7 @@ class TestMistralLLMWorkerObjectErrorHandling:
worker.instructor_for_objects = instructor.from_mistral(client=mistral_client, use_async=True)
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENT
assert exc_info.value.user_action is not None
@@ -277,7 +277,7 @@ class TestMistralLLMWorkerObjectErrorHandling:
worker.instructor_for_objects.chat.completions.create_with_completion.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is expected_category
assert exc_info.value.__cause__ is sdk_exc
diff --git a/tests/unit/pipelex/providers/mistral/test_mistral_reasoning.py b/tests/unit/pipelex/providers/mistral/test_mistral_reasoning.py
index 9b7a022ff..ecdaeeab1 100644
--- a/tests/unit/pipelex/providers/mistral/test_mistral_reasoning.py
+++ b/tests/unit/pipelex/providers/mistral/test_mistral_reasoning.py
@@ -29,7 +29,7 @@ def _make_worker(mocker: MockerFixture, thinking_mode: ThinkingMode) -> MistralL
def _mock_config(mocker: MockerFixture) -> None:
"""Mock get_config() to return a mistral_config with the effort_to_level_map."""
- from pipelex.providers.mistral.mistral_config import MistralConfig # noqa: PLC0415
+ from pipelex.providers.mistral.mistral_config import MistralConfig # ruff: ignore[import-outside-top-level]
mistral_config = MistralConfig(effort_to_level_map=_MISTRAL_LEVEL_MAP)
mocker.patch(
@@ -52,14 +52,14 @@ class TestMistralReasoning:
worker = _make_worker(mocker, thinking_mode=ThinkingMode.NONE)
job_params = LLMJobParams(temperature=0.5, reasoning_budget=4096)
with pytest.raises(LLMCapabilityError, match="does not support reasoning"):
- worker._resolve_prompt_mode(job_params=job_params) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ worker._resolve_prompt_mode(job_params=job_params) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
def test_reasoning_budget_with_thinking_mode_manual_raises(self, mocker: MockerFixture):
"""reasoning_budget with thinking_mode=manual raises with 'prompt_mode' guidance."""
worker = _make_worker(mocker, thinking_mode=ThinkingMode.MANUAL)
job_params = LLMJobParams(temperature=0.5, reasoning_budget=4096)
with pytest.raises(LLMCapabilityError, match="reasoning_budget"):
- worker._resolve_prompt_mode(job_params=job_params) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ worker._resolve_prompt_mode(job_params=job_params) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
@pytest.mark.parametrize(
("effort", "expected_prompt_mode"),
@@ -82,7 +82,7 @@ class TestMistralReasoning:
worker = _make_worker(mocker, thinking_mode=ThinkingMode.MANUAL)
_mock_config(mocker)
job_params = LLMJobParams(temperature=0.5, reasoning_effort=effort)
- result = worker._resolve_prompt_mode(job_params=job_params) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ result = worker._resolve_prompt_mode(job_params=job_params) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert result == expected_prompt_mode
def test_thinking_mode_none_raises_capability_error(self, mocker: MockerFixture):
@@ -90,20 +90,20 @@ class TestMistralReasoning:
worker = _make_worker(mocker, thinking_mode=ThinkingMode.NONE)
job_params = LLMJobParams(temperature=0.5, reasoning_effort=ReasoningEffort.HIGH)
with pytest.raises(LLMCapabilityError, match="does not support reasoning"):
- worker._resolve_prompt_mode(job_params=job_params) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ worker._resolve_prompt_mode(job_params=job_params) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
def test_thinking_mode_adaptive_raises_capability_error(self, mocker: MockerFixture):
"""Adaptive thinking mode is not applicable to Mistral models."""
worker = _make_worker(mocker, thinking_mode=ThinkingMode.ADAPTIVE)
job_params = LLMJobParams(temperature=0.5, reasoning_effort=ReasoningEffort.HIGH)
with pytest.raises(LLMCapabilityError, match="adaptive"):
- worker._resolve_prompt_mode(job_params=job_params) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ worker._resolve_prompt_mode(job_params=job_params) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
def test_no_reasoning_params_returns_unset(self, mocker: MockerFixture):
"""When neither reasoning_effort nor reasoning_budget is set, returns UNSET."""
- from mistralai.types import UNSET # noqa: PLC0415
+ from mistralai.types import UNSET # ruff: ignore[import-outside-top-level]
worker = _make_worker(mocker, thinking_mode=ThinkingMode.MANUAL)
job_params = LLMJobParams(temperature=0.5)
- result = worker._resolve_prompt_mode(job_params=job_params) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ result = worker._resolve_prompt_mode(job_params=job_params) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert result is UNSET
diff --git a/tests/unit/pipelex/providers/mistral/test_mistral_worker_error_handling.py b/tests/unit/pipelex/providers/mistral/test_mistral_worker_error_handling.py
index d927a2a02..c0f5726f8 100644
--- a/tests/unit/pipelex/providers/mistral/test_mistral_worker_error_handling.py
+++ b/tests/unit/pipelex/providers/mistral/test_mistral_worker_error_handling.py
@@ -116,7 +116,7 @@ class TestMistralWorkerErrorHandling:
worker.mistral_client_for_text.chat.complete_async.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_text(llm_job=_make_llm_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_text(llm_job=_make_llm_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is expected_category
assert exc_info.value.__cause__ is sdk_exc
@@ -131,7 +131,7 @@ class TestMistralWorkerErrorHandling:
worker.mistral_client_for_text.chat.complete_async.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_text(llm_job=_make_llm_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_text(llm_job=_make_llm_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATION
assert exc_info.value.user_action is not None
@@ -145,7 +145,7 @@ class TestMistralWorkerErrorHandling:
worker.mistral_client_for_text.chat.complete_async.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMModelNotFoundError) as exc_info:
- await worker._gen_text(llm_job=_make_llm_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_text(llm_job=_make_llm_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATION
assert exc_info.value.user_action is not None
@@ -179,7 +179,7 @@ class TestMistralWorkerErrorHandling:
)
with pytest.raises(ExtractJobFailureError) as exc_info:
- await worker._extract_page_from_image(image_uri="https://example.com/test.png") # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._extract_page_from_image(image_uri="https://example.com/test.png") # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is expected_category
assert exc_info.value.__cause__ is sdk_exc
@@ -199,7 +199,7 @@ class TestMistralWorkerErrorHandling:
)
with pytest.raises(ExtractModelNotFoundError) as exc_info:
- await worker._extract_page_from_image(image_uri="https://example.com/test.png") # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._extract_page_from_image(image_uri="https://example.com/test.png") # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATION
assert exc_info.value.user_action is not None
@@ -215,7 +215,7 @@ class TestMistralWorkerErrorHandling:
worker.mistral_client_for_text.chat.complete_async.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_text(llm_job=_make_llm_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_text(llm_job=_make_llm_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
report = exc_info.value.to_error_report()
assert report.error_category == "transient"
@@ -229,7 +229,7 @@ class TestMistralWorkerErrorHandling:
worker.mistral_client_for_text.chat.complete_async.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_text(llm_job=_make_llm_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_text(llm_job=_make_llm_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
report = exc_info.value.to_error_report()
assert report.error_category == "capacity"
@@ -247,7 +247,7 @@ class TestMistralWorkerErrorHandling:
)
with pytest.raises(ExtractJobFailureError) as exc_info:
- await worker._extract_page_from_image(image_uri="https://example.com/test.png") # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._extract_page_from_image(image_uri="https://example.com/test.png") # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
report = exc_info.value.to_error_report()
assert report.error_category == "configuration"
diff --git a/tests/unit/pipelex/providers/openai/test_openai_completions_img_gen_worker_error_handling.py b/tests/unit/pipelex/providers/openai/test_openai_completions_img_gen_worker_error_handling.py
index 0a68b9404..ce70b0652 100644
--- a/tests/unit/pipelex/providers/openai/test_openai_completions_img_gen_worker_error_handling.py
+++ b/tests/unit/pipelex/providers/openai/test_openai_completions_img_gen_worker_error_handling.py
@@ -66,7 +66,7 @@ class TestOpenAICompletionsImgGenWorkerErrorHandling:
worker.openai_client.chat.completions.create.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENT
assert exc_info.value.user_action is not None
@@ -84,7 +84,7 @@ class TestOpenAICompletionsImgGenWorkerErrorHandling:
worker.openai_client.chat.completions.create.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CAPACITY
assert exc_info.value.user_action is not None
@@ -97,7 +97,7 @@ class TestOpenAICompletionsImgGenWorkerErrorHandling:
worker.openai_client.chat.completions.create.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENT
assert exc_info.value.user_action is not None
@@ -110,7 +110,7 @@ class TestOpenAICompletionsImgGenWorkerErrorHandling:
worker.openai_client.chat.completions.create.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENT
@@ -120,7 +120,7 @@ class TestOpenAICompletionsImgGenWorkerErrorHandling:
worker.openai_client.chat.completions.create.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENT
assert exc_info.value.user_action is not None
@@ -136,7 +136,7 @@ class TestOpenAICompletionsImgGenWorkerErrorHandling:
worker.openai_client.chat.completions.create.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONTENT
assert exc_info.value.user_action is not None
@@ -152,7 +152,7 @@ class TestOpenAICompletionsImgGenWorkerErrorHandling:
worker.openai_client.chat.completions.create.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONTENT
assert exc_info.value.user_action is not None
@@ -168,7 +168,7 @@ class TestOpenAICompletionsImgGenWorkerErrorHandling:
worker.openai_client.chat.completions.create.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATION
assert exc_info.value.user_action is not None
@@ -184,7 +184,7 @@ class TestOpenAICompletionsImgGenWorkerErrorHandling:
worker.openai_client.chat.completions.create.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATION
assert exc_info.value.user_action is not None
@@ -200,7 +200,7 @@ class TestOpenAICompletionsImgGenWorkerErrorHandling:
worker.openai_client.chat.completions.create.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(ImgGenModelNotFoundError) as exc_info:
- await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATION
assert exc_info.value.user_action is not None
@@ -215,7 +215,7 @@ class TestOpenAICompletionsImgGenWorkerErrorHandling:
worker.openai_client.chat.completions.create.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATION
assert exc_info.value.user_action is not None
@@ -230,7 +230,7 @@ class TestOpenAICompletionsImgGenWorkerErrorHandling:
worker.openai_client.chat.completions.create.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image(img_gen_job=_make_img_gen_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENT
assert exc_info.value.user_action is not None
diff --git a/tests/unit/pipelex/providers/openai/test_openai_completions_reasoning.py b/tests/unit/pipelex/providers/openai/test_openai_completions_reasoning.py
index 7493de4a6..a0b391b6d 100644
--- a/tests/unit/pipelex/providers/openai/test_openai_completions_reasoning.py
+++ b/tests/unit/pipelex/providers/openai/test_openai_completions_reasoning.py
@@ -29,7 +29,7 @@ def _make_worker(mocker: MockerFixture, thinking_mode: ThinkingMode) -> OpenAICo
def _mock_config(mocker: MockerFixture) -> None:
"""Mock get_config() to return an openai_config with the effort_to_level_map."""
- from pipelex.providers.openai.openai_config import OpenAIConfig # noqa: PLC0415
+ from pipelex.providers.openai.openai_config import OpenAIConfig # ruff: ignore[import-outside-top-level]
openai_config = OpenAIConfig(effort_to_level_map=_OPENAI_LEVEL_MAP)
mocker.patch(
@@ -69,14 +69,14 @@ class TestOpenAICompletionsReasoning:
worker = _make_worker(mocker, thinking_mode=ThinkingMode.MANUAL)
_mock_config(mocker)
job_params = LLMJobParams(temperature=0.5, reasoning_effort=effort)
- result = worker._resolve_reasoning_effort(job_params=job_params) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ result = worker._resolve_reasoning_effort(job_params=job_params) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert result == expected_openai_effort
def test_no_reasoning_params_returns_none(self, mocker: MockerFixture):
"""When neither reasoning_effort nor reasoning_budget is set, returns None."""
worker = _make_worker(mocker, thinking_mode=ThinkingMode.MANUAL)
job_params = LLMJobParams(temperature=0.5)
- result = worker._resolve_reasoning_effort(job_params=job_params) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ result = worker._resolve_reasoning_effort(job_params=job_params) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert result is None
def test_reasoning_budget_raises_capability_error(self, mocker: MockerFixture):
@@ -84,25 +84,25 @@ class TestOpenAICompletionsReasoning:
worker = _make_worker(mocker, thinking_mode=ThinkingMode.MANUAL)
job_params = LLMJobParams(temperature=0.5, reasoning_budget=4096)
with pytest.raises(LLMCapabilityError, match="reasoning_budget"):
- worker._resolve_reasoning_effort(job_params=job_params) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ worker._resolve_reasoning_effort(job_params=job_params) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
def test_thinking_mode_none_raises_capability_error(self, mocker: MockerFixture):
"""Models with thinking_mode=none should raise LLMCapabilityError."""
worker = _make_worker(mocker, thinking_mode=ThinkingMode.NONE)
job_params = LLMJobParams(temperature=0.5, reasoning_effort=ReasoningEffort.HIGH)
with pytest.raises(LLMCapabilityError, match="does not support reasoning"):
- worker._resolve_reasoning_effort(job_params=job_params) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ worker._resolve_reasoning_effort(job_params=job_params) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
def test_thinking_mode_adaptive_raises_capability_error(self, mocker: MockerFixture):
"""Adaptive thinking mode is not applicable to OpenAI models."""
worker = _make_worker(mocker, thinking_mode=ThinkingMode.ADAPTIVE)
job_params = LLMJobParams(temperature=0.5, reasoning_effort=ReasoningEffort.HIGH)
with pytest.raises(LLMCapabilityError, match="adaptive"):
- worker._resolve_reasoning_effort(job_params=job_params) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ worker._resolve_reasoning_effort(job_params=job_params) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
def test_reasoning_budget_with_thinking_mode_none_raises(self, mocker: MockerFixture):
"""reasoning_budget with thinking_mode=none gives an accurate 'does not support reasoning' error."""
worker = _make_worker(mocker, thinking_mode=ThinkingMode.NONE)
job_params = LLMJobParams(temperature=0.5, reasoning_budget=4096)
with pytest.raises(LLMCapabilityError, match="does not support reasoning"):
- worker._resolve_reasoning_effort(job_params=job_params) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ worker._resolve_reasoning_effort(job_params=job_params) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
diff --git a/tests/unit/pipelex/providers/openai/test_openai_completions_usage_capture.py b/tests/unit/pipelex/providers/openai/test_openai_completions_usage_capture.py
index 40679b325..a4ef6601a 100644
--- a/tests/unit/pipelex/providers/openai/test_openai_completions_usage_capture.py
+++ b/tests/unit/pipelex/providers/openai/test_openai_completions_usage_capture.py
@@ -122,7 +122,7 @@ class TestOpenAICompletionsUsageCapture:
worker = _make_worker(mocker, _make_text_response(mocker, usage=usage))
llm_job = _make_llm_job_with_empty_usage()
- text = await worker._gen_text(llm_job=llm_job) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ text = await worker._gen_text(llm_job=llm_job) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert text == "pong"
captured = llm_job.job_report.llm_tokens_usage
@@ -139,7 +139,7 @@ class TestOpenAICompletionsUsageCapture:
worker = _make_worker(mocker, _make_text_response(mocker, usage=None))
llm_job = _make_llm_job_with_empty_usage()
- await worker._gen_text(llm_job=llm_job) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_text(llm_job=llm_job) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
captured = llm_job.job_report.llm_tokens_usage
assert captured is not None
diff --git a/tests/unit/pipelex/providers/openai/test_openai_completions_worker_object_error_handling.py b/tests/unit/pipelex/providers/openai/test_openai_completions_worker_object_error_handling.py
index a7ec5fce2..f776e781c 100644
--- a/tests/unit/pipelex/providers/openai/test_openai_completions_worker_object_error_handling.py
+++ b/tests/unit/pipelex/providers/openai/test_openai_completions_worker_object_error_handling.py
@@ -103,7 +103,7 @@ class TestOpenAICompletionsWorkerObjectErrorHandling:
worker.instructor_for_objects.chat.completions.create_with_completion.side_effect = wrapped # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENT
assert exc_info.value.user_action is not None
@@ -126,7 +126,7 @@ class TestOpenAICompletionsWorkerObjectErrorHandling:
worker.instructor_for_objects.chat.completions.create_with_completion.side_effect = wrapped # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CAPACITY
assert exc_info.value.user_action is not None
@@ -143,7 +143,7 @@ class TestOpenAICompletionsWorkerObjectErrorHandling:
worker.instructor_for_objects.chat.completions.create_with_completion.side_effect = wrapped # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENT
assert exc_info.value.user_action is not None
@@ -159,7 +159,7 @@ class TestOpenAICompletionsWorkerObjectErrorHandling:
worker.instructor_for_objects.chat.completions.create_with_completion.side_effect = wrapped # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENT
assert exc_info.value.user_action is not None
@@ -175,7 +175,7 @@ class TestOpenAICompletionsWorkerObjectErrorHandling:
worker.instructor_for_objects.chat.completions.create_with_completion.side_effect = wrapped # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONTENT
assert exc_info.value.user_action is not None
@@ -193,7 +193,7 @@ class TestOpenAICompletionsWorkerObjectErrorHandling:
worker.instructor_for_objects.chat.completions.create_with_completion.side_effect = wrapped # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONTENT
assert exc_info.value.user_action is not None
@@ -208,7 +208,7 @@ class TestOpenAICompletionsWorkerObjectErrorHandling:
worker.instructor_for_objects.chat.completions.create_with_completion.side_effect = wrapped # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATION
assert exc_info.value.user_action is not None
@@ -224,7 +224,7 @@ class TestOpenAICompletionsWorkerObjectErrorHandling:
worker.instructor_for_objects.chat.completions.create_with_completion.side_effect = wrapped # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMModelNotFoundError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATION
assert exc_info.value.user_action is not None
@@ -241,7 +241,7 @@ class TestOpenAICompletionsWorkerObjectErrorHandling:
worker.instructor_for_objects.chat.completions.create_with_completion.side_effect = wrapped # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.UNKNOWN
assert exc_info.value.__cause__ is wrapped
@@ -254,7 +254,7 @@ class TestOpenAICompletionsWorkerObjectErrorHandling:
transport error and does NOT wrap it in ``InstructorRetryException``. It propagates as
the raw SDK exception, which the worker classifies as TRANSIENT with provider metadata.
"""
- import instructor # noqa: PLC0415 # imported here to mirror runtime usage
+ import instructor # ruff: ignore[import-outside-top-level] # imported here to mirror runtime usage
worker = _make_worker(mocker)
@@ -264,7 +264,7 @@ class TestOpenAICompletionsWorkerObjectErrorHandling:
worker.instructor_for_objects = instructor.from_openai(openai_client)
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENT
assert exc_info.value.user_action is not None
@@ -298,7 +298,7 @@ class TestOpenAICompletionsWorkerObjectErrorHandling:
worker.instructor_for_objects.chat.completions.create_with_completion.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is expected_category
assert exc_info.value.__cause__ is sdk_exc
diff --git a/tests/unit/pipelex/providers/openai/test_openai_img_gen_worker_error_handling.py b/tests/unit/pipelex/providers/openai/test_openai_img_gen_worker_error_handling.py
index 39da82d5d..e83868a7d 100644
--- a/tests/unit/pipelex/providers/openai/test_openai_img_gen_worker_error_handling.py
+++ b/tests/unit/pipelex/providers/openai/test_openai_img_gen_worker_error_handling.py
@@ -66,7 +66,7 @@ class TestOpenAIImgGenWorkerErrorHandling:
)
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENT
assert exc_info.value.user_action is not None
@@ -92,7 +92,7 @@ class TestOpenAIImgGenWorkerErrorHandling:
)
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CAPACITY
assert exc_info.value.user_action is not None
@@ -113,7 +113,7 @@ class TestOpenAIImgGenWorkerErrorHandling:
)
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENT
assert exc_info.value.user_action is not None
@@ -134,7 +134,7 @@ class TestOpenAIImgGenWorkerErrorHandling:
)
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENT
assert exc_info.value.user_action is not None
@@ -156,7 +156,7 @@ class TestOpenAIImgGenWorkerErrorHandling:
)
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENT
assert exc_info.value.user_action is not None
@@ -180,7 +180,7 @@ class TestOpenAIImgGenWorkerErrorHandling:
)
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONTENT
assert exc_info.value.user_action is not None
@@ -202,7 +202,7 @@ class TestOpenAIImgGenWorkerErrorHandling:
)
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONTENT
assert exc_info.value.user_action is not None
@@ -224,7 +224,7 @@ class TestOpenAIImgGenWorkerErrorHandling:
)
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATION
assert exc_info.value.user_action is not None
@@ -248,7 +248,7 @@ class TestOpenAIImgGenWorkerErrorHandling:
)
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATION
assert exc_info.value.user_action is not None
@@ -270,7 +270,7 @@ class TestOpenAIImgGenWorkerErrorHandling:
)
with pytest.raises(ImgGenModelNotFoundError) as exc_info:
- await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATION
assert exc_info.value.user_action is not None
@@ -295,7 +295,7 @@ class TestOpenAIImgGenWorkerErrorHandling:
)
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
report = exc_info.value.to_error_report()
assert report.error_category == "transient"
diff --git a/tests/unit/pipelex/providers/openai/test_openai_responses_reasoning.py b/tests/unit/pipelex/providers/openai/test_openai_responses_reasoning.py
index 33647cbf7..25486e525 100644
--- a/tests/unit/pipelex/providers/openai/test_openai_responses_reasoning.py
+++ b/tests/unit/pipelex/providers/openai/test_openai_responses_reasoning.py
@@ -29,7 +29,7 @@ def _make_worker(mocker: MockerFixture, thinking_mode: ThinkingMode) -> OpenAIRe
def _mock_config(mocker: MockerFixture) -> None:
"""Mock get_config() to return an openai_config with the effort_to_level_map."""
- from pipelex.providers.openai.openai_config import OpenAIConfig # noqa: PLC0415
+ from pipelex.providers.openai.openai_config import OpenAIConfig # ruff: ignore[import-outside-top-level]
openai_config = OpenAIConfig(effort_to_level_map=_OPENAI_LEVEL_MAP)
mocker.patch(
@@ -69,7 +69,7 @@ class TestOpenAIResponsesReasoning:
worker = _make_worker(mocker, thinking_mode=ThinkingMode.MANUAL)
_mock_config(mocker)
job_params = LLMJobParams(temperature=0.5, reasoning_effort=effort)
- result = worker._resolve_reasoning(job_params=job_params) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ result = worker._resolve_reasoning(job_params=job_params) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert result is not None
assert result.get("effort") == expected_openai_effort
@@ -77,7 +77,7 @@ class TestOpenAIResponsesReasoning:
"""When neither reasoning_effort nor reasoning_budget is set, returns None."""
worker = _make_worker(mocker, thinking_mode=ThinkingMode.MANUAL)
job_params = LLMJobParams(temperature=0.5)
- result = worker._resolve_reasoning(job_params=job_params) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ result = worker._resolve_reasoning(job_params=job_params) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert result is None
def test_reasoning_budget_raises_capability_error(self, mocker: MockerFixture):
@@ -85,25 +85,25 @@ class TestOpenAIResponsesReasoning:
worker = _make_worker(mocker, thinking_mode=ThinkingMode.MANUAL)
job_params = LLMJobParams(temperature=0.5, reasoning_budget=4096)
with pytest.raises(LLMCapabilityError, match="reasoning_budget"):
- worker._resolve_reasoning(job_params=job_params) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ worker._resolve_reasoning(job_params=job_params) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
def test_thinking_mode_none_raises_capability_error(self, mocker: MockerFixture):
"""Models with thinking_mode=none should raise LLMCapabilityError."""
worker = _make_worker(mocker, thinking_mode=ThinkingMode.NONE)
job_params = LLMJobParams(temperature=0.5, reasoning_effort=ReasoningEffort.HIGH)
with pytest.raises(LLMCapabilityError, match="does not support reasoning"):
- worker._resolve_reasoning(job_params=job_params) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ worker._resolve_reasoning(job_params=job_params) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
def test_thinking_mode_adaptive_raises_capability_error(self, mocker: MockerFixture):
"""Adaptive thinking mode is not applicable to OpenAI models."""
worker = _make_worker(mocker, thinking_mode=ThinkingMode.ADAPTIVE)
job_params = LLMJobParams(temperature=0.5, reasoning_effort=ReasoningEffort.HIGH)
with pytest.raises(LLMCapabilityError, match="adaptive"):
- worker._resolve_reasoning(job_params=job_params) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ worker._resolve_reasoning(job_params=job_params) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
def test_reasoning_budget_with_thinking_mode_none_raises(self, mocker: MockerFixture):
"""reasoning_budget with thinking_mode=none gives an accurate 'does not support reasoning' error."""
worker = _make_worker(mocker, thinking_mode=ThinkingMode.NONE)
job_params = LLMJobParams(temperature=0.5, reasoning_budget=4096)
with pytest.raises(LLMCapabilityError, match="does not support reasoning"):
- worker._resolve_reasoning(job_params=job_params) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ worker._resolve_reasoning(job_params=job_params) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
diff --git a/tests/unit/pipelex/providers/openai/test_openai_responses_usage_capture.py b/tests/unit/pipelex/providers/openai/test_openai_responses_usage_capture.py
index 1f4fee753..0fea7c8d0 100644
--- a/tests/unit/pipelex/providers/openai/test_openai_responses_usage_capture.py
+++ b/tests/unit/pipelex/providers/openai/test_openai_responses_usage_capture.py
@@ -103,7 +103,7 @@ class TestOpenAIResponsesUsageCapture:
worker = _make_worker(mocker, response)
llm_job = _make_llm_job_with_empty_usage()
- text = await worker._gen_text(llm_job=llm_job) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ text = await worker._gen_text(llm_job=llm_job) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert text == "pong"
captured = llm_job.job_report.llm_tokens_usage
@@ -119,7 +119,7 @@ class TestOpenAIResponsesUsageCapture:
worker = _make_worker(mocker, response)
llm_job = _make_llm_job_with_empty_usage()
- await worker._gen_text(llm_job=llm_job) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_text(llm_job=llm_job) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
captured = llm_job.job_report.llm_tokens_usage
assert captured is not None
diff --git a/tests/unit/pipelex/providers/openai/test_openai_responses_worker_object_error_handling.py b/tests/unit/pipelex/providers/openai/test_openai_responses_worker_object_error_handling.py
index 2c044e88f..74c16fc45 100644
--- a/tests/unit/pipelex/providers/openai/test_openai_responses_worker_object_error_handling.py
+++ b/tests/unit/pipelex/providers/openai/test_openai_responses_worker_object_error_handling.py
@@ -104,7 +104,7 @@ class TestOpenAIResponsesWorkerObjectErrorHandling:
worker.instructor_for_objects.responses.create_with_completion.side_effect = wrapped # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENT
assert exc_info.value.user_action is not None
@@ -127,7 +127,7 @@ class TestOpenAIResponsesWorkerObjectErrorHandling:
worker.instructor_for_objects.responses.create_with_completion.side_effect = wrapped # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CAPACITY
assert exc_info.value.user_action is not None
@@ -144,7 +144,7 @@ class TestOpenAIResponsesWorkerObjectErrorHandling:
worker.instructor_for_objects.responses.create_with_completion.side_effect = wrapped # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENT
assert exc_info.value.user_action is not None
@@ -160,7 +160,7 @@ class TestOpenAIResponsesWorkerObjectErrorHandling:
worker.instructor_for_objects.responses.create_with_completion.side_effect = wrapped # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENT
assert exc_info.value.user_action is not None
@@ -176,7 +176,7 @@ class TestOpenAIResponsesWorkerObjectErrorHandling:
worker.instructor_for_objects.responses.create_with_completion.side_effect = wrapped # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONTENT
assert exc_info.value.user_action is not None
@@ -194,7 +194,7 @@ class TestOpenAIResponsesWorkerObjectErrorHandling:
worker.instructor_for_objects.responses.create_with_completion.side_effect = wrapped # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONTENT
assert exc_info.value.user_action is not None
@@ -209,7 +209,7 @@ class TestOpenAIResponsesWorkerObjectErrorHandling:
worker.instructor_for_objects.responses.create_with_completion.side_effect = wrapped # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATION
assert exc_info.value.user_action is not None
@@ -229,7 +229,7 @@ class TestOpenAIResponsesWorkerObjectErrorHandling:
worker.instructor_for_objects.responses.create_with_completion.side_effect = wrapped # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMModelNotFoundError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATION
assert exc_info.value.model_handle == "gpt-4o-handle"
@@ -248,7 +248,7 @@ class TestOpenAIResponsesWorkerObjectErrorHandling:
worker.instructor_for_objects.responses.create_with_completion.side_effect = wrapped # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.UNKNOWN
assert exc_info.value.__cause__ is wrapped
@@ -261,7 +261,7 @@ class TestOpenAIResponsesWorkerObjectErrorHandling:
retry the transport error and does NOT wrap it in ``InstructorRetryException``. It
propagates raw, and the worker classifies it as TRANSIENT with provider metadata.
"""
- import instructor # noqa: PLC0415 # imported here to mirror runtime usage
+ import instructor # ruff: ignore[import-outside-top-level] # imported here to mirror runtime usage
worker = _make_worker(mocker)
@@ -271,7 +271,7 @@ class TestOpenAIResponsesWorkerObjectErrorHandling:
worker.instructor_for_objects = instructor.from_openai(openai_client, mode=instructor.Mode.RESPONSES_TOOLS)
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENT
assert exc_info.value.user_action is not None
@@ -305,7 +305,7 @@ class TestOpenAIResponsesWorkerObjectErrorHandling:
worker.instructor_for_objects.responses.create_with_completion.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is expected_category
assert exc_info.value.__cause__ is sdk_exc
diff --git a/tests/unit/pipelex/providers/openai/test_openai_worker_error_handling.py b/tests/unit/pipelex/providers/openai/test_openai_worker_error_handling.py
index 28044040b..c70feaec6 100644
--- a/tests/unit/pipelex/providers/openai/test_openai_worker_error_handling.py
+++ b/tests/unit/pipelex/providers/openai/test_openai_worker_error_handling.py
@@ -183,7 +183,7 @@ class TestOpenAIWorkerErrorHandling:
worker.openai_client_for_text.chat.completions.create.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_text(llm_job=_make_llm_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_text(llm_job=_make_llm_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is expected_category
assert exc_info.value.__cause__ is sdk_exc
@@ -210,7 +210,7 @@ class TestOpenAIWorkerErrorHandling:
worker.openai_client_for_text.chat.completions.create.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_text(llm_job=_make_llm_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_text(llm_job=_make_llm_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is expected_category
assert exc_info.value.__cause__ is sdk_exc
@@ -235,7 +235,7 @@ class TestOpenAIWorkerErrorHandling:
worker.openai_client_for_text.chat.completions.create.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_text(llm_job=_make_llm_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_text(llm_job=_make_llm_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is expected_category
assert exc_info.value.__cause__ is sdk_exc
@@ -252,7 +252,7 @@ class TestOpenAIWorkerErrorHandling:
worker.openai_client_for_text.chat.completions.create.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMModelNotFoundError) as exc_info:
- await worker._gen_text(llm_job=_make_llm_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_text(llm_job=_make_llm_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATION
assert exc_info.value.__cause__ is sdk_exc
@@ -264,7 +264,7 @@ class TestOpenAIWorkerErrorHandling:
worker.openai_client_for_text.chat.completions.create.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_text(llm_job=_make_llm_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_text(llm_job=_make_llm_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENT
assert exc_info.value.__cause__ is sdk_exc
@@ -276,7 +276,7 @@ class TestOpenAIWorkerErrorHandling:
worker.openai_client_for_text.chat.completions.create.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_text(llm_job=_make_llm_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_text(llm_job=_make_llm_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATION
assert exc_info.value.__cause__ is sdk_exc
@@ -295,7 +295,7 @@ class TestOpenAIWorkerErrorHandling:
worker.openai_client_for_text.chat.completions.create.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_text(llm_job=_make_llm_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_text(llm_job=_make_llm_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATION
assert exc_info.value.user_action is not None
@@ -309,7 +309,7 @@ class TestOpenAIWorkerErrorHandling:
worker.openai_client_for_responses.responses.create.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_text(llm_job=_make_llm_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_text(llm_job=_make_llm_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATION
assert exc_info.value.__cause__ is sdk_exc
@@ -321,7 +321,7 @@ class TestOpenAIWorkerErrorHandling:
worker.openai_client.images.generate.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATION
assert exc_info.value.__cause__ is sdk_exc
@@ -335,7 +335,7 @@ class TestOpenAIWorkerErrorHandling:
worker.openai_client_for_responses.responses.create.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_text(llm_job=_make_llm_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_text(llm_job=_make_llm_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENT
assert exc_info.value.__cause__ is sdk_exc
@@ -347,7 +347,7 @@ class TestOpenAIWorkerErrorHandling:
worker.openai_client_for_responses.responses.create.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_text(llm_job=_make_llm_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_text(llm_job=_make_llm_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CAPACITY
@@ -360,7 +360,7 @@ class TestOpenAIWorkerErrorHandling:
worker.openai_client.images.generate.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENT
assert exc_info.value.__cause__ is sdk_exc
@@ -372,7 +372,7 @@ class TestOpenAIWorkerErrorHandling:
worker.openai_client.images.generate.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(ImgGenGenerationError) as exc_info:
- await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_image_list(img_gen_job=_make_img_gen_job(mocker), nb_images=1) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATION
assert exc_info.value.__cause__ is sdk_exc
@@ -386,7 +386,7 @@ class TestOpenAIWorkerErrorHandling:
worker.openai_client_for_text.chat.completions.create.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_text(llm_job=_make_llm_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_text(llm_job=_make_llm_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
report = exc_info.value.to_error_report()
assert report.error_category == "transient"
@@ -400,7 +400,7 @@ class TestOpenAIWorkerErrorHandling:
worker.openai_client_for_text.chat.completions.create.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
with pytest.raises(LLMCompletionError) as exc_info:
- await worker._gen_text(llm_job=_make_llm_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._gen_text(llm_job=_make_llm_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
report = exc_info.value.to_error_report()
assert report.error_category == "capacity"
diff --git a/tests/unit/pipelex/providers/pypdfium2/test_pypdfium2_worker_error_handling.py b/tests/unit/pipelex/providers/pypdfium2/test_pypdfium2_worker_error_handling.py
index 6b748e60d..594378e1a 100644
--- a/tests/unit/pipelex/providers/pypdfium2/test_pypdfium2_worker_error_handling.py
+++ b/tests/unit/pipelex/providers/pypdfium2/test_pypdfium2_worker_error_handling.py
@@ -31,7 +31,7 @@ def _make_extract_job(mocker: MockerFixture) -> Any:
"""Create a mock ExtractJob for pypdfium2 worker."""
job = mocker.MagicMock()
job.extract_input.image_uri = None
- job.extract_input.document_uri = "/tmp/test.pdf" # noqa: S108
+ job.extract_input.document_uri = "/tmp/test.pdf" # ruff: ignore[hardcoded-temp-file]
job.job_params.max_nb_images = 0 # No images, simplifies the test
job.job_report.extract_tokens_usage = None
return job
@@ -63,7 +63,7 @@ class TestPypdfium2WorkerErrorHandling:
worker,
"_resolve_pdf_uri",
new_callable=mocker.AsyncMock,
- return_value="/tmp/test.pdf", # noqa: S108
+ return_value="/tmp/test.pdf", # ruff: ignore[hardcoded-temp-file]
)
# Mock pypdfium2_renderer methods to raise the exception
@@ -74,7 +74,7 @@ class TestPypdfium2WorkerErrorHandling:
)
with pytest.raises(ExtractJobFailureError) as exc_info:
- await worker._extract_pages(extract_job=_make_extract_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._extract_pages(extract_job=_make_extract_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is expected_category
assert exc_info.value.__cause__ is sdk_exc
@@ -90,7 +90,7 @@ class TestPypdfium2WorkerErrorHandling:
worker,
"_resolve_pdf_uri",
new_callable=mocker.AsyncMock,
- return_value="/tmp/missing.pdf", # noqa: S108
+ return_value="/tmp/missing.pdf", # ruff: ignore[hardcoded-temp-file]
)
mocker.patch(
"pipelex.providers.pypdfium2.pypdfium2_worker.pypdfium2_renderer.extract_text_from_pdf_pages",
@@ -99,7 +99,7 @@ class TestPypdfium2WorkerErrorHandling:
)
with pytest.raises(ExtractJobFailureError) as exc_info:
- await worker._extract_pages(extract_job=_make_extract_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._extract_pages(extract_job=_make_extract_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
report = exc_info.value.to_error_report()
assert report.error_category == "content"
@@ -115,7 +115,7 @@ class TestPypdfium2WorkerErrorHandling:
worker,
"_resolve_pdf_uri",
new_callable=mocker.AsyncMock,
- return_value="/tmp/test.pdf", # noqa: S108
+ return_value="/tmp/test.pdf", # ruff: ignore[hardcoded-temp-file]
)
mocker.patch(
"pipelex.providers.pypdfium2.pypdfium2_worker.pypdfium2_renderer.extract_text_from_pdf_pages",
@@ -124,7 +124,7 @@ class TestPypdfium2WorkerErrorHandling:
)
with pytest.raises(ExtractJobFailureError) as exc_info:
- await worker._extract_pages(extract_job=_make_extract_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._extract_pages(extract_job=_make_extract_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
report = exc_info.value.to_error_report()
assert report.error_category == "transient"
diff --git a/tests/unit/pipelex/providers/pypdfium2/test_pypdfium2_worker_semantic.py b/tests/unit/pipelex/providers/pypdfium2/test_pypdfium2_worker_semantic.py
index 7c5c2b983..d67fd2425 100644
--- a/tests/unit/pipelex/providers/pypdfium2/test_pypdfium2_worker_semantic.py
+++ b/tests/unit/pipelex/providers/pypdfium2/test_pypdfium2_worker_semantic.py
@@ -27,7 +27,7 @@ def _make_worker(mocker: MockerFixture) -> Pypdfium2Worker:
def _make_extract_job(mocker: MockerFixture) -> Any:
job = mocker.MagicMock()
job.extract_input.image_uri = None
- job.extract_input.document_uri = "/tmp/test.pdf" # noqa: S108
+ job.extract_input.document_uri = "/tmp/test.pdf" # ruff: ignore[hardcoded-temp-file]
job.job_params.max_nb_images = 0
job.job_report.extract_tokens_usage = None
return job
@@ -61,7 +61,7 @@ class TestPypdfium2WorkerSemantic:
worker,
"_resolve_pdf_uri",
new_callable=mocker.AsyncMock,
- return_value="/tmp/test.pdf", # noqa: S108
+ return_value="/tmp/test.pdf", # ruff: ignore[hardcoded-temp-file]
)
mocker.patch(
"pipelex.providers.pypdfium2.pypdfium2_worker.pypdfium2_renderer.extract_text_from_pdf_pages",
@@ -70,7 +70,7 @@ class TestPypdfium2WorkerSemantic:
)
with pytest.raises(ExtractJobFailureError) as exc_info:
- await worker._extract_pages(extract_job=_make_extract_job(mocker)) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ await worker._extract_pages(extract_job=_make_extract_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
assert exc_info.value.error_category is expected_category
assert exc_info.value.user_action is not None
diff --git a/tests/unit/pipelex/reporting/test_emit_runner_fallback_non_llm.py b/tests/unit/pipelex/reporting/test_emit_runner_fallback_non_llm.py
index 42e148b00..27728c556 100644
--- a/tests/unit/pipelex/reporting/test_emit_runner_fallback_non_llm.py
+++ b/tests/unit/pipelex/reporting/test_emit_runner_fallback_non_llm.py
@@ -115,7 +115,7 @@ def _make_img_gen_job(run_id: str) -> ImgGenJob:
def _make_extract_job(run_id: str) -> ExtractJob:
job_metadata = _job_metadata(run_id, "wf_extract")
return ExtractJob(
- extract_input=ExtractInput(document_uri="/tmp/test.pdf"), # noqa: S108
+ extract_input=ExtractInput(document_uri="/tmp/test.pdf"), # ruff: ignore[hardcoded-temp-file]
job_params=ExtractJobParams.make_default_extract_job_params(),
job_config=ExtractJobConfig(),
job_report=ExtractJobReport(
diff --git a/tests/unit/pipelex/reporting/test_reporting_event_emission.py b/tests/unit/pipelex/reporting/test_reporting_event_emission.py
index 60fb0c853..4359d300b 100644
--- a/tests/unit/pipelex/reporting/test_reporting_event_emission.py
+++ b/tests/unit/pipelex/reporting/test_reporting_event_emission.py
@@ -184,7 +184,7 @@ class TestReportingEventEmission:
manager.report_inference_job(_make_test_llm_job("direct_run", trace_context=None))
manager.teardown()
- assert len(manager._event_log_contexts) == 0 # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ assert len(manager._event_log_contexts) == 0 # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
# ------------------------------------------------------------------
# Per-context isolation regression tests
@@ -289,7 +289,7 @@ class TestReportingEventEmission:
"""teardown() removes all event log contexts."""
manager, _event_log = self._make_reporting_manager_with_event_log()
manager.teardown()
- assert len(manager._event_log_contexts) == 0 # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ assert len(manager._event_log_contexts) == 0 # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
def test_sequence_counters_are_independent(self) -> None:
"""Each context maintains its own monotonic sequence counter."""
@@ -333,4 +333,4 @@ class TestReportingEventEmission:
manager.report_inference_job(llm_job)
# No event log was ever set; no event should have been emitted anywhere.
- assert len(manager._event_log_contexts) == 0 # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ assert len(manager._event_log_contexts) == 0 # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
diff --git a/tests/unit/pipelex/runtime_bridge/primitives/test_hydration.py b/tests/unit/pipelex/runtime_bridge/primitives/test_hydration.py
index 9ef82fa87..855a5b1b9 100644
--- a/tests/unit/pipelex/runtime_bridge/primitives/test_hydration.py
+++ b/tests/unit/pipelex/runtime_bridge/primitives/test_hydration.py
@@ -16,7 +16,7 @@ from pipelex.core.stuffs.text_content import TextContent
from pipelex.core.stuffs.yes_no_content import YesNoContent
from pipelex.pipe_run.exceptions import PipeJobError
from pipelex.runtime_bridge.primitives.hydration import (
- _hydrate_list_item, # noqa: PLC2701 # pyright: ignore[reportPrivateUsage]
+ _hydrate_list_item, # pyright: ignore[reportPrivateUsage]
hydrate_working_memory,
)
from pipelex.runtime_hub import get_class_registry
diff --git a/tests/unit/pipelex/runtime_bridge/primitives/test_validate_as_known_class.py b/tests/unit/pipelex/runtime_bridge/primitives/test_validate_as_known_class.py
index 39cfdddbd..f9125b2ea 100644
--- a/tests/unit/pipelex/runtime_bridge/primitives/test_validate_as_known_class.py
+++ b/tests/unit/pipelex/runtime_bridge/primitives/test_validate_as_known_class.py
@@ -2,7 +2,9 @@ from pydantic import ConfigDict
from pipelex.core.stuffs.stuff_content import StuffContent
from pipelex.core.stuffs.text_content import TextContent
-from pipelex.runtime_bridge.primitives.hydration import _validate_as_known_class # noqa: PLC2701 # pyright: ignore[reportPrivateUsage]
+from pipelex.runtime_bridge.primitives.hydration import (
+ _validate_as_known_class, # pyright: ignore[reportPrivateUsage]
+)
class _StuffContentAllowExtra(StuffContent):
diff --git a/tests/unit/pipelex/system/pipelex_service/test_gateway_terms_check.py b/tests/unit/pipelex/system/pipelex_service/test_gateway_terms_check.py
index cd607f825..7ade66148 100644
--- a/tests/unit/pipelex/system/pipelex_service/test_gateway_terms_check.py
+++ b/tests/unit/pipelex/system/pipelex_service/test_gateway_terms_check.py
@@ -100,7 +100,7 @@ class TestGatewayTermsCheck:
)
except (GatewayTermsNotAcceptedError, InferenceSetupRequiredError):
pytest.fail("setup() raised a terms/setup error even though needs_inference=False")
- except Exception: # noqa: S110
+ except Exception: # ruff: ignore[try-except-pass]
# Expected: setup() will fail later in the init chain (telemetry, models, etc.)
# We only care that it did NOT fail with terms/setup errors
pass
diff --git a/tests/unit/pipelex/test_base_exceptions.py b/tests/unit/pipelex/test_base_exceptions.py
index 5f27d969c..9e1af4b8b 100644
--- a/tests/unit/pipelex/test_base_exceptions.py
+++ b/tests/unit/pipelex/test_base_exceptions.py
@@ -1,4 +1,4 @@
-import subprocess # noqa: S404
+import subprocess # ruff: ignore[suspicious-subprocess-import]
import sys
@@ -28,5 +28,5 @@ class TestErrorReportColdImport:
"assert direct.to_dict() == {'error_type': 'X', 'message': 'm', "
"'title': 'X error', 'type_uri': 'https://docs.pipelex.com/latest/errors/x/'}\n"
)
- result = subprocess.run([sys.executable, "-c", code], capture_output=True, text=True, check=False) # noqa: S603
+ result = subprocess.run([sys.executable, "-c", code], capture_output=True, text=True, check=False) # ruff: ignore[subprocess-without-shell-equals-true]
assert result.returncode == 0, f"cold-path ErrorReport construction failed:\nstdout: {result.stdout}\nstderr: {result.stderr}"
diff --git a/tests/unit/pipelex/test_kernel_layer_import_closure.py b/tests/unit/pipelex/test_kernel_layer_import_closure.py
index dfaf2f156..d772dd944 100644
--- a/tests/unit/pipelex/test_kernel_layer_import_closure.py
+++ b/tests/unit/pipelex/test_kernel_layer_import_closure.py
@@ -31,7 +31,7 @@ from __future__ import annotations
import ast
import re
-import subprocess # noqa: S404
+import subprocess # ruff: ignore[suspicious-subprocess-import]
import sys
import textwrap
from pathlib import Path
@@ -176,7 +176,7 @@ _HUB_LAYERING_PAGE = _REPO_ROOT / "docs" / "contribute" / "hub-layering.md"
def _run_closure(*, entry_point: str) -> subprocess.CompletedProcess[str]:
"""Import one entry point in a fresh interpreter and return the detector's verdict."""
try:
- return subprocess.run( # noqa: S603
+ return subprocess.run( # ruff: ignore[subprocess-without-shell-equals-true]
[sys.executable, "-c", _CLOSURE_SCRIPT, entry_point, *INTERPRETER_PACKAGES],
capture_output=True,
text=True,
diff --git a/tests/unit/pipelex/test_runtime_boot_closure.py b/tests/unit/pipelex/test_runtime_boot_closure.py
index db2b303f2..a0c77cf74 100644
--- a/tests/unit/pipelex/test_runtime_boot_closure.py
+++ b/tests/unit/pipelex/test_runtime_boot_closure.py
@@ -19,7 +19,7 @@ and the PipeFunc executor modes are all empty on it — an import-time check can
that tries to resolve out of one of them.
"""
-import subprocess # noqa: S404
+import subprocess # ruff: ignore[suspicious-subprocess-import]
import sys
import textwrap
@@ -103,7 +103,7 @@ CONTROL_PACKAGE_THE_RUNTIME_ALWAYS_LOADS = "cogt"
def _run_booted_runtime(*, interpreter_packages: "tuple[str, ...]") -> subprocess.CompletedProcess[str]:
"""Boot the kernel layer in a fresh interpreter and return the sweep's verdict."""
try:
- return subprocess.run( # noqa: S603
+ return subprocess.run( # ruff: ignore[subprocess-without-shell-equals-true]
[sys.executable, "-c", _BOOTED_RUNTIME_SCRIPT, *interpreter_packages],
capture_output=True,
text=True,
diff --git a/tests/unit/pipelex/test_runtime_boot_stale_backend_error.py b/tests/unit/pipelex/test_runtime_boot_stale_backend_error.py
index e63c07f88..ca0b51d5b 100644
--- a/tests/unit/pipelex/test_runtime_boot_stale_backend_error.py
+++ b/tests/unit/pipelex/test_runtime_boot_stale_backend_error.py
@@ -165,7 +165,7 @@ class TestAStaleBackendFileTheLedgerCannotFullyExplain:
"""Both refusal shapes, because only one of them carries a pydantic error to translate."""
stale_file, refusal = request.getfixturevalue(fixture_name)
- message = RuntimeBoot._get_validation_error_msg( # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ message = RuntimeBoot._get_validation_error_msg( # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
component=BootComponent.INFERENCE_BACKEND_LIBRARY,
validation_exc=refusal,
)
@@ -183,7 +183,7 @@ class TestAStaleBackendFileTheLedgerCannotFullyExplain:
"""Two remedies, one of which discards the file, is worse advice than either alone."""
_, refusal = request.getfixturevalue(fixture_name)
- message = RuntimeBoot._get_validation_error_msg( # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ message = RuntimeBoot._get_validation_error_msg( # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
component=BootComponent.INFERENCE_BACKEND_LIBRARY,
validation_exc=refusal,
)
@@ -195,7 +195,7 @@ class TestAStaleBackendFileTheLedgerCannotFullyExplain:
"""The model deck shares this message and is not a surface: no scan, no block, same tail as before."""
_, refusal = stale_and_unexplained_in_defaults
- message = RuntimeBoot._get_validation_error_msg( # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ message = RuntimeBoot._get_validation_error_msg( # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
component=BootComponent.MODEL_DECK,
validation_exc=refusal,
)
@@ -223,7 +223,7 @@ class TestAStaleBackendFileTheLedgerCannotFullyExplain:
self._plant(path=stale_file, anchor="[gpt-4o]\n", keys='max_tokens = "lots"\n')
refusal = self._refusal_from_the_real_loader(machine=machine)
- message = RuntimeBoot._get_validation_error_msg( # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ message = RuntimeBoot._get_validation_error_msg( # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
component=BootComponent.INFERENCE_BACKEND_LIBRARY,
validation_exc=refusal,
)
@@ -246,7 +246,7 @@ class TestAStaleBackendFileTheLedgerCannotFullyExplain:
(machine / INFERENCE_DIR_NAME / "backends.toml").write_text(BACKENDS_TOML_WITH_A_BAD_VALUE, encoding="utf-8")
refusal = self._refusal_from_the_real_loader(machine=machine)
- message = RuntimeBoot._get_validation_error_msg( # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ message = RuntimeBoot._get_validation_error_msg( # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
component=BootComponent.INFERENCE_BACKEND_LIBRARY,
validation_exc=refusal,
)
@@ -269,7 +269,7 @@ class TestAStaleBackendFileTheLedgerCannotFullyExplain:
self._plant(path=stale_file, anchor="[defaults]\n", keys=f"{UNEXPLAINED_KEY} = 1\n")
refusal = self._refusal_from_the_real_loader(machine=machine)
- message = RuntimeBoot._get_validation_error_msg( # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ message = RuntimeBoot._get_validation_error_msg( # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
component=BootComponent.INFERENCE_BACKEND_LIBRARY,
validation_exc=refusal,
)
diff --git a/tests/unit/pipelex/tools/misc/test_filetype_utils.py b/tests/unit/pipelex/tools/misc/test_filetype_utils.py
index a09cba5f7..54ada9e70 100644
--- a/tests/unit/pipelex/tools/misc/test_filetype_utils.py
+++ b/tests/unit/pipelex/tools/misc/test_filetype_utils.py
@@ -179,14 +179,14 @@ class TestDetectFileTypeFromBase64:
assert result.mime == "text/plain"
mock_detect_bytes.assert_called_once_with(raw_bytes=test_bytes)
- def test_detect_file_type_from_base64_invalid_base64_string(self, mocker: MockerFixture): # noqa: ARG002
+ def test_detect_file_type_from_base64_invalid_base64_string(self, mocker: MockerFixture): # ruff: ignore[unused-method-argument]
# Test with invalid base64 string
invalid_b64 = "invalid!base64!string!"
with pytest.raises(FileTypeError, match="Could not identify file type of given bytes because input is not valid base64"):
detect_file_type_from_base64(invalid_b64)
- def test_detect_file_type_from_base64_invalid_base64_bytes(self, mocker: MockerFixture): # noqa: ARG002
+ def test_detect_file_type_from_base64_invalid_base64_bytes(self, mocker: MockerFixture): # ruff: ignore[unused-method-argument]
# Test with invalid base64 bytes
invalid_b64_bytes = b"invalid!base64!bytes!"
diff --git a/tests/unit/pipelex/tools/network/test_host_rules.py b/tests/unit/pipelex/tools/network/test_host_rules.py
index 96ccb3c00..9ebd811ba 100644
--- a/tests/unit/pipelex/tools/network/test_host_rules.py
+++ b/tests/unit/pipelex/tools/network/test_host_rules.py
@@ -17,7 +17,7 @@ class TestHostRules:
("198.18.0.1", True), # benchmarking range
("224.0.0.1", True), # multicast (is_global=True, caught explicitly)
("64:ff9b::1.2.3.4", True), # NAT64 well-known prefix (is_global=True, is_reserved)
- ("0.0.0.0", True), # noqa: S104 # unspecified address — asserting it is disallowed
+ ("0.0.0.0", True), # ruff: ignore[hardcoded-bind-all-interfaces] # unspecified address — asserting it is disallowed
("::1", True), # IPv6 loopback
("fe80::1", True), # IPv6 link-local
("8.8.8.8", False), # public
diff --git a/tests/unit/pipelex/tools/storage/test_gcp_storage_provider.py b/tests/unit/pipelex/tools/storage/test_gcp_storage_provider.py
index 842803aa2..97c0764b6 100644
--- a/tests/unit/pipelex/tools/storage/test_gcp_storage_provider.py
+++ b/tests/unit/pipelex/tools/storage/test_gcp_storage_provider.py
@@ -43,7 +43,7 @@ class TestGcpStorageProvider:
for test assertions.
"""
# Import the module first so it can be patched
- from google.cloud import storage # type: ignore[import-untyped] # noqa: PLC0415
+ from google.cloud import storage # type: ignore[import-untyped] # ruff: ignore[import-outside-top-level]
# Create mock objects
mock_blob = mocker.MagicMock()
@@ -78,7 +78,7 @@ class TestGcpStorageProvider:
gcp_bucket_name: str,
gcp_project_id: str,
gcp_credentials_file: str,
- mock_gcp_storage: dict[str, Any], # noqa: ARG002
+ mock_gcp_storage: dict[str, Any], # ruff: ignore[unused-method-argument]
) -> GcpStorageProvider:
"""Create a GcpStorageProvider with signed URLs disabled."""
return GcpStorageProvider(
@@ -94,7 +94,7 @@ class TestGcpStorageProvider:
gcp_bucket_name: str,
gcp_project_id: str,
gcp_credentials_file: str,
- mock_gcp_storage: dict[str, Any], # noqa: ARG002
+ mock_gcp_storage: dict[str, Any], # ruff: ignore[unused-method-argument]
) -> GcpStorageProvider:
"""Create a GcpStorageProvider with signed URLs enabled (1 hour lifespan)."""
return GcpStorageProvider(
@@ -155,7 +155,7 @@ class TestGcpStorageProvider:
mock_gcp_storage: dict[str, Any],
) -> None:
"""Test that loading a non-existent object raises StorageFileNotFoundError."""
- from google.api_core.exceptions import NotFound # type: ignore[import-untyped] # noqa: PLC0415
+ from google.api_core.exceptions import NotFound # type: ignore[import-untyped] # ruff: ignore[import-outside-top-level]
mock_gcp_storage["blob"].download_as_bytes.side_effect = NotFound("Object not found")
nonexistent_uri = f"{PIPELEX_STORAGE_SCHEME}nonexistent/file.bin"
diff --git a/tests/unit/pipelex/tools/storage/test_s3_storage_provider.py b/tests/unit/pipelex/tools/storage/test_s3_storage_provider.py
index e227ec05d..229b63c22 100644
--- a/tests/unit/pipelex/tools/storage/test_s3_storage_provider.py
+++ b/tests/unit/pipelex/tools/storage/test_s3_storage_provider.py
@@ -85,7 +85,7 @@ class TestS3StorageProvider:
async def test_store_returns_uri_with_scheme(
self,
s3_provider_no_signed_urls: S3StorageProvider,
- mock_aioboto3: dict[str, Any], # noqa: ARG002
+ mock_aioboto3: dict[str, Any], # ruff: ignore[unused-method-argument]
) -> None:
"""Test that store() returns a URI with the pipelex-storage:// scheme prefix."""
test_data = b"Hello, World!"
@@ -148,7 +148,7 @@ class TestS3StorageProvider:
async def test_store_raises_if_key_has_scheme_prefix(
self,
s3_provider_no_signed_urls: S3StorageProvider,
- mock_aioboto3: dict[str, Any], # noqa: ARG002
+ mock_aioboto3: dict[str, Any], # ruff: ignore[unused-method-argument]
) -> None:
"""Test that passing a key with pipelex-storage:// prefix raises an error."""
invalid_key = f"{PIPELEX_STORAGE_SCHEME}already/prefixed.bin"
@@ -161,7 +161,7 @@ class TestS3StorageProvider:
async def test_public_url_returns_public_url_when_signed_urls_disabled(
self,
s3_provider_no_signed_urls: S3StorageProvider,
- mock_aioboto3: dict[str, Any], # noqa: ARG002
+ mock_aioboto3: dict[str, Any], # ruff: ignore[unused-method-argument]
) -> None:
"""Test that public_url() returns a public URL when signed URLs are disabled."""
key = "display/test.bin"
@@ -447,7 +447,7 @@ class TestS3StorageProvider:
@pytest.mark.usefixtures("mock_aioboto3")
async def test_session_is_reused(self) -> None:
"""Test that the session is lazily initialized and reused."""
- import aioboto3 # noqa: PLC0415
+ import aioboto3 # ruff: ignore[import-outside-top-level]
provider = S3StorageProvider(
bucket_name=S3_TEST_BUCKET,
diff --git a/tests/unit/pipelex/tools/test_annotation_utils.py b/tests/unit/pipelex/tools/test_annotation_utils.py
index 2a2656e0a..537a1e706 100644
--- a/tests/unit/pipelex/tools/test_annotation_utils.py
+++ b/tests/unit/pipelex/tools/test_annotation_utils.py
@@ -14,12 +14,12 @@ class TestUnwrapOptional:
@pytest.mark.parametrize(
("annotation", "expected"),
[
- pytest.param(Optional[str], str, id="typing_optional_str"), # noqa: UP045 — the typing.Optional spelling is the test subject
+ pytest.param(Optional[str], str, id="typing_optional_str"), # ruff: ignore[non-pep604-annotation-optional] — the typing.Optional spelling is the test subject
pytest.param(Union[str, None], str, id="typing_union_str_none"),
pytest.param(str | None, str, id="pep604_str_none"),
- pytest.param(Optional[list[str]], list[str], id="typing_optional_list_str"), # noqa: UP045 — the typing.Optional spelling is the test subject
+ pytest.param(Optional[list[str]], list[str], id="typing_optional_list_str"), # ruff: ignore[non-pep604-annotation-optional] — the typing.Optional spelling is the test subject
pytest.param(list[str] | None, list[str], id="pep604_list_str_none"),
- pytest.param(Optional[TextContent], TextContent, id="typing_optional_text_content"), # noqa: UP045 — the typing.Optional spelling is the test subject
+ pytest.param(Optional[TextContent], TextContent, id="typing_optional_text_content"), # ruff: ignore[non-pep604-annotation-optional] — the typing.Optional spelling is the test subject
pytest.param(TextContent | None, TextContent, id="pep604_text_content_none"),
],
)
diff --git a/tests/unit/pipelex/tools/test_func_registry.py b/tests/unit/pipelex/tools/test_func_registry.py
index fc92058d8..fabe5be8d 100644
--- a/tests/unit/pipelex/tools/test_func_registry.py
+++ b/tests/unit/pipelex/tools/test_func_registry.py
@@ -20,29 +20,29 @@ def another_function(x: int):
# Valid function for testing
-def valid_function(working_memory: WorkingMemory) -> TextContent: # noqa: ARG001 # pyright: ignore[reportUnknownParameterType,reportMissingParameterType, reportUnusedParameter]
+def valid_function(working_memory: WorkingMemory) -> TextContent: # ruff: ignore[unused-function-argument] # pyright: ignore[reportUnknownParameterType,reportMissingParameterType, reportUnusedParameter]
return TextContent(text="test")
# Valid async function for testing (should also be eligible)
-async def valid_async_function(working_memory: WorkingMemory) -> TextContent: # noqa: ARG001,RUF029 # pyright: ignore[reportUnknownParameterType,reportMissingParameterType, reportUnusedParameter]
+async def valid_async_function(working_memory: WorkingMemory) -> TextContent: # ruff: ignore[unused-function-argument, unused-async] # pyright: ignore[reportUnknownParameterType,reportMissingParameterType, reportUnusedParameter]
return TextContent(text="test")
# Invalid functions for testing eligibility
-def wrong_param_name(other_param: WorkingMemory) -> TextContent: # noqa: ARG001 # pyright: ignore[reportUnknownParameterType,reportMissingParameterType, reportUnusedParameter]
+def wrong_param_name(other_param: WorkingMemory) -> TextContent: # ruff: ignore[unused-function-argument] # pyright: ignore[reportUnknownParameterType,reportMissingParameterType, reportUnusedParameter]
return TextContent(text="test")
-def wrong_param_type(working_memory: str) -> TextContent: # noqa: ARG001 # pyright: ignore[reportUnknownParameterType,reportMissingParameterType, reportUnusedParameter]
+def wrong_param_type(working_memory: str) -> TextContent: # ruff: ignore[unused-function-argument] # pyright: ignore[reportUnknownParameterType,reportMissingParameterType, reportUnusedParameter]
return TextContent(text="test")
-def wrong_return_type(working_memory: WorkingMemory) -> str: # noqa: ARG001 # pyright: ignore[reportUnknownParameterType,reportMissingParameterType, reportUnusedParameter]
+def wrong_return_type(working_memory: WorkingMemory) -> str: # ruff: ignore[unused-function-argument] # pyright: ignore[reportUnknownParameterType,reportMissingParameterType, reportUnusedParameter]
return "test"
-def too_many_params(working_memory: WorkingMemory, extra: str) -> TextContent: # noqa: ARG001 # pyright: ignore[reportUnknownParameterType,reportMissingParameterType, reportUnusedParameter]
+def too_many_params(working_memory: WorkingMemory, extra: str) -> TextContent: # ruff: ignore[unused-function-argument] # pyright: ignore[reportUnknownParameterType,reportMissingParameterType, reportUnusedParameter]
return TextContent(text="test")
@@ -50,7 +50,7 @@ def no_params() -> TextContent:
return TextContent(text="test")
-def no_type_hints(working_memory): # noqa: ARG001, ANN001 # pyright: ignore[reportUnknownParameterType,reportMissingParameterType, reportUnusedParameter]
+def no_type_hints(working_memory): # ruff: ignore[unused-function-argument, missing-type-function-argument] # pyright: ignore[reportUnknownParameterType,reportMissingParameterType, reportUnusedParameter]
return TextContent(text="test")
diff --git a/tests/unit/pipelex/tools/test_func_registry_utils.py b/tests/unit/pipelex/tools/test_func_registry_utils.py
index 7261e05b2..2c25caa52 100644
--- a/tests/unit/pipelex/tools/test_func_registry_utils.py
+++ b/tests/unit/pipelex/tools/test_func_registry_utils.py
@@ -126,7 +126,7 @@ class TestFuncRegistryUtils:
)
def test_function_registration_eligibility(
self,
- test_name: str, # noqa: ARG002
+ test_name: str, # ruff: ignore[unused-method-argument]
function_code: str,
expected_registered: list[str],
expected_not_registered: list[str],
@@ -271,11 +271,11 @@ async def stable_function(working_memory: WorkingMemory) -> TextContent:
def test_eligibility_check_directly(self):
# Valid async function
- async def valid_async_function(working_memory: WorkingMemory) -> TextContent: # noqa: ARG001,RUF029 # pyright: ignore[reportUnknownParameterType,reportMissingParameterType, reportUnusedParameter]
+ async def valid_async_function(working_memory: WorkingMemory) -> TextContent: # ruff: ignore[unused-function-argument, unused-async] # pyright: ignore[reportUnknownParameterType,reportMissingParameterType, reportUnusedParameter]
return TextContent(text="test")
# Valid sync function
- def valid_sync_function(working_memory: WorkingMemory) -> TextContent: # noqa: ARG001 # pyright: ignore[reportUnknownParameterType,reportMissingParameterType, reportUnusedParameter]
+ def valid_sync_function(working_memory: WorkingMemory) -> TextContent: # ruff: ignore[unused-function-argument] # pyright: ignore[reportUnknownParameterType,reportMissingParameterType, reportUnusedParameter]
return TextContent(text="test")
# Test eligibility
@@ -286,11 +286,11 @@ async def stable_function(working_memory: WorkingMemory) -> TextContent:
func_registry.teardown()
# Valid async function
- async def valid_async_function(working_memory: WorkingMemory) -> TextContent: # noqa: ARG001,RUF029 # pyright: ignore[reportUnknownParameterType,reportMissingParameterType, reportUnusedParameter]
+ async def valid_async_function(working_memory: WorkingMemory) -> TextContent: # ruff: ignore[unused-function-argument, unused-async] # pyright: ignore[reportUnknownParameterType,reportMissingParameterType, reportUnusedParameter]
return TextContent(text="valid")
# Valid sync function
- def valid_sync_function(working_memory: WorkingMemory) -> TextContent: # noqa: ARG001 # pyright: ignore[reportUnknownParameterType,reportMissingParameterType, reportUnusedParameter]
+ def valid_sync_function(working_memory: WorkingMemory) -> TextContent: # ruff: ignore[unused-function-argument] # pyright: ignore[reportUnknownParameterType,reportMissingParameterType, reportUnusedParameter]
return TextContent(text="valid")
# Try to register both functions
@@ -304,14 +304,14 @@ async def stable_function(working_memory: WorkingMemory) -> TextContent:
# Test register_functions method as well
func_registry.teardown()
- async def another_valid_async_function(working_memory: WorkingMemory) -> TextContent: # noqa: ARG001,RUF029 # pyright: ignore[reportUnknownParameterType,reportMissingParameterType, reportUnusedParameter]
+ async def another_valid_async_function(working_memory: WorkingMemory) -> TextContent: # ruff: ignore[unused-function-argument, unused-async] # pyright: ignore[reportUnknownParameterType,reportMissingParameterType, reportUnusedParameter]
return TextContent(text="another_valid_async")
- def another_valid_sync_function(working_memory: WorkingMemory) -> TextContent: # noqa: ARG001 # pyright: ignore[reportUnknownParameterType,reportMissingParameterType, reportUnusedParameter]
+ def another_valid_sync_function(working_memory: WorkingMemory) -> TextContent: # ruff: ignore[unused-function-argument] # pyright: ignore[reportUnknownParameterType,reportMissingParameterType, reportUnusedParameter]
return TextContent(text="another_valid_sync")
# Invalid function (wrong parameter name)
- def invalid_function(other_param: WorkingMemory) -> TextContent: # noqa: ARG001 # pyright: ignore[reportUnknownParameterType,reportMissingParameterType, reportUnusedParameter]
+ def invalid_function(other_param: WorkingMemory) -> TextContent: # ruff: ignore[unused-function-argument] # pyright: ignore[reportUnknownParameterType,reportMissingParameterType, reportUnusedParameter]
return TextContent(text="invalid")
# Register multiple functions at once - invalid functions should be silently skipped
diff --git a/tests/unit/pipelex/tools/test_jinja2_required_variables.py b/tests/unit/pipelex/tools/test_jinja2_required_variables.py
index 3f1375f31..e5ee01fdd 100644
--- a/tests/unit/pipelex/tools/test_jinja2_required_variables.py
+++ b/tests/unit/pipelex/tools/test_jinja2_required_variables.py
@@ -395,7 +395,7 @@ class TestDetectJinja2Variables:
)
def test_syntax_errors_raise_exception(
self,
- topic: str, # noqa: ARG002
+ topic: str, # ruff: ignore[unused-method-argument]
template_source: str,
):
"""Test that invalid templates raise Jinja2DetectVariablesError."""
diff --git a/tests/unit/pipelex/tools/test_jinja2_with_images_filter.py b/tests/unit/pipelex/tools/test_jinja2_with_images_filter.py
index 98a282c06..9a0fc5ff5 100644
--- a/tests/unit/pipelex/tools/test_jinja2_with_images_filter.py
+++ b/tests/unit/pipelex/tools/test_jinja2_with_images_filter.py
@@ -14,7 +14,7 @@ from pipelex.tools.jinja2.exceptions import Jinja2ContextError
from pipelex.tools.jinja2.image_registry import ImageRegistry
from pipelex.tools.jinja2.jinja2_models import Jinja2ContextKey
from pipelex.tools.jinja2.jinja2_with_images_filter import (
- _render_sequence_with_images, # noqa: PLC2701 # pyright: ignore[reportPrivateUsage]
+ _render_sequence_with_images, # pyright: ignore[reportPrivateUsage]
with_images,
)
from pipelex.tools.templating.text_format import TextFormat
diff --git a/tests/unit/pipelex/tools/test_log_idempotence.py b/tests/unit/pipelex/tools/test_log_idempotence.py
index 7ba9ddbc8..4735dd935 100644
--- a/tests/unit/pipelex/tools/test_log_idempotence.py
+++ b/tests/unit/pipelex/tools/test_log_idempotence.py
@@ -27,7 +27,7 @@ if TYPE_CHECKING:
@pytest.fixture
def log_config() -> LogConfig:
"""Build a real LogConfig from the package defaults — no hand-rolled stub."""
- from pipelex.system.configuration.config_loader import ConfigLoader # noqa: PLC0415
+ from pipelex.system.configuration.config_loader import ConfigLoader # ruff: ignore[import-outside-top-level]
loader = ConfigLoader()
config_dict = load_toml_from_path(loader.pipelex_root_dir / "pipelex.toml")
diff --git a/tests/unit/pipelex/tools/uri/test_uri_resolver_error_handling.py b/tests/unit/pipelex/tools/uri/test_uri_resolver_error_handling.py
index d065ea135..aaad61dd5 100644
--- a/tests/unit/pipelex/tools/uri/test_uri_resolver_error_handling.py
+++ b/tests/unit/pipelex/tools/uri/test_uri_resolver_error_handling.py
@@ -90,7 +90,7 @@ class TestUriResolverErrorHandling:
async def test_pipelex_storage_propagates_storage_errors(self, mocker: MockerFixture) -> None:
"""Test that storage errors are propagated when loading pipelex-storage:// URIs."""
- from pipelex.tools.storage.exceptions import StorageFileNotFoundError # noqa: PLC0415
+ from pipelex.tools.storage.exceptions import StorageFileNotFoundError # ruff: ignore[import-outside-top-level]
mock_storage = mocker.AsyncMock()
mock_storage.load = mocker.AsyncMock(side_effect=StorageFileNotFoundError("Key not found"))
diff --git a/tests/unit/pipelex/tracing/test_writer_id_schema.py b/tests/unit/pipelex/tracing/test_writer_id_schema.py
index ccf43730d..07d587481 100644
--- a/tests/unit/pipelex/tracing/test_writer_id_schema.py
+++ b/tests/unit/pipelex/tracing/test_writer_id_schema.py
@@ -187,12 +187,12 @@ class TestWriterIdSchema:
captured_items: list[dict[str, Any]] = []
class _StubTable:
- def put_item(self, *, Item: dict[str, Any]) -> None: # noqa: N803 # boto3 kwarg name
+ def put_item(self, *, Item: dict[str, Any]) -> None: # ruff: ignore[invalid-argument-name] # boto3 kwarg name
captured_items.append(Item)
class _StubResource:
@staticmethod
- def Table(_name: str) -> _StubTable: # noqa: N802 # boto3 method name
+ def Table(_name: str) -> _StubTable: # ruff: ignore[invalid-function-name] # boto3 method name
return _StubTable()
mocker.patch(
diff --git a/uv.lock b/uv.lock
index 5e03cb672..cba0cc8f1 100644
--- a/uv.lock
+++ b/uv.lock
@@ -2552,7 +2552,7 @@ wheels = [
[[package]]
name = "mthds"
-version = "0.8.0"
+version = "0.8.2"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "httpx" },
@@ -2561,9 +2561,9 @@ dependencies = [
{ name = "tomlkit" },
{ name = "typing-extensions" },
]
-sdist = { url = "https://files.pythonhosted.org/packages/44/f3/600110862775368d690ad19f06871a780ba7b08ec1a9aa57bde835782195/mthds-0.8.0.tar.gz", hash = "sha256:8b1232bd93d9281529374993dc8672b611f7a027fd3e82dbcfbb0ad59db64327", size = 129734, upload-time = "2026-07-06T15:44:51.322Z" }
+sdist = { url = "https://files.pythonhosted.org/packages/ed/87/9fefbf352f2f2794336ae6fa1f72ea7d7a74ce78524e3bce734bea83aa02/mthds-0.8.2.tar.gz", hash = "sha256:1ac24a415f5a4942e93309066ed6b65a553ca379578e2da93f492bc63342b0b6", size = 130890, upload-time = "2026-08-21T10:49:37.05Z" }
wheels = [
- { url = "https://files.pythonhosted.org/packages/f2/a8/a6b1896410f21904231bf6e008d25a9528e9043c17b4f04d141e48619ba6/mthds-0.8.0-py3-none-any.whl", hash = "sha256:cf2569bf013ad56d888241de82c6275277f2b9266155d66eb4800bbff32e2047", size = 58115, upload-time = "2026-07-06T15:44:50.005Z" },
+ { url = "https://files.pythonhosted.org/packages/b7/85/051bf842ead495c9126e04a940cbfd3fada2474599b89be27b6d73e73158/mthds-0.8.2-py3-none-any.whl", hash = "sha256:13d314523afc5f774b7f19f65b94ce32e753a617298aae8d6d11315448bbea9f", size = 58167, upload-time = "2026-08-21T10:49:35.804Z" },
]
[[package]]
@@ -3472,7 +3472,7 @@ requires-dist = [
{ name = "mkdocs-meta-manager", marker = "extra == 'docs'", specifier = ">=1.1.0" },
{ name = "mkdocs-redirects", marker = "extra == 'docs'", specifier = "==1.2.2" },
{ name = "moto", extras = ["dynamodb", "s3"], marker = "extra == 'dev'", specifier = ">=5.0.0" },
- { name = "mthds", specifier = ">=0.8.0" },
+ { name = "mthds", specifier = ">=0.8.2" },
{ name = "mypy", marker = "extra == 'dev'", specifier = "==1.19.1" },
{ name = "networkx", specifier = ">=3.4.2" },
{ name = "openai", specifier = ">=2.0.0" },
@@ -3506,7 +3506,7 @@ requires-dist = [
{ name = "reportlab", specifier = ">=4.0,<5" },
{ name = "requests", specifier = ">=2.33.0" },
{ name = "rich", specifier = ">=13.8.1" },
- { name = "ruff", marker = "extra == 'dev'", specifier = "==0.14.13" },
+ { name = "ruff", marker = "extra == 'dev'", specifier = "==0.16.4" },
{ name = "semantic-version", specifier = ">=2.10.0" },
{ name = "shortuuid", specifier = ">=1.0.13" },
{ name = "tomli", specifier = ">=2.3.0" },
@@ -4676,28 +4676,27 @@ wheels = [
[[package]]
name = "ruff"
-version = "0.14.13"
-source = { registry = "https://pypi.org/simple" }
-sdist = { url = "https://files.pythonhosted.org/packages/50/0a/1914efb7903174b381ee2ffeebb4253e729de57f114e63595114c8ca451f/ruff-0.14.13.tar.gz", hash = "sha256:83cd6c0763190784b99650a20fec7633c59f6ebe41c5cc9d45ee42749563ad47", size = 6059504, upload-time = "2026-01-15T20:15:16.918Z" }
-wheels = [
- { url = "https://files.pythonhosted.org/packages/c3/ae/0deefbc65ca74b0ab1fd3917f94dc3b398233346a74b8bbb0a916a1a6bf6/ruff-0.14.13-py3-none-linux_armv6l.whl", hash = "sha256:76f62c62cd37c276cb03a275b198c7c15bd1d60c989f944db08a8c1c2dbec18b", size = 13062418, upload-time = "2026-01-15T20:14:50.779Z" },
- { url = "https://files.pythonhosted.org/packages/47/df/5916604faa530a97a3c154c62a81cb6b735c0cb05d1e26d5ad0f0c8ac48a/ruff-0.14.13-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:914a8023ece0528d5cc33f5a684f5f38199bbb566a04815c2c211d8f40b5d0ed", size = 13442344, upload-time = "2026-01-15T20:15:07.94Z" },
- { url = "https://files.pythonhosted.org/packages/4c/f3/e0e694dd69163c3a1671e102aa574a50357536f18a33375050334d5cd517/ruff-0.14.13-py3-none-macosx_11_0_arm64.whl", hash = "sha256:d24899478c35ebfa730597a4a775d430ad0d5631b8647a3ab368c29b7e7bd063", size = 12354720, upload-time = "2026-01-15T20:15:09.854Z" },
- { url = "https://files.pythonhosted.org/packages/c3/e8/67f5fcbbaee25e8fc3b56cc33e9892eca7ffe09f773c8e5907757a7e3bdb/ruff-0.14.13-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9aaf3870f14d925bbaf18b8a2347ee0ae7d95a2e490e4d4aea6813ed15ebc80e", size = 12774493, upload-time = "2026-01-15T20:15:20.908Z" },
- { url = "https://files.pythonhosted.org/packages/6b/ce/d2e9cb510870b52a9565d885c0d7668cc050e30fa2c8ac3fb1fda15c083d/ruff-0.14.13-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ac5b7f63dd3b27cc811850f5ffd8fff845b00ad70e60b043aabf8d6ecc304e09", size = 12815174, upload-time = "2026-01-15T20:15:05.74Z" },
- { url = "https://files.pythonhosted.org/packages/88/00/c38e5da58beebcf4fa32d0ddd993b63dfacefd02ab7922614231330845bf/ruff-0.14.13-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:78d2b1097750d90ba82ce4ba676e85230a0ed694178ca5e61aa9b459970b3eb9", size = 13680909, upload-time = "2026-01-15T20:15:14.537Z" },
- { url = "https://files.pythonhosted.org/packages/61/61/cd37c9dd5bd0a3099ba79b2a5899ad417d8f3b04038810b0501a80814fd7/ruff-0.14.13-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:7d0bf87705acbbcb8d4c24b2d77fbb73d40210a95c3903b443cd9e30824a5032", size = 15144215, upload-time = "2026-01-15T20:15:22.886Z" },
- { url = "https://files.pythonhosted.org/packages/56/8a/85502d7edbf98c2df7b8876f316c0157359165e16cdf98507c65c8d07d3d/ruff-0.14.13-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a3eb5da8e2c9e9f13431032fdcbe7681de9ceda5835efee3269417c13f1fed5c", size = 14706067, upload-time = "2026-01-15T20:14:48.271Z" },
- { url = "https://files.pythonhosted.org/packages/7e/2f/de0df127feb2ee8c1e54354dc1179b4a23798f0866019528c938ba439aca/ruff-0.14.13-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:642442b42957093811cd8d2140dfadd19c7417030a7a68cf8d51fcdd5f217427", size = 14133916, upload-time = "2026-01-15T20:14:57.357Z" },
- { url = "https://files.pythonhosted.org/packages/0d/77/9b99686bb9fe07a757c82f6f95e555c7a47801a9305576a9c67e0a31d280/ruff-0.14.13-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4acdf009f32b46f6e8864af19cbf6841eaaed8638e65c8dac845aea0d703c841", size = 13859207, upload-time = "2026-01-15T20:14:55.111Z" },
- { url = "https://files.pythonhosted.org/packages/7d/46/2bdcb34a87a179a4d23022d818c1c236cb40e477faf0d7c9afb6813e5876/ruff-0.14.13-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:591a7f68860ea4e003917d19b5c4f5ac39ff558f162dc753a2c5de897fd5502c", size = 14043686, upload-time = "2026-01-15T20:14:52.841Z" },
- { url = "https://files.pythonhosted.org/packages/1a/a9/5c6a4f56a0512c691cf143371bcf60505ed0f0860f24a85da8bd123b2bf1/ruff-0.14.13-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:774c77e841cc6e046fc3e91623ce0903d1cd07e3a36b1a9fe79b81dab3de506b", size = 12663837, upload-time = "2026-01-15T20:15:18.921Z" },
- { url = "https://files.pythonhosted.org/packages/fe/bb/b920016ece7651fa7fcd335d9d199306665486694d4361547ccb19394c44/ruff-0.14.13-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:61f4e40077a1248436772bb6512db5fc4457fe4c49e7a94ea7c5088655dd21ae", size = 12805867, upload-time = "2026-01-15T20:14:59.272Z" },
- { url = "https://files.pythonhosted.org/packages/7d/b3/0bd909851e5696cd21e32a8fc25727e5f58f1934b3596975503e6e85415c/ruff-0.14.13-py3-none-musllinux_1_2_i686.whl", hash = "sha256:6d02f1428357fae9e98ac7aa94b7e966fd24151088510d32cf6f902d6c09235e", size = 13208528, upload-time = "2026-01-15T20:15:03.732Z" },
- { url = "https://files.pythonhosted.org/packages/3b/3b/e2d94cb613f6bbd5155a75cbe072813756363eba46a3f2177a1fcd0cd670/ruff-0.14.13-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:e399341472ce15237be0c0ae5fbceca4b04cd9bebab1a2b2c979e015455d8f0c", size = 13929242, upload-time = "2026-01-15T20:15:11.918Z" },
- { url = "https://files.pythonhosted.org/packages/6a/c5/abd840d4132fd51a12f594934af5eba1d5d27298a6f5b5d6c3be45301caf/ruff-0.14.13-py3-none-win32.whl", hash = "sha256:ef720f529aec113968b45dfdb838ac8934e519711da53a0456038a0efecbd680", size = 12919024, upload-time = "2026-01-15T20:14:43.647Z" },
- { url = "https://files.pythonhosted.org/packages/c2/55/6384b0b8ce731b6e2ade2b5449bf07c0e4c31e8a2e68ea65b3bafadcecc5/ruff-0.14.13-py3-none-win_amd64.whl", hash = "sha256:6070bd026e409734b9257e03e3ef18c6e1a216f0435c6751d7a8ec69cb59abef", size = 14097887, upload-time = "2026-01-15T20:15:01.48Z" },
- { url = "https://files.pythonhosted.org/packages/4d/e1/7348090988095e4e39560cfc2f7555b1b2a7357deba19167b600fdf5215d/ruff-0.14.13-py3-none-win_arm64.whl", hash = "sha256:7ab819e14f1ad9fe39f246cfcc435880ef7a9390d81a2b6ac7e01039083dd247", size = 13080224, upload-time = "2026-01-15T20:14:45.853Z" },
+version = "0.16.4"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/00/8f/d8074b1f25e003164087a8bfe79a0f1a3945135764dbb6aaab04103dcaf9/ruff-0.16.4.tar.gz", hash = "sha256:13171aa9d9af2240ee3504e639de73122c67e74036de5ba2e1d01422cd17e3dc", size = 4899731, upload-time = "2026-08-20T17:43:59.196Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/ff/80/779895ef584e089d22f2c6df0d0e99a65ec2df0805f1fffd439415b8c1f0/ruff-0.16.4-py3-none-linux_armv6l.whl", hash = "sha256:df4075f71ddac40b9934af60c3ec8a53047dd5a5fdc43224e6e4e8e9a27cb6f7", size = 10006909, upload-time = "2026-08-20T17:43:16.888Z" },
+ { url = "https://files.pythonhosted.org/packages/a9/e6/f553199b5e8927a05cb5c422d921fd0656b29ab976e91c44802107c6b0da/ruff-0.16.4-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:0c95538517af68004306b0fb3214ff2f2af67a65092aee77cd9eb86db6656604", size = 10240201, upload-time = "2026-08-20T17:43:19.337Z" },
+ { url = "https://files.pythonhosted.org/packages/1c/70/4a6dc4bb34da4dee35e30f09bbd1bfbdd26f33b62fb9b8df31f08a199cd2/ruff-0.16.4-py3-none-macosx_11_0_arm64.whl", hash = "sha256:963f83df8e69e575b64d67dd447ebbc917db41a14bf38d4593a4183e7aaa8255", size = 9835122, upload-time = "2026-08-20T17:43:21.708Z" },
+ { url = "https://files.pythonhosted.org/packages/24/12/c6e22d686372c15bcb7af99831f1a1be96df696491babf4f24e4f942c527/ruff-0.16.4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:32a5057c7ff3f6e6480a48fccfb3a412a690f48a3d03ac5cf08177d6c2da3ade", size = 9977162, upload-time = "2026-08-20T17:43:24.236Z" },
+ { url = "https://files.pythonhosted.org/packages/46/49/72b10ec912f5ab5854992eaf7aa7cd36729b6937d9dc4e0fb41b3bf428ec/ruff-0.16.4-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:b3dce8d9b0c57c265b91885a66a567d8ea1372e8eb4e250fa8e5e3f579e99cff", size = 9829789, upload-time = "2026-08-20T17:43:26.966Z" },
+ { url = "https://files.pythonhosted.org/packages/fa/80/0f30e32e7f6ee26edc39075502db9d368d788a44a79b55f763eb4ab03796/ruff-0.16.4-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7dc651db49283c69f8e72c834eec4fe5573e4c646856aebece0ce385dceb2a80", size = 10527949, upload-time = "2026-08-20T17:43:29.384Z" },
+ { url = "https://files.pythonhosted.org/packages/52/3d/86e8ad3542169e56cac3859a343afdb9df2ad54d35a59ce1e67baee83421/ruff-0.16.4-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3817b87dbcabc92f13b05019257c5b89b5b4d51b5fb20f56fb5235ceb723cd07", size = 11333695, upload-time = "2026-08-20T17:43:31.872Z" },
+ { url = "https://files.pythonhosted.org/packages/d0/16/481c29b380c20a0054a8261066665e1b3488e23636c49d0a43e75975b9bb/ruff-0.16.4-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e9fce1499134b2c8c68e5166f95705a5812062bb93aacc5f9873bb1a27084bc7", size = 10727741, upload-time = "2026-08-20T17:43:34.596Z" },
+ { url = "https://files.pythonhosted.org/packages/5e/b6/56bc0b8cf45b54b28b3a5e6381c8945d51b5b18adf659454c32295209a31/ruff-0.16.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f2d812e482f5a7e02eee26cd73d2a37ebbdf47d795ea63ba1b89110ae93e9fb3", size = 10286522, upload-time = "2026-08-20T17:43:37.288Z" },
+ { url = "https://files.pythonhosted.org/packages/e8/8b/b345b4fb110f2fbe2bd31eabd271e5e8b3b7e4ee6c0e02f2dc6be78db000/ruff-0.16.4-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:6baaf984aa7976edf93d3b627fe2d1d22ee94bbca05fa6f90fc76d73924e3454", size = 10584182, upload-time = "2026-08-20T17:43:39.984Z" },
+ { url = "https://files.pythonhosted.org/packages/29/e5/827b34041c35f58774a9681a4213994c164fc987800f4dddabcf451da0bf/ruff-0.16.4-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:bdfcf0b28662eb890372d50f92c283bb94e67e7635ed93c7fd533970acff7b2b", size = 10134195, upload-time = "2026-08-20T17:43:42.351Z" },
+ { url = "https://files.pythonhosted.org/packages/0f/10/d0bffcdd6729b87afc82ba0ef377173356a7dc8e972f5179968cf2fdf98c/ruff-0.16.4-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:b66b02cb9b04f537643cadf5768e5f98dc461890d530cb67113d71c8c76e605d", size = 9825821, upload-time = "2026-08-20T17:43:44.532Z" },
+ { url = "https://files.pythonhosted.org/packages/f5/32/0db2a863b796ca62d83e92a07a3ccf00921b14db02059347576a2fda3d4b/ruff-0.16.4-py3-none-musllinux_1_2_i686.whl", hash = "sha256:8528bf9a4b291a60bf02ea453511e8ce6215bd2b982ee80405b66b008b6c30a0", size = 10267658, upload-time = "2026-08-20T17:43:46.989Z" },
+ { url = "https://files.pythonhosted.org/packages/b2/a0/fbdeb59e48c6261f523e56c8f12e9c08fbe693786595cc7e3959207a9232/ruff-0.16.4-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:fbd85d2875fdd67e833213a651f613bbf25303abf6aa822a5121f4531195678d", size = 10697071, upload-time = "2026-08-20T17:43:49.891Z" },
+ { url = "https://files.pythonhosted.org/packages/aa/28/0c6dd865859c6d17bc8ccc34cb72b0e02d6c7eb25e8a1e22b5bea681e2c0/ruff-0.16.4-py3-none-win32.whl", hash = "sha256:312769988007aaeb8e189b443ccdd03c0e6374489e053467be6d96518ebff76e", size = 10021687, upload-time = "2026-08-20T17:43:52.281Z" },
+ { url = "https://files.pythonhosted.org/packages/a3/03/e724450f621698117f9aa6dd241c94d0274ae96781378dc86745ae29f0e7/ruff-0.16.4-py3-none-win_amd64.whl", hash = "sha256:05d9d27a18c4bcbefada602480ec9e01e0bc949d432e0ced5df77edac195919c", size = 10567657, upload-time = "2026-08-20T17:43:54.78Z" },
+ { url = "https://files.pythonhosted.org/packages/0e/fe/da8b9e1347696bb22120b77280ec5ce25d500ca5cb39d5ad6e5c18de19c1/ruff-0.16.4-py3-none-win_arm64.whl", hash = "sha256:a3a61621c9b6f6a89573e938a080e648f1695baa3f58570a3a707bc51ff65a21", size = 10451579, upload-time = "2026-08-20T17:43:57.135Z" },
]
[[package]]
diff --git a/wip/autofix/old-plan-to-auto-fix.md b/wip/autofix/old-plan-to-auto-fix.md
index 1d702a09a..9f3f9f25c 100644
--- a/wip/autofix/old-plan-to-auto-fix.md
+++ b/wip/autofix/old-plan-to-auto-fix.md
@@ -267,8 +267,8 @@ pipelex/cli/
```python
class FixRuleCategory(StrEnum):
- CORRECTION = "correction" # default ON
- PRUNING = "pruning" # default OFF, opt-in via --prune
+ CORRECTION = "correction" # default ON
+ PRUNING = "pruning" # default OFF, opt-in via --prune
class FixResult(BaseModel):
@@ -280,7 +280,7 @@ class FixResult(BaseModel):
class FixRule(ABC):
- code: str # e.g. "strip-namespace"
+ code: str # e.g. "strip-namespace"
category: FixRuleCategory
description: str
diff --git a/wip/autofix/suggested-fixes-design.md b/wip/autofix/suggested-fixes-design.md
index bd45d7117..a995e0268 100644
--- a/wip/autofix/suggested-fixes-design.md
+++ b/wip/autofix/suggested-fixes-design.md
@@ -29,23 +29,25 @@ Three layers, all in `pipelex/`:
```python
class FixOpKind(StrEnum):
- SET_KEY = "set_key" # set (or create) a key's value at a table path
+ SET_KEY = "set_key" # set (or create) a key's value at a table path
DELETE_KEY = "delete_key"
DELETE_TABLE = "delete_table"
- RENAME_TABLE_KEY = "rename_table_key" # position-preserving; needed for strip-namespace (stretch)
+ RENAME_TABLE_KEY = "rename_table_key" # position-preserving; needed for strip-namespace (stretch)
+
class FixOp(BaseModel):
kind: FixOpKind
- table_path: list[str] # e.g. ["pipe", "my_seq"] — aligned with field_path conventions
+ table_path: list[str] # e.g. ["pipe", "my_seq"] — aligned with field_path conventions
key: str | None
- value: TomlValue | None # TOML-representable
- new_key: str | None # rename only
+ value: TomlValue | None # TOML-representable
+ new_key: str | None # rename only
+
class SuggestedFix(BaseModel):
- fix_code: str # kebab-case rule id, e.g. "match-sequence-output"
- description: str # human/agent-readable, e.g. "Set output to 'Report[]' to match last step"
- safety: FixSafety # SAFE (auto-appliable) | UNSAFE (opt-in)
- source: str | None # file the ops target (multi-file libraries)
+ fix_code: str # kebab-case rule id, e.g. "match-sequence-output"
+ description: str # human/agent-readable, e.g. "Set output to 'Report[]' to match last step"
+ safety: FixSafety # SAFE (auto-appliable) | UNSAFE (opt-in)
+ source: str | None # file the ops target (multi-file libraries)
ops: list[FixOp]
```
diff --git a/wip/costs-in-graph-spec.md b/wip/costs-in-graph-spec.md
index c96f7416b..5b9964f23 100644
--- a/wip/costs-in-graph-spec.md
+++ b/wip/costs-in-graph-spec.md
@@ -106,6 +106,7 @@ The first draft of this plan then made the same mistake one level up, by letting
```python
# pipelex/graph/graphspec.py
+
class NodeUsageSpec(BaseModel):
"""Inference usage attributed to one graph node.
@@ -184,7 +185,7 @@ The first draft put the run total and the unattributed bucket in `GraphSpec.meta
class GraphUsageSpec(BaseModel):
model_config = ConfigDict(extra="forbid", strict=True)
- total: NodeUsageSpec # whole-run rollup
+ total: NodeUsageSpec # whole-run rollup
unattributed: NodeUsageSpec # usage whose node_id was "unknown"
```
diff --git a/wip/native-date-time/plan-and-review-log.md b/wip/native-date-time/plan-and-review-log.md
index a5d14e9df..65df7704c 100644
--- a/wip/native-date-time/plan-and-review-log.md
+++ b/wip/native-date-time/plan-and-review-log.md
@@ -19,8 +19,8 @@ Repro (no network):
```python
DateContent.model_validate_json('{"date": "2025-03-12", "time": "14:00:00+00:00"}', strict=True)
# 2 validation errors: date_type on 'date', time_type on 'time' — identical to the live-run failure
-TimeContent.model_validate_json('{"time": "14:00:00+00:00"}', strict=True) # time_type
-DateContent.model_validate({"date": "2025-03-12"}) # lax: passes (the inputs.json path)
+TimeContent.model_validate_json('{"time": "14:00:00+00:00"}', strict=True) # time_type
+DateContent.model_validate({"date": "2025-03-12"}) # lax: passes (the inputs.json path)
```
## Chosen fix — make the temporal natives validation-mode-proof (model-side, surgical)
diff --git a/wip/pipe-refs/probes/classify-bare-refs.py b/wip/pipe-refs/probes/classify-bare-refs.py
index 18c82c7af..5dae53ee2 100644
--- a/wip/pipe-refs/probes/classify-bare-refs.py
+++ b/wip/pipe-refs/probes/classify-bare-refs.py
@@ -1,4 +1,4 @@
-# ruff: noqa: INP001 - a standalone probe script, deliberately not a package
+# ruff: file-ignore[implicit-namespace-package] - a standalone probe script, deliberately not a package
"""Classify every bare in-body reference in a corpus of `.mthds` bundles.
Reads TOML and nothing else — no `pipelex` import, no library load — so the classification is a
diff --git a/wip/pipe-refs/probes/concept-lookup-matrix.py b/wip/pipe-refs/probes/concept-lookup-matrix.py
index 7d64ba191..cbbdb49af 100644
--- a/wip/pipe-refs/probes/concept-lookup-matrix.py
+++ b/wip/pipe-refs/probes/concept-lookup-matrix.py
@@ -1,4 +1,4 @@
-# ruff: noqa: INP001 - a standalone probe script, deliberately not a package
+# ruff: file-ignore[implicit-namespace-package] - a standalone probe script, deliberately not a package
"""What the concept entry lookup actually does with a bare code.
Originally written against `ConceptLibrary.get_required_concept_from_concept_ref_or_code` and its
@@ -41,7 +41,7 @@ def library_declaring(*declarations: tuple[str, str]) -> ConceptLibrary:
def attempt(*, label: str, library: ConceptLibrary, code: str, search_scope: str | None) -> None:
try:
found = library.get_required_entry_concept(code, search_scope=search_scope)
- except BaseException as exc: # noqa: BLE001 - naming *which* error escapes IS the measurement here
+ except BaseException as exc: # ruff: ignore[blind-except] - naming *which* error escapes IS the measurement here
print(f"{label:46} -> {type(exc).__name__}: {exc}")
else:
print(f"{label:46} -> resolved {found.concept_ref}")
diff --git a/wip/pipe-refs/probes/dep-subpipe-scope.py b/wip/pipe-refs/probes/dep-subpipe-scope.py
index 00fe9a3bb..ba14578c9 100644
--- a/wip/pipe-refs/probes/dep-subpipe-scope.py
+++ b/wip/pipe-refs/probes/dep-subpipe-scope.py
@@ -1,4 +1,4 @@
-# ruff: noqa: INP001 - a standalone probe script, deliberately not a package
+# ruff: file-ignore[implicit-namespace-package] - a standalone probe script, deliberately not a package
"""OQ1: which library does a dependency pipe's bare sub-pipe ref resolve against?
A dependency package is loaded into an isolated *child* library, and its pipes are ALSO registered
@@ -111,7 +111,7 @@ def build_resolved_dep(dep_dir: Path, *, exported_pipe_codes: set[str] | None) -
def ask(*, label: str, library: Library, pipe_code: str) -> None:
try:
found = library.pipe_library.get_optional_pipe(pipe_code=pipe_code)
- except BaseException as exc: # noqa: BLE001 - naming *which* error escapes IS the measurement here
+ except BaseException as exc: # ruff: ignore[blind-except] - naming *which* error escapes IS the measurement here
print(f" {label:<58} -> {type(exc).__name__}: {exc}")
else:
print(f" {label:<58} -> {describe(found)}")
@@ -127,7 +127,7 @@ def report(*, title: str, library: Library, library_id: str) -> None:
try:
with scoped_current_library(library_id=library_id):
library.validate_library()
- except BaseException as exc: # noqa: BLE001 - naming *which* error escapes IS the measurement here
+ except BaseException as exc: # ruff: ignore[blind-except] - naming *which* error escapes IS the measurement here
print(f" {'':<58} -> {type(exc).__name__}: {exc}")
else:
print(f" {'':<58} -> valid")
@@ -161,14 +161,14 @@ def main() -> None:
bare_library_id, bare_library = manager.open_library()
with scoped_current_library(library_id=bare_library_id):
- manager._load_single_dependency(library=bare_library, resolved_dep=resolved_dep) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ manager._load_single_dependency(library=bare_library, resolved_dep=resolved_dep) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
report(title="host declares nothing", library=bare_library, library_id=bare_library_id)
host_file = Path(temp_dir) / "host.mthds"
host_file.write_text(HOST_COLLIDING_MTHDS, encoding="utf-8")
colliding_library_id, colliding_library = manager.open_library()
with scoped_current_library(library_id=colliding_library_id):
- manager._load_single_dependency(library=colliding_library, resolved_dep=resolved_dep) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ manager._load_single_dependency(library=colliding_library, resolved_dep=resolved_dep) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
# load_from_blueprints validates the whole library, dependency entries included — since the
# strict lookup landed, that validation raises here. The host pipe is registered before the
# validation runs, so the shape-2 library is intact; catch and keep measuring.
@@ -177,7 +177,7 @@ def main() -> None:
library_id=colliding_library_id,
blueprints=[MthdsParser.make_pipelex_bundle_blueprint(bundle_path=host_file)],
)
- except BaseException as exc: # noqa: BLE001 - naming *which* error escapes IS the measurement here
+ except BaseException as exc: # ruff: ignore[blind-except] - naming *which* error escapes IS the measurement here
print(f"\n load_from_blueprints(host) -> {type(exc).__name__}: {exc}")
report(title="host declares its OWN pipe under the same bare code", library=colliding_library, library_id=colliding_library_id)
@@ -185,7 +185,7 @@ def main() -> None:
exporting_dep = build_resolved_dep(dep_dir, exported_pipe_codes={"probe_entry"})
exporting_library_id, exporting_library = manager.open_library()
with scoped_current_library(library_id=exporting_library_id):
- manager._load_single_dependency(library=exporting_library, resolved_dep=exporting_dep) # noqa: SLF001 # pyright: ignore[reportPrivateUsage]
+ manager._load_single_dependency(library=exporting_library, resolved_dep=exporting_dep) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]
report(title="dependency manifest exports only the entry pipe", library=exporting_library, library_id=exporting_library_id)