Skip to content

Commit 59b2b4a

Browse files
committed
pyright fixes
1 parent 09cf8ce commit 59b2b4a

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/torchrunx/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
from .launcher import launch
24

35

src/torchrunx/launcher.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,16 +133,18 @@ def launch(
133133

134134
# launch command
135135

136-
env_export_string = ""
137136
env_exports = []
138137
for k, v in os.environ.items():
139-
for e in env_vars:
140-
if any(fnmatch.fnmatch(k, e)):
141-
env_exports.append(f"{k}={v}")
138+
if any(fnmatch.fnmatch(k, e) for e in env_vars):
139+
env_exports.append(f"{k}={v}")
140+
141+
env_export_string = ""
142142
if len(env_exports) > 0:
143143
env_export_string = f"export {' '.join(env_exports)} && "
144144

145-
env_file_string = f"source {env_file} && " if env_file is not None else ""
145+
env_file_string = ""
146+
if env_file is not None:
147+
env_file_string = f"source {env_file} && "
146148

147149
launcher_hostname = socket.getfqdn()
148150
launcher_port = get_open_port()

0 commit comments

Comments
 (0)