From 63fc6843487164e577f4e7d62a189a527e9bc038 Mon Sep 17 00:00:00 2001 From: Abishek Sethuraman Date: Mon, 10 Nov 2025 11:29:23 -0800 Subject: [PATCH] ] Auto-generate stubs for named_resources (attempt2) (#1161) Summary: Internal Generate stubs for all the methods generated by the decorator of `named_resources`. Previous attempt reverted D83985902 because of autodeps issues. Genrule that looks at the all the named_resources and generates a file `named_resources.pyi` which is used by the test. Three targets added 1. `//torchx/fb/stubgen:generate_named_resources_stub` 2. `//torchx/specs:named_resources_stubs` 3. //torchx/specs:lib_core_srcs with srcs and deps common between newly created ones and //torchx/specs:lib_core. Some autodeps related quirks. [See post and comments here](https://fb.workplace.com/groups/556728033594708/posts/858891180045057/?comment_id=861391636461678&reply_comment_id=861443023123206). 1. Add noautodeps labels to the `//torchx/specs:lib_core_srcs` so its not added everywhere and triggers a cascade of changes. 2. Add the following to `import_prefix_map.toml` so `//torchx/specs:lib_core` is imported as needed. ``` "torchx.specs.fb" = "//torchx/specs:lib_core" "torchx.specs.api" = "//torchx/specs:lib_core" "torchx.specs.builders" = "//torchx/specs:lib_core" ``` Additionally, Modify some named resources as well. Fix some imports for completion Differential Revision: D86111386 --- torchx/specs/test/named_resources_test.py | 1 - 1 file changed, 1 deletion(-) diff --git a/torchx/specs/test/named_resources_test.py b/torchx/specs/test/named_resources_test.py index 2632b416e..1ec0d84fd 100644 --- a/torchx/specs/test/named_resources_test.py +++ b/torchx/specs/test/named_resources_test.py @@ -8,7 +8,6 @@ # pyre-strict -import os import unittest from unittest.mock import MagicMock, patch