Commit Graph

34 Commits (1e0788aeea2c331b30a6f56ec57600bc4f045b14)

Author SHA1 Message Date
Joakim Sørensen a94579107c
Bump awesomeversion from 22.5.2 to 22.6.0 () 2022-06-27 11:38:40 +02:00
J. Nick Koston 8b067e83f7
Initial orjson support take 3 ()
* Initial orjson support take 2

Still need to work out problem building wheels

--

Redux of  /  Now possible since the following is solved:
 (comment)

This implements orjson where we use our default encoder.  This does not implement orjson where `ExtendedJSONEncoder` is used as these areas tend to be called far less frequently.  If its desired, this could be done in a followup, but it seemed like a case of diminishing returns (except maybe for large diagnostics files, or traces, but those are not expected to be downloaded frequently).

Areas where this makes a perceptible difference:
- Anything that subscribes to entities (Initial subscribe_entities payload)
- Initial download of registries on first connection / restore
- History queries
- Saving states to the database
- Large logbook queries
- Anything that subscribes to events (appdaemon)

Cavets:
orjson supports serializing dataclasses natively (and much faster) which
eliminates the need to implement `as_dict` in many places
when the data is already in a dataclass. This works
well as long as all the data in the dataclass can also
be serialized. I audited all places where we have an `as_dict`
for a dataclass and found only backups needs to be adjusted (support for `Path` needed to be added for backups).  I was a little bit worried about `SensorExtraStoredData` with `Decimal` but it all seems to work out from since it converts it before it gets to the json encoding cc @dgomes

If it turns out to be a problem we can disable this
with option |= [orjson.OPT_PASSTHROUGH_DATACLASS](https://github.com/ijl/orjson#opt_passthrough_dataclass) and it
will fallback to `as_dict`

Its quite impressive for history queries
<img width="1271" alt="Screen_Shot_2022-05-30_at_23_46_30" src="https://user-images.githubusercontent.com/663432/171145699-661ad9db-d91d-4b2d-9c1a-9d7866c03a73.png">

* use for views as well

* handle UnicodeEncodeError

* tweak

* DRY

* DRY

* not needed

* fix tests

* Update tests/components/http/test_view.py

* Update tests/components/http/test_view.py

* black

* templates
2022-06-22 21:59:51 +02:00
Franck Nijhof 99db2a5afe
Update requests to 2.28.0 ()
* Update requests to 2.28.0

* Fix mypy warning

* Fix Facebook messenger tests
2022-06-14 12:21:32 +02:00
Marc Mueller 983a76a91c
Update pylint to 2.14.0 () 2022-06-06 21:43:47 +02:00
J. Nick Koston c365454afb
Revert "Initial orjson support ()" ()
This was causing the wheels to fail to build. We need
to workout why when we don't have release pressure

This reverts commit d9d22a9556.
2022-05-31 13:51:55 -07:00
J. Nick Koston d9d22a9556
Initial orjson support () 2022-05-31 12:18:11 -07:00
Joakim Sørensen 9fe4aef4bc
Bump awesomeversion from 22.5.1 to 22.5.2 () 2022-05-27 14:37:19 -07:00
uvjustin 01b5f98414
Bump httpx to 0.23.0 ()
Co-authored-by: J. Nick Koston <nick@koston.org>
2022-05-26 21:20:37 -10:00
Marc Mueller 1ac71455cb
Move remaining metadata to pyproject () 2022-05-26 02:54:49 +02:00
Marc Mueller d0008683be
Use new project metadata format [PEP 621] () 2022-05-24 19:01:27 -07:00
Marc Mueller 9b9b553521
Disable no-self-use [pylint] ()
* Disable no-self-use

* Remove disable comments
2022-04-25 07:41:01 -07:00
Marc Mueller 90dab235f7
Update pylint to 2.13.7 ()
* Update pylint to 2.13.7

* Spelling

* Remove old pylint config value

* Code updates
2022-04-21 13:02:52 -07:00
Erik Montnemery 821908ca45
Include threadname and time in pytest logs ()
* Include threadname and time in pytest logs

* Add failing test

* Include the name of the logger

* Revert "Add failing test"

This reverts commit 5dbc137572.
2022-04-05 10:10:16 +02:00
Marc Mueller 53245c6523
Update pylint to 2.13.0 () 2022-03-25 15:14:48 -07:00
Ville Skyttä 0673e96401
Update black target version to 3.9+ () 2022-01-30 20:15:50 -08:00
Marc Mueller be5ff87171
Rewrite pylint init-hook () 2022-01-29 23:47:40 +01:00
Marc Mueller 783e26e8e4
Use isolated build environments () 2022-01-28 14:09:05 -08:00
epenet 11fa86cc83
Add pylint plugin to enforce type hints ()
Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-01-24 13:38:56 +01:00
Marc Mueller 2d2944d186
Enable `deprecated-typing-alias` check [pylint] () 2022-01-12 13:53:34 +01:00
Marc Mueller f3bc9fc740
Update Python version used for pylint () 2022-01-11 13:41:57 +01:00
Marc Mueller 25f8d4a189
Upgrade pylint to 2.12.1 () 2021-11-26 00:13:27 +01:00
Marc Mueller 48bada5a18
Update pylint to 2.11.1 () 2021-09-18 13:52:59 +02:00
Marc Mueller f6b162bc39
Add pylint CodeStyle extension () 2021-07-19 06:57:06 -07:00
Marc Mueller b5cec353cc
Fix pylint issue with stream component c-extension ()
* Rename 'extension-pkg-whitelist' setting to 'extension-pkg-allow-list'
* Add 'av.stream' and 'av.audio.stream'
* Replace 'Any' type hint
2021-07-10 22:58:37 +02:00
Ruslan Sayfutdinov 016abda12e
Pylint plugin to check that relative imports are used ()
* Pylint plugin to check that relative imports are used

* Fix existing sites

* Update description message

* Fix typo
2021-05-22 09:15:30 +01:00
Ruslan Sayfutdinov 0e7409e617
Pylint plugin to check __init__ return type ()
* Pylint plugin to check __init__ return type

* Support *args add **kwargs, type hints

* Use 'in' instead of 'any()'

* Fix last few places
2021-05-20 18:00:10 +01:00
Marc Mueller f1d48ddfe3
Update pylint to 2.8.0 () 2021-04-24 14:39:24 -10:00
Marc Mueller 2956eb0902
Update pylint to 2.7.3 ()
* Update pylint to 2.7.3

* Add class-const-naming-style

* Remove unused-import message

* Additional cleanup
2021-03-29 18:02:56 -10:00
J. Nick Koston c820dd4cb5
Have pylint warn when user visible log messages do not start with capital letter or end with a period ()
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-03-19 09:26:36 -05:00
Franck Nijhof a2b13785c2
Restore pylint concurrency () 2021-03-01 13:40:46 +01:00
Ville Skyttä 43474762b2
Drop remaining Python < 3.8 support ()
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-01-04 11:47:29 +01:00
Ville Skyttä 0444f3de14
Move isort, pylint, and pytest configs to pyproject.toml () 2020-10-06 11:26:48 +02:00
Ville Skyttä 445fd15f76 Drop Python 3.6 support () 2019-12-16 07:29:19 +01:00
Paulus Schoutsen da05dfe708 Add Black 2019-07-31 12:23:23 -07:00