aio-usb-hotplug 5.2.0__tar.gz → 7.0.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.
@@ -0,0 +1,14 @@
1
+ *.egg-info
2
+ *.pyc
3
+ *.pyo
4
+ .coverage
5
+ .python-version
6
+ .tags
7
+ build/
8
+ dist/
9
+ htmlcov/
10
+ .eggs/
11
+ .pytest_cache/
12
+ .tox/
13
+ .venv/
14
+ .vscode/
@@ -1,23 +1,16 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: aio-usb-hotplug
3
- Version: 5.2.0
3
+ Version: 7.0.0
4
4
  Summary: Asynchronous generators yielding detected hotplug events on the USB buses
5
- Home-page: https://github.com/ntamas/aio-usb-hotplug/
6
- License: MIT
7
- Author: Tamas Nepusz
8
- Author-email: tamas@collmot.com
9
- Requires-Python: >=3.7,<4.0
10
- Classifier: License :: OSI Approved :: MIT License
11
- Classifier: Programming Language :: Python :: 3
12
- Classifier: Programming Language :: Python :: 3.7
13
- Classifier: Programming Language :: Python :: 3.8
14
- Classifier: Programming Language :: Python :: 3.9
15
- Classifier: Programming Language :: Python :: 3.10
16
- Classifier: Programming Language :: Python :: 3.11
17
- Requires-Dist: anyio (>=3.0.0,<4.0.0)
18
- Requires-Dist: pyudev (>=0.22.0); sys_platform == "linux"
19
- Requires-Dist: pyusb (>=1.1.0,<2.0.0)
5
+ Project-URL: Homepage, https://github.com/ntamas/aio-usb-hotplug/
20
6
  Project-URL: Repository, https://github.com/ntamas/aio-usb-hotplug/
7
+ Author-email: Tamas Nepusz <tamas@collmot.com>
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ Requires-Python: >=3.9
11
+ Requires-Dist: anyio>=4.9.0
12
+ Requires-Dist: pyudev>=0.24.3; sys_platform == 'linux'
13
+ Requires-Dist: pyusb>=1.3.1
21
14
  Description-Content-Type: text/markdown
22
15
 
23
16
  # aio-usb-hotplug
@@ -25,7 +18,7 @@ Description-Content-Type: text/markdown
25
18
  `aio-usb-hotplug` is a Python library that provides asynchronous generators
26
19
  yielding detected hotplug events on the USB buses.
27
20
 
28
- Requires Python >= 3.7.
21
+ Requires Python >= 3.8.
29
22
 
