Commit Graph
92 Commits
Author SHA1 Message Date
epenetandGitHub 7169d52010 Remove import annotations from core (#169547) 2026-04-30 20:34:43 +02:00
Erik MontnemeryandGitHub 5bc2e271d2 Re-raise annotated_yaml.YAMLException as HomeAssistantError (#147129)
* Re-raise annotated_yaml.YAMLException as HomeAssistantError

* Fix comment
2025-06-19 12:52:01 +02:00
f4fe234279 Bump annotatedyaml to 0.4.4 (#140861)
* Bump annotatedyaml to 0.4.2

changelog: https://github.com/home-assistant-libs/annotatedyaml/compare/v0.2.0...v0.4.2

~10-11% performance improvement

* tweak imports

* bump to .3 to make pylint happy

* bump again for fixes

---------

Co-authored-by: Shay Levy <[email protected]>
2025-03-18 22:26:23 -10:00
Jan-Philipp BeneckeandGitHub 7b9ea63f17 Split out yaml loading into own package (#140683)
* Split out yaml loading into library

* Code review

* Code review

* Fix check config script
2025-03-15 22:26:18 -04:00
Ville SkyttäandGitHub 40eb8b91cc Adjust to recommended propcache.api import paths (#136150) 2025-01-21 10:58:22 +01:00
Joost LekkerkerkerandGitHub 9f7a38f189 Enable RUF022 (#135767) 2025-01-16 13:48:24 +01:00
epenetandGitHub 313309a7e0 Remove deprecated YAML loaders (#130364) 2024-11-11 20:24:51 +01:00
J. Nick KostonandGitHub 0f29fd3e10 Switch to using fast cached_property implementation in propcache (#127339) 2024-10-03 13:11:02 -05:00
Erik MontnemeryandGitHub a4e9e4b23b Tweak exception message in yaml loader (#124841) 2024-08-29 11:31:19 +02:00
Erik MontnemeryandGitHub 404a7bab18 Wrap OSError in loader.load_yaml (#124406) 2024-08-22 09:06:41 -05:00
Erik MontnemeryandGitHub ab6d0e3277 Handle !include without arguments in configuration.yaml (#124399)
* Prevent !include without arguments in configuration.yaml from crashing core

* Add test
2024-08-22 12:08:24 +02:00
0e52d149e4 Update voluptuous to 0.15.2 (#120631)
* Update voluptuous to 0.15.1

* Fix typing issues

* Add type ignores for json result type

* Update voluptuous to 0.15.2

---------

Co-authored-by: J. Nick Koston <[email protected]>
2024-07-02 12:57:09 -07:00
Marc MuellerandGitHub 87bb7ced79 Use PEP 695 for simple type aliases (#117633) 2024-05-17 14:42:21 +02:00
6d7345ea1c Speed up loading YAML (#117388)
Co-authored-by: Dave T <[email protected]>
2024-05-14 13:56:42 +02:00
SidandGitHub 3799d20d43 Enable Ruff B905 (#114197) 2024-04-14 00:14:26 -05:00
025c6f5e2e Add __slots__ to NodeClass classes (#115079)
Co-authored-by: J. Nick Koston <[email protected]>
2024-04-08 08:44:18 -10:00
8e98ba7312 Add first batch of Ruff PYI rules (#115100)
Co-authored-by: Jan Bouwhuis <[email protected]>
2024-04-07 11:30:50 -10:00
Marc MuellerandGitHub 816ce116bf Remove unnecessary functools.cached_property backport (#114239) 2024-04-04 11:24:26 +02:00
6bb4e7d62c Bump ruff to 0.3.4 (#112690)
Co-authored-by: Sid <[email protected]>
Co-authored-by: Marc Mueller <[email protected]>
Co-authored-by: J. Nick Koston <[email protected]>
2024-03-26 00:02:16 +01:00
SidandGitHub 6ee273a548 Clean up unneeded ruff noqa directives (#113616) 2024-03-16 09:48:37 -10:00
Marc MuellerandGitHub aa16a9d707 Add empty line after module docstring (3) (#112750) 2024-03-08 20:38:34 +01:00
Marc MuellerandGitHub 19ab3d6daf Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
5d421e249f YAML loader performance improvements (#111199)
* YAML loader performance improvements

- Cache the name of the loader since we call it multiple
  times for every line

- Add a fast path for scalar tags since they are the
  most common

* Update homeassistant/util/yaml/loader.py

Co-authored-by: Joost Lekkerkerker <[email protected]>

* remove unreachable code

---------

Co-authored-by: Joost Lekkerkerker <[email protected]>
2024-02-23 13:37:09 -05:00
1cb5bbf865 Fix empty files included by !include_dir_named (#108489)
Co-authored-by: Joost Lekkerkerker <[email protected]>
2024-01-20 15:12:32 +01:00
Marc MuellerandGitHub afcb7a26cd Enable strict typing for config (#108023) 2024-01-18 09:20:19 +01:00
Pedro LamasandGitHub 6cab4486f7 Fix loading empty yaml files with include_dir_named (#107853) 2024-01-16 10:23:04 +01:00
Marc MuellerandGitHub 43fa51b696 Enable strict typing for blueprint (#106887) 2024-01-02 20:48:51 +01:00
Erik MontnemeryandGitHub 5b55c7da5f Remove logic converting empty or falsy YAML to empty dict (#103912)
* Correct logic converting empty YAML to empty dict

* Modify according to github comments

* Add load_yaml_dict helper

* Update check_config script

* Update tests
2023-12-05 18:08:11 +01:00
Erik MontnemeryandGitHub 5b59e043fa Don't use deprecated_class decorator on deprecated YAML classes (#105063) 2023-12-05 11:36:26 +01:00
Erik MontnemeryandGitHub ae002e2f38 Remove breaks_in_ha_version from deprecated YAML classes (#105062) 2023-12-05 10:48:31 +01:00
Erik MontnemeryandGitHub db51a8e1f7 Allow passing breaks_in_ha_version to deprecation helper decorators (#104985) 2023-12-04 11:52:10 +01:00
Erik MontnemeryandGitHub 00e57ab9a4 Use deprecated_class decorator in deprecated YAML loader classes (#104835) 2023-11-30 22:43:34 +01:00
Erik MontnemeryandGitHub abc05451a2 Restore renamed yaml loader classes and warn when used (#104818) 2023-11-30 18:14:48 +01:00
Erik MontnemeryandGitHub 12902b8a68 Add NodeStrClass.__voluptuous_compile__ (#104808) 2023-11-30 17:45:27 +01:00
706add4a57 Switch formatting from black to ruff-format (#102893)
Co-authored-by: Franck Nijhof <[email protected]>
2023-11-27 14:38:59 +01:00
Erik MontnemeryandGitHub 88698d8dfe Fix docstring in yaml util (#104240) 2023-11-20 11:34:14 +01:00
Erik MontnemeryandGitHub f89194784d Fix including yaml files with scalar values (#103914) 2023-11-13 15:23:50 +01:00
Erik MontnemeryandGitHub e49f6b41ee Rename YAML loader classes (#103609) 2023-11-08 00:26:54 +01:00
Erik MontnemeryandGitHub c29b0cd05b Correct line numbers in yaml node annotations (#103605) 2023-11-07 23:22:23 +01:00
Erik MontnemeryandGitHub 05deae09fc Add file and line annotation to strings when loading yaml (#103586) 2023-11-07 17:10:15 +01:00
Marc MuellerandGitHub 11e8bf0b9c Update types packages (#100850) 2023-09-25 18:53:22 +02:00
Ville SkyttäandGitHub 6399d74c15 Remove unnnecessary pylint configs from core (#98704) 2023-08-22 23:12:12 +02:00
rlippmannandGitHub 3a72054f93 Make dataclasses in HA core slotted (#91208) 2023-04-11 07:58:28 -10:00
Paulus SchoutsenandGitHub 3f32c5d2ad Yaml use dict (#88977)
* Use built-in dict instead of OrderedDict

* Use dict instead of OrderedDict in YAML
2023-03-01 12:29:57 -05:00
Marc MuellerandGitHub 8abce25948 Update Union typing (4) [Py310] (#86427) 2023-01-23 09:04:40 +01:00
Franck NijhofandGitHub 7adb8d5ddc Code styling tweaks to core utils & YAML loader (#85433)
Code styling tweaks to core utils
2023-01-08 22:01:55 -08:00
d4f69a3652 String formatting and max line length - Part 7 (#84532)
Co-authored-by: Martin Hjelmare <[email protected]>
2022-12-27 11:18:56 +01:00
Marc MuellerandGitHub 19acbf0d2a Update types packages (#84381) 2022-12-21 19:15:55 +01:00
Marc MuellerandGitHub 0c8eeaa643 Update mypy to 0.990 (#81783)
* Update mypy to 0.990

* Remove type ignore - overriding attr with property (13475)

* Remove type ignores - hasattr (13544)

* Adjust type ignore - assignment (13549)

* New error code - type-abstract (13785)

* Disable annotation-unchecked (13851)
2022-11-08 14:41:39 +01:00
48e82ff62f Fix failure to raise on bad YAML syntax from include files (#75510)
Co-authored-by: Franck Nijhof <[email protected]>
2022-07-20 19:25:17 +02:00