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
This commit is contained in:
Myle Ott 2020-12-15 17:46:37 -08:00 committed by Facebook GitHub Bot
parent 5a3e51d211
commit 8d7ee5bf81
2 changed files with 6 additions and 2 deletions

View File

@ -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("${"))
):

View File

@ -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",