__init__.py 727 B

12345678910111213141516171819202122232425
  1. from __future__ import annotations
  2. import typing as t
  3. from .serving import run_simple as run_simple
  4. from .test import Client as Client
  5. from .wrappers import Request as Request
  6. from .wrappers import Response as Response
  7. def __getattr__(name: str) -> t.Any:
  8. if name == "__version__":
  9. import importlib.metadata
  10. import warnings
  11. warnings.warn(
  12. "The '__version__' attribute is deprecated and will be removed in"
  13. " Werkzeug 3.1. Use feature detection or"
  14. " 'importlib.metadata.version(\"werkzeug\")' instead.",
  15. DeprecationWarning,
  16. stacklevel=2,
  17. )
  18. return importlib.metadata.version("werkzeug")
  19. raise AttributeError(name)