From 8d7ee5bf813f1fc0a0685e0cb1ef58fcc63e7855 Mon Sep 17 00:00:00 2001 From: Myle Ott Date: Tue, 15 Dec 2020 17:46:37 -0800 Subject: [PATCH] Fix hydra with Python 3.8 (#1511) Summary: Pull Request resolved: https://github.com/fairinternal/fairseq-py/pull/1511 Test Plan: Imported from OSS Reviewed By: alexeib Differential Revision: D25570468 Pulled By: myleott fbshipit-source-id: 98efc6983479e163e6cf0a7ef33decaa1bc429f1 --- fairseq/dataclass/utils.py | 3 ++- setup.py | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/fairseq/dataclass/utils.py b/fairseq/dataclass/utils.py index 9d52d4594..45e7ed917 100644 --- a/fairseq/dataclass/utils.py +++ b/fairseq/dataclass/utils.py @@ -228,8 +228,9 @@ def _override_attr( if isinstance(val, tuple): val = list(val) + v_type = getattr(v.type, "__origin__", None) if ( - getattr(v.type, "__origin__", None) is List + (v_type is List or v_type is list) # skip interpolation and not (isinstance(val, str) and val.startswith("${")) ): diff --git a/setup.py b/setup.py index 0a4be4b0d..195429803 100644 --- a/setup.py +++ b/setup.py @@ -168,6 +168,8 @@ def do_setup(package_data): "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", "Topic :: Scientific/Engineering :: Artificial Intelligence", ], long_description=readme, @@ -182,7 +184,8 @@ def do_setup(package_data): "cffi", "cython", 'dataclasses; python_version<"3.7"', - "hydra-core", + "hydra-core<1.1", + "omegaconf<2.1", 'numpy<1.20.0; python_version<"3.7"', 'numpy; python_version>="3.7"', "regex",