Skip to content

Commit 10081a6

Browse files
authored
[Evals] Replace 'getargspec with getfullargspec` to support python 3.12 (#102)
Adds compatibility for python 3.12
1 parent 3612afa commit 10081a6

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description = "Skythought Evals: Evaluation and Data Generation Tools for Reason
55
authors = [
66
{ name = "NovaSky Team" }
77
]
8-
requires-python = ">=3.9,<3.11"
8+
requires-python = ">=3.9,<3.13"
99
dependencies = [
1010
"vllm==0.7.0",
1111
"word2number",

skythought/evals/scoring/utils/pyext2.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,18 +108,18 @@ def modify_function(f, globals={}, name=None, code=None, defaults=None,
108108
newf.__dict__.update(f.__dict__)
109109
return newf
110110
def argspec(f):
111-
return inspect.getargspec(f)
111+
return inspect.getfullargspec(f)
112112
eval(compile('def _exec(m,g): exec m in g', '<exec>', 'exec'))
113113

114114
def _gettypes(args):
115115
return tuple(map(type, args))
116116

117-
oargspec = inspect.getargspec
117+
oargspec = inspect.getfullargspec
118118

119119
def _argspec(func):
120120
return __targspec(func, oargspec)
121121

122-
inspect.getargspec = _argspec
122+
inspect.getfullargspec = _argspec
123123

124124
try:
125125
import IPython
@@ -253,7 +253,7 @@ def from_objects(module_name_for_code_eval, docstring, **d):
253253
254254
:param docstring: Optional. The module's docstring.
255255
256-
:param \*\*d: All the keyword args, mapped from name->value.
256+
:param **d: All the keyword args, mapped from name->value.
257257
258258
Example: ``RuntimeModule.from_objects('name', 'doc', a=1, b=2)``'''
259259
module = types.ModuleType(module_name_for_code_eval, docstring)
@@ -387,9 +387,9 @@ def _wrap(f):
387387
def fannotate(*args, **kwargs):
388388
'''Set function annotations using decorators.
389389
390-
:param \*args: The first positional argument is used for the function's return value; all others are discarded.
390+
:param *args: The first positional argument is used for the function's return value; all others are discarded.
391391
392-
:param \**kwargs: This is a mapping of argument names to annotations.
392+
:param **kwargs: This is a mapping of argument names to annotations.
393393
394394
Example::
395395

skythought/evals/tasks/taco/pyext2.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,18 +108,18 @@ def modify_function(f, globals={}, name=None, code=None, defaults=None,
108108
newf.__dict__.update(f.__dict__)
109109
return newf
110110
def argspec(f):
111-
return inspect.getargspec(f)
111+
return inspect.getfullargspec(f)
112112
eval(compile('def _exec(m,g): exec m in g', '<exec>', 'exec'))
113113

114114
def _gettypes(args):
115115
return tuple(map(type, args))
116116

117-
oargspec = inspect.getargspec
117+
oargspec = inspect.getfullargspec
118118

119119
def _argspec(func):
120120
return __targspec(func, oargspec)
121121

122-
inspect.getargspec = _argspec
122+
inspect.getfullargspec = _argspec
123123

124124
try:
125125
import IPython
@@ -253,7 +253,7 @@ def from_objects(module_name_for_code_eval, docstring, **d):
253253
254254
:param docstring: Optional. The module's docstring.
255255
256-
:param \*\*d: All the keyword args, mapped from name->value.
256+
:param **d: All the keyword args, mapped from name->value.
257257
258258
Example: ``RuntimeModule.from_objects('name', 'doc', a=1, b=2)``'''
259259
module = types.ModuleType(module_name_for_code_eval, docstring)
@@ -387,9 +387,9 @@ def _wrap(f):
387387
def fannotate(*args, **kwargs):
388388
'''Set function annotations using decorators.
389389
390-
:param \*args: The first positional argument is used for the function's return value; all others are discarded.
390+
:param *args: The first positional argument is used for the function's return value; all others are discarded.
391391
392-
:param \**kwargs: This is a mapping of argument names to annotations.
392+
:param **kwargs: This is a mapping of argument names to annotations.
393393
394394
Example::
395395

0 commit comments

Comments
 (0)