You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

31 line
848 B

  1. __all__ = 'VERSION', 'version_info'
  2. VERSION = '1.9.0'
  3. def version_info() -> str:
  4. import platform
  5. import sys
  6. from importlib import import_module
  7. from pathlib import Path
  8. from .main import compiled
  9. optional_deps = []
  10. for p in ('devtools', 'dotenv', 'email-validator', 'typing-extensions'):
  11. try:
  12. import_module(p.replace('-', '_'))
  13. except ImportError:
  14. continue
  15. optional_deps.append(p)
  16. info = {
  17. 'pydantic version': VERSION,
  18. 'pydantic compiled': compiled,
  19. 'install path': Path(__file__).resolve().parent,
  20. 'python version': sys.version,
  21. 'platform': platform.platform(),
  22. 'optional deps. installed': optional_deps,
  23. }
  24. return '\n'.join('{:>30} {}'.format(k + ':', str(v).replace('\n', ' ')) for k, v in info.items())