GrahamDumpleton / wrapt

A Python module for decorators, wrappers and monkey patching.
BSD 2-Clause "Simplified" License
2.04k stars 230 forks source link

Use inspect.Signature instead of inspect.formatargspec #203

Closed grayjk closed 2 years ago

grayjk commented 2 years ago

Closes #196

GrahamDumpleton commented 2 years ago

This needs to either wait until Python 2.7 support is dropped, or be changed to still accomodate that version.

Traceback (most recent call last):
  File "setup.py", line 42, in <module>
    ext_modules=[] if disable_extensions else extensions
  File "/opt/hostedtoolcache/Python/2.7.18/x64/lib/python2.7/site-packages/setuptools/__init__.py", line 162, in setup
    return distutils.core.setup(**attrs)
  File "/opt/hostedtoolcache/Python/2.7.18/x64/lib/python2.7/distutils/core.py", line 124, in setup
    dist.parse_config_files()
  File "/opt/hostedtoolcache/Python/2.7.18/x64/lib/python2.7/site-packages/setuptools/dist.py", line 702, in parse_config_files
    ignore_option_errors=ignore_option_errors)
  File "/opt/hostedtoolcache/Python/2.7.18/x64/lib/python2.7/site-packages/setuptools/config.py", line 121, in parse_configuration
    meta.parse()
  File "/opt/hostedtoolcache/Python/2.7.18/x64/lib/python2.7/site-packages/setuptools/config.py", line 426, in parse
    section_parser_method(section_options)
  File "/opt/hostedtoolcache/Python/2.7.18/x64/lib/python2.7/site-packages/setuptools/config.py", line 399, in parse_section
    self[name] = value
  File "/opt/hostedtoolcache/Python/2.7.18/x64/lib/python2.7/site-packages/setuptools/config.py", line 184, in __setitem__
    value = parser(value)
  File "/opt/hostedtoolcache/Python/2.7.18/x64/lib/python2.7/site-packages/setuptools/config.py", line 515, in _parse_version
    version = self._parse_attr(value, self.package_dir)
  File "/opt/hostedtoolcache/Python/2.7.18/x64/lib/python2.7/site-packages/setuptools/config.py", line 349, in _parse_attr
    module = import_module(module_name)
  File "/opt/hostedtoolcache/Python/2.7.18/x64/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/home/runner/work/wrapt/wrapt/src/wrapt/__init__.py", line 10, in <module>
    from .decorators import (adapter_factory, AdapterFactory, decorator,
  File "/home/runner/work/wrapt/wrapt/src/wrapt/decorators.py", line 34, in <module>
    from inspect import ismethod, isclass, Signature, Parameter
ImportError: cannot import name Signature
grayjk commented 2 years ago

Have you identified a timeline for removing python 2 support? How does that align with a Python 3.11 release in October 2022?

GrahamDumpleton commented 2 years ago

Python 2 support would be dropped when get around to going through:

and try and switch to Python stable API.

Don't know when that may be.

GrahamDumpleton commented 2 years ago

Should have been dealt with by https://github.com/GrahamDumpleton/wrapt/pull/205