serialx-compat 1.1.1__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,28 @@
1
+ Metadata-Version: 2.4
2
+ Name: serialx-compat
3
+ Version: 1.1.1
4
+ Summary: Compatibility package exposing pyserial-style imports backed by serialx
5
+ Author-email: puddly <puddly3@gmail.com>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Repository, https://github.com/puddly/serialx
8
+ Requires-Python: >=3.10
9
+ Description-Content-Type: text/markdown
10
+ Requires-Dist: serialx==1.1.1
11
+ Provides-Extra: esphome
12
+ Requires-Dist: serialx[esphome]; extra == "esphome"
13
+ Provides-Extra: dev
14
+ Requires-Dist: serialx[dev]; extra == "dev"
15
+
16
+ # serialx-compat
17
+ `serialx-compat` provides import-path compatibility for projects that expect:
18
+
19
+ - `serial`
20
+ - `serial_asyncio`
21
+ - `serial_asyncio_fast`
22
+
23
+ All functionality is delegated to [`serialx`](https://pypi.org/project/serialx/).
24
+
25
+ > [!IMPORTANT]
26
+ > WARNING: This package intentionally overlaps Python import paths with
27
+ > `pyserial`, `pyserial-asyncio`, and `pyserial-asyncio-fast`. Uninstall those packages
28
+ > first.
@@ -0,0 +1,13 @@
1
+ # serialx-compat
2
+ `serialx-compat` provides import-path compatibility for projects that expect:
3
+
4
+ - `serial`
5
+ - `serial_asyncio`
6
+ - `serial_asyncio_fast`
7
+
8
+ All functionality is delegated to [`serialx`](https://pypi.org/project/serialx/).
9
+
10
+ > [!IMPORTANT]
11
+ > WARNING: This package intentionally overlaps Python import paths with
12
+ > `pyserial`, `pyserial-asyncio`, and `pyserial-asyncio-fast`. Uninstall those packages
13
+ > first.
@@ -0,0 +1,39 @@
1
+ [build-system]
2
+ requires = ["setuptools>=80"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "serialx-compat"
7
+ version = "1.1.1" # Rewritten by CI to match the serialx version
8
+ description = "Compatibility package exposing pyserial-style imports backed by serialx"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = "Apache-2.0"
12
+ authors = [{ name = "puddly", email = "puddly3@gmail.com" }]
13
+ dependencies = ["serialx==1.1.1"] # Rewritten to serialx==<release version> by release CI
14
+
15
+ [project.optional-dependencies]
16
+ esphome = [
17
+ "serialx[esphome]",
18
+ ]
19
+
20
+ dev = [
21
+ "serialx[dev]",
22
+ ]
23
+
24
+ [project.urls]
25
+ Repository = "https://github.com/puddly/serialx"
26
+
27
+ [tool.setuptools]
28
+ py-modules = ["serial_asyncio", "serial_asyncio_fast"]
29
+
30
+ [tool.setuptools.packages.find]
31
+ include = ["serial", "serial.*"]
32
+
33
+ [tool.pytest.ini_options]
34
+ testpaths = ["tests"]
35
+
36
+ [tool.mypy]
37
+ check_untyped_defs = true
38
+ show_error_codes = true
39
+ show_error_context = true
@@ -0,0 +1,79 @@
1
+ """Compatibility shim for pyserial's ``serial`` package backed by serialx."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import importlib.util
6
+
7
+ if importlib.util.find_spec("serial.serialcli"):
8
+ raise RuntimeError(
9
+ "serialx-compat detected a mixed installation with pyserial files. Uninstall"
10
+ " pyserial, pyserial-asyncio, and pyserial-asyncio-fast before installing"
11
+ " serialx-compat."
12
+ )
13
+
14
+ from importlib.metadata import version
15
+
16
+ from serialx import (
17
+ CR,
18
+ EIGHTBITS,
19
+ LF,
20
+ PARITY_EVEN,
21
+ PARITY_NONE,
22
+ PARITY_ODD,
23
+ SEVENBITS,
24
+ STOPBITS_ONE,
25
+ STOPBITS_TWO,
26
+ BaseSerial,
27
+ BaseSerialTransport,
28
+ ModemPins,
29
+ Parity,
30
+ PinState,
31
+ Serial,
32
+ SerialException,
33
+ SerialPortInfo,
34
+ SerialStreamWriter,
35
+ SerialTimeoutException,
36
+ SerialTransport,
37
+ StopBits,
38
+ UnsupportedSetting,
39
+ create_serial_connection,
40
+ get_serial_classes,
41
+ list_serial_ports,
42
+ open_serial_connection,
43
+ serial_for_url,
44
+ )
45
+
46
+ VERSION = version("serialx-compat")
47
+ __version__ = VERSION
48
+
49
+ __all__ = [
50
+ "create_serial_connection",
51
+ "get_serial_classes",
52
+ "list_serial_ports",
53
+ "open_serial_connection",
54
+ "serial_for_url",
55
+ "ModemPins",
56
+ "Parity",
57
+ "PinState",
58
+ "BaseSerial",
59
+ "BaseSerialTransport",
60
+ "Serial",
61
+ "SerialException",
62
+ "UnsupportedSetting",
63
+ "SerialPortInfo",
64
+ "SerialStreamWriter",
65
+ "SerialTransport",
66
+ "StopBits",
67
+ "SerialTimeoutException",
68
+ "EIGHTBITS",
69
+ "SEVENBITS",
70
+ "PARITY_NONE",
71
+ "PARITY_EVEN",
72
+ "PARITY_ODD",
73
+ "STOPBITS_ONE",
74
+ "STOPBITS_TWO",
75
+ "CR",
76
+ "LF",
77
+ "VERSION",
78
+ "__version__",
79
+ ]
@@ -0,0 +1,8 @@
1
+ """Compatibility shim for pyserial's ``serial.serialutil`` module."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from serialx.serialutil import * # noqa: F401,F403
6
+ from serialx.serialutil import __all__ as _serialutil_all
7
+
8
+ __all__ = _serialutil_all
@@ -0,0 +1,5 @@
1
+ """Compatibility shim for pyserial's ``serial.tools`` package."""
2
+
3
+ from __future__ import annotations
4
+
5
+ __all__: list[str] = []
@@ -0,0 +1,8 @@
1
+ """Compatibility shim for pyserial's ``serial.tools.list_ports`` module."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from serialx.tools.list_ports import * # noqa: F401,F403
6
+ from serialx.tools.list_ports import __all__ as _list_ports_all
7
+
8
+ __all__ = _list_ports_all
@@ -0,0 +1,8 @@
1
+ """Compatibility shim for ``serial.tools.list_ports_common`` module."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from serialx.tools.list_ports_common import * # noqa: F401,F403
6
+ from serialx.tools.list_ports_common import __all__ as _list_ports_common_all
7
+
8
+ __all__ = _list_ports_common_all
@@ -0,0 +1,24 @@
1
+ """Compatibility shim for ``serial_asyncio`` backed by serialx."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from importlib.metadata import version
6
+
7
+ from serialx import (
8
+ SerialStreamWriter,
9
+ SerialTransport,
10
+ create_serial_connection,
11
+ open_serial_connection,
12
+ )
13
+
14
+ VERSION = version("serialx-compat")
15
+ __version__ = VERSION
16
+
17
+ __all__ = [
18
+ "SerialStreamWriter",
19
+ "SerialTransport",
20
+ "create_serial_connection",
21
+ "open_serial_connection",
22
+ "VERSION",
23
+ "__version__",
24
+ ]
@@ -0,0 +1,24 @@
1
+ """Compatibility shim for ``serial_asyncio_fast`` backed by serialx."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from importlib.metadata import version
6
+
7
+ from serialx import (
8
+ SerialStreamWriter,
9
+ SerialTransport,
10
+ create_serial_connection,
11
+ open_serial_connection,
12
+ )
13
+
14
+ VERSION = version("serialx-compat")
15
+ __version__ = VERSION
16
+
17
+ __all__ = [
18
+ "SerialStreamWriter",
19
+ "SerialTransport",
20
+ "create_serial_connection",
21
+ "open_serial_connection",
22
+ "VERSION",
23
+ "__version__",
24
+ ]
@@ -0,0 +1,28 @@
1
+ Metadata-Version: 2.4
2
+ Name: serialx-compat
3
+ Version: 1.1.1
4
+ Summary: Compatibility package exposing pyserial-style imports backed by serialx
5
+ Author-email: puddly <puddly3@gmail.com>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Repository, https://github.com/puddly/serialx
8
+ Requires-Python: >=3.10
9
+ Description-Content-Type: text/markdown
10
+ Requires-Dist: serialx==1.1.1
11
+ Provides-Extra: esphome
12
+ Requires-Dist: serialx[esphome]; extra == "esphome"
13
+ Provides-Extra: dev
14
+ Requires-Dist: serialx[dev]; extra == "dev"
15
+
16
+ # serialx-compat
17
+ `serialx-compat` provides import-path compatibility for projects that expect:
18
+
19
+ - `serial`
20
+ - `serial_asyncio`
21
+ - `serial_asyncio_fast`
22
+
23
+ All functionality is delegated to [`serialx`](https://pypi.org/project/serialx/).
24
+
25
+ > [!IMPORTANT]
26
+ > WARNING: This package intentionally overlaps Python import paths with
27
+ > `pyserial`, `pyserial-asyncio`, and `pyserial-asyncio-fast`. Uninstall those packages
28
+ > first.
@@ -0,0 +1,15 @@
1
+ README.md
2
+ pyproject.toml
3
+ serial_asyncio.py
4
+ serial_asyncio_fast.py
5
+ serial/__init__.py
6
+ serial/serialutil.py
7
+ serial/tools/__init__.py
8
+ serial/tools/list_ports.py
9
+ serial/tools/list_ports_common.py
10
+ serialx_compat.egg-info/PKG-INFO
11
+ serialx_compat.egg-info/SOURCES.txt
12
+ serialx_compat.egg-info/dependency_links.txt
13
+ serialx_compat.egg-info/requires.txt
14
+ serialx_compat.egg-info/top_level.txt
15
+ tests/test_compat_imports.py
@@ -0,0 +1,7 @@
1
+ serialx==1.1.1
2
+
3
+ [dev]
4
+ serialx[dev]
5
+
6
+ [esphome]
7
+ serialx[esphome]
@@ -0,0 +1,3 @@
1
+ serial
2
+ serial_asyncio
3
+ serial_asyncio_fast
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,42 @@
1
+ """Smoke tests for import compatibility shims."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import serial
6
+ import serial.serialutil
7
+ import serial.tools
8
+ import serial.tools.list_ports
9
+ import serial.tools.list_ports_common
10
+ import serial_asyncio
11
+ import serial_asyncio_fast
12
+
13
+
14
+ def test_serial_exports_versions_and_core_symbols() -> None:
15
+ """Serial module exposes expected symbols and version attributes."""
16
+ assert serial.__version__ == serial.VERSION
17
+ assert isinstance(serial.VERSION, str)
18
+ assert hasattr(serial, "Serial")
19
+ assert hasattr(serial, "serial_for_url")
20
+
21
+
22
+ def test_serial_submodules_are_importable() -> None:
23
+ """Serial package submodules expected by pyserial users import correctly."""
24
+ assert hasattr(serial.tools.list_ports, "comports")
25
+
26
+
27
+ def test_serial_asyncio_exports_versions_and_core_symbols() -> None:
28
+ """serial_asyncio module exposes expected symbols and version attributes."""
29
+ assert serial_asyncio.__version__ == serial_asyncio.VERSION
30
+ assert isinstance(serial_asyncio.VERSION, str)
31
+ assert hasattr(serial_asyncio, "create_serial_connection")
32
+ assert hasattr(serial_asyncio, "open_serial_connection")
33
+ assert hasattr(serial_asyncio, "SerialTransport")
34
+
35
+
36
+ def test_serial_asyncio_fast_exports_versions_and_core_symbols() -> None:
37
+ """serial_asyncio_fast module exposes expected symbols and version attributes."""
38
+ assert serial_asyncio_fast.__version__ == serial_asyncio_fast.VERSION
39
+ assert isinstance(serial_asyncio_fast.VERSION, str)
40
+ assert hasattr(serial_asyncio_fast, "create_serial_connection")
41
+ assert hasattr(serial_asyncio_fast, "open_serial_connection")
42
+ assert hasattr(serial_asyncio_fast, "SerialTransport")