Skip to content

Commit

Permalink
pyright fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
apoorvkh committed Jul 12, 2024
1 parent 09cf8ce commit 59b2b4a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/torchrunx/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from .launcher import launch


Expand Down
12 changes: 7 additions & 5 deletions src/torchrunx/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,16 +133,18 @@ def launch(

# launch command

env_export_string = ""
env_exports = []
for k, v in os.environ.items():
for e in env_vars:
if any(fnmatch.fnmatch(k, e)):
env_exports.append(f"{k}={v}")
if any(fnmatch.fnmatch(k, e) for e in env_vars):
env_exports.append(f"{k}={v}")

env_export_string = ""
if len(env_exports) > 0:
env_export_string = f"export {' '.join(env_exports)} && "

env_file_string = f"source {env_file} && " if env_file is not None else ""
env_file_string = ""
if env_file is not None:
env_file_string = f"source {env_file} && "

launcher_hostname = socket.getfqdn()
launcher_port = get_open_port()
Expand Down

0 comments on commit 59b2b4a

Please sign in to comment.