marshmallow-code / apispec

A pluggable API specification generator. Currently supports the OpenAPI Specification (f.k.a. the Swagger specification)..

Home Page:https://apispec.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Version classes are deprecated in setuputils > 59.5.0

christophert opened this issue · comments

It looks like the version classes used in apispec.utils were deprecated with setuptools since 59.5.: pypa/setuptools@1701579 from source change: pypa/distutils#75

.tox/py37/lib/python3.7/site-packages/apispec/__init__.py:3: in <module>
    from .core import APISpec
.tox/py37/lib/python3.7/site-packages/apispec/core.py:13: in <module>
    from .utils import OpenAPIVersion, deepupdate, COMPONENT_SUBSECTIONS, build_reference
.tox/py37/lib/python3.7/site-packages/apispec/utils.py:76: in <module>
    class OpenAPIVersion(version.LooseVersion):
.tox/py37/lib/python3.7/site-packages/apispec/utils.py:94: in OpenAPIVersion
    MIN_INCLUSIVE_VERSION = version.LooseVersion("2.0")
.tox/py37/lib/python3.7/site-packages/setuptools/_distutils/version.py:57: in __init__
    stacklevel=2,
E   DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.

Can apispec.utils be migrated to packaging.version with little disruption?

Technically, the fix is a breaking change. We can do it in next major.

No rush because it is currently just a deprecation warning.

It is in the TODO list but no issue was created. Thanks for the heads up.