diff --git a/scripts/collect_env.py b/scripts/collect_env.py index a21f7a538..7890d8f65 100644 --- a/scripts/collect_env.py +++ b/scripts/collect_env.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + # This script uses https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py # and collects additional information on top of it to output relevant system # environment info. diff --git a/scripts/component_integration_tests.py b/scripts/component_integration_tests.py index 4d6d506ae..c4a512c3d 100755 --- a/scripts/component_integration_tests.py +++ b/scripts/component_integration_tests.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + """ Kubernetes integration tests. """ diff --git a/scripts/example_app_defs.py b/scripts/example_app_defs.py index ec58ebbb9..2fb5b593f 100644 --- a/scripts/example_app_defs.py +++ b/scripts/example_app_defs.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + """ App Defs for integration tests. """ diff --git a/scripts/integ_test_utils.py b/scripts/integ_test_utils.py index 10e07755d..d711663c3 100644 --- a/scripts/integ_test_utils.py +++ b/scripts/integ_test_utils.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import dataclasses import os import subprocess diff --git a/scripts/kfpint.py b/scripts/kfpint.py index 1ab78a96a..dd9cc6eac 100755 --- a/scripts/kfpint.py +++ b/scripts/kfpint.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + """ This file runs the KFP integration tests on KFP cluster. There's a number of environment variables that need to be setup as well as the cluster. diff --git a/scripts/kube_dist_trainer.py b/scripts/kube_dist_trainer.py index 10cba839c..bf0c01d77 100755 --- a/scripts/kube_dist_trainer.py +++ b/scripts/kube_dist_trainer.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + """ Kubernetes integration tests. """ diff --git a/torchx/__init__.py b/torchx/__init__.py index 04f37bcb2..7aaa04602 100644 --- a/torchx/__init__.py +++ b/torchx/__init__.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + from .version import ( # noqa F401; noqa F401 __version__ as __version__, TORCHX_IMAGE as IMAGE, diff --git a/torchx/apps/serve/serve.py b/torchx/apps/serve/serve.py index eca779a3a..e8d9cf82e 100644 --- a/torchx/apps/serve/serve.py +++ b/torchx/apps/serve/serve.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import argparse import binascii import os diff --git a/torchx/apps/serve/test/serve_test.py b/torchx/apps/serve/test/serve_test.py index c29628e97..7ea12a712 100644 --- a/torchx/apps/serve/test/serve_test.py +++ b/torchx/apps/serve/test/serve_test.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import os.path import tempfile import unittest diff --git a/torchx/apps/utils/booth_main.py b/torchx/apps/utils/booth_main.py index 362186344..b751a3f58 100755 --- a/torchx/apps/utils/booth_main.py +++ b/torchx/apps/utils/booth_main.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import argparse import sys from typing import List diff --git a/torchx/apps/utils/copy_main.py b/torchx/apps/utils/copy_main.py index 5c0d3801f..bce5b9249 100755 --- a/torchx/apps/utils/copy_main.py +++ b/torchx/apps/utils/copy_main.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import argparse import os import shutil diff --git a/torchx/apps/utils/process_monitor.py b/torchx/apps/utils/process_monitor.py index a89c53bd8..a6190697a 100755 --- a/torchx/apps/utils/process_monitor.py +++ b/torchx/apps/utils/process_monitor.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import argparse import subprocess import sys diff --git a/torchx/apps/utils/test/booth_test.py b/torchx/apps/utils/test/booth_test.py index 7884101ee..f0c948ed2 100644 --- a/torchx/apps/utils/test/booth_test.py +++ b/torchx/apps/utils/test/booth_test.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import shutil import tempfile import unittest diff --git a/torchx/apps/utils/test/copy_test.py b/torchx/apps/utils/test/copy_test.py index 3cd30fc85..2819ac7d9 100644 --- a/torchx/apps/utils/test/copy_test.py +++ b/torchx/apps/utils/test/copy_test.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import os import os.path import tempfile diff --git a/torchx/apps/utils/test/process_monitor_test.py b/torchx/apps/utils/test/process_monitor_test.py index 050269cfd..85fd5d7d2 100644 --- a/torchx/apps/utils/test/process_monitor_test.py +++ b/torchx/apps/utils/test/process_monitor_test.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import io import unittest from unittest.mock import MagicMock, patch diff --git a/torchx/cli/__init__.py b/torchx/cli/__init__.py index 5ed2bcaaf..a70aa0137 100644 --- a/torchx/cli/__init__.py +++ b/torchx/cli/__init__.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + """ The ``torchx`` CLI is a commandline tool around :py:class:`torchx.runner.Runner`. It allows users to launch :py:class:`torchx.specs.AppDef` directly onto diff --git a/torchx/cli/argparse_util.py b/torchx/cli/argparse_util.py index b9c2f6af6..808774e9b 100644 --- a/torchx/cli/argparse_util.py +++ b/torchx/cli/argparse_util.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + from argparse import Action, ArgumentParser, Namespace from typing import Any, Dict, Optional, Sequence, Text diff --git a/torchx/cli/cmd_base.py b/torchx/cli/cmd_base.py index c8902f7c8..5b07e5c2f 100644 --- a/torchx/cli/cmd_base.py +++ b/torchx/cli/cmd_base.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import abc import argparse diff --git a/torchx/cli/cmd_cancel.py b/torchx/cli/cmd_cancel.py index 62059c17e..d7b3efa7d 100644 --- a/torchx/cli/cmd_cancel.py +++ b/torchx/cli/cmd_cancel.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import argparse import logging diff --git a/torchx/cli/cmd_configure.py b/torchx/cli/cmd_configure.py index ba9ddc9fd..daecd9b0b 100644 --- a/torchx/cli/cmd_configure.py +++ b/torchx/cli/cmd_configure.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import argparse import logging import sys diff --git a/torchx/cli/cmd_describe.py b/torchx/cli/cmd_describe.py index 62ae8ee10..10b4d522c 100644 --- a/torchx/cli/cmd_describe.py +++ b/torchx/cli/cmd_describe.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import argparse import dataclasses import logging diff --git a/torchx/cli/cmd_list.py b/torchx/cli/cmd_list.py index 242b8d53f..6918b4a7e 100644 --- a/torchx/cli/cmd_list.py +++ b/torchx/cli/cmd_list.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import argparse import logging diff --git a/torchx/cli/cmd_log.py b/torchx/cli/cmd_log.py index c6d99681b..75bab07fc 100644 --- a/torchx/cli/cmd_log.py +++ b/torchx/cli/cmd_log.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import argparse import logging import re diff --git a/torchx/cli/cmd_run.py b/torchx/cli/cmd_run.py index 19a1f19e9..311543409 100644 --- a/torchx/cli/cmd_run.py +++ b/torchx/cli/cmd_run.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import argparse import logging import os diff --git a/torchx/cli/cmd_runopts.py b/torchx/cli/cmd_runopts.py index fcc3a9560..340aa3bc7 100644 --- a/torchx/cli/cmd_runopts.py +++ b/torchx/cli/cmd_runopts.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import argparse import logging diff --git a/torchx/cli/cmd_status.py b/torchx/cli/cmd_status.py index df2c04a1a..4cd543bfe 100644 --- a/torchx/cli/cmd_status.py +++ b/torchx/cli/cmd_status.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import argparse import logging import sys diff --git a/torchx/cli/cmd_tracker.py b/torchx/cli/cmd_tracker.py index 19332b1dd..c0f1aa214 100644 --- a/torchx/cli/cmd_tracker.py +++ b/torchx/cli/cmd_tracker.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import argparse import logging diff --git a/torchx/cli/colors.py b/torchx/cli/colors.py index ed49202a6..e99b9ddda 100644 --- a/torchx/cli/colors.py +++ b/torchx/cli/colors.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import sys # only print colors if outputting directly to a terminal diff --git a/torchx/cli/main.py b/torchx/cli/main.py index f8453b4a6..f8e07038e 100644 --- a/torchx/cli/main.py +++ b/torchx/cli/main.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import logging import os import sys diff --git a/torchx/cli/test/argparse_util_test.py b/torchx/cli/test/argparse_util_test.py index 43dc0ebe4..7360bbc40 100644 --- a/torchx/cli/test/argparse_util_test.py +++ b/torchx/cli/test/argparse_util_test.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + from argparse import ArgumentParser from unittest import mock diff --git a/torchx/cli/test/cmd_cancel_test.py b/torchx/cli/test/cmd_cancel_test.py index 9b6986782..503a77d1e 100644 --- a/torchx/cli/test/cmd_cancel_test.py +++ b/torchx/cli/test/cmd_cancel_test.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import argparse import unittest from unittest.mock import MagicMock, patch diff --git a/torchx/cli/test/cmd_configure_test.py b/torchx/cli/test/cmd_configure_test.py index 723605d9f..ebbb03a5b 100644 --- a/torchx/cli/test/cmd_configure_test.py +++ b/torchx/cli/test/cmd_configure_test.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import argparse import os import shutil diff --git a/torchx/cli/test/cmd_describe_test.py b/torchx/cli/test/cmd_describe_test.py index f6c3d527e..c5e312daa 100644 --- a/torchx/cli/test/cmd_describe_test.py +++ b/torchx/cli/test/cmd_describe_test.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import argparse import unittest from unittest.mock import patch diff --git a/torchx/cli/test/cmd_list_test.py b/torchx/cli/test/cmd_list_test.py index ff124d14b..e45e73f04 100644 --- a/torchx/cli/test/cmd_list_test.py +++ b/torchx/cli/test/cmd_list_test.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import argparse import unittest from unittest.mock import MagicMock, patch diff --git a/torchx/cli/test/cmd_log_test.py b/torchx/cli/test/cmd_log_test.py index 7df5c8544..86f59846b 100644 --- a/torchx/cli/test/cmd_log_test.py +++ b/torchx/cli/test/cmd_log_test.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import io import sys import unittest diff --git a/torchx/cli/test/cmd_run_test.py b/torchx/cli/test/cmd_run_test.py index fb0c3b205..1f53ccc80 100644 --- a/torchx/cli/test/cmd_run_test.py +++ b/torchx/cli/test/cmd_run_test.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import argparse import dataclasses import io diff --git a/torchx/cli/test/cmd_runopts_test.py b/torchx/cli/test/cmd_runopts_test.py index 9ef26d5a9..a4355ceaa 100644 --- a/torchx/cli/test/cmd_runopts_test.py +++ b/torchx/cli/test/cmd_runopts_test.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import argparse import unittest diff --git a/torchx/cli/test/cmd_status_test.py b/torchx/cli/test/cmd_status_test.py index b3766067e..0e8742e29 100644 --- a/torchx/cli/test/cmd_status_test.py +++ b/torchx/cli/test/cmd_status_test.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import argparse import unittest from unittest.mock import patch diff --git a/torchx/cli/test/cmd_tracker_test.py b/torchx/cli/test/cmd_tracker_test.py index 36ca2330a..731d10d25 100644 --- a/torchx/cli/test/cmd_tracker_test.py +++ b/torchx/cli/test/cmd_tracker_test.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import argparse import unittest from unittest.mock import MagicMock, patch diff --git a/torchx/cli/test/components.py b/torchx/cli/test/components.py index 3cc3dda41..a8280c4d7 100644 --- a/torchx/cli/test/components.py +++ b/torchx/cli/test/components.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import torchx.specs as specs diff --git a/torchx/cli/test/container/ps_main.py b/torchx/cli/test/container/ps_main.py index e55b717d1..ab204c85a 100755 --- a/torchx/cli/test/container/ps_main.py +++ b/torchx/cli/test/container/ps_main.py @@ -5,4 +5,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + print("ps_main") diff --git a/torchx/cli/test/container/reader_main.py b/torchx/cli/test/container/reader_main.py index 0defeaac2..bb6d00536 100755 --- a/torchx/cli/test/container/reader_main.py +++ b/torchx/cli/test/container/reader_main.py @@ -5,4 +5,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + print("reader_main") diff --git a/torchx/cli/test/container/train_main.py b/torchx/cli/test/container/train_main.py index f94ddf68f..3ac9e2b4a 100755 --- a/torchx/cli/test/container/train_main.py +++ b/torchx/cli/test/container/train_main.py @@ -5,4 +5,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + print("train_main") diff --git a/torchx/cli/test/main_test.py b/torchx/cli/test/main_test.py index fc0167679..0c9362f1e 100644 --- a/torchx/cli/test/main_test.py +++ b/torchx/cli/test/main_test.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import argparse import os import unittest diff --git a/torchx/components/__init__.py b/torchx/components/__init__.py index c30e6fca9..a215fc4ce 100644 --- a/torchx/components/__init__.py +++ b/torchx/components/__init__.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + """ This module contains a collection of builtin TorchX components. The directory structure is organized by component category. Components are simply diff --git a/torchx/components/component_test_base.py b/torchx/components/component_test_base.py index c6e426175..fc40502e4 100644 --- a/torchx/components/component_test_base.py +++ b/torchx/components/component_test_base.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + """ You can unit test the component definitions as you would normal Python code since they are valid Python definitions. diff --git a/torchx/components/dist.py b/torchx/components/dist.py index 3ffc08339..817534a25 100644 --- a/torchx/components/dist.py +++ b/torchx/components/dist.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + """ For distributed training, TorchX relies on the scheduler's gang scheduling capabilities to schedule ``n`` copies of nodes. Once launched, the application diff --git a/torchx/components/integration_tests/component_provider.py b/torchx/components/integration_tests/component_provider.py index 442e57a3a..9fc2bc224 100644 --- a/torchx/components/integration_tests/component_provider.py +++ b/torchx/components/integration_tests/component_provider.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import os import tempfile from abc import ABC, abstractmethod diff --git a/torchx/components/integration_tests/integ_tests.py b/torchx/components/integration_tests/integ_tests.py index f0443434a..28c382166 100644 --- a/torchx/components/integration_tests/integ_tests.py +++ b/torchx/components/integration_tests/integ_tests.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import inspect import logging import sys diff --git a/torchx/components/serve.py b/torchx/components/serve.py index e04cfe1df..6f7189a95 100644 --- a/torchx/components/serve.py +++ b/torchx/components/serve.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + """ These components aim to make it easier to interact with inference and serving tools such as `torchserve `_. diff --git a/torchx/components/structured_arg.py b/torchx/components/structured_arg.py index 6c1851cc0..29a26ea1b 100644 --- a/torchx/components/structured_arg.py +++ b/torchx/components/structured_arg.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + """ Defines methods for structured (higher order) component argument parsing. Use the functionalities defined in this module to author components diff --git a/torchx/components/test/dist_test.py b/torchx/components/test/dist_test.py index 296742d3b..669f1a7fc 100644 --- a/torchx/components/test/dist_test.py +++ b/torchx/components/test/dist_test.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + from torchx.components.component_test_base import ComponentTestCase from torchx.components.dist import _TORCH_DEBUG_FLAGS, ddp, parse_nnodes, spmd diff --git a/torchx/components/test/serve_test.py b/torchx/components/test/serve_test.py index 6200c5b32..931cc17a6 100644 --- a/torchx/components/test/serve_test.py +++ b/torchx/components/test/serve_test.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import unittest import torchx.specs as specs diff --git a/torchx/components/test/utils_test.py b/torchx/components/test/utils_test.py index 06abde03d..5f0bb7ee3 100644 --- a/torchx/components/test/utils_test.py +++ b/torchx/components/test/utils_test.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import torchx.components.utils as utils from torchx.components.component_test_base import ComponentTestCase from torchx.specs import AppState diff --git a/torchx/components/utils.py b/torchx/components/utils.py index f8502310b..62bf33664 100644 --- a/torchx/components/utils.py +++ b/torchx/components/utils.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + """ This contains TorchX utility components that are `ready-to-use` out of the box. These are components that simply execute well known binaries (e.g. ``cp``) diff --git a/torchx/examples/apps/compute_world_size/main.py b/torchx/examples/apps/compute_world_size/main.py index 39041ee26..78b8914a1 100644 --- a/torchx/examples/apps/compute_world_size/main.py +++ b/torchx/examples/apps/compute_world_size/main.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + """ Compute World Size Example diff --git a/torchx/examples/apps/compute_world_size/module/test/util_test.py b/torchx/examples/apps/compute_world_size/module/test/util_test.py index 7e6fde1ac..a13fd8c9d 100644 --- a/torchx/examples/apps/compute_world_size/module/test/util_test.py +++ b/torchx/examples/apps/compute_world_size/module/test/util_test.py @@ -3,6 +3,8 @@ # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. + +# pyre-strict import os import random import unittest diff --git a/torchx/examples/apps/compute_world_size/module/util.py b/torchx/examples/apps/compute_world_size/module/util.py index dfbb6953e..0b20414dd 100644 --- a/torchx/examples/apps/compute_world_size/module/util.py +++ b/torchx/examples/apps/compute_world_size/module/util.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import os import torch diff --git a/torchx/examples/apps/datapreproc/datapreproc.py b/torchx/examples/apps/datapreproc/datapreproc.py index 12eb71565..974acd69e 100755 --- a/torchx/examples/apps/datapreproc/datapreproc.py +++ b/torchx/examples/apps/datapreproc/datapreproc.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + """ Data Preprocessing App Example ==================================== diff --git a/torchx/examples/apps/lightning/data.py b/torchx/examples/apps/lightning/data.py index e16c36920..cc8beb026 100644 --- a/torchx/examples/apps/lightning/data.py +++ b/torchx/examples/apps/lightning/data.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + """ Trainer Datasets Example ======================== diff --git a/torchx/examples/apps/lightning/model.py b/torchx/examples/apps/lightning/model.py index 973caf838..4f4a6dcfb 100644 --- a/torchx/examples/apps/lightning/model.py +++ b/torchx/examples/apps/lightning/model.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + """ Tiny ImageNet Model ==================== diff --git a/torchx/examples/apps/lightning/profiler.py b/torchx/examples/apps/lightning/profiler.py index bca66531b..24f2a602e 100644 --- a/torchx/examples/apps/lightning/profiler.py +++ b/torchx/examples/apps/lightning/profiler.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + """ Simple Logging Profiler =========================== diff --git a/torchx/examples/apps/lightning/test/model_test.py b/torchx/examples/apps/lightning/test/model_test.py index 4da9a15ce..67cd4ab04 100644 --- a/torchx/examples/apps/lightning/test/model_test.py +++ b/torchx/examples/apps/lightning/test/model_test.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import unittest import torch diff --git a/torchx/examples/apps/lightning/train.py b/torchx/examples/apps/lightning/train.py index 364f88030..f1c340dca 100755 --- a/torchx/examples/apps/lightning/train.py +++ b/torchx/examples/apps/lightning/train.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + """ Trainer Example ============================================= diff --git a/torchx/examples/apps/tracker/main.py b/torchx/examples/apps/tracker/main.py index 737e624d5..86e160786 100644 --- a/torchx/examples/apps/tracker/main.py +++ b/torchx/examples/apps/tracker/main.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import argparse import os import pathlib diff --git a/torchx/examples/pipelines/kfp/advanced_pipeline.py b/torchx/examples/pipelines/kfp/advanced_pipeline.py index 6f794e2e0..e84e6ee52 100755 --- a/torchx/examples/pipelines/kfp/advanced_pipeline.py +++ b/torchx/examples/pipelines/kfp/advanced_pipeline.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + """ Advanced KubeFlow Pipelines Example =================================== diff --git a/torchx/examples/pipelines/kfp/dist_pipeline.py b/torchx/examples/pipelines/kfp/dist_pipeline.py index ee6ca1842..a32bbfd9b 100755 --- a/torchx/examples/pipelines/kfp/dist_pipeline.py +++ b/torchx/examples/pipelines/kfp/dist_pipeline.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + """ Distributed KubeFlow Pipelines Example ====================================== diff --git a/torchx/examples/pipelines/kfp/intro_pipeline.py b/torchx/examples/pipelines/kfp/intro_pipeline.py index abea27868..51a0c6e77 100755 --- a/torchx/examples/pipelines/kfp/intro_pipeline.py +++ b/torchx/examples/pipelines/kfp/intro_pipeline.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + """ Intro KubeFlow Pipelines Example ================================ diff --git a/torchx/examples/pipelines/kfp/test/kfp_pipeline_test.py b/torchx/examples/pipelines/kfp/test/kfp_pipeline_test.py index 02e10e93e..f4d26da4b 100644 --- a/torchx/examples/pipelines/kfp/test/kfp_pipeline_test.py +++ b/torchx/examples/pipelines/kfp/test/kfp_pipeline_test.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import os import os.path import sys diff --git a/torchx/notebook.py b/torchx/notebook.py index 8ee855dc8..3096d29b2 100644 --- a/torchx/notebook.py +++ b/torchx/notebook.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + """ This contains TorchX utilities for creating and running components and apps from an Jupyter/IPython Notebook. diff --git a/torchx/pipelines/kfp/__init__.py b/torchx/pipelines/kfp/__init__.py index 8ac4d033a..1adeede50 100644 --- a/torchx/pipelines/kfp/__init__.py +++ b/torchx/pipelines/kfp/__init__.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + """ This module contains adapters for converting TorchX components into KubeFlow Pipeline components. diff --git a/torchx/pipelines/kfp/adapter.py b/torchx/pipelines/kfp/adapter.py index c66a2558c..623d43dc5 100644 --- a/torchx/pipelines/kfp/adapter.py +++ b/torchx/pipelines/kfp/adapter.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import json import os import os.path diff --git a/torchx/pipelines/kfp/test/adapter_test.py b/torchx/pipelines/kfp/test/adapter_test.py index c6440cf7e..df7b743a8 100644 --- a/torchx/pipelines/kfp/test/adapter_test.py +++ b/torchx/pipelines/kfp/test/adapter_test.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import os.path import tempfile import unittest diff --git a/torchx/pipelines/kfp/test/version_test.py b/torchx/pipelines/kfp/test/version_test.py index 23e91ae3c..f932f5b7b 100644 --- a/torchx/pipelines/kfp/test/version_test.py +++ b/torchx/pipelines/kfp/test/version_test.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import importlib import unittest from unittest.mock import patch diff --git a/torchx/pipelines/kfp/version.py b/torchx/pipelines/kfp/version.py index d42d4d1ee..a9244e289 100644 --- a/torchx/pipelines/kfp/version.py +++ b/torchx/pipelines/kfp/version.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + # Follows PEP-0440 version scheme guidelines # https://www.python.org/dev/peps/pep-0440/#version-scheme # diff --git a/torchx/runner/__init__.py b/torchx/runner/__init__.py index bfdf29736..2c95eca4a 100644 --- a/torchx/runner/__init__.py +++ b/torchx/runner/__init__.py @@ -5,4 +5,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + from torchx.runner.api import get_runner, Runner # noqa: F401 F403 diff --git a/torchx/runner/api.py b/torchx/runner/api.py index f3b8a14a9..0203a313d 100644 --- a/torchx/runner/api.py +++ b/torchx/runner/api.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import json import logging import os diff --git a/torchx/runner/config.py b/torchx/runner/config.py index 40943c0d7..53c6ccc9f 100644 --- a/torchx/runner/config.py +++ b/torchx/runner/config.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + """ Status: Beta diff --git a/torchx/runner/events/__init__.py b/torchx/runner/events/__init__.py index 30209c8cc..2ebc0dc9f 100644 --- a/torchx/runner/events/__init__.py +++ b/torchx/runner/events/__init__.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + """ Module contains events processing mechanisms that are integrated with the standard python logging. diff --git a/torchx/runner/events/api.py b/torchx/runner/events/api.py index 2ce37533b..db76f3f3d 100644 --- a/torchx/runner/events/api.py +++ b/torchx/runner/events/api.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import json from dataclasses import asdict, dataclass from enum import Enum diff --git a/torchx/runner/events/handlers.py b/torchx/runner/events/handlers.py index ccdadccfa..e7c9cd9dd 100644 --- a/torchx/runner/events/handlers.py +++ b/torchx/runner/events/handlers.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import logging from typing import Dict diff --git a/torchx/runner/events/test/lib_test.py b/torchx/runner/events/test/lib_test.py index 62d2d247f..f17324f42 100644 --- a/torchx/runner/events/test/lib_test.py +++ b/torchx/runner/events/test/lib_test.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import json import logging import unittest diff --git a/torchx/runner/test/api_test.py b/torchx/runner/test/api_test.py index 940b3e381..f355dee0d 100644 --- a/torchx/runner/test/api_test.py +++ b/torchx/runner/test/api_test.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import datetime import os from contextlib import contextmanager diff --git a/torchx/runner/test/config_test.py b/torchx/runner/test/config_test.py index ddb8c8aaf..c9730d9cf 100644 --- a/torchx/runner/test/config_test.py +++ b/torchx/runner/test/config_test.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import os from datetime import datetime from io import StringIO diff --git a/torchx/runner/test/resource/distributed.py b/torchx/runner/test/resource/distributed.py index 13a40a391..fecbe21c3 100644 --- a/torchx/runner/test/resource/distributed.py +++ b/torchx/runner/test/resource/distributed.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import os from typing import Dict, Optional diff --git a/torchx/runtime/tracking/__init__.py b/torchx/runtime/tracking/__init__.py index 147e73dd5..78dce4c1d 100644 --- a/torchx/runtime/tracking/__init__.py +++ b/torchx/runtime/tracking/__init__.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + """ .. note:: EXPERIMENTAL, USE AT YOUR OWN RISK, APIs SUBJECT TO CHANGE diff --git a/torchx/runtime/tracking/api.py b/torchx/runtime/tracking/api.py index c3a06d8d0..39cffb98f 100644 --- a/torchx/runtime/tracking/api.py +++ b/torchx/runtime/tracking/api.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import abc import json from typing import Dict, Union diff --git a/torchx/runtime/tracking/test/api_test.py b/torchx/runtime/tracking/test/api_test.py index 5fa2b6726..c51e6faf3 100644 --- a/torchx/runtime/tracking/test/api_test.py +++ b/torchx/runtime/tracking/test/api_test.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import shutil import tempfile import unittest diff --git a/torchx/schedulers/__init__.py b/torchx/schedulers/__init__.py index 955065704..2ce694fbe 100644 --- a/torchx/schedulers/__init__.py +++ b/torchx/schedulers/__init__.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import importlib from typing import Dict, Mapping diff --git a/torchx/schedulers/api.py b/torchx/schedulers/api.py index f2ccc0718..437c4e23a 100644 --- a/torchx/schedulers/api.py +++ b/torchx/schedulers/api.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import abc import re from dataclasses import dataclass, field diff --git a/torchx/schedulers/aws_batch_scheduler.py b/torchx/schedulers/aws_batch_scheduler.py index 5118a04f0..a354c57bc 100644 --- a/torchx/schedulers/aws_batch_scheduler.py +++ b/torchx/schedulers/aws_batch_scheduler.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + """ This contains the TorchX AWS Batch scheduler which can be used to run TorchX diff --git a/torchx/schedulers/devices.py b/torchx/schedulers/devices.py index 662e679dd..2491c2c68 100644 --- a/torchx/schedulers/devices.py +++ b/torchx/schedulers/devices.py @@ -4,6 +4,8 @@ # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. + +# pyre-strict import warnings from typing import Callable, Dict, List, Mapping diff --git a/torchx/schedulers/docker_scheduler.py b/torchx/schedulers/docker_scheduler.py index ce4b91aa7..d7dfe9470 100644 --- a/torchx/schedulers/docker_scheduler.py +++ b/torchx/schedulers/docker_scheduler.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import fnmatch import logging import os.path diff --git a/torchx/schedulers/gcp_batch_scheduler.py b/torchx/schedulers/gcp_batch_scheduler.py index e52d1ac8d..4645c9afd 100644 --- a/torchx/schedulers/gcp_batch_scheduler.py +++ b/torchx/schedulers/gcp_batch_scheduler.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + """ This contains the TorchX GCP Batch scheduler which can be used to run TorchX diff --git a/torchx/schedulers/ids.py b/torchx/schedulers/ids.py index 8c308e3f3..9e4b90032 100644 --- a/torchx/schedulers/ids.py +++ b/torchx/schedulers/ids.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import os import random import struct diff --git a/torchx/schedulers/kubernetes_scheduler.py b/torchx/schedulers/kubernetes_scheduler.py index c5a2c22bd..458a3ae01 100644 --- a/torchx/schedulers/kubernetes_scheduler.py +++ b/torchx/schedulers/kubernetes_scheduler.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + """ This contains the TorchX Kubernetes scheduler which can be used to run TorchX diff --git a/torchx/schedulers/local_scheduler.py b/torchx/schedulers/local_scheduler.py index e3f706998..2fa07d362 100644 --- a/torchx/schedulers/local_scheduler.py +++ b/torchx/schedulers/local_scheduler.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + """ This contains the TorchX local scheduler which can be used to run TorchX components locally via subprocesses. diff --git a/torchx/schedulers/lsf_scheduler.py b/torchx/schedulers/lsf_scheduler.py index ecf7e8235..102a8f417 100644 --- a/torchx/schedulers/lsf_scheduler.py +++ b/torchx/schedulers/lsf_scheduler.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + """ This contains the TorchX LSF scheduler which can be used to run TorchX components on a LSF cluster. diff --git a/torchx/schedulers/slurm_scheduler.py b/torchx/schedulers/slurm_scheduler.py index 6899a7668..331fd8611 100644 --- a/torchx/schedulers/slurm_scheduler.py +++ b/torchx/schedulers/slurm_scheduler.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + """ This contains the TorchX Slurm scheduler which can be used to run TorchX components on a Slurm cluster. diff --git a/torchx/schedulers/streams.py b/torchx/schedulers/streams.py index 4da497b0f..050307315 100644 --- a/torchx/schedulers/streams.py +++ b/torchx/schedulers/streams.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import io import os import threading diff --git a/torchx/schedulers/test/api_test.py b/torchx/schedulers/test/api_test.py index 3b9cb897b..7f8ecf8ac 100644 --- a/torchx/schedulers/test/api_test.py +++ b/torchx/schedulers/test/api_test.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import unittest from datetime import datetime diff --git a/torchx/schedulers/test/aws_batch_scheduler_test.py b/torchx/schedulers/test/aws_batch_scheduler_test.py index 5f759e609..d9a2914aa 100644 --- a/torchx/schedulers/test/aws_batch_scheduler_test.py +++ b/torchx/schedulers/test/aws_batch_scheduler_test.py @@ -3,6 +3,8 @@ # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. + +# pyre-strict import threading import unittest from contextlib import contextmanager diff --git a/torchx/schedulers/test/devices_test.py b/torchx/schedulers/test/devices_test.py index 3a38cf701..f6099b83f 100644 --- a/torchx/schedulers/test/devices_test.py +++ b/torchx/schedulers/test/devices_test.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import unittest diff --git a/torchx/schedulers/test/docker_scheduler_test.py b/torchx/schedulers/test/docker_scheduler_test.py index 6f50d78ea..929444fff 100644 --- a/torchx/schedulers/test/docker_scheduler_test.py +++ b/torchx/schedulers/test/docker_scheduler_test.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import posixpath import unittest from datetime import datetime, timedelta diff --git a/torchx/schedulers/test/gcp_batch_scheduler_test.py b/torchx/schedulers/test/gcp_batch_scheduler_test.py index c088b2439..7c96a3ff9 100644 --- a/torchx/schedulers/test/gcp_batch_scheduler_test.py +++ b/torchx/schedulers/test/gcp_batch_scheduler_test.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import unittest from contextlib import contextmanager from datetime import datetime diff --git a/torchx/schedulers/test/ids_test.py b/torchx/schedulers/test/ids_test.py index d1ab10347..2aad43eeb 100644 --- a/torchx/schedulers/test/ids_test.py +++ b/torchx/schedulers/test/ids_test.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import unittest from unittest.mock import MagicMock, patch diff --git a/torchx/schedulers/test/kubernetes_scheduler_test.py b/torchx/schedulers/test/kubernetes_scheduler_test.py index 3bd16ff1f..8e6b356a9 100644 --- a/torchx/schedulers/test/kubernetes_scheduler_test.py +++ b/torchx/schedulers/test/kubernetes_scheduler_test.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import base64 import importlib import sys diff --git a/torchx/schedulers/test/local_scheduler_test.py b/torchx/schedulers/test/local_scheduler_test.py index 6c86b6997..8dae7ecba 100644 --- a/torchx/schedulers/test/local_scheduler_test.py +++ b/torchx/schedulers/test/local_scheduler_test.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import abc import json import multiprocessing as mp diff --git a/torchx/schedulers/test/lsf_scheduler_test.py b/torchx/schedulers/test/lsf_scheduler_test.py index 1828efba6..7d4032e54 100644 --- a/torchx/schedulers/test/lsf_scheduler_test.py +++ b/torchx/schedulers/test/lsf_scheduler_test.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import unittest from unittest.mock import MagicMock, patch diff --git a/torchx/schedulers/test/registry_test.py b/torchx/schedulers/test/registry_test.py index ed1ab1c50..951cf8e73 100644 --- a/torchx/schedulers/test/registry_test.py +++ b/torchx/schedulers/test/registry_test.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import unittest from typing import Any, Dict, Optional from unittest.mock import MagicMock, patch diff --git a/torchx/schedulers/test/slurm_scheduler_test.py b/torchx/schedulers/test/slurm_scheduler_test.py index efbf12b20..a2f47daed 100644 --- a/torchx/schedulers/test/slurm_scheduler_test.py +++ b/torchx/schedulers/test/slurm_scheduler_test.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import datetime import os import subprocess diff --git a/torchx/schedulers/test/streams_test.py b/torchx/schedulers/test/streams_test.py index 8c9fdae3b..757160101 100644 --- a/torchx/schedulers/test/streams_test.py +++ b/torchx/schedulers/test/streams_test.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import io import os.path import shutil diff --git a/torchx/schedulers/test/test_util.py b/torchx/schedulers/test/test_util.py index f499876a0..c3865d2d8 100644 --- a/torchx/schedulers/test/test_util.py +++ b/torchx/schedulers/test/test_util.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import ctypes import os from typing import List diff --git a/torchx/specs/__init__.py b/torchx/specs/__init__.py index c836f53ec..78aa1676e 100644 --- a/torchx/specs/__init__.py +++ b/torchx/specs/__init__.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + """ This contains the TorchX AppDef and related component definitions. These are used by components to define the apps which can then be launched via a TorchX diff --git a/torchx/specs/api.py b/torchx/specs/api.py index 32197719c..fd8761585 100644 --- a/torchx/specs/api.py +++ b/torchx/specs/api.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import copy import json import re diff --git a/torchx/specs/builders.py b/torchx/specs/builders.py index dc47fe782..fc93c3d27 100644 --- a/torchx/specs/builders.py +++ b/torchx/specs/builders.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import argparse import inspect from typing import Any, Callable, Dict, List, Mapping, Optional, Union diff --git a/torchx/specs/file_linter.py b/torchx/specs/file_linter.py index 505a7f1f3..a10bb369e 100644 --- a/torchx/specs/file_linter.py +++ b/torchx/specs/file_linter.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import abc import argparse import ast diff --git a/torchx/specs/finder.py b/torchx/specs/finder.py index 17b1d11ad..d9f285ade 100644 --- a/torchx/specs/finder.py +++ b/torchx/specs/finder.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import abc import importlib import inspect diff --git a/torchx/specs/named_resources_aws.py b/torchx/specs/named_resources_aws.py index 533068d71..69052dfd2 100644 --- a/torchx/specs/named_resources_aws.py +++ b/torchx/specs/named_resources_aws.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + r""" `torchx.specs.named_resources_aws` contains resource definitions that represent corresponding AWS instance types taken from https://aws.amazon.com/ec2/instance-types/. The resources are exposed diff --git a/torchx/specs/named_resources_generic.py b/torchx/specs/named_resources_generic.py index 81dc6e428..2d93ecf75 100644 --- a/torchx/specs/named_resources_generic.py +++ b/torchx/specs/named_resources_generic.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + """ Defines generic named resources that are not specific to any cloud provider's instance types. These generic named resources are meant to be used as diff --git a/torchx/specs/test/api_test.py b/torchx/specs/test/api_test.py index 61977270c..6a74fe421 100644 --- a/torchx/specs/test/api_test.py +++ b/torchx/specs/test/api_test.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import os import time import unittest diff --git a/torchx/specs/test/builders_test.py b/torchx/specs/test/builders_test.py index 49660e009..91569c0f0 100644 --- a/torchx/specs/test/builders_test.py +++ b/torchx/specs/test/builders_test.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import argparse import sys import unittest diff --git a/torchx/specs/test/components/__init__.py b/torchx/specs/test/components/__init__.py index 2e41cd717..581f84e46 100644 --- a/torchx/specs/test/components/__init__.py +++ b/torchx/specs/test/components/__init__.py @@ -3,3 +3,5 @@ # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. + +# pyre-strict diff --git a/torchx/specs/test/components/a/__init__.py b/torchx/specs/test/components/a/__init__.py index c83c229da..12c8c345f 100644 --- a/torchx/specs/test/components/a/__init__.py +++ b/torchx/specs/test/components/a/__init__.py @@ -3,6 +3,8 @@ # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. + +# pyre-strict import torchx from torchx import specs diff --git a/torchx/specs/test/components/a/b/__init__.py b/torchx/specs/test/components/a/b/__init__.py index 2e41cd717..581f84e46 100644 --- a/torchx/specs/test/components/a/b/__init__.py +++ b/torchx/specs/test/components/a/b/__init__.py @@ -3,3 +3,5 @@ # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. + +# pyre-strict diff --git a/torchx/specs/test/components/a/b/c.py b/torchx/specs/test/components/a/b/c.py index 5e5e96dcf..42b2fb7ec 100644 --- a/torchx/specs/test/components/a/b/c.py +++ b/torchx/specs/test/components/a/b/c.py @@ -3,6 +3,8 @@ # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. + +# pyre-strict import torchx from torchx import specs diff --git a/torchx/specs/test/components/c/__init__.py b/torchx/specs/test/components/c/__init__.py index a9fdb3b99..004a89a0b 100644 --- a/torchx/specs/test/components/c/__init__.py +++ b/torchx/specs/test/components/c/__init__.py @@ -4,3 +4,5 @@ # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. + +# pyre-strict diff --git a/torchx/specs/test/components/c/d.py b/torchx/specs/test/components/c/d.py index e4dfb21fd..32e4cd942 100644 --- a/torchx/specs/test/components/c/d.py +++ b/torchx/specs/test/components/c/d.py @@ -3,6 +3,8 @@ # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. + +# pyre-strict import torchx from torchx import specs diff --git a/torchx/specs/test/file_linter_test.py b/torchx/specs/test/file_linter_test.py index cbaa45026..1c615d50c 100644 --- a/torchx/specs/test/file_linter_test.py +++ b/torchx/specs/test/file_linter_test.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import argparse import os import unittest diff --git a/torchx/specs/test/finder_test.py b/torchx/specs/test/finder_test.py index 9d8ebd834..812ab1c5c 100644 --- a/torchx/specs/test/finder_test.py +++ b/torchx/specs/test/finder_test.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import os import shutil import tempfile diff --git a/torchx/specs/test/named_resources_test.py b/torchx/specs/test/named_resources_test.py index 543aa4185..f03705b8d 100644 --- a/torchx/specs/test/named_resources_test.py +++ b/torchx/specs/test/named_resources_test.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import unittest from unittest.mock import MagicMock, patch diff --git a/torchx/test/fixtures.py b/torchx/test/fixtures.py index d629a5829..eab62a52e 100644 --- a/torchx/test/fixtures.py +++ b/torchx/test/fixtures.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + """ Useful test fixtures (classes that you can subclass your python ``unittest.TestCase``) """ diff --git a/torchx/test/notebook_test.py b/torchx/test/notebook_test.py index e872fc675..e8b365f4a 100644 --- a/torchx/test/notebook_test.py +++ b/torchx/test/notebook_test.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import io import posixpath import unittest diff --git a/torchx/test/version_test.py b/torchx/test/version_test.py index 1357c9b4a..c96998f75 100644 --- a/torchx/test/version_test.py +++ b/torchx/test/version_test.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import unittest diff --git a/torchx/tracker/__init__.py b/torchx/tracker/__init__.py index 813055183..634ce9e28 100644 --- a/torchx/tracker/__init__.py +++ b/torchx/tracker/__init__.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + """ .. note:: PROTOTYPE, USE AT YOUR OWN RISK, APIs SUBJECT TO CHANGE diff --git a/torchx/tracker/api.py b/torchx/tracker/api.py index e9ada07f2..28f8d02c3 100644 --- a/torchx/tracker/api.py +++ b/torchx/tracker/api.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + from __future__ import annotations import logging diff --git a/torchx/tracker/backend/fsspec.py b/torchx/tracker/backend/fsspec.py index 381bc9d1b..a8642d4fb 100644 --- a/torchx/tracker/backend/fsspec.py +++ b/torchx/tracker/backend/fsspec.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + from __future__ import annotations import json diff --git a/torchx/tracker/backend/test/fsspec_test.py b/torchx/tracker/backend/test/fsspec_test.py index b4ff0888f..10ed27f5d 100644 --- a/torchx/tracker/backend/test/fsspec_test.py +++ b/torchx/tracker/backend/test/fsspec_test.py @@ -4,6 +4,8 @@ # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. + +# pyre-strict import shutil import tempfile import unittest diff --git a/torchx/util/cuda.py b/torchx/util/cuda.py index 4044f784e..ea42922f1 100644 --- a/torchx/util/cuda.py +++ b/torchx/util/cuda.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import torch diff --git a/torchx/util/datetime.py b/torchx/util/datetime.py index fd47269e0..296d48c63 100644 --- a/torchx/util/datetime.py +++ b/torchx/util/datetime.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + from datetime import datetime, timedelta diff --git a/torchx/util/entrypoints.py b/torchx/util/entrypoints.py index 0bba149dc..b2f0e1fe3 100644 --- a/torchx/util/entrypoints.py +++ b/torchx/util/entrypoints.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + from typing import Any, Dict, Optional import importlib_metadata as metadata diff --git a/torchx/util/io.py b/torchx/util/io.py index d383006f7..df43d0290 100644 --- a/torchx/util/io.py +++ b/torchx/util/io.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + from os import path from pathlib import Path from typing import Optional diff --git a/torchx/util/modules.py b/torchx/util/modules.py index 6447db687..5ac418ee7 100644 --- a/torchx/util/modules.py +++ b/torchx/util/modules.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import importlib from types import ModuleType from typing import Callable, Optional, Union diff --git a/torchx/util/shlex.py b/torchx/util/shlex.py index 21bd98bdb..71e6f9230 100644 --- a/torchx/util/shlex.py +++ b/torchx/util/shlex.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import shlex from typing import Iterable diff --git a/torchx/util/strings.py b/torchx/util/strings.py index f2aa113d5..979167403 100644 --- a/torchx/util/strings.py +++ b/torchx/util/strings.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import re diff --git a/torchx/util/test/entrypoints_test.py b/torchx/util/test/entrypoints_test.py index 61aaa1b6a..efa3a4893 100644 --- a/torchx/util/test/entrypoints_test.py +++ b/torchx/util/test/entrypoints_test.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import unittest from configparser import ConfigParser from types import ModuleType diff --git a/torchx/util/test/shlex_test.py b/torchx/util/test/shlex_test.py index 2723bd7ea..1a4cf46b5 100644 --- a/torchx/util/test/shlex_test.py +++ b/torchx/util/test/shlex_test.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import unittest from torchx.util import shlex diff --git a/torchx/util/test/strings_test.py b/torchx/util/test/strings_test.py index 644da0cd9..d5a76cdcf 100644 --- a/torchx/util/test/strings_test.py +++ b/torchx/util/test/strings_test.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import unittest from torchx.util.strings import normalize_str diff --git a/torchx/util/test/types_test.py b/torchx/util/test/types_test.py index f3cacbb33..78bfc9346 100644 --- a/torchx/util/test/types_test.py +++ b/torchx/util/test/types_test.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import inspect import unittest from typing import cast, Dict, List, Optional, Union diff --git a/torchx/util/types.py b/torchx/util/types.py index b6cf5d914..bdb86ccec 100644 --- a/torchx/util/types.py +++ b/torchx/util/types.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import inspect from typing import Any, Callable, Dict, List, Optional, Tuple, Type, TypeVar, Union diff --git a/torchx/version.py b/torchx/version.py index 3c09b96da..2a753e775 100644 --- a/torchx/version.py +++ b/torchx/version.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + from torchx.util.entrypoints import load # Follows PEP-0440 version scheme guidelines diff --git a/torchx/workspace/__init__.py b/torchx/workspace/__init__.py index 3f75bf1f9..5625ce41d 100644 --- a/torchx/workspace/__init__.py +++ b/torchx/workspace/__init__.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + """ Status: Beta diff --git a/torchx/workspace/api.py b/torchx/workspace/api.py index 239b341ac..2eeb764fe 100644 --- a/torchx/workspace/api.py +++ b/torchx/workspace/api.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import abc import fnmatch import posixpath diff --git a/torchx/workspace/dir_workspace.py b/torchx/workspace/dir_workspace.py index e19afc9e6..9da49b1ac 100644 --- a/torchx/workspace/dir_workspace.py +++ b/torchx/workspace/dir_workspace.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import os import posixpath import shutil diff --git a/torchx/workspace/docker_workspace.py b/torchx/workspace/docker_workspace.py index 13d9c7756..d93fb667d 100644 --- a/torchx/workspace/docker_workspace.py +++ b/torchx/workspace/docker_workspace.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import io import logging import posixpath diff --git a/torchx/workspace/test/dir_workspace_test.py b/torchx/workspace/test/dir_workspace_test.py index 627ca458f..48dc4a4bb 100644 --- a/torchx/workspace/test/dir_workspace_test.py +++ b/torchx/workspace/test/dir_workspace_test.py @@ -5,6 +5,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import os.path import shutil import tempfile diff --git a/torchx/workspace/test/docker_workspace_test.py b/torchx/workspace/test/docker_workspace_test.py index 738c9228f..fa9a4335b 100644 --- a/torchx/workspace/test/docker_workspace_test.py +++ b/torchx/workspace/test/docker_workspace_test.py @@ -4,6 +4,8 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# pyre-strict + import json import os import stat