Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Python 3.11 #2377

Open
kbr-scylla opened this issue Dec 8, 2022 · 5 comments
Open

Support for Python 3.11 #2377

kbr-scylla opened this issue Dec 8, 2022 · 5 comments

Comments

@kbr-scylla
Copy link

Importing the github module gives an error; the error comes from deprecated -> wrapt, which uses inspect.formatargspec, which was deprecated since Python 3.5 and removed in Python 3.11.

    import github
env/lib64/python3.11/site-packages/github/__init__.py:56: in <module>
    from github.MainClass import Github, GithubIntegration
env/lib64/python3.11/site-packages/github/MainClass.py:59: in <module>
    import github.Event
env/lib64/python3.11/site-packages/github/Event.py:32: in <module>
    import github.NamedUser
env/lib64/python3.11/site-packages/github/NamedUser.py:44: in <module>
    import github.Organization
env/lib64/python3.11/site-packages/github/Organization.py:50: in <module>
    import github.Repository
env/lib64/python3.11/site-packages/github/Repository.py:93: in <module>
    from deprecated import deprecated
env/lib64/python3.11/site-packages/deprecated/__init__.py:15: in <module>
    from deprecated.classic import deprecated
env/lib64/python3.11/site-packages/deprecated/classic.py:15: in <module>
    import wrapt
env/lib64/python3.11/site-packages/wrapt/__init__.py:10: in <module>
    from .decorators import (adapter_factory, AdapterFactory, decorator,
env/lib64/python3.11/site-packages/wrapt/decorators.py:34: in <module>
    from inspect import ismethod, isclass, formatargspec
E   ImportError: cannot import name 'formatargspec' from 'inspect' (/usr/lib64/python3.11/inspect.py)
@kbr-scylla
Copy link
Author

There is an open PR in the deprecated library for 3.11 support:
tantale/deprecated#58

I guess that is a blocker.

@hugovk
Copy link
Contributor

hugovk commented Jan 15, 2023

tantale/deprecated#58 isn't a blocker: it doesn't make any code changes for 3.11 other than adding a Trove classifier to advertise support. The other changes are to test 3.11.

However, as you note, Deprecated depends on wrapt, which added support for Python 3.11 in wrapt 1.14.0: https://wrapt.readthedocs.io/en/latest/changes.html#version-1-14-0

So Deprecated should really require wrapt >= 1.14.0 for Python 3.11. I'll update that PR.

In the meantime you can manually update wrapt:

python -m pip install "wrapt>=1.14.0"

In any case, this is a Deprecated issue rather than a PyGithub one.

@hugovk
Copy link
Contributor

hugovk commented Jan 15, 2023

So Deprecated should really require wrapt >= 1.14.0 for Python 3.11. I'll update that PR.

Good news, this is already done in a newer PR which includes mine: tantale/deprecated#59

@kbr-scylla
Copy link
Author

Great, thanks.

@EnricoMi
Copy link
Collaborator

Looks like Python 3.11 support has been released: #2332

I think this can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants