__init__.py 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. # SPDX-License-Identifier: MIT
  2. from __future__ import absolute_import, division, print_function
  3. import sys
  4. from functools import partial
  5. from . import converters, exceptions, filters, setters, validators
  6. from ._cmp import cmp_using
  7. from ._config import get_run_validators, set_run_validators
  8. from ._funcs import asdict, assoc, astuple, evolve, has, resolve_types
  9. from ._make import (
  10. NOTHING,
  11. Attribute,
  12. Factory,
  13. attrib,
  14. attrs,
  15. fields,
  16. fields_dict,
  17. make_class,
  18. validate,
  19. )
  20. from ._version_info import VersionInfo
  21. __version__ = "21.4.0"
  22. __version_info__ = VersionInfo._from_version_string(__version__)
  23. __title__ = "attrs"
  24. __description__ = "Classes Without Boilerplate"
  25. __url__ = "https://www.attrs.org/"
  26. __uri__ = __url__
  27. __doc__ = __description__ + " <" + __uri__ + ">"
  28. __author__ = "Hynek Schlawack"
  29. __email__ = "hs@ox.cx"
  30. __license__ = "MIT"
  31. __copyright__ = "Copyright (c) 2015 Hynek Schlawack"
  32. s = attributes = attrs
  33. ib = attr = attrib
  34. dataclass = partial(attrs, auto_attribs=True) # happy Easter ;)
  35. __all__ = [
  36. "Attribute",
  37. "Factory",
  38. "NOTHING",
  39. "asdict",
  40. "assoc",
  41. "astuple",
  42. "attr",
  43. "attrib",
  44. "attributes",
  45. "attrs",
  46. "cmp_using",
  47. "converters",
  48. "evolve",
  49. "exceptions",
  50. "fields",
  51. "fields_dict",
  52. "filters",
  53. "get_run_validators",
  54. "has",
  55. "ib",
  56. "make_class",
  57. "resolve_types",
  58. "s",
  59. "set_run_validators",
  60. "setters",
  61. "validate",
  62. "validators",
  63. ]
  64. if sys.version_info[:2] >= (3, 6):
  65. from ._next_gen import define, field, frozen, mutable # noqa: F401
  66. __all__.extend(("define", "field", "frozen", "mutable"))