Skip to content

Commit 7ec5819

Browse files
kiukchungfacebook-github-bot
authored andcommitted
import Workspace from torchx.specs not torchx.workspace (#1144)
Summary: `Workspace` class moved from `torchx.workspace` to `torchx.specs` to accomodate the new `Role.workspace` attribute in #1139. This diff removes the re-export of `Workspace` from `torchx.workspace` and changes import-sites to correctly import `Workspace` from `torchx.specs` Differential Revision: D84628206
1 parent 0ec5d5e commit 7ec5819

File tree

5 files changed

+7
-9
lines changed

5 files changed

+7
-9
lines changed

torchx/cli/cmd_run.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from torchx.runner import config, get_runner, Runner
2727
from torchx.runner.config import load_sections
2828
from torchx.schedulers import get_default_scheduler_name, get_scheduler_factories
29-
from torchx.specs import CfgVal
29+
from torchx.specs import CfgVal, Workspace
3030
from torchx.specs.finder import (
3131
_Component,
3232
ComponentNotFoundException,
@@ -36,7 +36,6 @@
3636
)
3737
from torchx.util.log_tee_helpers import tee_logs
3838
from torchx.util.types import none_throws
39-
from torchx.workspace import Workspace
4039

4140

4241
MISSING_COMPONENT_ERROR_MSG = (

torchx/runner/api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/usr/bin/env python3
21
# Copyright (c) Meta Platforms, Inc. and affiliates.
32
# All rights reserved.
43
#
@@ -43,6 +42,7 @@
4342
parse_app_handle,
4443
runopts,
4544
UnknownAppException,
45+
Workspace,
4646
)
4747
from torchx.specs.finder import get_component
4848
from torchx.tracker.api import (
@@ -54,7 +54,7 @@
5454
from torchx.util.session import get_session_id_or_create_new, TORCHX_INTERNAL_SESSION_ID
5555

5656
from torchx.util.types import none_throws
57-
from torchx.workspace.api import Workspace, WorkspaceMixin
57+
from torchx.workspace import WorkspaceMixin
5858

5959
if TYPE_CHECKING:
6060
from typing_extensions import Self

torchx/runner/test/config_test.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@
2525
)
2626
from torchx.schedulers import get_scheduler_factories, Scheduler
2727
from torchx.schedulers.api import DescribeAppResponse, ListAppResponse, Stream
28-
from torchx.specs import AppDef, AppDryRunInfo, CfgVal, runopts
28+
from torchx.specs import AppDef, AppDryRunInfo, CfgVal, runopts, Workspace
2929
from torchx.test.fixtures import TestWithTmpDir
30-
from torchx.workspace import Workspace
3130

3231

3332
class TestScheduler(Scheduler):

torchx/schedulers/api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/usr/bin/env python3
21
# Copyright (c) Meta Platforms, Inc. and affiliates.
32
# All rights reserved.
43
#
@@ -22,8 +21,9 @@
2221
Role,
2322
RoleStatus,
2423
runopts,
24+
Workspace,
2525
)
26-
from torchx.workspace.api import Workspace, WorkspaceMixin
26+
from torchx.workspace import WorkspaceMixin
2727

2828

2929
DAYS_IN_2_WEEKS = 14

torchx/workspace/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@
2222
* ``memory://foo-bar/`` an in-memory workspace for notebook/programmatic usage
2323
"""
2424

25-
from torchx.workspace.api import walk_workspace, Workspace, WorkspaceMixin # noqa: F401
25+
from torchx.workspace.api import walk_workspace, WorkspaceMixin # noqa: F401

0 commit comments

Comments
 (0)