dbus-fast 1.60.0__tar.gz → 2.45.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of dbus-fast might be problematic. Click here for more details.

Files changed (57) hide show
  1. {dbus_fast-1.60.0 → dbus_fast-2.45.0}/PKG-INFO +14 -19
  2. {dbus_fast-1.60.0 → dbus_fast-2.45.0}/README.md +7 -6
  3. dbus_fast-2.45.0/build_ext.py +66 -0
  4. dbus_fast-2.45.0/pyproject.toml +241 -0
  5. dbus_fast-2.45.0/setup.py +31 -0
  6. {dbus_fast-1.60.0 → dbus_fast-2.45.0}/src/dbus_fast/__init__.py +14 -16
  7. {dbus_fast-1.60.0 → dbus_fast-2.45.0}/src/dbus_fast/__version__.py +1 -1
  8. dbus_fast-2.45.0/src/dbus_fast/_private/__init__.py +1 -0
  9. {dbus_fast-1.60.0 → dbus_fast-2.45.0}/src/dbus_fast/_private/_cython_compat.py +2 -0
  10. dbus_fast-2.45.0/src/dbus_fast/_private/address.pxd +15 -0
  11. {dbus_fast-1.60.0 → dbus_fast-2.45.0}/src/dbus_fast/_private/address.py +35 -24
  12. {dbus_fast-1.60.0 → dbus_fast-2.45.0}/src/dbus_fast/_private/constants.py +2 -0
  13. dbus_fast-2.45.0/src/dbus_fast/_private/marshaller.pxd +110 -0
  14. {dbus_fast-1.60.0 → dbus_fast-2.45.0}/src/dbus_fast/_private/marshaller.py +90 -60
  15. dbus_fast-2.45.0/src/dbus_fast/_private/unmarshaller.pxd +261 -0
  16. dbus_fast-2.45.0/src/dbus_fast/_private/unmarshaller.py +902 -0
  17. {dbus_fast-1.60.0 → dbus_fast-2.45.0}/src/dbus_fast/_private/util.py +27 -23
  18. dbus_fast-2.45.0/src/dbus_fast/aio/__init__.py +5 -0
  19. {dbus_fast-1.60.0 → dbus_fast-2.45.0}/src/dbus_fast/aio/message_bus.py +173 -95
  20. dbus_fast-2.45.0/src/dbus_fast/aio/message_reader.pxd +13 -0
  21. dbus_fast-2.45.0/src/dbus_fast/aio/message_reader.py +49 -0
  22. {dbus_fast-1.60.0 → dbus_fast-2.45.0}/src/dbus_fast/aio/proxy_object.py +9 -5
  23. {dbus_fast-1.60.0 → dbus_fast-2.45.0}/src/dbus_fast/auth.py +26 -9
  24. {dbus_fast-1.60.0 → dbus_fast-2.45.0}/src/dbus_fast/constants.py +25 -2
  25. {dbus_fast-1.60.0 → dbus_fast-2.45.0}/src/dbus_fast/errors.py +3 -3
  26. dbus_fast-2.45.0/src/dbus_fast/glib/__init__.py +3 -0
  27. {dbus_fast-1.60.0 → dbus_fast-2.45.0}/src/dbus_fast/glib/message_bus.py +17 -9
  28. {dbus_fast-1.60.0 → dbus_fast-2.45.0}/src/dbus_fast/glib/proxy_object.py +4 -5
  29. {dbus_fast-1.60.0 → dbus_fast-2.45.0}/src/dbus_fast/introspection.py +122 -33
  30. dbus_fast-2.45.0/src/dbus_fast/message.pxd +76 -0
  31. {dbus_fast-1.60.0 → dbus_fast-2.45.0}/src/dbus_fast/message.py +137 -47
  32. dbus_fast-2.45.0/src/dbus_fast/message_bus.pxd +75 -0
  33. {dbus_fast-1.60.0 → dbus_fast-2.45.0}/src/dbus_fast/message_bus.py +377 -312
  34. {dbus_fast-1.60.0 → dbus_fast-2.45.0}/src/dbus_fast/proxy_object.py +45 -29
  35. dbus_fast-2.45.0/src/dbus_fast/send_reply.py +61 -0
  36. dbus_fast-2.45.0/src/dbus_fast/service.pxd +50 -0
  37. {dbus_fast-1.60.0 → dbus_fast-2.45.0}/src/dbus_fast/service.py +185 -81
  38. {dbus_fast-1.60.0 → dbus_fast-2.45.0}/src/dbus_fast/signature.pxd +9 -1
  39. {dbus_fast-1.60.0 → dbus_fast-2.45.0}/src/dbus_fast/signature.py +86 -60
  40. {dbus_fast-1.60.0 → dbus_fast-2.45.0}/src/dbus_fast/unpack.pxd +4 -1
  41. {dbus_fast-1.60.0 → dbus_fast-2.45.0}/src/dbus_fast/unpack.py +2 -1
  42. {dbus_fast-1.60.0 → dbus_fast-2.45.0}/src/dbus_fast/validators.py +4 -0
  43. dbus_fast-1.60.0/build.py +0 -40
  44. dbus_fast-1.60.0/pyproject.toml +0 -109
  45. dbus_fast-1.60.0/setup.py +0 -43
  46. dbus_fast-1.60.0/src/dbus_fast/_private/__init__.py +0 -0
  47. dbus_fast-1.60.0/src/dbus_fast/_private/marshaller.pxd +0 -83
  48. dbus_fast-1.60.0/src/dbus_fast/_private/unmarshaller.pxd +0 -180
  49. dbus_fast-1.60.0/src/dbus_fast/_private/unmarshaller.py +0 -651
  50. dbus_fast-1.60.0/src/dbus_fast/aio/__init__.py +0 -2
  51. dbus_fast-1.60.0/src/dbus_fast/aio/message_reader.pxd +0 -3
  52. dbus_fast-1.60.0/src/dbus_fast/aio/message_reader.py +0 -35
  53. dbus_fast-1.60.0/src/dbus_fast/glib/__init__.py +0 -2
  54. dbus_fast-1.60.0/src/dbus_fast/main.py +0 -2
  55. dbus_fast-1.60.0/src/dbus_fast/message.pxd +0 -47
  56. {dbus_fast-1.60.0 → dbus_fast-2.45.0}/LICENSE +0 -0
  57. {dbus_fast-1.60.0 → dbus_fast-2.45.0}/src/dbus_fast/py.typed +0 -0
