From ba61d39b0b93e27cf493930bf6bedf10dcb445af Mon Sep 17 00:00:00 2001 From: SumanthRH Date: Mon, 24 Mar 2025 22:42:38 +0000 Subject: [PATCH 1/4] switch to getfullargspec to support python 3.12 Signed-off-by: SumanthRH --- skythought/evals/scoring/utils/pyext2.py | 14 +++++++------- skythought/evals/tasks/taco/pyext2.py | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/skythought/evals/scoring/utils/pyext2.py b/skythought/evals/scoring/utils/pyext2.py index ff1593da..e741997a 100644 --- a/skythought/evals/scoring/utils/pyext2.py +++ b/skythought/evals/scoring/utils/pyext2.py @@ -108,18 +108,18 @@ def modify_function(f, globals={}, name=None, code=None, defaults=None, newf.__dict__.update(f.__dict__) return newf def argspec(f): - return inspect.getargspec(f) + return inspect.getfullargspec(f) eval(compile('def _exec(m,g): exec m in g', '', 'exec')) def _gettypes(args): return tuple(map(type, args)) -oargspec = inspect.getargspec +oargspec = inspect.getfullargspec def _argspec(func): return __targspec(func, oargspec) -inspect.getargspec = _argspec +inspect.getfullargspec = _argspec try: import IPython @@ -127,10 +127,10 @@ def _argspec(func): IPython = None else: # Replace IPython's argspec - oipyargspec = IPython.core.oinspect.getargspec + oipyargspec = IPython.core.oinspect.getfullargspec def _ipyargspec(func): return __targspec(func, oipyargspec, '__orig_arg_ipy__') - IPython.core.oinspect.getargspec = _ipyargspec + IPython.core.oinspect.getfullargspec = _ipyargspec class overload(object): '''Simple function overloading in Python.''' @@ -177,7 +177,7 @@ def _newf(*args, **kwargs): _newf.__is_overload__ = True _newf.__orig_arg__ = argspec(f) if IPython: - _newf.__orig_arg_ipy__ = IPython.core.oinspect.getargspec(f) + _newf.__orig_arg_ipy__ = IPython.core.oinspect.getfullargspec(f) return _newf return _wrap @classmethod @@ -232,7 +232,7 @@ def _newf(*args): _newf.__is_overload__ = True _newf.__orig_arg__ = argspec(f) if IPython: - _newf.__orig_arg_ipy__ = IPython.core.oinspect.getargspec(f) + _newf.__orig_arg_ipy__ = IPython.core.oinspect.getfullargspec(f) return _newf return _wrap diff --git a/skythought/evals/tasks/taco/pyext2.py b/skythought/evals/tasks/taco/pyext2.py index ff1593da..e741997a 100644 --- a/skythought/evals/tasks/taco/pyext2.py +++ b/skythought/evals/tasks/taco/pyext2.py @@ -108,18 +108,18 @@ def modify_function(f, globals={}, name=None, code=None, defaults=None, newf.__dict__.update(f.__dict__) return newf def argspec(f): - return inspect.getargspec(f) + return inspect.getfullargspec(f) eval(compile('def _exec(m,g): exec m in g', '', 'exec')) def _gettypes(args): return tuple(map(type, args)) -oargspec = inspect.getargspec +oargspec = inspect.getfullargspec def _argspec(func): return __targspec(func, oargspec) -inspect.getargspec = _argspec +inspect.getfullargspec = _argspec try: import IPython @@ -127,10 +127,10 @@ def _argspec(func): IPython = None else: # Replace IPython's argspec - oipyargspec = IPython.core.oinspect.getargspec + oipyargspec = IPython.core.oinspect.getfullargspec def _ipyargspec(func): return __targspec(func, oipyargspec, '__orig_arg_ipy__') - IPython.core.oinspect.getargspec = _ipyargspec + IPython.core.oinspect.getfullargspec = _ipyargspec class overload(object): '''Simple function overloading in Python.''' @@ -177,7 +177,7 @@ def _newf(*args, **kwargs): _newf.__is_overload__ = True _newf.__orig_arg__ = argspec(f) if IPython: - _newf.__orig_arg_ipy__ = IPython.core.oinspect.getargspec(f) + _newf.__orig_arg_ipy__ = IPython.core.oinspect.getfullargspec(f) return _newf return _wrap @classmethod @@ -232,7 +232,7 @@ def _newf(*args): _newf.__is_overload__ = True _newf.__orig_arg__ = argspec(f) if IPython: - _newf.__orig_arg_ipy__ = IPython.core.oinspect.getargspec(f) + _newf.__orig_arg_ipy__ = IPython.core.oinspect.getfullargspec(f) return _newf return _wrap From 4af6618cf3e6b001a4ac8c4365c83690713ae37b Mon Sep 17 00:00:00 2001 From: SumanthRH Date: Mon, 24 Mar 2025 22:50:30 +0000 Subject: [PATCH 2/4] fix Signed-off-by: SumanthRH --- skythought/evals/scoring/utils/pyext2.py | 8 ++++---- skythought/evals/tasks/taco/pyext2.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/skythought/evals/scoring/utils/pyext2.py b/skythought/evals/scoring/utils/pyext2.py index e741997a..5e4935ae 100644 --- a/skythought/evals/scoring/utils/pyext2.py +++ b/skythought/evals/scoring/utils/pyext2.py @@ -127,10 +127,10 @@ def _argspec(func): IPython = None else: # Replace IPython's argspec - oipyargspec = IPython.core.oinspect.getfullargspec + oipyargspec = IPython.core.oinspect.getargspec def _ipyargspec(func): return __targspec(func, oipyargspec, '__orig_arg_ipy__') - IPython.core.oinspect.getfullargspec = _ipyargspec + IPython.core.oinspect.getargspec = _ipyargspec class overload(object): '''Simple function overloading in Python.''' @@ -177,7 +177,7 @@ def _newf(*args, **kwargs): _newf.__is_overload__ = True _newf.__orig_arg__ = argspec(f) if IPython: - _newf.__orig_arg_ipy__ = IPython.core.oinspect.getfullargspec(f) + _newf.__orig_arg_ipy__ = IPython.core.oinspect.getargspec(f) return _newf return _wrap @classmethod @@ -232,7 +232,7 @@ def _newf(*args): _newf.__is_overload__ = True _newf.__orig_arg__ = argspec(f) if IPython: - _newf.__orig_arg_ipy__ = IPython.core.oinspect.getfullargspec(f) + _newf.__orig_arg_ipy__ = IPython.core.oinspect.getargspec(f) return _newf return _wrap diff --git a/skythought/evals/tasks/taco/pyext2.py b/skythought/evals/tasks/taco/pyext2.py index e741997a..5e4935ae 100644 --- a/skythought/evals/tasks/taco/pyext2.py +++ b/skythought/evals/tasks/taco/pyext2.py @@ -127,10 +127,10 @@ def _argspec(func): IPython = None else: # Replace IPython's argspec - oipyargspec = IPython.core.oinspect.getfullargspec + oipyargspec = IPython.core.oinspect.getargspec def _ipyargspec(func): return __targspec(func, oipyargspec, '__orig_arg_ipy__') - IPython.core.oinspect.getfullargspec = _ipyargspec + IPython.core.oinspect.getargspec = _ipyargspec class overload(object): '''Simple function overloading in Python.''' @@ -177,7 +177,7 @@ def _newf(*args, **kwargs): _newf.__is_overload__ = True _newf.__orig_arg__ = argspec(f) if IPython: - _newf.__orig_arg_ipy__ = IPython.core.oinspect.getfullargspec(f) + _newf.__orig_arg_ipy__ = IPython.core.oinspect.getargspec(f) return _newf return _wrap @classmethod @@ -232,7 +232,7 @@ def _newf(*args): _newf.__is_overload__ = True _newf.__orig_arg__ = argspec(f) if IPython: - _newf.__orig_arg_ipy__ = IPython.core.oinspect.getfullargspec(f) + _newf.__orig_arg_ipy__ = IPython.core.oinspect.getargspec(f) return _newf return _wrap From 676610ef2132c3f4408df17eb82b93fd0753d5af Mon Sep 17 00:00:00 2001 From: SumanthRH Date: Mon, 24 Mar 2025 22:55:44 +0000 Subject: [PATCH 3/4] remove unnecessary backslashes Signed-off-by: SumanthRH --- skythought/evals/scoring/utils/pyext2.py | 6 +++--- skythought/evals/tasks/taco/pyext2.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/skythought/evals/scoring/utils/pyext2.py b/skythought/evals/scoring/utils/pyext2.py index 5e4935ae..f7b824aa 100644 --- a/skythought/evals/scoring/utils/pyext2.py +++ b/skythought/evals/scoring/utils/pyext2.py @@ -253,7 +253,7 @@ def from_objects(module_name_for_code_eval, docstring, **d): :param docstring: Optional. The module's docstring. - :param \*\*d: All the keyword args, mapped from name->value. + :param **d: All the keyword args, mapped from name->value. Example: ``RuntimeModule.from_objects('name', 'doc', a=1, b=2)``''' module = types.ModuleType(module_name_for_code_eval, docstring) @@ -387,9 +387,9 @@ def _wrap(f): def fannotate(*args, **kwargs): '''Set function annotations using decorators. - :param \*args: The first positional argument is used for the function's return value; all others are discarded. + :param *args: The first positional argument is used for the function's return value; all others are discarded. - :param \**kwargs: This is a mapping of argument names to annotations. + :param **kwargs: This is a mapping of argument names to annotations. Example:: diff --git a/skythought/evals/tasks/taco/pyext2.py b/skythought/evals/tasks/taco/pyext2.py index 5e4935ae..f7b824aa 100644 --- a/skythought/evals/tasks/taco/pyext2.py +++ b/skythought/evals/tasks/taco/pyext2.py @@ -253,7 +253,7 @@ def from_objects(module_name_for_code_eval, docstring, **d): :param docstring: Optional. The module's docstring. - :param \*\*d: All the keyword args, mapped from name->value. + :param **d: All the keyword args, mapped from name->value. Example: ``RuntimeModule.from_objects('name', 'doc', a=1, b=2)``''' module = types.ModuleType(module_name_for_code_eval, docstring) @@ -387,9 +387,9 @@ def _wrap(f): def fannotate(*args, **kwargs): '''Set function annotations using decorators. - :param \*args: The first positional argument is used for the function's return value; all others are discarded. + :param *args: The first positional argument is used for the function's return value; all others are discarded. - :param \**kwargs: This is a mapping of argument names to annotations. + :param **kwargs: This is a mapping of argument names to annotations. Example:: From bb7e27f0d968780e135f9b022716e97cd59d0dd0 Mon Sep 17 00:00:00 2001 From: SumanthRH Date: Mon, 24 Mar 2025 23:30:26 +0000 Subject: [PATCH 4/4] relax python requirement Signed-off-by: SumanthRH --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 98a3fccc..79ffa294 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ description = "Skythought Evals: Evaluation and Data Generation Tools for Reason authors = [ { name = "NovaSky Team" } ] -requires-python = ">=3.9,<3.11" +requires-python = ">=3.9,<3.13" dependencies = [ "vllm==0.7.0", "word2number",