Skip to content

using deprecated stuff #138

Description

@AlgoApi

just import aiohttp-apispec and have installed marshmallow>=3.26.1 to get this error:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
    import aiohttp_apispec;
    ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/algoapi/MyProjects/sber/my/PEERS/RentalDisk-API/.venv/lib/python3.14/site-packages/aiohttp_apispec/__init__.py", line 1, in <module>
    from .aiohttp_apispec import AiohttpApiSpec, setup_aiohttp_apispec
  File "/home/algoapi/MyProjects/sber/my/PEERS/RentalDisk-API/.venv/lib/python3.14/site-packages/aiohttp_apispec/aiohttp_apispec.py", line 10, in <module>
    from apispec.ext.marshmallow import MarshmallowPlugin, common
  File "/home/algoapi/MyProjects/sber/my/PEERS/RentalDisk-API/.venv/lib/python3.14/site-packages/apispec/ext/marshmallow/__init__.py", line 75, in <module>
    from .openapi import OpenAPIConverter
  File "/home/algoapi/MyProjects/sber/my/PEERS/RentalDisk-API/.venv/lib/python3.14/site-packages/apispec/ext/marshmallow/openapi.py", line 16, in <module>
    from .field_converter import FieldConverterMixin
  File "/home/algoapi/MyProjects/sber/my/PEERS/RentalDisk-API/.venv/lib/python3.14/site-packages/apispec/ext/marshmallow/field_converter.py", line 21, in <module>
    [int(part) for part in marshmallow.__version__.split(".") if part.isdigit()]
                           ^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'marshmallow' has no attribute '__version__'

The solution would be to install marshmallow version 3.26.1, but I'd like to fix that.

marshmallow on this version when using marshmallow.__version__ announces the imminent removal of this:

DeprecationWarning: The 'version' attribute is deprecated and will be removed in in a future version. Use feature detection or 'importlib.metadata.version("marshmallow")' instead.
3.26.1

From this we conclude that it is necessary to change the range of package versions from apispec<4.0,>=3.0.0 to one where there is no error in apispec with the new marshmallow version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions