Commit graph

3982 commits

Author SHA1 Message Date
53bdcb9604
A major rewrite of the inspect plugin.
- The `inspect` plugin and the Sphinx inspection extensions now use the
  same underlying logic.

- Moved all the common inspection logic under
  `platypush.common.reflection`.

- Faster scanning of the available integrations and components through a
  pool of threads.

- Added `doc_url` parameters.

- Migrated events and responses metadata scanning logic.

- Now expanding some custom Sphinx tag instead of returning errors when
  running outside of the Sphinx context - it includes `:class:`,
  `:meth:` and `.. schema::`.
2023-10-09 01:33:45 +02:00
9acd71944c
Skip numpy types serialization errors on Message.Encoder. 2023-10-09 01:33:45 +02:00
e5a5ac5ffb
Added doc_url parameter to integration metadata. 2023-10-09 01:33:45 +02:00
d872835093
New API to check if a table class exists before defining it.
- Check if it's part of the metadata through a function call rather than
  checking `Base.metadata` in every single module.

- Make it possible to override them (mostly for doc generation logic
  that needs to be able to import those classes).

- Make it possible to extend them.
2023-10-09 01:33:44 +02:00
608844ca0c
[WIP] Large refactor of the inspection plugin and models. 2023-10-09 01:33:44 +02:00
841643f3ff
Added cachedir to configuration. 2023-10-09 01:33:44 +02:00
40557f5d5d
Replaced one more occurrence of <type> | None syntax. 2023-10-09 01:33:44 +02:00
4da3c13976
First WIP commit for the new Integrations panel. 2023-10-09 01:33:44 +02:00
4d52fd35b9
Skip None responses in the RSS plugin. 2023-10-04 22:08:11 +02:00
40d3ad1150
Removed <type> | None type hints.
They break on Python < 3.10.
2023-10-03 01:15:13 +02:00
fd7037d048
Added git checkout and rebase commands to sync-stable-branch step. 2023-10-01 23:31:46 +02:00
ae66e9c205 Merge pull request '[#317] Added Drone step to sync the stable branch on tag' (#332) from 317-ci-cd-automation-for-stable-branch into master
Reviewed-on: platypush/platypush#332
2023-10-01 23:19:22 +02:00
98b51362e9
[#317] Added Drone step to sync the stable branch on tag.
Closes: #317
2023-10-01 23:17:53 +02:00
3086dd86fc
LINT+Black+stability fixes for some plugins that hadn't been touched in a while.
- media.mplayer
- media.omxplayer
- media.vlc
- music.mpd
- music.snapcast
2023-10-01 22:55:06 +02:00
2aefc4e5c8
Several improvements for the Google integrations.
1. Improved documentation. Every plugin now reports the exact steps to
   get the integration up and running with the right API scopes.

2. All Google plugins now have a standard process to get (and reuse) the
   client secret. Except for PubSub, Translate and Maps (which have
   their own flows), all the Google plugins now read the client secrets
   from `<WORKDIR>/credentials/google/client_secret.json` by default.

3. Black/LINT for some of those plugins, which hadn't been touched in a
   while.

4. The interface to pass API scopes is now leaner. It's now possible to
   pass a scope directly as e.g. `calendar.readonly` rather than
   `https://www.googleapis.com/auth/calendar.readonly`.

5. Improved the logic to retrieve the right scope tokens file. If e.g.
   an integration requires the role `A`, and a credentials file exists
   for the roles `A` and `B`, then this file will be used rather than
   prompting the user to authenticate again.
2023-10-01 15:37:20 +02:00
5ca3757834
A more readable configuration for the calendar plugin.
The old type configuration
(`platypush.plugins.calendar.name.CalendarNamePlugin`) is a bit clunky.

Instead, since the type will always be a plugin, we should encourage
the use of `calendar.name` directly to identify the type.
2023-10-01 01:09:15 +02:00
966a6ce29e
httplib2 should be an explicit dependency for Google integrations.
Plus, some misc LINT/Black chores.
2023-10-01 00:52:59 +02:00
a7bb81553c
Regex fix. 2023-09-30 15:11:09 +02:00
9e489bb5cf
Propagate the default/required properties of a parameter upon merge. 2023-09-30 14:57:11 +02:00
1732bfa82c
Fixed _default_docstring regex. 2023-09-30 14:36:08 +02:00
532f5479b3
Added full YAML example for chat.irc configuration. 2023-09-30 14:34:54 +02:00
ecffbf29bf
Skip vararg/varkw parameters from the config snippet. 2023-09-30 13:53:33 +02:00
acb40bd5fd
The test step should also install all dependencies via apk add. 2023-09-30 13:36:28 +02:00
4f5ccda353
Better documentation for the calendar plugin. 2023-09-30 13:31:41 +02:00
7bd721e6a4
Added missing pip install parameter. 2023-09-30 13:31:04 +02:00
c82f7bbfbe
Ignore the default docstring text for __init__.
If no docstring is specified for a constructor, Python usually pre-fills
a standard text - "Initialize self. See help(type(self))".

We don't need this default text in our plugins documentation.
2023-09-30 13:29:49 +02:00
d030e2b8c7
Install all the deps via apk add on Alpine in the build-docs step. 2023-09-30 13:29:10 +02:00
15d06fa5c2
Improved docstring parser logic. 2023-09-30 12:35:31 +02:00
e6f05dfe07 Merge pull request '[#311] Logic to automatically generate the documentation for the dependencies of the integrations' (#330) from 311/auto-generate-deps-docs into master
Reviewed-on: platypush/platypush#330
2023-09-30 02:31:43 +02:00
343972b520
New IntegrationMetadata generic util class.
This object is in charge of parsing all the metadata of a
plugin/backend.
2023-09-30 02:28:20 +02:00
905d6632e0
Misc documentation improvements. 2023-09-29 18:09:15 +02:00
0a3ec4b9f1
Merge branch 'master' into 311/auto-generate-deps-docs 2023-09-28 01:25:29 +02:00
5025d892be
Added install/ subfolders to package_data 2023-09-28 01:25:01 +02:00
b76f141b61
Catch response write errors in the MQTT callback.
If the client that forwarded the request is no longer available (either
because an exception or a timeout was raised) then its I/O buffer and
event loop may be closed.

In this case, the response callback should handle and report the
exception, and still set the event, so that any other threads waiting
for the response can move on.
2023-09-27 11:23:55 +02:00
ca7f042ccc
We shouldn't call dateutil.parser if t has already been deserialized to a datetime. 2023-09-27 11:20:10 +02:00
c311987741
Removed typing.Final from some of the most commonly used modules.
`typing.Final` is not defined on Python < 3.8.
2023-09-26 23:50:10 +02:00
9298f52443
Moved BluetoothPlugin to __init__.py.
This is for consistency with other plugins, that all have their main
plugin class definition inside of `__init__.py`.
2023-09-24 19:21:53 +02:00
c3337ccc6c
[#311] Docs deps autogen sphinx plugin.
Added an `add_dependencies` plugin to the Sphinx build process that
parses the manifest files of the scanned backends and plugins and
automatically generates the documentation for the required dependencies
and triggered events.

This means that those dependencies are no longer required to be listed
in the docstring of the class itself.

Also in this commit:

- Black/LINT for some integrations that hadn't been touched in a long
  time.

- Deleted some leftovers from previous refactors (deprecated
  `backend.mqtt`, `backend.zwave.mqtt`, `backend.http.request.rss`).

- Deleted deprecated `inotify` backend - replaced by `file.monitor` (see
  #289).
2023-09-24 17:00:08 +02:00
27340f2889
Fixed a variable name in the Drone RPM step. 2023-09-23 16:48:49 +02:00
33b26fa8dd
fuse doesn't like inter-device move operations.
So the Drone pipeline has to resort to the cp+rm dance instead.
2023-09-23 16:42:15 +02:00
b9e68d69a9
Merge branch '316/rpm-support' 2023-09-23 16:38:20 +02:00
bbd8e939e6
Fixed a multiline expression 2023-09-23 16:37:52 +02:00
fe5158d0ca Merge pull request '[#316] RPM support' (#328) from 316/rpm-support into master
Reviewed-on: platypush/platypush#328
2023-09-23 16:25:34 +02:00
ad2ee75c99
Updated docs 2023-09-23 16:24:18 +02:00
059f7a4b11 Merge branch 'master' into 316/rpm-support 2023-09-23 16:21:48 +02:00
f6dea0b4d4
Added RPM update step to Drone CI pipeline.
Closes: #316.
2023-09-23 16:21:00 +02:00
2b981f6b68
Added python-croniter dependency to Fedora.
Plus, some clean up of the variables on .drone.yaml.
2023-09-23 16:20:28 +02:00
b797add90d
Modify shebang header for Mercury JS script.
The RPM build process wants an absolute path.
2023-09-23 16:16:13 +02:00
a872d6f554
Added Fedora to the available Docker base images. 2023-09-22 19:02:13 +02:00
79e24461cb
Coalesce to empty list if zigbee.mqtt.devices returns null. 2023-09-22 17:00:53 +02:00