From 22f9adb8e33b4a7f518ef5f47b10704972575eea Mon Sep 17 00:00:00 2001 From: Darren Burns Date: Tue, 14 Jun 2022 17:06:15 +0100 Subject: [PATCH 1/6] Make devtools deps extras, add note to internal ref docs, raise exception when deps missing --- pyproject.toml | 8 +++++++- reference/_devtools.md | 12 ++++++++++++ src/textual/app.py | 4 +--- src/textual/devtools/client.py | 21 ++++++++++++++++++--- 4 files changed, 38 insertions(+), 7 deletions(-) create mode 100644 reference/_devtools.md diff --git a/pyproject.toml b/pyproject.toml index ff29418295..c446f5fa89 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,7 +27,10 @@ rich = "^12.4.3" click = "8.1.2" importlib-metadata = "^4.11.3" typing-extensions = { version = "^4.0.0", python = "<3.8" } -msgpack = "^1.0.3" + +# Dependencies below are required for devtools only +aiohttp = { version = "^3.8.1", optional = true } +msgpack = { version = "^1.0.3", optional = true } [tool.poetry.dev-dependencies] pytest = "^6.2.3" @@ -42,6 +45,9 @@ pytest-aiohttp = "^1.0.4" time-machine = "^2.6.0" Jinja2 = "<3.1.0" +[tool.poetry.extras] +dev = ["aiohttp", "msgpack"] + [tool.black] includes = "src" diff --git a/reference/_devtools.md b/reference/_devtools.md new file mode 100644 index 0000000000..95ddb47e0f --- /dev/null +++ b/reference/_devtools.md @@ -0,0 +1,12 @@ +# Devtools + +## Installation + +Using the Textual Devtools requires installation of the `dev` extra dependency. + +https://python-poetry.org/docs/pyproject/#extras + +## Running + +TODO: Note how we run the devtools themselves and how we run our Textual apps +such that they can connect. Don't forget Windows instructions :) diff --git a/src/textual/app.py b/src/textual/app.py index 398f38324c..7dae3407bd 100644 --- a/src/textual/app.py +++ b/src/textual/app.py @@ -34,7 +34,7 @@ from rich.console import Console, RenderableType from rich.measure import Measurement from rich.protocol import is_renderable -from rich.segment import Segments, SegmentLines +from rich.segment import Segments from rich.traceback import Traceback from . import actions @@ -47,7 +47,6 @@ from ._event_broker import extract_handler_actions, NoHandler from .binding import Bindings, NoBinding from .css.stylesheet import Stylesheet -from .css.styles import RenderStyles from .css.query import NoMatchingNodesError from .design import ColorSystem from .devtools.client import DevtoolsClient, DevtoolsConnectionError, DevtoolsLog @@ -61,7 +60,6 @@ from .message_pump import MessagePump from .reactive import Reactive from .renderables.blank import Blank -from ._profile import timer from .screen import Screen from .widget import Widget diff --git a/src/textual/devtools/client.py b/src/textual/devtools/client.py index 7d34aaab31..c9a526d9bf 100644 --- a/src/textual/devtools/client.py +++ b/src/textual/devtools/client.py @@ -3,19 +3,34 @@ import asyncio import inspect import json -import msgpack + import pickle from time import time from asyncio import Queue, Task, QueueFull from io import StringIO from typing import Type, Any, NamedTuple -import aiohttp -from aiohttp import ClientResponseError, ClientConnectorError, ClientWebSocketResponse from rich.console import Console from rich.segment import Segment +class DevtoolsDependenciesMissingError(Exception): + """Raise when the required devtools dependencies are not installed in the environment""" + + +try: + import aiohttp + from aiohttp import ( + ClientResponseError, + ClientConnectorError, + ClientWebSocketResponse, + ) + import msgpack +except ImportError: + raise DevtoolsDependenciesMissingError( + "Textual Devtools requires installation of the 'dev' extra dependencies. " + ) + DEVTOOLS_PORT = 8081 WEBSOCKET_CONNECT_TIMEOUT = 3 LOG_QUEUE_MAXSIZE = 512 From 20eceb69aa2a20464edee5d644d1fa116e62e85d Mon Sep 17 00:00:00 2001 From: Darren Burns Date: Wed, 15 Jun 2022 10:12:32 +0100 Subject: [PATCH 2/6] Ensure dev extras are installed in GitHub Actions --- .github/workflows/pythonpackage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index e5b50637ef..7e7d6fabc1 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -25,7 +25,7 @@ jobs: version: 1.1.6 virtualenvs-in-project: true - name: Install dependencies - run: poetry install + run: poetry install --extras "dev" if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' - name: Format check with black run: | From bfc585a7e60073ddab7ad62f03df22c0e1bb9fd4 Mon Sep 17 00:00:00 2001 From: Darren Burns Date: Wed, 15 Jun 2022 10:14:23 +0100 Subject: [PATCH 3/6] Update lockfile --- poetry.lock | 105 +++++++++++++++++++++++++++------------------------- 1 file changed, 54 insertions(+), 51 deletions(-) diff --git a/poetry.lock b/poetry.lock index 5d288f9ecb..71e7f4179a 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2,7 +2,7 @@ name = "aiohttp" version = "3.8.1" description = "Async http client/server framework (asyncio)" -category = "dev" +category = "main" optional = false python-versions = ">=3.6" @@ -24,7 +24,7 @@ speedups = ["aiodns", "brotli", "cchardet"] name = "aiosignal" version = "1.2.0" description = "aiosignal: a list of registered asynchronous callbacks" -category = "dev" +category = "main" optional = false python-versions = ">=3.6" @@ -35,7 +35,7 @@ frozenlist = ">=1.1.0" name = "async-timeout" version = "4.0.2" description = "Timeout context manager for asyncio programs" -category = "dev" +category = "main" optional = false python-versions = ">=3.6" @@ -46,7 +46,7 @@ typing-extensions = {version = ">=3.6.5", markers = "python_version < \"3.8\""} name = "asynctest" version = "0.13.0" description = "Enhance the standard unittest package with features for testing asyncio libraries" -category = "dev" +category = "main" optional = false python-versions = ">=3.5" @@ -62,7 +62,7 @@ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" name = "attrs" version = "21.4.0" description = "Classes Without Boilerplate" -category = "dev" +category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" @@ -115,7 +115,7 @@ python-versions = ">=3.6.1" name = "charset-normalizer" version = "2.0.12" description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." -category = "dev" +category = "main" optional = false python-versions = ">=3.5.0" @@ -188,7 +188,7 @@ testing = ["covdefaults (>=1.2.0)", "coverage (>=4)", "pytest (>=4)", "pytest-co name = "frozenlist" version = "1.3.0" description = "A list-like structure which implements collections.abc.MutableSequence" -category = "dev" +category = "main" optional = false python-versions = ">=3.7" @@ -208,7 +208,7 @@ dev = ["twine", "markdown", "flake8", "wheel"] [[package]] name = "griffe" -version = "0.19.3" +version = "0.20.0" description = "Signatures for entire Python programs. Extract the structure, the frame, the skeleton of your project, to generate API documentation or find breaking changes in your API." category = "dev" optional = false @@ -235,7 +235,7 @@ license = ["ukkonen"] name = "idna" version = "3.3" description = "Internationalized Domain Names in Applications (IDNA)" -category = "dev" +category = "main" optional = false python-versions = ">=3.5" @@ -345,14 +345,14 @@ mkdocs = ">=1.1" [[package]] name = "mkdocs-material" -version = "8.3.0" +version = "8.3.5" description = "Documentation that simply works" category = "dev" optional = false python-versions = ">=3.7" [package.dependencies] -jinja2 = ">=2.11.1" +jinja2 = ">=3.0.2" markdown = ">=3.2" mkdocs = ">=1.3.0" mkdocs-material-extensions = ">=1.0.3" @@ -391,7 +391,7 @@ python-legacy = ["mkdocstrings-python-legacy (>=0.2.1)"] [[package]] name = "mkdocstrings-python" -version = "0.7.0" +version = "0.7.1" description = "A Python handler for mkdocstrings." category = "dev" optional = false @@ -406,14 +406,14 @@ name = "msgpack" version = "1.0.4" description = "MessagePack serializer" category = "main" -optional = false +optional = true python-versions = "*" [[package]] name = "multidict" version = "6.0.2" description = "multidict implementation" -category = "dev" +category = "main" optional = false python-versions = ">=3.7" @@ -533,7 +533,7 @@ python-versions = ">=3.6" [[package]] name = "pymdown-extensions" -version = "9.4" +version = "9.5" description = "Extension pack for Python Markdown." category = "dev" optional = false @@ -740,7 +740,7 @@ testing = ["coverage (>=4)", "coverage-enable-subprocess (>=1)", "flaky (>=3)", [[package]] name = "watchdog" -version = "2.1.8" +version = "2.1.9" description = "Filesystem events monitoring" category = "dev" optional = false @@ -753,7 +753,7 @@ watchmedo = ["PyYAML (>=3.10)"] name = "yarl" version = "1.7.2" description = "Yet another URL library" -category = "dev" +category = "main" optional = false python-versions = ">=3.6" @@ -774,10 +774,13 @@ python-versions = ">=3.7" docs = ["sphinx", "jaraco.packaging (>=9)", "rst.linker (>=1.9)"] testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-cov", "pytest-enabler (>=1.0.1)", "jaraco.itertools", "func-timeout", "pytest-black (>=0.3.7)", "pytest-mypy (>=0.9.1)"] +[extras] +dev = ["aiohttp", "msgpack"] + [metadata] lock-version = "1.1" python-versions = "^3.7" -content-hash = "378a60041202d505cba26ea7084886fe1b01090a0035253b100593b559aed090" +content-hash = "fa967da13a215abd45b601b171943b3dfb94ecbeffa8078d9e53f22e249f513b" [metadata.files] aiohttp = [ @@ -1040,8 +1043,8 @@ ghp-import = [ {file = "ghp_import-2.1.0-py3-none-any.whl", hash = "sha256:8337dd7b50877f163d4c0289bc1f1c7f127550241988d568c1db512c4324a619"}, ] griffe = [ - {file = "griffe-0.19.3-py3-none-any.whl", hash = "sha256:348422f0e303ff3b76d6b35a96fa9c90dddcbe175506171fda78e8e5cf8c4246"}, - {file = "griffe-0.19.3.tar.gz", hash = "sha256:3a51e53bc58c45d38d6d7b4509b41b153b506de3df99767e6f891c75d91706a5"}, + {file = "griffe-0.20.0-py3-none-any.whl", hash = "sha256:899e0c9c09baf22b31de1c969a03edaf0ddf72d0a7183df8de746b6c26ed62f4"}, + {file = "griffe-0.20.0.tar.gz", hash = "sha256:bf181de6e661c0d2a229c1dc7e90db0def280ee3a89c6829fcc1695baee65f7f"}, ] identify = [ {file = "identify-2.5.1-py2.py3-none-any.whl", hash = "sha256:0dca2ea3e4381c435ef9c33ba100a78a9b40c0bab11189c7cf121f75815efeaa"}, @@ -1122,8 +1125,8 @@ mkdocs-autorefs = [ {file = "mkdocs_autorefs-0.4.1-py3-none-any.whl", hash = "sha256:a2248a9501b29dc0cc8ba4c09f4f47ff121945f6ce33d760f145d6f89d313f5b"}, ] mkdocs-material = [ - {file = "mkdocs-material-8.3.0.tar.gz", hash = "sha256:4cad98c47c49a86591ed16a790c07d59402901fc5345f575a3b7329403f5c66e"}, - {file = "mkdocs_material-8.3.0-py2.py3-none-any.whl", hash = "sha256:e37e7da1c5923c5b9f0bb8c4ad90bc694fee8f966b43b302a7ff61cb2c35c2e0"}, + {file = "mkdocs-material-8.3.5.tar.gz", hash = "sha256:0d7ae82b28fa57a2ad9a4eeb5fd01704cb8fe963eb20c56a68afdd735e52b432"}, + {file = "mkdocs_material-8.3.5-py2.py3-none-any.whl", hash = "sha256:9190aef365bd6ed43b27f47d1de956d9e67b61f4b9edb444563337ef717cacd3"}, ] mkdocs-material-extensions = [ {file = "mkdocs-material-extensions-1.0.3.tar.gz", hash = "sha256:bfd24dfdef7b41c312ede42648f9eb83476ea168ec163b613f9abd12bbfddba2"}, @@ -1134,8 +1137,8 @@ mkdocstrings = [ {file = "mkdocstrings-0.19.0.tar.gz", hash = "sha256:efa34a67bad11229d532d89f6836a8a215937548623b64f3698a1df62e01cc3e"}, ] mkdocstrings-python = [ - {file = "mkdocstrings-python-0.7.0.tar.gz", hash = "sha256:e54c67890e8bb7dc4604360c8ef5dd214b23b6924de7706f461e3c998d4ea061"}, - {file = "mkdocstrings_python-0.7.0-py3-none-any.whl", hash = "sha256:6964bd92f106766e771ac6cd5bc02643a960602b4d921b95362e31d491e9a6db"}, + {file = "mkdocstrings-python-0.7.1.tar.gz", hash = "sha256:c334b382dca202dfa37071c182418a6df5818356a95d54362a2b24822ca3af71"}, + {file = "mkdocstrings_python-0.7.1-py3-none-any.whl", hash = "sha256:a22060bfa374697678e9af4e62b020d990dad2711c98f7a9fac5c0345bef93c7"}, ] msgpack = [ {file = "msgpack-1.0.4-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:4ab251d229d10498e9a2f3b1e68ef64cb393394ec477e3370c457f9430ce9250"}, @@ -1314,8 +1317,8 @@ pygments = [ {file = "Pygments-2.12.0.tar.gz", hash = "sha256:5eb116118f9612ff1ee89ac96437bb6b49e8f04d8a13b514ba26f620208e26eb"}, ] pymdown-extensions = [ - {file = "pymdown_extensions-9.4-py3-none-any.whl", hash = "sha256:5b7432456bf555ce2b0ab3c2439401084cda8110f24f6b3ecef952b8313dfa1b"}, - {file = "pymdown_extensions-9.4.tar.gz", hash = "sha256:1baa22a60550f731630474cad28feb0405c8101f1a7ddc3ec0ed86ee510bcc43"}, + {file = "pymdown_extensions-9.5-py3-none-any.whl", hash = "sha256:ec141c0f4983755349f0c8710416348d1a13753976c028186ed14f190c8061c4"}, + {file = "pymdown_extensions-9.5.tar.gz", hash = "sha256:3ef2d998c0d5fa7eb09291926d90d69391283561cf6306f85cd588a5eb5befa0"}, ] pyparsing = [ {file = "pyparsing-3.0.9-py3-none-any.whl", hash = "sha256:5026bae9a10eeaefb61dab2f09052b9f4307d44aee4eda64b309723d8d206bbc"}, @@ -1474,31 +1477,31 @@ virtualenv = [ {file = "virtualenv-20.14.1.tar.gz", hash = "sha256:ef589a79795589aada0c1c5b319486797c03b67ac3984c48c669c0e4f50df3a5"}, ] watchdog = [ - {file = "watchdog-2.1.8-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:676263bee67b165f16b05abc52acc7a94feac5b5ab2449b491f1a97638a79277"}, - {file = "watchdog-2.1.8-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:aa68d2d9a89d686fae99d28a6edf3b18595e78f5adf4f5c18fbfda549ac0f20c"}, - {file = "watchdog-2.1.8-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:5e2e51c53666850c3ecffe9d265fc5d7351db644de17b15e9c685dd3cdcd6f97"}, - {file = "watchdog-2.1.8-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:7721ac736170b191c50806f43357407138c6748e4eb3e69b071397f7f7aaeedd"}, - {file = "watchdog-2.1.8-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:ce7376aed3da5fd777483fe5ebc8475a440c6d18f23998024f832134b2938e7b"}, - {file = "watchdog-2.1.8-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:f9ee4c6bf3a1b2ed6be90a2d78f3f4bbd8105b6390c04a86eb48ed67bbfa0b0b"}, - {file = "watchdog-2.1.8-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:68dbe75e0fa1ba4d73ab3f8e67b21770fbed0651d32ce515cd38919a26873266"}, - {file = "watchdog-2.1.8-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:0c520009b8cce79099237d810aaa19bc920941c268578436b62013b2f0102320"}, - {file = "watchdog-2.1.8-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:efcc8cbc1b43902571b3dce7ef53003f5b97fe4f275fe0489565fc6e2ebe3314"}, - {file = "watchdog-2.1.8-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:746e4c197ec1083581bb1f64d07d1136accf03437badb5ff8fcb862565c193b2"}, - {file = "watchdog-2.1.8-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:1ae17b6be788fb8e4d8753d8d599de948f0275a232416e16436363c682c6f850"}, - {file = "watchdog-2.1.8-pp37-pypy37_pp73-macosx_10_9_x86_64.whl", hash = "sha256:ddde157dc1447d8130cb5b8df102fad845916fe4335e3d3c3f44c16565becbb7"}, - {file = "watchdog-2.1.8-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:4978db33fc0934c92013ee163a9db158ec216099b69fce5aec790aba704da412"}, - {file = "watchdog-2.1.8-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:b962de4d7d92ff78fb2dbc6a0cb292a679dea879a0eb5568911484d56545b153"}, - {file = "watchdog-2.1.8-py3-none-manylinux2014_aarch64.whl", hash = "sha256:1e5d0fdfaa265c29dc12621913a76ae99656cf7587d03950dfeb3595e5a26102"}, - {file = "watchdog-2.1.8-py3-none-manylinux2014_armv7l.whl", hash = "sha256:036ed15f7cd656351bf4e17244447be0a09a61aaa92014332d50719fc5973bc0"}, - {file = "watchdog-2.1.8-py3-none-manylinux2014_i686.whl", hash = "sha256:2962628a8777650703e8f6f2593065884c602df7bae95759b2df267bd89b2ef5"}, - {file = "watchdog-2.1.8-py3-none-manylinux2014_ppc64.whl", hash = "sha256:156ec3a94695ea68cfb83454b98754af6e276031ba1ae7ae724dc6bf8973b92a"}, - {file = "watchdog-2.1.8-py3-none-manylinux2014_ppc64le.whl", hash = "sha256:47598fe6713fc1fee86b1ca85c9cbe77e9b72d002d6adeab9c3b608f8a5ead10"}, - {file = "watchdog-2.1.8-py3-none-manylinux2014_s390x.whl", hash = "sha256:fed4de6e45a4f16e4046ea00917b4fe1700b97244e5d114f594b4a1b9de6bed8"}, - {file = "watchdog-2.1.8-py3-none-manylinux2014_x86_64.whl", hash = "sha256:24dedcc3ce75e150f2a1d704661f6879764461a481ba15a57dc80543de46021c"}, - {file = "watchdog-2.1.8-py3-none-win32.whl", hash = "sha256:6ddf67bc9f413791072e3afb466e46cc72c6799ba73dea18439b412e8f2e3257"}, - {file = "watchdog-2.1.8-py3-none-win_amd64.whl", hash = "sha256:88ef3e8640ef0a64b7ad7394b0f23384f58ac19dd759da7eaa9bc04b2898943f"}, - {file = "watchdog-2.1.8-py3-none-win_ia64.whl", hash = "sha256:0fb60c7d31474b21acba54079ce9ff0136411183e9a591369417cddb1d7d00d7"}, - {file = "watchdog-2.1.8.tar.gz", hash = "sha256:6d03149126864abd32715d4e9267d2754cede25a69052901399356ad3bc5ecff"}, + {file = "watchdog-2.1.9-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:a735a990a1095f75ca4f36ea2ef2752c99e6ee997c46b0de507ba40a09bf7330"}, + {file = "watchdog-2.1.9-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6b17d302850c8d412784d9246cfe8d7e3af6bcd45f958abb2d08a6f8bedf695d"}, + {file = "watchdog-2.1.9-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ee3e38a6cc050a8830089f79cbec8a3878ec2fe5160cdb2dc8ccb6def8552658"}, + {file = "watchdog-2.1.9-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:64a27aed691408a6abd83394b38503e8176f69031ca25d64131d8d640a307591"}, + {file = "watchdog-2.1.9-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:195fc70c6e41237362ba720e9aaf394f8178bfc7fa68207f112d108edef1af33"}, + {file = "watchdog-2.1.9-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:bfc4d351e6348d6ec51df007432e6fe80adb53fd41183716017026af03427846"}, + {file = "watchdog-2.1.9-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:8250546a98388cbc00c3ee3cc5cf96799b5a595270dfcfa855491a64b86ef8c3"}, + {file = "watchdog-2.1.9-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:117ffc6ec261639a0209a3252546b12800670d4bf5f84fbd355957a0595fe654"}, + {file = "watchdog-2.1.9-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:97f9752208f5154e9e7b76acc8c4f5a58801b338de2af14e7e181ee3b28a5d39"}, + {file = "watchdog-2.1.9-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:247dcf1df956daa24828bfea5a138d0e7a7c98b1a47cf1fa5b0c3c16241fcbb7"}, + {file = "watchdog-2.1.9-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:226b3c6c468ce72051a4c15a4cc2ef317c32590d82ba0b330403cafd98a62cfd"}, + {file = "watchdog-2.1.9-pp37-pypy37_pp73-macosx_10_9_x86_64.whl", hash = "sha256:d9820fe47c20c13e3c9dd544d3706a2a26c02b2b43c993b62fcd8011bcc0adb3"}, + {file = "watchdog-2.1.9-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:70af927aa1613ded6a68089a9262a009fbdf819f46d09c1a908d4b36e1ba2b2d"}, + {file = "watchdog-2.1.9-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:ed80a1628cee19f5cfc6bb74e173f1b4189eb532e705e2a13e3250312a62e0c9"}, + {file = "watchdog-2.1.9-py3-none-manylinux2014_aarch64.whl", hash = "sha256:9f05a5f7c12452f6a27203f76779ae3f46fa30f1dd833037ea8cbc2887c60213"}, + {file = "watchdog-2.1.9-py3-none-manylinux2014_armv7l.whl", hash = "sha256:255bb5758f7e89b1a13c05a5bceccec2219f8995a3a4c4d6968fe1de6a3b2892"}, + {file = "watchdog-2.1.9-py3-none-manylinux2014_i686.whl", hash = "sha256:d3dda00aca282b26194bdd0adec21e4c21e916956d972369359ba63ade616153"}, + {file = "watchdog-2.1.9-py3-none-manylinux2014_ppc64.whl", hash = "sha256:186f6c55abc5e03872ae14c2f294a153ec7292f807af99f57611acc8caa75306"}, + {file = "watchdog-2.1.9-py3-none-manylinux2014_ppc64le.whl", hash = "sha256:083171652584e1b8829581f965b9b7723ca5f9a2cd7e20271edf264cfd7c1412"}, + {file = "watchdog-2.1.9-py3-none-manylinux2014_s390x.whl", hash = "sha256:b530ae007a5f5d50b7fbba96634c7ee21abec70dc3e7f0233339c81943848dc1"}, + {file = "watchdog-2.1.9-py3-none-manylinux2014_x86_64.whl", hash = "sha256:4f4e1c4aa54fb86316a62a87b3378c025e228178d55481d30d857c6c438897d6"}, + {file = "watchdog-2.1.9-py3-none-win32.whl", hash = "sha256:5952135968519e2447a01875a6f5fc8c03190b24d14ee52b0f4b1682259520b1"}, + {file = "watchdog-2.1.9-py3-none-win_amd64.whl", hash = "sha256:7a833211f49143c3d336729b0020ffd1274078e94b0ae42e22f596999f50279c"}, + {file = "watchdog-2.1.9-py3-none-win_ia64.whl", hash = "sha256:ad576a565260d8f99d97f2e64b0f97a48228317095908568a9d5c786c829d428"}, + {file = "watchdog-2.1.9.tar.gz", hash = "sha256:43ce20ebb36a51f21fa376f76d1d4692452b2527ccd601950d69ed36b9e21609"}, ] yarl = [ {file = "yarl-1.7.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:f2a8508f7350512434e41065684076f640ecce176d262a7d54f0da41d99c5a95"}, From 84565ed0a5b47bc5abaea9ab8a35eae11af41130 Mon Sep 17 00:00:00 2001 From: Darren Burns Date: Wed, 15 Jun 2022 10:24:05 +0100 Subject: [PATCH 4/6] Add extra docs note --- reference/_devtools.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reference/_devtools.md b/reference/_devtools.md index 95ddb47e0f..fa66208fe4 100644 --- a/reference/_devtools.md +++ b/reference/_devtools.md @@ -10,3 +10,5 @@ https://python-poetry.org/docs/pyproject/#extras TODO: Note how we run the devtools themselves and how we run our Textual apps such that they can connect. Don't forget Windows instructions :) +We might also add a link to the documentation from the exception that gets +raised when the "dev" extra dependencies aren't installed. From 9e836145069198c9d63b3785445405d4f9fe558b Mon Sep 17 00:00:00 2001 From: Darren Burns Date: Wed, 15 Jun 2022 11:10:24 +0100 Subject: [PATCH 5/6] Add a TODO about adding link to devtools docs --- src/textual/devtools/client.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/textual/devtools/client.py b/src/textual/devtools/client.py index c9a526d9bf..63c59f3d82 100644 --- a/src/textual/devtools/client.py +++ b/src/textual/devtools/client.py @@ -27,6 +27,7 @@ class DevtoolsDependenciesMissingError(Exception): ) import msgpack except ImportError: + # TODO: Add link to documentation on how to install devtools raise DevtoolsDependenciesMissingError( "Textual Devtools requires installation of the 'dev' extra dependencies. " ) From 993cdccb00c09841ffae57687acd2a1d7f92f499 Mon Sep 17 00:00:00 2001 From: Darren Burns Date: Wed, 15 Jun 2022 11:21:39 +0100 Subject: [PATCH 6/6] Add click to dev extras dependencies in pyproject --- pyproject.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c446f5fa89..5b058e02a0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,14 +24,17 @@ textual = "textual.cli.cli:run" python = "^3.7" rich = "^12.4.3" #rich = {path="../rich", develop=true} -click = "8.1.2" importlib-metadata = "^4.11.3" typing-extensions = { version = "^4.0.0", python = "<3.8" } # Dependencies below are required for devtools only aiohttp = { version = "^3.8.1", optional = true } +click = {version = "8.1.2", optional = true} msgpack = { version = "^1.0.3", optional = true } +[tool.poetry.extras] +dev = ["aiohttp", "click", "msgpack"] + [tool.poetry.dev-dependencies] pytest = "^6.2.3" black = "^22.3.0" @@ -45,9 +48,6 @@ pytest-aiohttp = "^1.0.4" time-machine = "^2.6.0" Jinja2 = "<3.1.0" -[tool.poetry.extras] -dev = ["aiohttp", "msgpack"] - [tool.black] includes = "src"