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

distutils package is depricated in python 3.10 #250

Open
SerGeRybakov opened this issue Dec 8, 2021 · 4 comments
Open

distutils package is depricated in python 3.10 #250

SerGeRybakov opened this issue Dec 8, 2021 · 4 comments
Labels

Comments

@SerGeRybakov
Copy link

Hi there!

First of all many thanks for such awesome framework!

Just installed python 3.10.1 and Sanic updated to 21.9.3 in my project. The very first run of pytest was broken by deprication warning "The distutils package is deprecated and slated for removal in Python 3.12."

Full trace is

ImportError while loading conftest '/home/serge/my_api/tests/conftest.py'.
tests/conftest.py:13: in <module>
    from app.api_server import create_app
app/api_server.py:7: in <module>
    from sanic_openapi.openapi2 import openapi2_blueprint
venv3101/lib/python3.10/site-packages/sanic_openapi/__init__.py:1: in <module>
    from .openapi2 import doc, openapi2_blueprint
venv3101/lib/python3.10/site-packages/sanic_openapi/openapi2/__init__.py:1: in <module>
    from .blueprint import blueprint_factory
venv3101/lib/python3.10/site-packages/sanic_openapi/openapi2/blueprint.py:2: in <module>
    from distutils.version import LooseVersion
../../.asdf/installs/python/3.10.1/lib/python3.10/distutils/__init__.py:19: in <module>
    warnings.warn(_DEPRECATION_MESSAGE,
E   DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives

So for now I can not use Sanic-openapi (21.6.1) with python 3.10, what makes my really sad.
Can it be updated asap?

@ahopkins
Copy link
Member

ahopkins commented Dec 8, 2021

Thanks for the feedback. Happy to accept a PR if you'd like to take a crack at it.

This is the way we generally are handling version checking: https://github.com/sanic-org/sanic-ext/blob/main/sanic_ext/bootstrap.py#L45

Which brings me to my next point, have you seen Sanic Extensions yet? It is meant as the replacement for this lib, which will no longer receive feature support. It is largely a 1:1 upgrade once you change some imports around. In your case, it might be a little more work since I see you are still using OAS2 and not OAS3. Sanic Extensions only has support for OAS3.

@SerGeRybakov
Copy link
Author

@ahopkins Thanks a lot for pointing Extensions. Haven't used them yet. My docs in OAS2 cause I followed your documentation where it was undelined that OAS3 is experimental. For now I'll try it. Thanks a lot once again.

@ahopkins
Copy link
Member

ahopkins commented Dec 8, 2021

undelined that OAS3 is experimental

Hmm... we should remove that. Thanks for pointing that out.

@stale
Copy link

stale bot commented Apr 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is incorrect, please respond with an update. Thank you for your contributions.

@stale stale bot added the stale label Apr 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants