ganga-devs / ganga

Ganga is an easy-to-use frontend for job definition and management
GNU General Public License v3.0
97 stars 159 forks source link

Fix SyntaxError: invalid syntax in doc/fill_gpi.py #2341

Closed aryabhatta-dey closed 3 months ago

aryabhatta-dey commented 3 months ago

Building the documentation currently fails on the latest develop branch with the following error:

Traceback (most recent call last):
  File "/home/arya/Dev/ganga/doc/fill_gpi.py", line 143, in <module>
    print('    .. method:: {signature}'.format(signature=signature(f)), file=cf)
                                                         ^^^^^^^^^^^^
  File "/home/arya/Dev/ganga/doc/fill_gpi.py", line 69, in signature
    args, varargs, varkw, defaults = inspect.getargspec(func)
                                     ^^^^^^^^^^^^^^^^^^
AttributeError: module 'inspect' has no attribute 'getargspec'. Did you mean: 'getargs'?

This error is due to the getargspec method being deprecated and replaced by getfullargspec, as mentioned here.

Replacing inspect.getargspec with inspect.getfullargspec solves the error.

I have tested the change on Python 3.7.17 (the oldest version that satisfies the dependencies) and on Python 3.12.3. In both the versions running:

cd doc
make html

executes successfully and generates the build as expected.