30
23
  Works with [`asyncio`](https://docs.python.org/3/library/asyncio.html)
31
24
  and [`trio`](https://trio.readthedocs.io/en/stable/).
@@ -106,4 +99,3 @@ Please make sure to update tests as appropriate.
106
99
  ## License
107
100
 
108
101
  [MIT](https://choosealicense.com/licenses/mit/)
109
-
@@ -3,7 +3,7 @@
3
3
  `aio-usb-hotplug` is a Python library that provides asynchronous generators
4
4
  yielding detected hotplug events on the USB buses.
5
5
 
6
- Requires Python >= 3.7.
6
+ Requires Python >= 3.8.
7
7
 
8
8
  Works with [`asyncio`](https://docs.python.org/3/library/asyncio.html)
9
9
  and [`trio`](https://trio.readthedocs.io/en/stable/).
@@ -0,0 +1,52 @@
1
+ [project]
2
+ name = "aio-usb-hotplug"
3
+ version = "7.0.0"
4
+ description = "Asynchronous generators yielding detected hotplug events on the USB buses"
5
+ license = "MIT"
6
+ readme = "README.md"
7
+ authors = [{ name = "Tamas Nepusz", email = "tamas@collmot.com" }]
8
+ requires-python = ">=3.9"
9
+ dependencies = [
10
+ "anyio (>=4.9.0)",
11
+ 'pyudev (>=0.24.3) ; sys_platform == "linux"',
12
+ "pyusb (>=1.3.1)",
13
+ ]
14
+
15
+ [project.urls]
16
+ Homepage = "https://github.com/ntamas/aio-usb-hotplug/"
17
+ Repository = "https://github.com/ntamas/aio-usb-hotplug/"
18
+
19
+ [dependency-groups]
20
+ dev = [
21
+ "pytest (>=8.4.1)",
22
+ "coverage[toml] (>=7.9.1)",
23
+ "pytest-cov (>=6.2.1)",
24
+ "trio>=0.30.0",
25
+ ]
26
+
27
+ [tool.hatch.envs.hatch-test]
28
+ extra-dependencies = ["libusb-package", "trio"]
29
+
30
+ [tool.hatch.build.targets.sdist]
31
+ include = ["src"]
32
+
33
+ [tool.hatch.build.targets.wheel]
34
+ packages = ["src/aio_usb_hotplug"]
35
+
36
+ [tool.coverage.paths]
37
+ source = ["src"]
38
+
39
+ [tool.coverage.run]
40
+ branch = true
41
+ source = ["src"]
42
+
43
+ [tool.coverage.report]
44
+ show_missing = true
45
+
46
+ [tool.ruff]
47
+ lint.ignore = ["B905", "E402", "E501"]
48
+ lint.select = ["B", "C", "E", "F", "W"]
49
+
50
+ [build-system]
51
+ requires = ["hatchling"]
52
+ build-backend = "hatchling.build"
@@ -11,7 +11,7 @@ Device = Any
11
11
  class USBBusScannerBackend(metaclass=ABCMeta):
12
12
  """Interface specification for USB bus scanner backends."""
13
13
 
14
- def configure(self, configuration: Dict[str, Any]) -> None:
14
+ def configure(self, configuration: Dict[str, Any]) -> None: # noqa: B027
15
15
  """Configures the scanner backend and specifies which devices the
16
16
  backend should report.
17
17
 
@@ -98,7 +98,7 @@ class HotplugDetector:
98
98
  self,
99
99
  params: Optional[Dict] = None,
100
100
  *,
101
- backend: Callable[[], USBBusScannerBackend] = choose_backend
101
+ backend: Callable[[], USBBusScannerBackend] = choose_backend,
102
102
  ):
103
103
  """Constructor.
104
104
 
@@ -149,7 +149,7 @@ class HotplugDetector:
149
149
  added = {}
150
150
  seen = set()
151
151
 
152
- for index, device in enumerate(devices):
152
+ for _index, device in enumerate(devices):
153
153
  key = key_of(device)
154
154
  if key in self._active:
155
155
  seen.add(key)
@@ -198,7 +198,7 @@ class HotplugDetector:
198
198
  task: Callable[[Device], Coroutine],
199
199
  *,
200
200
  predicate: Optional[Callable[[Device], bool]] = None,
201
- cancellable: bool = True
201
+ cancellable: bool = True,
202
202
  ) -> None:
203
203
  """Runs a background task that listens for hotplug events and runs an
204
204
  asynchronous task for each device that was added to the USB bus.
@@ -1,2 +1,2 @@
1
- __version_info__ = (5, 2, 0)
1
+ __version_info__ = (7, 0, 0)
2
2
  __version__ = ".".join("{0}".format(x) for x in __version_info__)
@@ -1,40 +0,0 @@
1
- [tool.poetry]
2
- name = "aio-usb-hotplug"
3
- version = "5.2.0"
4
- description = "Asynchronous generators yielding detected hotplug events on the USB buses"
5
- license = "MIT"
6
- readme = "README.md"
7
- homepage = "https://github.com/ntamas/aio-usb-hotplug/"
8
- repository = "https://github.com/ntamas/aio-usb-hotplug/"
9
- authors = ["Tamas Nepusz <tamas@collmot.com>"]
10
- packages = [
11
- { include = "aio_usb_hotplug", from = "src" }
12
- ]
13
-
14
- [tool.poetry.dependencies]
15
- python = "^3.7"
16
- anyio = "^3.0.0"
17
- pyudev = { version = ">=0.22.0", platform = "linux" }
18
- pyusb = "^1.1.0"
19
-
20
- [tool.poetry.dev-dependencies]
21
- pytest = "^7.2.0"
22
- coverage = {extras = ["toml"], version = "^6.0"}
23
- pytest-cov = "^4.0.0"
24
- trio = "^0.19.0"
25
-
26
- [tool.poetry.scripts]
27
-
28
- [tool.coverage.paths]
29
- source = ["src"]
30
-
31
- [tool.coverage.run]
32
- branch = true
33
- source = ["src"]
34
-
35
- [tool.coverage.report]
36
- show_missing = true
37
-
38
- [build-system]
39
- requires = ["poetry>=0.12"]
40
- build-backend = "poetry.masonry.api"
@@ -1,38 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- from setuptools import setup
3
-
4
- package_dir = \
5
- {'': 'src'}
6
-
7
- packages = \
8
- ['aio_usb_hotplug', 'aio_usb_hotplug.backends']
9
-
10
- package_data = \
11
- {'': ['*']}
12
-
13
- install_requires = \
14
- ['anyio>=3.0.0,<4.0.0', 'pyusb>=1.1.0,<2.0.0']
15
-
16
- extras_require = \
17
- {':sys_platform == "linux"': ['pyudev>=0.22.0']}
18
-
19
- setup_kwargs = {
20
- 'name': 'aio-usb-hotplug',
21
- 'version': '5.2.0',
22
- 'description': 'Asynchronous generators yielding detected hotplug events on the USB buses',
23
- 'long_description': '# aio-usb-hotplug\n\n`aio-usb-hotplug` is a Python library that provides asynchronous generators\nyielding detected hotplug events on the USB buses.\n\nRequires Python >= 3.7.\n\nWorks with [`asyncio`](https://docs.python.org/3/library/asyncio.html)\nand [`trio`](https://trio.readthedocs.io/en/stable/).\n\n## Installation\n\nUse the package manager [pip](https://pip.pypa.io/en/stable/) to install\n`aio-usb-hotplug`.\n\n```bash\npip install aio-usb-hotplug\n```\n\n`aio-usb-hotplug` depends on [PyUSB](https://pypi.org/pypi/pyusb), which\nin turn requires [libusb](https://libusb.info) or\n[openusb](https://sourceforge.net/projects/openusb/). An easy way to satisfy\nthis requirement is to install\n[libusb-package](https://pypi.org/pypi/libusb-package), which supplies\npre-compiled binaries for most platforms:\n\n```bash\npip install libusb-package\n```\n\n`aio-usb-hotplug` will make use of\n[libusb-package](https://pypi.org/pypi/libusb-package) if it is installed in\nthe current Python environment.\n\n## Usage\n\n### Dump all hotplug events related to a specific USB device\n\n```python\nfrom aio_usb_hotplug import HotplugDetector\nfrom trio import run # ...or asyncio\n\nasync def dump_events():\n detector = HotplugDetector.for_device(vid="1050", pid="0407")\n async for event in detector.events():\n print(repr(event))\n\ntrio.run(dump_events)\n```\n\n### Run an async task for each USB device matching a VID/PID pair\n\n```python\nfrom aio_usb_hotplug import HotplugDetector\nfrom trio import sleep_forever\n\n\nasync def handle_device(device):\n print("Handling device:", repr(device))\n try:\n # Do something meaningful with the device. The task gets cancelled\n # when the device is unplugged.\n await sleep_forever()\n finally:\n # Device unplugged or an exception happened\n print("Stopped handling device:", repr(device))\n\n\nasync def handle_detected_devices():\n detector = HotplugDetector.for_device(vid="1050", pid="0407")\n await detector.run_for_each_device(handle_device)\n\n\ntrio.run(handle_detected_devices)\n```\n\n## Contributing\n\nPull requests are welcome. For major changes, please open an issue first to\ndiscuss what you would like to change.\n\nPlease make sure to update tests as appropriate.\n\n## License\n\n[MIT](https://choosealicense.com/licenses/mit/)\n',
24
- 'author': 'Tamas Nepusz',
25
- 'author_email': 'tamas@collmot.com',
26
- 'maintainer': 'None',
27
- 'maintainer_email': 'None',
28
- 'url': 'https://github.com/ntamas/aio-usb-hotplug/',
29
- 'package_dir': package_dir,
30
- 'packages': packages,
31
- 'package_data': package_data,
32
- 'install_requires': install_requires,
33
- 'extras_require': extras_require,
34
- 'python_requires': '>=3.7,<4.0',
35
- }
36
-
37
-
38
- setup(**setup_kwargs)
File without changes