Skip to content

Commit 402feb2

Browse files
kiukchungfacebook-github-bot
authored andcommitted
(torchx/components) Remove dependency to pyre_extensions
Summary: There was only a single usage of `pyre_extensions` in the entire code base. Get rid of this dependency by using an `assert` statement rather than `pyre_extensions.none_throws`. Reviewed By: highker Differential Revision: D77621041
1 parent 7fabab4 commit 402feb2

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
pyre-extensions
21
docstring-parser>=0.8.1
32
importlib-metadata
43
pyyaml

torchx/components/structured_arg.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@
3030
from pathlib import Path
3131
from typing import Optional
3232

33-
from pyre_extensions import none_throws
34-
3533
from torchx import specs
3634

3735

@@ -148,7 +146,8 @@ def parse_from(
148146
if m: # use the last module name
149147
run_name = m.rpartition(".")[2]
150148
else: # use script name w/ no extension
151-
run_name = Path(none_throws(script)).stem
149+
assert script, "`script` can't be `None` here due checks above"
150+
run_name = Path(script).stem
152151
return StructuredNameArgument(
153152
experiment_name or default_experiment_name, run_name
154153
)

0 commit comments

Comments
 (0)