Commit 2124818
Summary:
Pull Request resolved: #1075
Add support for cases like:
```lang=python
# some_file.py
# ====================
def my_component(...) -> specs.AppDef: ...
# other_file.py
# ====================
from some_file import my_component
```
where the component is invoked with
`torchx run ... other_file.py:my_component`
This was currently failing with a validation error because in the step where we inspect the AST of the component, we assume that the file where the component is being looked up is the same as the file where it is implemented.
Reviewed By: kiukchung
Differential Revision: D75496839
Co-authored-by: Daniel Ohayon <dohayon@meta.com>
1 parent df5d30c commit 2124818
2 files changed
+25
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
277 | 291 | | |
278 | 292 | | |
279 | 293 | | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | 294 | | |
284 | 295 | | |
285 | 296 | | |
| |||
292 | 303 | | |
293 | 304 | | |
294 | 305 | | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
295 | 312 | | |
296 | 313 | | |
297 | 314 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
238 | 239 | | |
239 | 240 | | |
240 | 241 | | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
241 | 246 | | |
242 | 247 | | |
243 | 248 | | |
| |||
0 commit comments