Skip to content

Commit 3267fa9

Browse files
authored
dependencies: unpin pyre and fix issues (pytorch#706)
1 parent f1e19c5 commit 3267fa9

File tree

7 files changed

+13
-10
lines changed

7 files changed

+13
-10
lines changed

.github/workflows/pyre.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,5 @@ jobs:
2121
run: |
2222
set -eux
2323
pip install -e .[dev]
24-
VERSION=$(grep "version" .pyre_configuration | sed -n -e 's/.*\(0\.0\.[0-9]*\).*/\1/p')
25-
pip install pyre-check-nightly==$VERSION
2624
- name: Run Pyre
2725
run: scripts/pyre.sh

.pyre_configuration

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,5 @@
1717
"search_path": [
1818
"stubs"
1919
],
20-
"strict": true,
21-
"version": "0.0.101662549039"
20+
"strict": true
2221
}

dev-requirements.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ hydra-core
1313
ipython
1414
kfp==1.8.9
1515
moto==4.1.3
16-
pyre-extensions==0.0.29
16+
pyre-extensions
17+
pyre-check
1718
pytest
1819
pytorch-lightning==1.5.10
1920
torch-model-archiver>=0.4.2

scripts/kfpint.py

-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@
6666

6767
def get_fn_name(fn: Callable[..., T]) -> str:
6868
if hasattr(fn, "__qualname__"):
69-
# pyre-ignore[16]
7069
return fn.__qualname__
7170
elif hasattr(fn, "__name__"):
7271
return fn.__name__

torchx/components/component_test_base.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ def validate(self, module: ModuleType, function_name: str) -> None:
6868
"""
6969

7070
# make it the same as a custom component (e.g. /abs/path/to/component.py:train)
71-
component_id = f"{os.path.abspath(module.__file__)}:{function_name}"
71+
module_path = module.__file__
72+
assert module_path, f"module must have __file__: {module_path}"
73+
module_path = os.path.abspath(module_path)
74+
component_id = f"{module_path}:{function_name}"
7275
component_def = get_component(component_id)
7376

7477
# on `--help` argparse will print the help message and exit 0

torchx/schedulers/test/local_scheduler_test.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,6 @@ def test_submit(self) -> None:
244244
expected_app_id = make_unique(app.name)
245245
cfg = {"log_dir": self.test_dir}
246246
with patch(LOCAL_SCHEDULER_MAKE_UNIQUE, return_value=expected_app_id):
247-
248247
app_id = self.scheduler.submit(app, cfg)
249248

250249
self.assertEqual(f"{expected_app_id}", app_id)
@@ -282,7 +281,9 @@ def test_submit_cleanup(self) -> None:
282281
app = AppDef(name="test_app", roles=[role])
283282
self.scheduler.submit(app, cfg={})
284283
self.scheduler.close()
285-
self.assertFalse(os.path.exists(self.scheduler._base_log_dir))
284+
base_log_dir = self.scheduler._base_log_dir
285+
self.assertIsNotNone(base_log_dir)
286+
self.assertFalse(os.path.exists(base_log_dir))
286287
self.assertTrue(self.scheduler._created_tmp_log_dir)
287288

288289
def test_macros_env(self) -> None:

torchx/specs/finder.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,9 @@ def _get_components_from_module(self, module: ModuleType) -> List[_Component]:
223223
functions = getmembers(module, isfunction)
224224
component_defs = []
225225

226-
module_path = os.path.abspath(module.__file__)
226+
module_path = module.__file__
227+
assert module_path, f"module must have __file__: {module_path}"
228+
module_path = os.path.abspath(module_path)
227229
rel_module_name = module_relname(module, relative_to=self.base_module)
228230
for function_name, function in functions:
229231
linter_errors = validate(module_path, function_name)

0 commit comments

Comments
 (0)