Skip to content

Commit 352925e

Browse files
authored
Crystalfontz backports (#40)
- Respect `PLUSDECK_CONFIG_FILE` - Remove `plusdeck`, `plusdeckd` and `plusdeckctl` from Python package - Add optional aliases in `./bin` - Do not export from `plusdeck.dbus` - `plusdeck.dbus.domain` and `plusdeck.dbus.select` modules - Overhauled documentation
1 parent 3f12b7f commit 352925e

54 files changed

Lines changed: 1254 additions & 499 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/qa.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ jobs:
3131
npx pyright@latest
3232
- name: Run tests
3333
run: |
34-
pytest ./tests --ignore=tests/test_integration.py
34+
pytest ./tests --ignore-glob='./tests/integration/**'

CHANGELOG.md

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
1-
yyyy/mm/dd Version x.y.z-1
1+
yyyy/mm/dd Version 5.0.0-1
22
------------------------
3-
- Include generated DBus interface docs
4-
- Fix links in documentation
5-
- CLI respects `CRYSTALFONTZ_CONFIG_FILE` environment variable
6-
- Remove `tox` from development tools
7-
- Consistently licensed as MPL-2.0
8-
- Improved PyPI classifiers
3+
- CLI changes:
4+
- Main CLI respects `PLUSDECK_CONFIG_FILE` environment variable
5+
- **BREAKING:** `plusdeck`, `plusdeckd` and `plusdeckctl` have been removed from the Python package in favor of `python3 -m plusdeck`, `python3 -m plusdeck.dbus.service` and `python3 -m plusdeck.dbus.client`, respectively
6+
- Optional alias scripts for `plusdeck`, `plusdeck-service` and `plusdeck-dbus` included in the `./bin` folder
7+
- DBus service CLI includes a `--system/--user` flag for explicitly selecting the bus
8+
- **BREAKING:** DBus client CLI now uses `--user/--default` flag for selecting the bus
9+
- DBus API Changes:
10+
- **BREAKING:** Root `plusdeck.dbus` no longer includes convenience exports
11+
- Addition of `plusdeck.dbus.domain` module for domain mapping
12+
- Addition of `plusdeck.dbus.select` module for selecting the DBus bus
13+
- Testing changes:
14+
- Additional integration test for DBus
15+
- Remove `tox` from development tools
16+
- Documentation improvements:
17+
- Include generated DBus interface docs
18+
- Fix links in documentation
19+
- General overhaul based on lessons from `crystalfontz`
20+
- Packaging & Licensing
21+
- **BREAKING:** Consistently licensed as MPL-2.0
22+
- Improved PyPI classifiers
923

1024
2025/02/09 Version 4.0.1-1
1125
--------------------------

bin/plusdeck

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/sh
2+
3+
exec python3 -m plusdeck "$@"

bin/plusdeck-dbus

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/sh
2+
3+
exec python3 -m plusdeck.dbus.client "$@"

bin/plusdeck-service

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/sh
2+
3+
exec python3 -m plusdeck.dbus.service "$@"

docs/dialout.md renamed to docs/access.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1-
# Dialout
1+
# Access and Permissions
22

3-
In Linux, by default, accessing serial ports requires `sudo`. This is inconvenient - you probably want your current user to have acccess without using `sudo`.
3+
In Linux, by default, accessing serial ports requires `sudo`. This is inconvenient - you probably want your current user to have access without using `sudo`. There are two ways to manage this access: either through the DBus service, or with the `dialout` group.
4+
5+
## DBus
6+
7+
The DBus service has the advantage of more fine-grained access control. However, it is only supported in Linux.
8+
9+
For more information, see [DBus Access and Permissions](./dbus/access.md)
10+
11+
## Dialout
412

513
Typically, Linux serial ports are generally owned by `root` and are attached to the `dialout` group, with permissions such that members of the `dialout` group may read and write to the port.
614

docs/api/plusdeck.dbus.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

docs/api/plusdeck.dbus/index.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# DBus API Overview
2+
3+
The `plusdeck` library includes a DBus service and client. This service allows for multitenancy on Linux - the centralized service controls the serial bus, and clients - including `python3 -m plusdeck.dbus.client` - can connect to the service.
4+
5+
The DBus APIs largely depend on the [sdbus](https://pypi.org/project/sdbus/) Python library, which in turn depends on the [sd-bus](https://www.freedesktop.org/software/systemd/man/latest/sd-bus.html) library. This means that, effectively, the DBus API is only available on Linux. `sdbus` is therefore an optional dependency, under the `dbus` extra.
6+
7+
As a consequence, the DBus API is (unlike the primary `plusdeck` API) not re-exported at the top level. This is to make it viable to run unit tests for parts of the DBus API which don't strictly depend on `sdbus`, namely tests for `plusdeck.dbus.domain`.
8+
9+
For information on the DBus service and client CLI, check out [the core DBus documentation](../../dbus/index.md).
10+
11+
## plusdeck.dbus.client
12+
13+
This module contains the core `DbusClient` class. This class is used for interacting with a live DBus service. This is where most users will want to start.
14+
15+
For more information, view the API docs for [`plusdeck.dbus.client`](./plusdeck.dbus.client.md).
16+
17+
## plusdeck.dbus.domain
18+
19+
The DBus interface uses DBus compatible types, rather than the standard `plusdeck` domain objects. The domain module contains type aliases and mapper classes for converting to and from `plusdeck` domain objects and DBus types. While not strictly necessary for using the client, it's highly recommended.
20+
21+
For more information, view the API docs for [`plusdeck.dbus.domain`](./plusdeck.dbus.domain.md).
22+
23+
## plusdeck.dbus.config
24+
25+
Configuration for the DBus service is a little different than for the serial client. This is because the DBus service doesn't live reload a config after it changes. In other words, if you edit the config file, the DBus service's loaded config will show drift. This module helps track the drift between these sources.
26+
27+
For more information, view the API docs for [`plusdeck.dbus.config`](./plusdeck.dbus.config.md).
28+
29+
## plusdeck.dbus.service
30+
31+
This module contains abstractions for running the DBus service. It will typically be used through [the service CLI](../../dbus/service.md). But this module may be useful for users wishing to embed it in another program.
32+
33+
For more information, view the API docs for [`plusdeck.dbus.service`](./plusdeck.dbus.service.md).
34+
35+
## plusdeck.dbus.select
36+
37+
This module contains convenience functions for configuring which bus the program uses.
38+
39+
For more information, view the API docs for [`plusdeck.dbus.select`](./plusdeck.dbus.select.md).
40+
41+
## plusdeck.dbus.interface
42+
43+
This module contains the core `DbusInterface` class. This is used directly when serving the interface, and subclassed by the client.
44+
45+
For more information, view the API docs for [`plusdeck.dbus.interface`](./plusdeck.dbus.interface.md).
46+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# plusdeck.dbus.client
2+
3+
This module contains the core `DbusClient` abstraction, which is used to interact with a DBus service.
4+
5+
For information on how to use `plusdeck` domain objects with the DBus client, see [the API docs for `plusdeck.dbus.domain`](./plusdeck.dbus.domain.md). For examples of how to use the DBus client, look at [the source code for `plusdeckctl`](https://github.com/jfhbrook/plusdeck/blob/main/plusdeck/dbus/client/cli.py).
6+
7+
::: plusdeck.dbus.client
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# plusdeck.dbus.config
2+
3+
::: plusdeck.dbus.config

0 commit comments

Comments
 (0)