Skip to content

Commit b9c91e7

Browse files
gijzelaerrclaude
andcommitted
Make the demo extras self-contained
Move rich and click into the demo extras so `pip install "python-snap7[demo]"` actually gets you a working demo — the previous split forced users to install [cli,demo] to unlock the rich live dashboard, which nobody would have guessed. rich is still listed under cli too; pip dedupes and it keeps the cli extras independent for anyone who wants the CLI without the demo. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent d445ed5 commit b9c91e7

3 files changed

Lines changed: 9 additions & 7 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Documentation = "https://python-snap7.readthedocs.io/en/latest/"
3535
test = ["pytest", "pytest-asyncio", "pytest-cov", "pytest-html", "hypothesis", "mypy", "types-setuptools", "ruff", "tox", "tox-uv", "types-click", "uv"]
3636
s7commplus = ["cryptography"]
3737
cli = ["rich", "click" ]
38-
demo = ["psutil"]
38+
demo = ["psutil", "rich", "click"]
3939
doc = ["sphinx", "sphinx_rtd_theme"]
4040
discovery = ["pnio-dcp"]
4141

snap7/cli.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,9 @@ def server(port: int) -> None:
157157
def demo(port: int, refresh: float, plain: bool) -> None:
158158
"""Start a live S7 server that exposes real host metrics on DB1.
159159
160-
Requires the ``demo`` extras (psutil). For the live display, also
161-
install the ``cli`` extras (rich):
160+
Install with:
162161
163-
pip install "python-snap7[cli,demo]"
162+
pip install "python-snap7[demo]"
164163
"""
165164
try:
166165
from snap7.demo import run_demo

snap7/demo.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@
66
write to. An optional :mod:`rich` live display shows the current values
77
and logs any writes with a timestamp.
88
9-
This is a demo, not a production tool. Requires the ``demo`` extras
10-
(``psutil``, plus ``rich`` from the ``cli`` extras for the live display)::
9+
This is a demo, not a production tool. Install with::
1110
12-
pip install "python-snap7[cli,demo]"
11+
pip install "python-snap7[demo]"
1312
s7 demo --port 10102
1413
14+
The ``demo`` extras pull in everything the demo needs: ``psutil`` for
15+
metrics, ``rich`` for the live dashboard, and ``click`` for the CLI
16+
entry point.
17+
1518
DB layout
1619
---------
1720

0 commit comments

Comments
 (0)