__init__.py 690 B

12345678910111213141516171819202122232425
  1. """Contains main apispec classes: `APISpec` and `BasePlugin`"""
  2. import typing
  3. from .core import APISpec
  4. from .plugin import BasePlugin
  5. __all__ = ["APISpec", "BasePlugin"]
  6. def __getattr__(name: str) -> typing.Any:
  7. if name == "__version__":
  8. import importlib.metadata
  9. import warnings
  10. warnings.warn(
  11. "The '__version__' attribute is deprecated and will be removed in"
  12. " in a future version. Use feature detection or"
  13. " 'importlib.metadata.version(\"apispec\")' instead.",
  14. DeprecationWarning,
  15. stacklevel=2,
  16. )
  17. return importlib.metadata.version("apispec")
  18. raise AttributeError(name)