@@ -1,31 +1,25 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: dbus-fast
3
- Version: 1.60.0
3
+ Version: 2.45.0
4
4
  Summary: A faster version of dbus-next
5
- Home-page: https://github.com/bluetooth-devices/dbus-fast
6
5
  License: MIT
6
+ License-File: LICENSE
7
7
  Author: Bluetooth Devices Authors
8
8
  Author-email: bluetooth@koston.org
9
- Requires-Python: >=3.7,<4.0
9
+ Requires-Python: >=3.9
10
10
  Classifier: Development Status :: 5 - Production/Stable
11
11
  Classifier: Intended Audience :: Developers
12
12
  Classifier: License :: OSI Approved :: MIT License
13
13
  Classifier: Natural Language :: English
14
14
  Classifier: Operating System :: OS Independent
15
15
  Classifier: Programming Language :: Python :: 3
16
- Classifier: Programming Language :: Python :: 3.7
17
- Classifier: Programming Language :: Python :: 3.8
18
16
  Classifier: Programming Language :: Python :: 3.9
19
17
  Classifier: Programming Language :: Python :: 3.10
20
18
  Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Programming Language :: Python :: 3.14
21
22
  Classifier: Topic :: Software Development :: Libraries
22
- Provides-Extra: docs
23
- Requires-Dist: Sphinx (>=5.1.1,<6.0.0); extra == "docs"
24
- Requires-Dist: async-timeout (>=3.0.0)
25
- Requires-Dist: myst-parser (>=0.18.0,<0.19.0); extra == "docs"
26
- Requires-Dist: sphinx-rtd-theme (>=1.0.0,<2.0.0); extra == "docs"
27
- Requires-Dist: sphinxcontrib-asyncio (>=0.3.0,<0.4.0); extra == "docs"
28
- Requires-Dist: sphinxcontrib-fulltoc (>=1.2.0,<2.0.0); extra == "docs"
29
23
  Project-URL: Bug Tracker, https://github.com/bluetooth-devices/dbus-fast/issues
30
24
  Project-URL: Changelog, https://github.com/bluetooth-devices/dbus-fast/blob/main/CHANGELOG.md
31
25
  Project-URL: Documentation, https://dbus-fast.readthedocs.io
@@ -49,12 +43,13 @@ Description-Content-Type: text/markdown
49
43
  <a href="https://python-poetry.org/">
50
44
  <img src="https://img.shields.io/badge/packaging-poetry-299bd7?style=flat-square&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAASCAYAAABrXO8xAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJJSURBVHgBfZLPa1NBEMe/s7tNXoxW1KJQKaUHkXhQvHgW6UHQQ09CBS/6V3hKc/AP8CqCrUcpmop3Cx48eDB4yEECjVQrlZb80CRN8t6OM/teagVxYZi38+Yz853dJbzoMV3MM8cJUcLMSUKIE8AzQ2PieZzFxEJOHMOgMQQ+dUgSAckNXhapU/NMhDSWLs1B24A8sO1xrN4NECkcAC9ASkiIJc6k5TRiUDPhnyMMdhKc+Zx19l6SgyeW76BEONY9exVQMzKExGKwwPsCzza7KGSSWRWEQhyEaDXp6ZHEr416ygbiKYOd7TEWvvcQIeusHYMJGhTwF9y7sGnSwaWyFAiyoxzqW0PM/RjghPxF2pWReAowTEXnDh0xgcLs8l2YQmOrj3N7ByiqEoH0cARs4u78WgAVkoEDIDoOi3AkcLOHU60RIg5wC4ZuTC7FaHKQm8Hq1fQuSOBvX/sodmNJSB5geaF5CPIkUeecdMxieoRO5jz9bheL6/tXjrwCyX/UYBUcjCaWHljx1xiX6z9xEjkYAzbGVnB8pvLmyXm9ep+W8CmsSHQQY77Zx1zboxAV0w7ybMhQmfqdmmw3nEp1I0Z+FGO6M8LZdoyZnuzzBdjISicKRnpxzI9fPb+0oYXsNdyi+d3h9bm9MWYHFtPeIZfLwzmFDKy1ai3p+PDls1Llz4yyFpferxjnyjJDSEy9CaCx5m2cJPerq6Xm34eTrZt3PqxYO1XOwDYZrFlH1fWnpU38Y9HRze3lj0vOujZcXKuuXm3jP+s3KbZVra7y2EAAAAAASUVORK5CYII=" alt="Poetry">
51
45
  </a>
52
- <a href="https://github.com/ambv/black">
53
- <img src="https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square" alt="black">
46
+ <a href="https://github.com/astral-sh/ruff">
47
+ <img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json" alt="Ruff">
54
48
  </a>
55
49
  <a href="https://github.com/pre-commit/pre-commit">
56
50
  <img src="https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white&style=flat-square" alt="pre-commit">
57
51
  </a>
52
+ <a href="https://codspeed.io/Bluetooth-Devices/dbus-fast"><img src="https://img.shields.io/endpoint?url=https://codspeed.io/badge.json" alt="CodSpeed Badge"/></a>
58
53
  </p>
59
54
  <p align="center">
60
55
  <a href="https://pypi.org/project/dbus-fast/">
