Add constraints to attr_utils.

Constraints will provide the ability to provide deeper and more flexible
type-checking of fields on classes defined using attrs. It will no
longer be necessary to specify a specific sequence or mapping type when
they appear as the member type of a sequence or the key or value type of
a mapping: sequence or mapping can be used as appropriate. The
constraints can also be combined and nested, so for example one could
enforce the keys and values of mappings that appear in a sequence have
certain types.

Change-Id: I628b9701f2051b12efb1a1b67a0aece8eeda08a6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/build/+/2792049
Commit-Queue: Garrett Beaty <gbeaty@chromium.org>
Auto-Submit: Garrett Beaty <gbeaty@chromium.org>
Reviewed-by: Stephen Martinis <martiniss@chromium.org>
2 files changed
tree: 71316b29fbb262768a3ec69493fa412f1e4b1e38
  1. infra/
  2. recipes/
  3. scripts/
  4. site_config/
  5. .gitattributes
  6. .gitignore
  7. .style.yapf
  8. .vpython
  9. .yapfignore
  10. codereview.settings
  11. CROS_OWNERS
  12. DEPS
  13. environment.cfg.py
  14. LICENSE
  15. OWNERS
  16. PRESUBMIT.py
  17. README.md
  18. WATCHLISTS
README.md

Recipes

If you're here to make a change to ‘recipes’ (the code located in scripts/slave/recipes*), please take a look at the README for more information pertaining to recipes.

Style

The preferred style is PEP8 with two-space indent; that is, the Chromium Python style. Functions use lowercase_with_underscores, with the exception of the special functions RunSteps and RunTests in recipes. Use yapf (git cl format --no-clang-format) to autoformat new code.