@@ -148,7 +143,7 @@ asyncio.run(main())
148
143
 
149
144
  To define a service on the bus, use the `ServiceInterface` class and decorate class methods to specify DBus methods, properties, and signals with their type signatures.
150
145
 
151
- For more information, see the [overview for the high-level service](https://python-dbus-fast.readthedocs.io/en/latest/high-level-service/index.html).
146
+ For more information, see the [overview for the high-level service](https://dbus-fast.readthedocs.io/en/latest/high-level-service/index.html).
152
147
 
153
148
  ```python
154
149
  from dbus_fast.service import ServiceInterface, method, dbus_property, signal, Variant
@@ -201,7 +196,7 @@ asyncio.run(main())
201
196
 
202
197
  The low-level interface works with DBus messages directly.
203
198
 
204
- For more information, see the [overview for the low-level interface](https://python-dbus-fast.readthedocs.io/en/latest/low-level-interface/index.html).
199
+ For more information, see the [overview for the low-level interface](https://dbus-fast.readthedocs.io/en/latest/low-level-interface/index.html).
205
200
 
206
201
  ```python
207
202
  from dbus_fast.message import Message, MessageType
@@ -229,13 +224,13 @@ async def main():
229
224
  asyncio.run(main())
230
225
  ```
231
226
 
232
- ## Projects that use python-dbus-fast
227
+ ## Projects that use dbus-fast
233
228
 
234
229
  - [Bluetooth Adapters](https://github.com/bluetooth-devices/bluetooth-adapters)
235
230
 
236
231
  ## Contributing
237
232
 
238
- Contributions are welcome. Development happens on [Github](https://github.com/altdesktop/python-dbus-fast).
233
+ Contributions are welcome. Development happens on [Github](https://github.com/Bluetooth-Devices/dbus-fast).
239
234
 
240
235
  Before you commit, run `pre-commit run --all-files` to run the linter, code formatter, and the test suite.
241
236
 
@@ -15,12 +15,13 @@
15
15
  <a href="https://python-poetry.org/">
16
16
  <img src="https://img.shields.io/badge/packaging-poetry-299bd7?style=flat-square&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAASCAYAAABrXO8xAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJJSURBVHgBfZLPa1NBEMe/s7tNXoxW1KJQKaUHkXhQvHgW6UHQQ09CBS/6V3hKc/AP8CqCrUcpmop3Cx48eDB4yEECjVQrlZb80CRN8t6OM/teagVxYZi38+Yz853dJbzoMV3MM8cJUcLMSUKIE8AzQ2PieZzFxEJOHMOgMQQ+dUgSAckNXhapU/NMhDSWLs1B24A8sO1xrN4NECkcAC9ASkiIJc6k5TRiUDPhnyMMdhKc+Zx19l6SgyeW76BEONY9exVQMzKExGKwwPsCzza7KGSSWRWEQhyEaDXp6ZHEr416ygbiKYOd7TEWvvcQIeusHYMJGhTwF9y7sGnSwaWyFAiyoxzqW0PM/RjghPxF2pWReAowTEXnDh0xgcLs8l2YQmOrj3N7ByiqEoH0cARs4u78WgAVkoEDIDoOi3AkcLOHU60RIg5wC4ZuTC7FaHKQm8Hq1fQuSOBvX/sodmNJSB5geaF5CPIkUeecdMxieoRO5jz9bheL6/tXjrwCyX/UYBUcjCaWHljx1xiX6z9xEjkYAzbGVnB8pvLmyXm9ep+W8CmsSHQQY77Zx1zboxAV0w7ybMhQmfqdmmw3nEp1I0Z+FGO6M8LZdoyZnuzzBdjISicKRnpxzI9fPb+0oYXsNdyi+d3h9bm9MWYHFtPeIZfLwzmFDKy1ai3p+PDls1Llz4yyFpferxjnyjJDSEy9CaCx5m2cJPerq6Xm34eTrZt3PqxYO1XOwDYZrFlH1fWnpU38Y9HRze3lj0vOujZcXKuuXm3jP+s3KbZVra7y2EAAAAAASUVORK5CYII=" alt="Poetry">
17
17
  </a>
18
- <a href="https://github.com/ambv/black">
19
- <img src="https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square" alt="black">
18
+ <a href="https://github.com/astral-sh/ruff">
19
+ <img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json" alt="Ruff">
20
20
  </a>
21
21
  <a href="https://github.com/pre-commit/pre-commit">
22
22
  <img src="https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white&style=flat-square" alt="pre-commit">
23
23
  </a>
24
+ <a href="https://codspeed.io/Bluetooth-Devices/dbus-fast"><img src="https://img.shields.io/endpoint?url=https://codspeed.io/badge.json" alt="CodSpeed Badge"/></a>
24
25
  </p>
25
26
  <p align="center">
26
27
  <a href="https://pypi.org/project/dbus-fast/">
@@ -114,7 +115,7 @@ asyncio.run(main())
114
115
 
115
116
  To define a service on the bus, use the `ServiceInterface` class and decorate class methods to specify DBus methods, properties, and signals with their type signatures.
116
117
 
117
- For more information, see the [overview for the high-level service](https://python-dbus-fast.readthedocs.io/en/latest/high-level-service/index.html).
118
+ For more information, see the [overview for the high-level service](https://dbus-fast.readthedocs.io/en/latest/high-level-service/index.html).
118
119
 
119
120
  ```python
120
121
  from dbus_fast.service import ServiceInterface, method, dbus_property, signal, Variant
@@ -167,7 +168,7 @@ asyncio.run(main())
167
168
 
168
169
  The low-level interface works with DBus messages directly.
169
170
 
170
- For more information, see the [overview for the low-level interface](https://python-dbus-fast.readthedocs.io/en/latest/low-level-interface/index.html).
171
+ For more information, see the [overview for the low-level interface](https://dbus-fast.readthedocs.io/en/latest/low-level-interface/index.html).
171
172
 
172
173
  ```python
173
174
  from dbus_fast.message import Message, MessageType
@@ -195,13 +196,13 @@ async def main():
195
196
  asyncio.run(main())
196
197
  ```
197
198
 
198
- ## Projects that use python-dbus-fast
199
+ ## Projects that use dbus-fast
199
200
 
200
201
  - [Bluetooth Adapters](https://github.com/bluetooth-devices/bluetooth-adapters)
201
202
 
202
203
  ## Contributing
203
204
 
204
- Contributions are welcome. Development happens on [Github](https://github.com/altdesktop/python-dbus-fast).
205
+ Contributions are welcome. Development happens on [Github](https://github.com/Bluetooth-Devices/dbus-fast).
205
206
 
206
207
  Before you commit, run `pre-commit run --all-files` to run the linter, code formatter, and the test suite.
207
208
 
@@ -0,0 +1,66 @@
1
+ """Build optional cython modules."""
2
+
3
+ import logging
4
+ import os
5
+ from distutils.command.build_ext import build_ext
6
+
7
+ _LOGGER = logging.getLogger(__name__)
8
+
9
+ try:
10
+ from setuptools import Extension
11
+ except ImportError:
12
+ from distutils.core import Extension
13
+
14
+
15
+ TO_CYTHONIZE = [
16
+ "src/dbus_fast/aio/message_reader.py",
17
+ "src/dbus_fast/message.py",
18
+ "src/dbus_fast/message_bus.py",
19
+ "src/dbus_fast/service.py",
20
+ "src/dbus_fast/signature.py",
21
+ "src/dbus_fast/unpack.py",
22
+ "src/dbus_fast/_private/address.py",
23
+ "src/dbus_fast/_private/marshaller.py",
24
+ "src/dbus_fast/_private/unmarshaller.py",
25
+ ]
26
+
27
+ EXTENSIONS = [
28
+ Extension(
29
+ ext.removeprefix("src/").removesuffix(".py").replace("/", "."),
30
+ [ext],
31
+ language="c",
32
+ extra_compile_args=["-O3", "-g0"],
33
+ )
34
+ for ext in TO_CYTHONIZE
35
+ ]
36
+
37
+
38
+ class BuildExt(build_ext):
39
+ def build_extensions(self):
40
+ try:
41
+ super().build_extensions()
42
+ except Exception:
43
+ _LOGGER.debug("Failed to build extensions", exc_info=True)
44
+
45
+
46
+ def build(setup_kwargs):
47
+ if os.environ.get("SKIP_CYTHON"):
48
+ return
49
+ try:
50
+ from Cython.Build import cythonize # noqa: PLC0415
51
+
52
+ setup_kwargs.update(
53
+ {
54
+ "ext_modules": cythonize(
55
+ EXTENSIONS,
56
+ compiler_directives={"language_level": "3"}, # Python 3
57
+ ),
58
+ "cmdclass": {"build_ext": BuildExt},
59
+ }
60
+ )
61
+ setup_kwargs["exclude_package_data"] = {
62
+ pkg: ["*.c"] for pkg in setup_kwargs["packages"]
63
+ }
64
+ except Exception:
65
+ if os.environ.get("REQUIRE_CYTHON"):
66
+ raise
@@ -0,0 +1,241 @@
1
+ [tool.poetry]
2
+ name = "dbus-fast"
3
+ version = "2.45.0"
4
+ description = "A faster version of dbus-next"
5
+ authors = ["Bluetooth Devices Authors <bluetooth@koston.org>"]
6
+ license = "MIT"
7
+ readme = "README.md"
8
+ repository = "https://github.com/bluetooth-devices/dbus-fast"
9
+ documentation = "https://dbus-fast.readthedocs.io"
10
+ classifiers = [
11
+ "Development Status :: 5 - Production/Stable",
12
+ "Intended Audience :: Developers",
13
+ "Natural Language :: English",
14
+ "Operating System :: OS Independent",
15
+ "Topic :: Software Development :: Libraries",
16
+ "Programming Language :: Python :: 3.9",
17
+ "Programming Language :: Python :: 3.10",
18
+ "Programming Language :: Python :: 3.11",
19
+ "Programming Language :: Python :: 3.12",
20
+ "Programming Language :: Python :: 3.13",
21
+ "Programming Language :: Python :: 3.14",
22
+ ]
23
+ packages = [
24
+ { include = "dbus_fast", from = "src" },
25
+ ]
26
+ # Make sure we don't package temporary C files generated by the build process
27
+ exclude = [ "**/*.c" ]
28
+
29
+ [tool.poetry.build]
30
+ generate-setup-file = true
31
+ script = "build_ext.py"
32
+
33
+ [tool.poetry.urls]
34
+ "Bug Tracker" = "https://github.com/bluetooth-devices/dbus-fast/issues"
35
+ "Changelog" = "https://github.com/bluetooth-devices/dbus-fast/blob/main/CHANGELOG.md"
36
+
37
+ [tool.poetry.dependencies]
38
+ python = ">=3.9"
39
+
40
+ # duplicated in docs/requirements.txt for readthedocs compatibility
41
+ [tool.poetry.group.docs.dependencies]
42
+ myst-parser = ">=0.18,<3.1"
43
+ sphinx = ">=5.1.1,<8.0.0"
44
+ sphinx-rtd-theme = ">=1,<4"
45
+ sphinxcontrib-asyncio = "^0.3.0"
46
+ sphinxcontrib-fulltoc = "^1.2.0"
47
+
48
+ [tool.poetry.group.dev.dependencies]
49
+ pytest = ">=7,<9"
50
+ pytest-cov = ">=3,<8"
51
+ pytest-asyncio = ">=0.19,<1.3"
52
+ pycairo = "^1.21.0"
53
+ PyGObject = {version = ">=3.50,<3.51", python = "<4"}
54
+ Cython = ">=3,<3.3.0"
55
+ setuptools = ">=65.4.1,<81.0.0"
56
+ pytest-timeout = "^2.1.0"
57
+ pytest-codspeed = ">=3.1.1,<5.0.0"
58
+ covdefaults = "^2.3.0"
59
+
60
+ [tool.semantic_release]
61
+ branch = "main"
62
+ version_toml = ["pyproject.toml:tool.poetry.version"]
63
+ version_variables = ["src/dbus_fast/__version__.py:__version__"]
64
+ build_command = "pip install poetry && poetry build"
65
+
66
+ [tool.pytest.ini_options]
67
+ addopts = "-v -Wdefault --cov=dbus_fast --cov-report=term-missing:skip-covered"
68
+ pythonpath = ["src"]
69
+
70
+ [tool.coverage.run]
71
+ branch = true
72
+ plugins = ["covdefaults"]
73
+
74
+ [tool.coverage.report]
75
+ fail_under = 30 # cython version will have low cover because we do not have Cython tracing
76
+ exclude_also = [
77
+ "if cython.compiled:",
78
+ ]
79
+
80
+ [tool.isort]
81
+ profile = "black"
82
+ known_first_party = ["dbus_fast", "tests"]
83
+
84
+ [tool.mypy]
85
+ check_untyped_defs = true
86
+ disallow_any_generics = false # turn this on when we drop 3.7/3.8 support
87
+ disallow_incomplete_defs = true
88
+ disallow_untyped_defs = true
89
+ mypy_path = "src/"
90
+ no_implicit_optional = true
91
+ show_error_codes = true
92
+ warn_unreachable = true
93
+ warn_unused_ignores = true
94
+ exclude = [
95
+ 'docs/.*',
96
+ 'setup.py',
97
+ ]
98
+
99
+ [[tool.mypy.overrides]]
100
+ module = "tests.*"
101
+ allow_untyped_defs = true
102
+
103
+ [[tool.mypy.overrides]]
104
+ module = "docs.*"
105
+ ignore_errors = true
106
+
107
+ [build-system]
108
+ requires = ['setuptools>=65.4.1', 'wheel', 'Cython>=3,<3.3.0', "poetry-core>=1.0.0"]
109
+ build-backend = "poetry.core.masonry.api"
110
+
111
+ [tool.ruff]
112
+ target-version = "py39"
113
+ line-length = 88
114
+
115
+ [tool.ruff.lint]
116
+ ignore = [
117
+ "F821", # undefined names are used for decorators
118
+ "S101", # use of assert detected
119
+ "S105", # too many false positives
120
+ "SLF001", # intended
121
+ "SIM109", # intended for cython
122
+ "SIM102", # intended for cython
123
+ "E501", # too many to fix,
124
+ "TID252", # intended
125
+ "PLC0414", # intended
126
+ "TRY003", # too many to fix
127
+ "PLR2004", # way too many to fix right now
128
+ "PLR0911", # api is public
129
+ "PYI036", # too many to fix
130
+ "PYI034", # too many to fix
131
+ "E721", # many are as intended
132
+ ## should fix these sooner
133
+ "B007", # too many to fix -- should fix sooner
134
+ "SIM103", # too many to fix -- should fix sooner
135
+ "SIM110", # too many to fix -- should fix sooner
136
+ "RUF012", # too many to fix -- should fix sooner
137
+ "TRY002", # too many to fix -- should fix sooner
138
+ "B904", # too many to fix -- should fix sooner
139
+ "PERF401", # too many to fix -- should fix sooner
140
+ "B904", # too many to fix -- should fix sooner
141
+ "B006", # too many to fix -- should fix sooner
142
+ "G004", # too many to fix -- should fix sooner
143
+ "PT015", # too many to fix -- should fix sooner
144
+ "B011", # too many to fix -- should fix sooner
145
+ "PLR1714", # too many to fix -- should fix sooner
146
+ "PLR0915", # too many to fix -- should fix sooner
147
+ "PERF102", # too many to fix -- should fix sooner
148
+ "TRY401", # too many to fix -- should fix sooner
149
+ "PLR0913", # too many to fix -- should fix sooner
150
+ "PLR0912", # too many to fix -- should fix sooner
151
+ "PERF203", # too many to fix -- should fix sooner
152
+ "G201", # too many to fix -- should fix sooner
153
+ "TRY301", # too many to fix -- should fix sooner
154
+ "B020", # too many to fix -- should fix sooner
155
+ "S314", # too many to fix -- should fix sooner
156
+ "RET504", # too many to fix -- should fix sooner
157
+ "SIM105", # too many to fix -- should fix sooner
158
+ "TRY300", # too many to fix -- should fix sooner
159
+ "PLW2901", # too many to fix -- should fix sooner
160
+ "PERF402", # too many to fix -- should fix sooner
161
+
162
+ ]
163
+ select = [
164
+ "ASYNC", # async rules
165
+ "B", # flake8-bugbear
166
+ "C4", # flake8-comprehensions
167
+ "S", # flake8-bandit
168
+ "F", # pyflake
169
+ "E", # pycodestyle
170
+ "W", # pycodestyle
171
+ "UP", # pyupgrade
172
+ "I", # isort
173
+ "LOG", # log
174
+ "RUF", # ruff specific
175
+ "FLY", # flynt
176
+ "FURB", # refurb
177
+ "G", # flake8-logging-format ,
178
+ "PERF", # Perflint
179
+ "PGH", # pygrep-hooks
180
+ "PIE", # flake8-pie
181
+ "PL", # pylint
182
+ "PT", # flake8-pytest-style
183
+ "PYI", # flake8-pyi
184
+ "RET", # flake8-return
185
+ "RSE", # flake8-raise ,
186
+ "SIM", # flake8-simplify
187
+ "SLF", # flake8-self
188
+ "SLOT", # flake8-slots
189
+ "T100", # Trace found: {name} used
190
+ "T20", # flake8-print
191
+ "TID", # Tidy imports
192
+ "TRY", # tryceratops
193
+ ]
194
+
195
+
196
+ [tool.ruff.lint.per-file-ignores]
197
+ "tests/**/*" = [
198
+ "D100",
199
+ "D101",
200
+ "D102",
201
+ "D103",
202
+ "D104",
203
+ "S101",
204
+ "S108",
205
+ "SLF001",
206
+ "PLW", # too many to fix
207
+ "TRY",# too many to fix right now
208
+ "PT",# too many to fix right now
209
+ "B",# too many to fix right now
210
+ "RET",# too many to fix right now
211
+ "PLR2004", # too many to fix right now
212
+ "PT011", # too many to fix right now
213
+ "PT006", # too many to fix right now
214
+ "PGH003", # too many to fix right now
215
+ "PT007", # too many to fix right now
216
+ "PT027", # too many to fix right now
217
+ "PLW0603" , # too many to fix right now
218
+ "PLR0915", # too many to fix right now
219
+ "FLY002", # too many to fix right now
220
+ "PT018", # too many to fix right now
221
+ "PLR0124", # too many to fix right now
222
+ "SIM202" , # too many to fix right now
223
+ "PT012" , # too many to fix right now
224
+ "TID252", # too many to fix right now
225
+ "PLR0913", # skip this one
226
+ "SIM102" , # too many to fix right now
227
+ "SIM108", # too many to fix right now
228
+ "T201", # too many to fix right now
229
+ ]
230
+ "bench/**/*" = [
231
+ "T201", # intended
232
+ ]
233
+ "examples/**/*" = [
234
+ "T201", # intended
235
+ "RSE102", # too many to fix
236
+ "C408", # too many to fix
237
+ "E402", # as intended
238
+ ]
239
+ "docs/**/*" = [
240
+ "E402", # as intended
241
+ ]
@@ -0,0 +1,31 @@
1
+ # -*- coding: utf-8 -*-
2
+ from setuptools import setup
3
+
4
+ package_dir = \
5
+ {'': 'src'}
6
+
7
+ packages = \
8
+ ['dbus_fast', 'dbus_fast._private', 'dbus_fast.aio', 'dbus_fast.glib']
9
+
10
+ package_data = \
11
+ {'': ['*']}
12
+
13
+ setup_kwargs = {
14
+ 'name': 'dbus-fast',
15
+ 'version': '2.45.0',
16
+ 'description': 'A faster version of dbus-next',
17
+ 'long_description': '# dbus-fast\n\n<p align="center">\n <a href="https://github.com/bluetooth-devices/dbus-fast/actions?query=workflow%3ACI">\n <img src="https://img.shields.io/github/workflow/status/bluetooth-devices/dbus-fast/CI/main?label=CI&logo=github&style=flat-square" alt="CI Status" >\n </a>\n <a href="https://dbus-fast.readthedocs.io">\n <img src="https://img.shields.io/readthedocs/dbus-fast.svg?logo=read-the-docs&logoColor=fff&style=flat-square" alt="Documentation Status">\n </a>\n <a href="https://codecov.io/gh/bluetooth-devices/dbus-fast">\n <img src="https://img.shields.io/codecov/c/github/bluetooth-devices/dbus-fast.svg?logo=codecov&logoColor=fff&style=flat-square" alt="Test coverage percentage">\n </a>\n</p>\n<p align="center">\n <a href="https://python-poetry.org/">\n <img src="https://img.shields.io/badge/packaging-poetry-299bd7?style=flat-square&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAASCAYAAABrXO8xAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJJSURBVHgBfZLPa1NBEMe/s7tNXoxW1KJQKaUHkXhQvHgW6UHQQ09CBS/6V3hKc/AP8CqCrUcpmop3Cx48eDB4yEECjVQrlZb80CRN8t6OM/teagVxYZi38+Yz853dJbzoMV3MM8cJUcLMSUKIE8AzQ2PieZzFxEJOHMOgMQQ+dUgSAckNXhapU/NMhDSWLs1B24A8sO1xrN4NECkcAC9ASkiIJc6k5TRiUDPhnyMMdhKc+Zx19l6SgyeW76BEONY9exVQMzKExGKwwPsCzza7KGSSWRWEQhyEaDXp6ZHEr416ygbiKYOd7TEWvvcQIeusHYMJGhTwF9y7sGnSwaWyFAiyoxzqW0PM/RjghPxF2pWReAowTEXnDh0xgcLs8l2YQmOrj3N7ByiqEoH0cARs4u78WgAVkoEDIDoOi3AkcLOHU60RIg5wC4ZuTC7FaHKQm8Hq1fQuSOBvX/sodmNJSB5geaF5CPIkUeecdMxieoRO5jz9bheL6/tXjrwCyX/UYBUcjCaWHljx1xiX6z9xEjkYAzbGVnB8pvLmyXm9ep+W8CmsSHQQY77Zx1zboxAV0w7ybMhQmfqdmmw3nEp1I0Z+FGO6M8LZdoyZnuzzBdjISicKRnpxzI9fPb+0oYXsNdyi+d3h9bm9MWYHFtPeIZfLwzmFDKy1ai3p+PDls1Llz4yyFpferxjnyjJDSEy9CaCx5m2cJPerq6Xm34eTrZt3PqxYO1XOwDYZrFlH1fWnpU38Y9HRze3lj0vOujZcXKuuXm3jP+s3KbZVra7y2EAAAAAASUVORK5CYII=" alt="Poetry">\n </a>\n <a href="https://github.com/astral-sh/ruff">\n <img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json" alt="Ruff">\n </a>\n <a href="https://github.com/pre-commit/pre-commit">\n <img src="https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white&style=flat-square" alt="pre-commit">\n </a>\n <a href="https://codspeed.io/Bluetooth-Devices/dbus-fast"><img src="https://img.shields.io/endpoint?url=https://codspeed.io/badge.json" alt="CodSpeed Badge"/></a>\n</p>\n<p align="center">\n <a href="https://pypi.org/project/dbus-fast/">\n <img src="https://img.shields.io/pypi/v/dbus-fast.svg?logo=python&logoColor=fff&style=flat-square" alt="PyPI Version">\n </a>\n <img src="https://img.shields.io/pypi/pyversions/dbus-fast.svg?style=flat-square&logo=python&amp;logoColor=fff" alt="Supported Python versions">\n <img src="https://img.shields.io/pypi/l/dbus-fast.svg?style=flat-square" alt="License">\n</p>\n\nA faster version of dbus-next originally from the [great DBus next library](https://github.com/altdesktop/python-dbus-next) ❤️\n\n## Installation\n\nInstall this via pip (or your favourite package manager):\n\n`pip install dbus-fast`\n\n[Documentation](https://dbus-fast.readthedocs.io/en/latest/)\n\ndbus-fast is a Python library for DBus that aims to be a performant fully featured high level library primarily geared towards integration of applications into Linux desktop and mobile environments.\n\nDesktop application developers can use this library for integrating their applications into desktop environments by implementing common DBus standard interfaces or creating custom plugin interfaces.\n\nDesktop users can use this library to create their own scripts and utilities to interact with those interfaces for customization of their desktop environment.\n\ndbus-fast plans to improve over other DBus libraries for Python in the following ways:\n\n- Zero dependencies and pure Python 3\n- An optional cython extension is available to speed up (un)marshalling\n- Focus on performance\n- Support for multiple IO backends including asyncio and the GLib main loop.\n- Nonblocking IO suitable for GUI development.\n- Target the latest language features of Python for beautiful services and clients.\n- Complete implementation of the DBus type system without ever guessing types.\n- Integration tests for all features of the library.\n- Completely documented public API.\n\n## Installing\n\nThis library is available on PyPi as [dbus-fast](https://pypi.org/project/dbus-fast/).\n\n```\npip3 install dbus-fast\n```\n\n## The Client Interface\n\nTo use a service on the bus, the library constructs a proxy object you can use to call methods, get and set properties, and listen to signals.\n\nFor more information, see the [overview for the high-level client](https://dbus-fast.readthedocs.io/en/latest/high-level-client/index.html).\n\nThis example connects to a media player and controls it with the [MPRIS](https://specifications.freedesktop.org/mpris-spec/latest/) DBus interface.\n\n```python\nfrom dbus_fast.aio import MessageBus\n\nimport asyncio\n\n\nasync def main():\n bus = await MessageBus().connect()\n # the introspection xml would normally be included in your project, but\n # this is convenient for development\n introspection = await bus.introspect(\'org.mpris.MediaPlayer2.vlc\', \'/org/mpris/MediaPlayer2\')\n\n obj = bus.get_proxy_object(\'org.mpris.MediaPlayer2.vlc\', \'/org/mpris/MediaPlayer2\', introspection)\n player = obj.get_interface(\'org.mpris.MediaPlayer2.Player\')\n properties = obj.get_interface(\'org.freedesktop.DBus.Properties\')\n\n # call methods on the interface (this causes the media player to play)\n await player.call_play()\n\n volume = await player.get_volume()\n print(f\'current volume: {volume}, setting to 0.5\')\n\n await player.set_volume(0.5)\n\n # listen to signals\n def on_properties_changed(interface_name, changed_properties, invalidated_properties):\n for changed, variant in changed_properties.items():\n print(f\'property changed: {changed} - {variant.value}\')\n\n properties.on_properties_changed(on_properties_changed)\n\n await asyncio.Event().wait()\n\nasyncio.run(main())\n```\n\n## The Service Interface\n\nTo define a service on the bus, use the `ServiceInterface` class and decorate class methods to specify DBus methods, properties, and signals with their type signatures.\n\nFor more information, see the [overview for the high-level service](https://dbus-fast.readthedocs.io/en/latest/high-level-service/index.html).\n\n```python\nfrom dbus_fast.service import ServiceInterface, method, dbus_property, signal, Variant\nfrom dbus_fast.aio MessageBus\n\nimport asyncio\n\nclass ExampleInterface(ServiceInterface):\n def __init__(self, name):\n super().__init__(name)\n self._string_prop = \'kevin\'\n\n @method()\n def Echo(self, what: \'s\') -> \'s\':\n return what\n\n @method()\n def GetVariantDict() -> \'a{sv}\':\n return {\n \'foo\': Variant(\'s\', \'bar\'),\n \'bat\': Variant(\'x\', -55),\n \'a_list\': Variant(\'as\', [\'hello\', \'world\'])\n }\n\n @dbus_property()\n def string_prop(self) -> \'s\':\n return self._string_prop\n\n @string_prop.setter\n def string_prop_setter(self, val: \'s\'):\n self._string_prop = val\n\n @signal()\n def signal_simple(self) -> \'s\':\n return \'hello\'\n\nasync def main():\n bus = await MessageBus().connect()\n interface = ExampleInterface(\'test.interface\')\n bus.export(\'/test/path\', interface)\n # now that we are ready to handle requests, we can request name from D-Bus\n await bus.request_name(\'test.name\')\n # wait indefinitely\n await asyncio.Event().wait()\n\nasyncio.run(main())\n```\n\n## The Low-Level Interface\n\nThe low-level interface works with DBus messages directly.\n\nFor more information, see the [overview for the low-level interface](https://dbus-fast.readthedocs.io/en/latest/low-level-interface/index.html).\n\n```python\nfrom dbus_fast.message import Message, MessageType\nfrom dbus_fast.aio import MessageBus\n\nimport asyncio\nimport json\n\n\nasync def main():\n bus = await MessageBus().connect()\n\n reply = await bus.call(\n Message(destination=\'org.freedesktop.DBus\',\n path=\'/org/freedesktop/DBus\',\n interface=\'org.freedesktop.DBus\',\n member=\'ListNames\'))\n\n if reply.message_type == MessageType.ERROR:\n raise Exception(reply.body[0])\n\n print(json.dumps(reply.body[0], indent=2))\n\n\nasyncio.run(main())\n```\n\n## Projects that use dbus-fast\n\n- [Bluetooth Adapters](https://github.com/bluetooth-devices/bluetooth-adapters)\n\n## Contributing\n\nContributions are welcome. Development happens on [Github](https://github.com/Bluetooth-Devices/dbus-fast).\n\nBefore you commit, run `pre-commit run --all-files` to run the linter, code formatter, and the test suite.\n\n## Copyright\n\nYou can use this code under an MIT license (see LICENSE).\n\n- © 2019, Tony Crisci\n- © 2022, Bluetooth Devices authors\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n<!-- prettier-ignore-start -->\n<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->\n<!-- markdownlint-disable -->\n<!-- markdownlint-enable -->\n<!-- ALL-CONTRIBUTORS-LIST:END -->\n<!-- prettier-ignore-end -->\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n\n## Credits\n\nThis package was created with\n[Cookiecutter](https://github.com/audreyr/cookiecutter) and the\n[browniebroke/cookiecutter-pypackage](https://github.com/browniebroke/cookiecutter-pypackage)\nproject template.\n',
18
+ 'author': 'Bluetooth Devices Authors',
19
+ 'author_email': 'bluetooth@koston.org',
20
+ 'maintainer': 'None',
21
+ 'maintainer_email': 'None',
22
+ 'url': 'https://github.com/bluetooth-devices/dbus-fast',
23
+ 'package_dir': package_dir,
24
+ 'packages': packages,
25
+ 'package_data': package_data,
26
+ 'python_requires': '>=3.9',
27
+ }
28
+ from build_ext import *
29
+ build(setup_kwargs)
30
+
31
+ setup(**setup_kwargs)
@@ -1,4 +1,4 @@
1
- from . import aio, glib, introspection, message_bus, proxy_object, service
1
+ from . import introspection, message_bus, proxy_object, service
2
2
  from .constants import (
3
3
  ArgDirection,
4
4
  BusType,
@@ -40,23 +40,11 @@ from .validators import (
40
40
  )
41
41
 
42
42
  __all__ = [
43
- "aio",
44
- "glib",
45
- "introspection",
46
- "message_bus",
47
- "proxy_object",
48
- "service",
49
43
  "ArgDirection",
50
- "BusType",
51
- "ErrorType",
52
- "MessageFlag",
53
- "MessageType",
54
- "NameFlag",
55
- "PropertyAccess",
56
- "ReleaseNameReply",
57
- "RequestNameReply",
58
44
  "AuthError",
45
+ "BusType",
59
46
  "DBusError",
47
+ "ErrorType",
60
48
  "InterfaceNotFoundError",
61
49
  "InvalidAddressError",
62
50
  "InvalidBusNameError",
@@ -66,9 +54,15 @@ __all__ = [
66
54
  "InvalidMessageError",
67
55
  "InvalidObjectPathError",
68
56
  "InvalidSignatureError",
57
+ "Message",
58
+ "MessageFlag",
59
+ "MessageType",
60
+ "NameFlag",
61
+ "PropertyAccess",
62
+ "ReleaseNameReply",
63
+ "RequestNameReply",
69
64
  "SignalDisabledError",
70
65
  "SignatureBodyMismatchError",
71
- "Message",
72
66
  "SignatureTree",
73
67
  "SignatureType",
74
68
  "Variant",
@@ -76,9 +70,13 @@ __all__ = [
76
70
  "assert_interface_name_valid",
77
71
  "assert_member_name_valid",
78
72
  "assert_object_path_valid",
73
+ "introspection",
79
74
  "is_bus_name_valid",
80
75
  "is_interface_name_valid",
81
76
  "is_member_name_valid",
82
77
  "is_object_path_valid",
78
+ "message_bus",
79
+ "proxy_object",
80
+ "service",
83
81
  "unpack_variants",
84
82
  ]
@@ -3,7 +3,7 @@ __description__ = (
3
3
  "A performant zero-dependency DBus library for Python with asyncio support"
4
4
  )
5
5
  __url__ = "https://github.com/bluetooth-devices/dbus-fast"
6
- __version__ = "1.60.0"
6
+ __version__ = "2.45.0"
7
7
  __author__ = "Bluetooth Devices authors, Tony Crisci"
8
8
  __author_email__ = "bluetooth@koston.org"
9
9
  __license__ = "MIT"
@@ -0,0 +1 @@
1
+ from __future__ import annotations
@@ -1,5 +1,7 @@
1
1
  """Stub for when Cython is not available."""
2
2
 
3
+ from __future__ import annotations
4
+
3
5
 
4
6
  class FakeCython:
5
7
  """Stub for when Cython is not available."""
@@ -0,0 +1,15 @@
1
+ """cdefs for address.py"""
2
+
3
+ import cython
4
+
5
+
6
+ cdef object unquote
7
+
8
+ @cython.locals(kv=cython.str, opt_string=cython.str, address=cython.str)
9
+ cpdef parse_address(cython.str address_str)
10
+
11
+ cpdef get_bus_address(object bus_type)
12
+
13
+ cpdef get_session_bus_address()
14
+
15
+ cpdef get_system_bus_address()