urwid 5.1.2__tar.gz → 5.2.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.
- {urwid-5.1.2 → urwid-5.2.0}/.github/labeler.yml +1 -1
- {urwid-5.1.2 → urwid-5.2.0}/.github/workflows/documentation-pdf.yml +1 -1
- {urwid-5.1.2 → urwid-5.2.0}/.github/workflows/documentation.yml +1 -1
- {urwid-5.1.2 → urwid-5.2.0}/.github/workflows/isolated_mypy.yml +2 -2
- {urwid-5.1.2 → urwid-5.2.0}/.github/workflows/isolated_pylint.yml +2 -2
- {urwid-5.1.2 → urwid-5.2.0}/.github/workflows/isolated_pyrefly.yml +1 -1
- {urwid-5.1.2 → urwid-5.2.0}/.github/workflows/pythonpackage.yml +10 -9
- {urwid-5.1.2 → urwid-5.2.0}/.github/workflows/yamllint.yml +1 -1
- {urwid-5.1.2 → urwid-5.2.0}/PKG-INFO +1 -28
- {urwid-5.1.2 → urwid-5.2.0}/README.rst +0 -26
- {urwid-5.1.2 → urwid-5.2.0}/SECURITY.md +3 -1
- {urwid-5.1.2 → urwid-5.2.0}/classifiers.txt +0 -1
- {urwid-5.1.2 → urwid-5.2.0}/conftest.py +17 -2
- urwid-5.2.0/pylint-requirements.txt +1 -0
- {urwid-5.1.2 → urwid-5.2.0}/pyproject.toml +22 -5
- {urwid-5.1.2 → urwid-5.2.0}/pyrefly-requirements.txt +1 -1
- {urwid-5.1.2 → urwid-5.2.0}/pytest_requirements.txt +2 -1
- {urwid-5.1.2 → urwid-5.2.0}/tox.ini +3 -28
- {urwid-5.1.2 → urwid-5.2.0}/urwid/__init__.py +14 -2
- {urwid-5.1.2 → urwid-5.2.0}/urwid/_deprecation.py +12 -4
- urwid-5.2.0/urwid/ansi_parser/__init__.py +86 -0
- urwid-5.2.0/urwid/ansi_parser/_grammar.py +102 -0
- urwid-5.1.2/urwid/ansi_parser.py → urwid-5.2.0/urwid/ansi_parser/_parser.py +356 -637
- urwid-5.2.0/urwid/ansi_parser/_resolve.py +158 -0
- urwid-5.2.0/urwid/ansi_parser/_results.py +109 -0
- urwid-5.2.0/urwid/ansi_parser/_vt_parser.py +382 -0
- urwid-5.2.0/urwid/canvas/__init__.py +87 -0
- urwid-5.2.0/urwid/canvas/_base.py +600 -0
- urwid-5.2.0/urwid/canvas/_cache.py +230 -0
- urwid-5.2.0/urwid/canvas/_composite.py +820 -0
- urwid-5.2.0/urwid/canvas/_text.py +440 -0
- urwid-5.2.0/urwid/canvas/term/__init__.py +45 -0
- urwid-5.2.0/urwid/canvas/term/_cells.py +137 -0
- urwid-5.2.0/urwid/canvas/term/_editing.py +522 -0
- urwid-5.2.0/urwid/canvas/term/_modes.py +408 -0
- urwid-5.2.0/urwid/canvas/term/_palette.py +182 -0
- urwid-5.2.0/urwid/canvas/term/_parser.py +908 -0
- urwid-5.2.0/urwid/canvas/term/_rectangles.py +381 -0
- urwid-5.2.0/urwid/canvas/term/_reports.py +356 -0
- urwid-5.2.0/urwid/canvas/term/_screen.py +1183 -0
- urwid-5.2.0/urwid/canvas/term/_state.py +256 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid/display/_posix_raw_display.py +134 -15
- urwid-5.2.0/urwid/display/_raw_display_base/__init__.py +52 -0
- urwid-5.2.0/urwid/display/_raw_display_base/_attributes.py +193 -0
- urwid-5.2.0/urwid/display/_raw_display_base/_base.py +633 -0
- urwid-5.2.0/urwid/display/_raw_display_base/_detection.py +742 -0
- urwid-5.2.0/urwid/display/_raw_display_base/_input.py +388 -0
- urwid-5.2.0/urwid/display/_raw_display_base/_modes.py +601 -0
- urwid-5.2.0/urwid/display/_raw_display_base/_screen.py +391 -0
- urwid-5.2.0/urwid/display/_sgr.py +444 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid/display/_web.css +2 -1
- {urwid-5.1.2 → urwid-5.2.0}/urwid/display/_web.js +29 -3
- {urwid-5.1.2 → urwid-5.2.0}/urwid/display/_web_common.py +44 -1
- {urwid-5.1.2 → urwid-5.2.0}/urwid/display/_win32_raw_display.py +143 -58
- urwid-5.2.0/urwid/display/common/__init__.py +193 -0
- urwid-5.2.0/urwid/display/common/_attr_spec.py +953 -0
- urwid-5.2.0/urwid/display/common/_colors.py +527 -0
- urwid-5.2.0/urwid/display/common/_css.py +127 -0
- urwid-5.2.0/urwid/display/common/_depth.py +442 -0
- urwid-5.2.0/urwid/display/common/_screen.py +581 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid/display/curses.py +279 -104
- urwid-5.2.0/urwid/display/escape/__init__.py +233 -0
- urwid-5.2.0/urwid/display/escape/_input.py +298 -0
- urwid-5.2.0/urwid/display/escape/_keys.py +293 -0
- urwid-5.2.0/urwid/display/escape/_mouse.py +118 -0
- urwid-5.2.0/urwid/display/escape/_sequences.py +325 -0
- urwid-5.2.0/urwid/display/escape/_trie.py +955 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid/display/html_fragment.py +15 -2
- {urwid-5.1.2 → urwid-5.2.0}/urwid/display/web.py +140 -30
- {urwid-5.1.2 → urwid-5.2.0}/urwid/display/websocket.py +4 -31
- {urwid-5.1.2 → urwid-5.2.0}/urwid/event_loop/abstract_loop.py +7 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid/event_loop/asyncio_loop.py +29 -5
- {urwid-5.1.2 → urwid-5.2.0}/urwid/event_loop/glib_loop.py +13 -11
- {urwid-5.1.2 → urwid-5.2.0}/urwid/event_loop/guarded_loop.py +4 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid/event_loop/main_loop.py +177 -29
- {urwid-5.1.2 → urwid-5.2.0}/urwid/event_loop/tornado_loop.py +59 -13
- {urwid-5.1.2 → urwid-5.2.0}/urwid/event_loop/trio_loop.py +31 -9
- {urwid-5.1.2 → urwid-5.2.0}/urwid/event_loop/twisted_loop.py +34 -5
- {urwid-5.1.2 → urwid-5.2.0}/urwid/event_loop/zmq_loop.py +33 -4
- urwid-5.2.0/urwid/log_handler.py +358 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid/str_util.py +43 -2
- {urwid-5.1.2 → urwid-5.2.0}/urwid/util.py +54 -20
- {urwid-5.1.2 → urwid-5.2.0}/urwid/version.py +3 -3
- urwid-5.2.0/urwid/vterm.py +1134 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid/widget/__init__.py +7 -1
- urwid-5.2.0/urwid/widget/_pop_up_list.py +211 -0
- urwid-5.2.0/urwid/widget/action_menu.py +790 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid/widget/bar_graph.py +43 -4
- {urwid-5.1.2 → urwid-5.2.0}/urwid/widget/columns.py +107 -14
- {urwid-5.1.2 → urwid-5.2.0}/urwid/widget/constants.py +7 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid/widget/container.py +40 -2
- {urwid-5.1.2 → urwid-5.2.0}/urwid/widget/deque_walker.py +5 -1
- urwid-5.2.0/urwid/widget/drop_down.py +332 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid/widget/edit.py +2 -2
- {urwid-5.1.2 → urwid-5.2.0}/urwid/widget/filler.py +41 -10
- {urwid-5.1.2 → urwid-5.2.0}/urwid/widget/frame.py +24 -23
- {urwid-5.1.2 → urwid-5.2.0}/urwid/widget/grid_flow.py +21 -13
- {urwid-5.1.2 → urwid-5.2.0}/urwid/widget/line_box.py +9 -5
- {urwid-5.1.2 → urwid-5.2.0}/urwid/widget/list_walker.py +12 -2
- {urwid-5.1.2 → urwid-5.2.0}/urwid/widget/listbox.py +176 -14
- {urwid-5.1.2 → urwid-5.2.0}/urwid/widget/monitored_deque.py +210 -38
- {urwid-5.1.2 → urwid-5.2.0}/urwid/widget/monitored_list.py +64 -9
- {urwid-5.1.2 → urwid-5.2.0}/urwid/widget/notifications.py +7 -3
- {urwid-5.1.2 → urwid-5.2.0}/urwid/widget/pile.py +20 -13
- {urwid-5.1.2 → urwid-5.2.0}/urwid/widget/popup.py +303 -41
- {urwid-5.1.2 → urwid-5.2.0}/urwid/widget/scrollable.py +39 -1
- {urwid-5.1.2 → urwid-5.2.0}/urwid/widget/spinner.py +1 -2
- {urwid-5.1.2 → urwid-5.2.0}/urwid/widget/table.py +757 -96
- {urwid-5.1.2 → urwid-5.2.0}/urwid/widget/tabs.py +13 -2
- urwid-5.2.0/urwid/widget/terminal_output.py +237 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid/widget/widget.py +45 -10
- {urwid-5.1.2 → urwid-5.2.0}/urwid.egg-info/PKG-INFO +1 -28
- {urwid-5.1.2 → urwid-5.2.0}/urwid.egg-info/SOURCES.txt +45 -5
- {urwid-5.1.2 → urwid-5.2.0}/urwid.egg-info/scm_file_list.json +55 -5
- urwid-5.2.0/urwid.egg-info/scm_version.json +8 -0
- urwid-5.1.2/pylint-requirements.txt +0 -1
- urwid-5.1.2/urwid/canvas.py +0 -1758
- urwid-5.1.2/urwid/display/_raw_display_base.py +0 -1871
- urwid-5.1.2/urwid/display/common.py +0 -1701
- urwid-5.1.2/urwid/display/escape.py +0 -1379
- urwid-5.1.2/urwid/vterm.py +0 -2431
- urwid-5.1.2/urwid/widget/drop_down.py +0 -259
- urwid-5.1.2/urwid.egg-info/scm_version.json +0 -8
- {urwid-5.1.2 → urwid-5.2.0}/.devcontainer/dev.dockerfile +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/.devcontainer/devcontainer.json +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/.devcontainer/docs-pdf/devcontainer.json +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/.dockerignore +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/.editorconfig +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/.github/CODE_OF_CONDUCT.md +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/.github/ISSUE_TEMPLATE/docs.md +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/.github/ISSUE_TEMPLATE/question.md +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/.github/dependabot.yml +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/.github/release.yml +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/.github/workflows/labels.yml +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/.gitignore +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/.pre-commit-config.yaml +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/.yamllint.yml +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/COPYING +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/MANIFEST.in +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/mypy-requirements.txt +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/requirements.txt +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/setup.cfg +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid/_selectors.py +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid/command_map.py +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid/display/__init__.py +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid/display/_web_common.js +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid/display/_websocket.css +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid/display/_websocket.html +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid/display/_websocket.js +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid/display/_win32.py +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid/display/lcd.py +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid/display/raw.py +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid/event_loop/__init__.py +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid/event_loop/select_loop.py +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid/font.py +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid/graphics.py +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid/numedit.py +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid/py.typed +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid/signals.py +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid/split_repr.py +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid/testing.py +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid/text_layout.py +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid/widget/ansi_text.py +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid/widget/attr_map.py +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid/widget/attr_wrap.py +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid/widget/big_text.py +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid/widget/box_adapter.py +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid/widget/divider.py +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid/widget/filtered_walker.py +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid/widget/overlay.py +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid/widget/overlay_stack.py +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid/widget/padding.py +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid/widget/progress_bar.py +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid/widget/solid_fill.py +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid/widget/text.py +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid/widget/treetools.py +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid/widget/widget_decoration.py +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid/widget/wimp.py +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid.egg-info/dependency_links.txt +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid.egg-info/not-zip-safe +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid.egg-info/requires.txt +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/urwid.egg-info/top_level.txt +0 -0
- {urwid-5.1.2 → urwid-5.2.0}/yamllint-requirements.txt +0 -0
|
@@ -17,13 +17,13 @@ jobs:
|
|
|
17
17
|
steps:
|
|
18
18
|
- uses: actions/checkout@v7
|
|
19
19
|
- name: Install uv
|
|
20
|
-
uses: astral-sh/setup-uv@v10.
|
|
20
|
+
uses: astral-sh/setup-uv@v10.4.0
|
|
21
21
|
- name: Create virtual environment
|
|
22
22
|
run: uv venv --python 3.14
|
|
23
23
|
- name: Install package with all extras
|
|
24
24
|
run: uv pip install -e ".[curses,serial,tornado,trio,twisted,zmq]"
|
|
25
25
|
- name: Install dependencies
|
|
26
26
|
run: uv pip install --upgrade -r mypy-requirements.txt
|
|
27
|
-
# tests other than tests/type_checks are not checked, see [tool.ruff]
|
|
27
|
+
# tests other than tests/type_checks are not checked, see [tool.ruff.lint] exclude in pyproject.toml
|
|
28
28
|
- name: Type check with mypy
|
|
29
29
|
run: uv run --no-project mypy urwid examples tests/type_checks
|
|
@@ -17,13 +17,13 @@ jobs:
|
|
|
17
17
|
steps:
|
|
18
18
|
- uses: actions/checkout@v7
|
|
19
19
|
- name: Install uv
|
|
20
|
-
uses: astral-sh/setup-uv@v10.
|
|
20
|
+
uses: astral-sh/setup-uv@v10.4.0
|
|
21
21
|
- name: Create virtual environment
|
|
22
22
|
run: uv venv --python 3.14
|
|
23
23
|
- name: Install package with all extras
|
|
24
24
|
run: uv pip install -e ".[curses,serial,tornado,trio,twisted,zmq]"
|
|
25
25
|
- name: Install dependencies
|
|
26
26
|
run: uv pip install --upgrade -r pylint-requirements.txt
|
|
27
|
-
# tests are not checked, see [tool.ruff]
|
|
27
|
+
# tests are not checked, see [tool.ruff.lint] exclude in pyproject.toml
|
|
28
28
|
- name: Lint with pylint
|
|
29
29
|
run: uv run --no-project pylint --output-format=github urwid
|
|
@@ -53,14 +53,14 @@ jobs:
|
|
|
53
53
|
steps:
|
|
54
54
|
- uses: actions/checkout@v7
|
|
55
55
|
- name: Install uv
|
|
56
|
-
uses: astral-sh/setup-uv@v10.
|
|
56
|
+
uses: astral-sh/setup-uv@v10.4.0
|
|
57
57
|
- name: Create virtual environment
|
|
58
58
|
run: uv venv --python 3.14
|
|
59
59
|
- name: Install package with all extras
|
|
60
60
|
run: uv pip install -e ".[curses,serial,tornado,trio,twisted,zmq]"
|
|
61
61
|
- name: Install dependencies
|
|
62
62
|
run: uv pip install --upgrade -r pylint-requirements.txt
|
|
63
|
-
# tests are not checked, see [tool.ruff]
|
|
63
|
+
# tests are not checked, see [tool.ruff.lint] exclude in pyproject.toml
|
|
64
64
|
- name: Lint with pylint
|
|
65
65
|
run: uv run --no-project pylint --output-format=github urwid
|
|
66
66
|
|
|
@@ -70,14 +70,14 @@ jobs:
|
|
|
70
70
|
steps:
|
|
71
71
|
- uses: actions/checkout@v7
|
|
72
72
|
- name: Install uv
|
|
73
|
-
uses: astral-sh/setup-uv@v10.
|
|
73
|
+
uses: astral-sh/setup-uv@v10.4.0
|
|
74
74
|
- name: Create virtual environment
|
|
75
75
|
run: uv venv --python 3.14
|
|
76
76
|
- name: Install package with all extras
|
|
77
77
|
run: uv pip install -e ".[curses,serial,tornado,trio,twisted,zmq]"
|
|
78
78
|
- name: Install dependencies
|
|
79
79
|
run: uv pip install --upgrade -r mypy-requirements.txt
|
|
80
|
-
# tests other than tests/type_checks are not checked, see [tool.ruff]
|
|
80
|
+
# tests other than tests/type_checks are not checked, see [tool.ruff.lint] exclude in pyproject.toml
|
|
81
81
|
- name: Type check with mypy
|
|
82
82
|
run: uv run --no-project mypy urwid examples tests/type_checks
|
|
83
83
|
|
|
@@ -87,7 +87,7 @@ jobs:
|
|
|
87
87
|
steps:
|
|
88
88
|
- uses: actions/checkout@v7
|
|
89
89
|
- name: Install uv
|
|
90
|
-
uses: astral-sh/setup-uv@v10.
|
|
90
|
+
uses: astral-sh/setup-uv@v10.4.0
|
|
91
91
|
- name: Create virtual environment
|
|
92
92
|
run: uv venv --python 3.14
|
|
93
93
|
- name: Install package with all extras
|
|
@@ -132,7 +132,7 @@ jobs:
|
|
|
132
132
|
python-version: ${{ matrix.python-version }}
|
|
133
133
|
allow-prereleases: true
|
|
134
134
|
- name: Install uv
|
|
135
|
-
uses: astral-sh/setup-uv@v10.
|
|
135
|
+
uses: astral-sh/setup-uv@v10.4.0
|
|
136
136
|
- name: Create virtual environment
|
|
137
137
|
run: uv venv --python-preference only-system --python ${{ matrix.python-version }}
|
|
138
138
|
- name: Install dependencies
|
|
@@ -150,7 +150,8 @@ jobs:
|
|
|
150
150
|
&& 'serial,tornado,trio,twisted,zmq'
|
|
151
151
|
|| 'curses,serial,tornado,trio,twisted,zmq' }}]"
|
|
152
152
|
- name: Test
|
|
153
|
-
|
|
153
|
+
# One pytest-xdist worker per runner CPU.
|
|
154
|
+
run: uv run --no-project python -m pytest -n auto --cov-report=term --cov-report=xml
|
|
154
155
|
- name: Coveralls Parallel
|
|
155
156
|
uses: coverallsapp/github-action@v2
|
|
156
157
|
with:
|
|
@@ -179,7 +180,7 @@ jobs:
|
|
|
179
180
|
fetch-depth: 0 # need for setuptools_scm
|
|
180
181
|
|
|
181
182
|
- name: Install uv
|
|
182
|
-
uses: astral-sh/setup-uv@v10.
|
|
183
|
+
uses: astral-sh/setup-uv@v10.4.0
|
|
183
184
|
|
|
184
185
|
- name: Build dist
|
|
185
186
|
run: uv build
|
|
@@ -203,7 +204,7 @@ jobs:
|
|
|
203
204
|
steps:
|
|
204
205
|
- uses: actions/checkout@v7
|
|
205
206
|
- name: Install uv
|
|
206
|
-
uses: astral-sh/setup-uv@v10.
|
|
207
|
+
uses: astral-sh/setup-uv@v10.4.0
|
|
207
208
|
- uses: actions/download-artifact@v8
|
|
208
209
|
with:
|
|
209
210
|
# unpacks default artifact into dist/
|
|
@@ -17,7 +17,7 @@ jobs:
|
|
|
17
17
|
steps:
|
|
18
18
|
- uses: actions/checkout@v7
|
|
19
19
|
- name: Install uv
|
|
20
|
-
uses: astral-sh/setup-uv@v10.
|
|
20
|
+
uses: astral-sh/setup-uv@v10.4.0
|
|
21
21
|
- name: Lint YAML files
|
|
22
22
|
run: uv run --no-project --with-requirements yamllint-requirements.txt yamllint . -f github
|
|
23
23
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: urwid
|
|
3
|
-
Version: 5.
|
|
3
|
+
Version: 5.2.0
|
|
4
4
|
Summary: A full-featured console (xterm et al.) user interface library
|
|
5
5
|
Author-email: Ian Ward <ian@excess.org>
|
|
6
6
|
License-Expression: LGPL-2.1-only
|
|
@@ -30,7 +30,6 @@ Classifier: Programming Language :: Python :: 3.15
|
|
|
30
30
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
31
31
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
32
32
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
33
|
-
Classifier: Programming Language :: Python :: Implementation :: GraalPy
|
|
34
33
|
Classifier: Programming Language :: Python :: Free Threading :: 2 - Beta
|
|
35
34
|
Classifier: Typing :: Typed
|
|
36
35
|
Requires-Python: >=3.11.0
|
|
@@ -173,19 +172,6 @@ Tests with compatible extras (tornado, trio, serial). Excludes problematic C ext
|
|
|
173
172
|
tox -e pypy311 # PyPy 3.11
|
|
174
173
|
tox -e pypy312 # PyPy 3.12
|
|
175
174
|
|
|
176
|
-
**GraalPy**
|
|
177
|
-
|
|
178
|
-
Tests with compatible extras (tornado, serial). Excludes extras that need C extensions GraalPy
|
|
179
|
-
doesn't support (glib, zmq) or that have known compatibility issues (trio, twisted). GraalPy also
|
|
180
|
-
ships no ``_curses`` module, so curses-dependent tests are expected to fail, and the Terminal
|
|
181
|
-
widget (``urwid.vterm``) is unsupported since its ``fcntl``/``pty`` usage doesn't work on GraalPy,
|
|
182
|
-
so its tests are skipped rather than run.
|
|
183
|
-
|
|
184
|
-
.. code:: bash
|
|
185
|
-
|
|
186
|
-
tox -e graalpy312 # GraalPy 3.12
|
|
187
|
-
tox -e graalpy313 # GraalPy 3.13
|
|
188
|
-
|
|
189
175
|
Supported Python versions
|
|
190
176
|
=========================
|
|
191
177
|
|
|
@@ -194,7 +180,6 @@ Urwid supports:
|
|
|
194
180
|
- CPython 3.11, 3.12, 3.13, 3.14, 3.15
|
|
195
181
|
- CPython 3.13+ with free-threading (PEP 703 ``--disable-gil``)
|
|
196
182
|
- PyPy 3.11
|
|
197
|
-
- GraalPy 3.12, 3.13 (experimental)
|
|
198
183
|
|
|
199
184
|
Python implementation notes
|
|
200
185
|
===========================
|
|
@@ -227,18 +212,6 @@ Urwid core is fully supported. Some extras may have compatibility issues:
|
|
|
227
212
|
- ❌ Unsupported: curses on Windows (PyPy for Windows ships no ``_curses`` module and ``windows-curses`` publishes
|
|
228
213
|
no PyPy wheels)
|
|
229
214
|
|
|
230
|
-
**GraalPy (experimental)**
|
|
231
|
-
|
|
232
|
-
Urwid core and the ``select``/``asyncio`` event loops are supported. Some extras, display
|
|
233
|
-
modules, and the Terminal widget are not:
|
|
234
|
-
|
|
235
|
-
- ✅ Supported: core, tornado, serial, lcd
|
|
236
|
-
- ❌ Unsupported: curses (GraalPy ships no ``_curses`` module), glib, zmq, twisted, trio (no C
|
|
237
|
-
extension support, or known compatibility issues), Terminal widget/``urwid.vterm`` (like on
|
|
238
|
-
Windows, ``fcntl``/``pty`` usage doesn't work on GraalPy)
|
|
239
|
-
- ❌ Unsupported: GraalPy 3.11 (GraalPy 24), whose ``os`` module has no ``O_NOFOLLOW`` and whose ASCII and Latin-1
|
|
240
|
-
codecs ignore registered error handlers
|
|
241
|
-
|
|
242
215
|
Authors
|
|
243
216
|
=======
|
|
244
217
|
|
|
@@ -115,19 +115,6 @@ Tests with compatible extras (tornado, trio, serial). Excludes problematic C ext
|
|
|
115
115
|
tox -e pypy311 # PyPy 3.11
|
|
116
116
|
tox -e pypy312 # PyPy 3.12
|
|
117
117
|
|
|
118
|
-
**GraalPy**
|
|
119
|
-
|
|
120
|
-
Tests with compatible extras (tornado, serial). Excludes extras that need C extensions GraalPy
|
|
121
|
-
doesn't support (glib, zmq) or that have known compatibility issues (trio, twisted). GraalPy also
|
|
122
|
-
ships no ``_curses`` module, so curses-dependent tests are expected to fail, and the Terminal
|
|
123
|
-
widget (``urwid.vterm``) is unsupported since its ``fcntl``/``pty`` usage doesn't work on GraalPy,
|
|
124
|
-
so its tests are skipped rather than run.
|
|
125
|
-
|
|
126
|
-
.. code:: bash
|
|
127
|
-
|
|
128
|
-
tox -e graalpy312 # GraalPy 3.12
|
|
129
|
-
tox -e graalpy313 # GraalPy 3.13
|
|
130
|
-
|
|
131
118
|
Supported Python versions
|
|
132
119
|
=========================
|
|
133
120
|
|
|
@@ -136,7 +123,6 @@ Urwid supports:
|
|
|
136
123
|
- CPython 3.11, 3.12, 3.13, 3.14, 3.15
|
|
137
124
|
- CPython 3.13+ with free-threading (PEP 703 ``--disable-gil``)
|
|
138
125
|
- PyPy 3.11
|
|
139
|
-
- GraalPy 3.12, 3.13 (experimental)
|
|
140
126
|
|
|
141
127
|
Python implementation notes
|
|
142
128
|
===========================
|
|
@@ -169,18 +155,6 @@ Urwid core is fully supported. Some extras may have compatibility issues:
|
|
|
169
155
|
- ❌ Unsupported: curses on Windows (PyPy for Windows ships no ``_curses`` module and ``windows-curses`` publishes
|
|
170
156
|
no PyPy wheels)
|
|
171
157
|
|
|
172
|
-
**GraalPy (experimental)**
|
|
173
|
-
|
|
174
|
-
Urwid core and the ``select``/``asyncio`` event loops are supported. Some extras, display
|
|
175
|
-
modules, and the Terminal widget are not:
|
|
176
|
-
|
|
177
|
-
- ✅ Supported: core, tornado, serial, lcd
|
|
178
|
-
- ❌ Unsupported: curses (GraalPy ships no ``_curses`` module), glib, zmq, twisted, trio (no C
|
|
179
|
-
extension support, or known compatibility issues), Terminal widget/``urwid.vterm`` (like on
|
|
180
|
-
Windows, ``fcntl``/``pty`` usage doesn't work on GraalPy)
|
|
181
|
-
- ❌ Unsupported: GraalPy 3.11 (GraalPy 24), whose ``os`` module has no ``O_NOFOLLOW`` and whose ASCII and Latin-1
|
|
182
|
-
codecs ignore registered error handlers
|
|
183
|
-
|
|
184
158
|
Authors
|
|
185
159
|
=======
|
|
186
160
|
|
|
@@ -24,7 +24,9 @@ What the module protects:
|
|
|
24
24
|
- The id is generated by `secrets.token_urlsafe()`.
|
|
25
25
|
- A client-supplied id is checked against `_URWID_ID_MAX_LEN` and `_URWID_ID_CHARS` before any file lookup.
|
|
26
26
|
- Resource limits
|
|
27
|
-
- A
|
|
27
|
+
- A request body is read up to the `CONTENT_LENGTH` the web server gives, never until end of input.
|
|
28
|
+
- A keystroke request over `MAX_READ` bytes, and an initial request over `MAX_INITIAL_READ` bytes, are refused.
|
|
29
|
+
- A keyboard input line longer than `MAX_LINE_LENGTH` characters is dropped, up to and including its newline.
|
|
28
30
|
- The screen size is capped at `MAX_COLS` and `MAX_ROWS`.
|
|
29
31
|
- The number of concurrent sessions of one user and `pipe_dir` is limited to about `max_clients`
|
|
30
32
|
(`set_preferences()`): two sessions starting at once can both pass the check, and stale pipes count towards it.
|
|
@@ -18,6 +18,5 @@ Programming Language :: Python :: 3.15
|
|
|
18
18
|
Programming Language :: Python :: 3 :: Only
|
|
19
19
|
Programming Language :: Python :: Implementation :: CPython
|
|
20
20
|
Programming Language :: Python :: Implementation :: PyPy
|
|
21
|
-
Programming Language :: Python :: Implementation :: GraalPy
|
|
22
21
|
Programming Language :: Python :: Free Threading :: 2 - Beta
|
|
23
22
|
Typing :: Typed
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"""Pytest configuration: skip
|
|
1
|
+
"""Pytest configuration: prepare the pytest-xdist controller, skip modules that cannot be imported here."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
@@ -9,6 +9,8 @@ import typing
|
|
|
9
9
|
if typing.TYPE_CHECKING:
|
|
10
10
|
from pathlib import Path
|
|
11
11
|
|
|
12
|
+
import pytest
|
|
13
|
+
|
|
12
14
|
IS_WINDOWS = sys.platform == "win32"
|
|
13
15
|
|
|
14
16
|
# Modules that import only on one platform. Urwid picks between them at runtime
|
|
@@ -40,7 +42,7 @@ def _backend_available(name: str) -> bool:
|
|
|
40
42
|
"""Return whether the module *name* can be imported.
|
|
41
43
|
|
|
42
44
|
Importing is the only reliable probe.
|
|
43
|
-
|
|
45
|
+
PyPy for Windows ships an ``_curses`` stub that ``find_spec`` resolves,
|
|
44
46
|
but the stub raises ``ModuleNotFoundError`` on import.
|
|
45
47
|
"""
|
|
46
48
|
try:
|
|
@@ -50,6 +52,19 @@ def _backend_available(name: str) -> bool:
|
|
|
50
52
|
return True
|
|
51
53
|
|
|
52
54
|
|
|
55
|
+
def pytest_configure(config: pytest.Config) -> None:
|
|
56
|
+
"""Import urwid in the pytest-xdist controller before the workers start.
|
|
57
|
+
|
|
58
|
+
The controller rebuilds each warning a worker reports by importing the module that defines its class,
|
|
59
|
+
on one execnet receiver thread per worker.
|
|
60
|
+
Two such threads importing urwid modules for the first time at once deadlock in the import system,
|
|
61
|
+
which ends the run with ``INTERNALERROR`` (pytest-dev/pytest-xdist#1422).
|
|
62
|
+
Once urwid is imported, those imports are lookups in :data:`sys.modules`.
|
|
63
|
+
"""
|
|
64
|
+
if not hasattr(config, "workerinput"):
|
|
65
|
+
importlib.import_module("urwid")
|
|
66
|
+
|
|
67
|
+
|
|
53
68
|
def pytest_ignore_collect(collection_path: Path) -> bool | None:
|
|
54
69
|
"""Skip collecting a platform-only or optional-backend test module that cannot run here."""
|
|
55
70
|
name = collection_path.name
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pylint==4.1.4
|
|
@@ -85,6 +85,7 @@ pytest = [
|
|
|
85
85
|
"pytest-asyncio",
|
|
86
86
|
"pytest-cov",
|
|
87
87
|
"pytest-timeout",
|
|
88
|
+
"pytest-xdist",
|
|
88
89
|
]
|
|
89
90
|
ruff = [
|
|
90
91
|
"ruff",
|
|
@@ -119,10 +120,9 @@ skip = [ "pp*", "*-musllinux_*" ]
|
|
|
119
120
|
[tool.ruff]
|
|
120
121
|
target-version = "py311"
|
|
121
122
|
line-length = 120
|
|
122
|
-
# The test suite is not
|
|
123
|
-
# rule sets, and that is a gap to close rather than a decision.
|
|
123
|
+
# The test suite is not linted by ruff, or checked by mypy, pyrefly, pylint or refurb yet: it is not clean against
|
|
124
|
+
# their rule sets, and that is a gap to close rather than a decision. Its formatting is checked.
|
|
124
125
|
# tests/type_checks is the exception for mypy and pyrefly: it is a fixture written for them, and they check it.
|
|
125
|
-
extend-exclude = [ "tests" ]
|
|
126
126
|
output-format = "full"
|
|
127
127
|
[tool.ruff.format]
|
|
128
128
|
docstring-code-format = true
|
|
@@ -132,6 +132,19 @@ docstring-code-format = true
|
|
|
132
132
|
# Shown verbatim in the docs as numbered listings, wcur2.py from a fixed line (`:lines: 7-`).
|
|
133
133
|
"docs/tutorial/*.py" = [ "D100", "D101", "D102", "D103", "D107" ]
|
|
134
134
|
"docs/manual/*.py" = [ "D100", "D101", "D102", "D103", "D107" ]
|
|
135
|
+
"tests/**" = [
|
|
136
|
+
"S101", # a test states its expectation with assert, which pytest rewrites to report the compared values
|
|
137
|
+
"B023", # a closure made in a test loop runs in the iteration that made it
|
|
138
|
+
"E741", # short names such as l are the data of a test
|
|
139
|
+
"D100", # a docstring on every test module, class and method would only repeat its name
|
|
140
|
+
"D101",
|
|
141
|
+
"D102",
|
|
142
|
+
"D103",
|
|
143
|
+
"D104",
|
|
144
|
+
"D105",
|
|
145
|
+
"D106",
|
|
146
|
+
"D107",
|
|
147
|
+
]
|
|
135
148
|
[tool.ruff.lint.isort]
|
|
136
149
|
known-third-party = []
|
|
137
150
|
[tool.ruff.lint.pydocstyle]
|
|
@@ -144,6 +157,7 @@ allow-dunder-method-names = [
|
|
|
144
157
|
"_contents__setitem__", # class generation
|
|
145
158
|
]
|
|
146
159
|
[tool.ruff.lint]
|
|
160
|
+
exclude = [ "tests/**" ]
|
|
147
161
|
extend-select = [
|
|
148
162
|
"A", # flake8-builtins
|
|
149
163
|
"ASYNC", # flake8-async
|
|
@@ -290,6 +304,9 @@ exclude-protected = [
|
|
|
290
304
|
"_w", # API
|
|
291
305
|
"os._exit",
|
|
292
306
|
]
|
|
307
|
+
[tool.pylint.imports]
|
|
308
|
+
# mypy's strict mode takes `import name as name` as the explicit re-export of a name a package's __all__ does not list
|
|
309
|
+
allow-reexport-from-package = true
|
|
293
310
|
[tool.pylint.dunder]
|
|
294
311
|
good-dunder-names = [
|
|
295
312
|
"__rich_repr__",
|
|
@@ -353,7 +370,7 @@ disable_error_code = [
|
|
|
353
370
|
|
|
354
371
|
[tool.pyrefly]
|
|
355
372
|
python-version = "3.11.0"
|
|
356
|
-
# Docs are not checked; tests other than tests/type_checks are not checked, see [tool.ruff]
|
|
373
|
+
# Docs are not checked; tests other than tests/type_checks are not checked, see [tool.ruff.lint] exclude.
|
|
357
374
|
project-includes = [ "examples", "tests/type_checks", "urwid" ]
|
|
358
375
|
check-unannotated-defs = true
|
|
359
376
|
# PyGObject is only installed with the "glib" extra, which needs system libraries.
|
|
@@ -382,7 +399,7 @@ matches = "examples/**"
|
|
|
382
399
|
[tool.pyrefly.sub-config.errors]
|
|
383
400
|
bad-override = "ignore"
|
|
384
401
|
[[tool.pyrefly.sub-config]]
|
|
385
|
-
matches = "urwid/
|
|
402
|
+
matches = "urwid/canvas/term/_parser.py"
|
|
386
403
|
[tool.pyrefly.sub-config.errors]
|
|
387
404
|
# CSI_COMMANDS is a table of lambdas, and Pyrefly does not type them from the CSICommand.callback field.
|
|
388
405
|
implicit-any-lambda = "ignore"
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
pyrefly==1.
|
|
1
|
+
pyrefly==1.5.0
|
|
2
2
|
types-pyserial==3.5.0.20261104
|
|
@@ -6,7 +6,6 @@ envlist =
|
|
|
6
6
|
py31{1,2,3,4,5}
|
|
7
7
|
py31{3,4,5}t
|
|
8
8
|
pypy31{1,2}
|
|
9
|
-
graalpy31{2,3}
|
|
10
9
|
ruff
|
|
11
10
|
pylint
|
|
12
11
|
mypy
|
|
@@ -71,30 +70,6 @@ commands =
|
|
|
71
70
|
setenv =
|
|
72
71
|
PYTHONWARNDEFAULTENCODING=1
|
|
73
72
|
|
|
74
|
-
[testenv:graalpy31{2,3}]
|
|
75
|
-
# GraalPy (Oracle's Python implementation on GraalVM) - experimental support
|
|
76
|
-
# GraalPy has limited C extension support, skip problematic ones
|
|
77
|
-
usedevelop = true
|
|
78
|
-
# GraalPy's JIT warm-up starves next to other environments, so each one runs last and alone.
|
|
79
|
-
depends =
|
|
80
|
-
{[testenv]depends}
|
|
81
|
-
py31{1,2,3,4,5}
|
|
82
|
-
py31{3,4,5}t
|
|
83
|
-
pypy31{1,2}
|
|
84
|
-
graalpy313: graalpy312
|
|
85
|
-
dependency_groups = pytest
|
|
86
|
-
# GraalPy doesn't support pygobject (glib), pyzmq, or twisted well
|
|
87
|
-
extras =
|
|
88
|
-
serial
|
|
89
|
-
tornado
|
|
90
|
-
# Coverage tracing slows GraalPy down by orders of magnitude (one test: 5 s without, over 10 min with).
|
|
91
|
-
# Its JIT can be far slower on a cold or loaded machine than the 3.7 s its slowest test took on a workstation,
|
|
92
|
-
# so it gets a wider per-test timeout than the project's 300 s.
|
|
93
|
-
commands =
|
|
94
|
-
pytest --no-cov --timeout=600
|
|
95
|
-
setenv =
|
|
96
|
-
PYTHONWARNDEFAULTENCODING=1
|
|
97
|
-
|
|
98
73
|
[testenv:readme]
|
|
99
74
|
dependency_groups = build
|
|
100
75
|
extras =
|
|
@@ -125,21 +100,21 @@ dependency_groups = pylint
|
|
|
125
100
|
extras =
|
|
126
101
|
{[testenv]extras}
|
|
127
102
|
glib
|
|
128
|
-
# tests are not checked, see [tool.ruff]
|
|
103
|
+
# tests are not checked, see [tool.ruff.lint] exclude in pyproject.toml
|
|
129
104
|
commands = pylint urwid
|
|
130
105
|
|
|
131
106
|
[testenv:refurb]
|
|
132
107
|
depends = ruff
|
|
133
108
|
deps = refurb
|
|
134
109
|
extras =
|
|
135
|
-
# tests are not checked, see [tool.ruff]
|
|
110
|
+
# tests are not checked, see [tool.ruff.lint] exclude in pyproject.toml
|
|
136
111
|
commands = refurb urwid examples
|
|
137
112
|
|
|
138
113
|
[testenv:mypy]
|
|
139
114
|
base_python = py314
|
|
140
115
|
depends = ruff
|
|
141
116
|
dependency_groups = mypy
|
|
142
|
-
# tests other than tests/type_checks are not checked, see [tool.ruff]
|
|
117
|
+
# tests other than tests/type_checks are not checked, see [tool.ruff.lint] exclude in pyproject.toml
|
|
143
118
|
commands = mypy urwid examples tests/type_checks
|
|
144
119
|
|
|
145
120
|
[testenv:pyrefly]
|
|
@@ -41,6 +41,7 @@ from urwid.canvas import (
|
|
|
41
41
|
SolidCanvas,
|
|
42
42
|
TextCanvas,
|
|
43
43
|
)
|
|
44
|
+
from urwid.canvas.term import TermCanvas, TermCharset, TermModes
|
|
44
45
|
from urwid.command_map import (
|
|
45
46
|
ACTIVATE,
|
|
46
47
|
CURSOR_DOWN,
|
|
@@ -160,6 +161,7 @@ from .widget import (
|
|
|
160
161
|
TOP,
|
|
161
162
|
WEIGHT,
|
|
162
163
|
AbstractWidget,
|
|
164
|
+
ActionMenu,
|
|
163
165
|
Align,
|
|
164
166
|
ANSIText,
|
|
165
167
|
AttrMap,
|
|
@@ -194,6 +196,7 @@ from .widget import (
|
|
|
194
196
|
ListBoxError,
|
|
195
197
|
ListWalker,
|
|
196
198
|
ListWalkerError,
|
|
199
|
+
MenuItem,
|
|
197
200
|
MonitoredDeque,
|
|
198
201
|
MonitoredFocusDeque,
|
|
199
202
|
MonitoredFocusList,
|
|
@@ -210,6 +213,7 @@ from .widget import (
|
|
|
210
213
|
Pile,
|
|
211
214
|
PileError,
|
|
212
215
|
PopUpLauncher,
|
|
216
|
+
PopUpPlacement,
|
|
213
217
|
PopUpTarget,
|
|
214
218
|
ProgressBar,
|
|
215
219
|
RadioButton,
|
|
@@ -232,6 +236,7 @@ from .widget import (
|
|
|
232
236
|
TableRow,
|
|
233
237
|
Tabs,
|
|
234
238
|
TabsError,
|
|
239
|
+
TerminalOutput,
|
|
235
240
|
Text,
|
|
236
241
|
TextError,
|
|
237
242
|
TreeListBox,
|
|
@@ -309,6 +314,7 @@ __all__: tuple[str, ...] = (
|
|
|
309
314
|
"YELLOW",
|
|
310
315
|
"ANSIText",
|
|
311
316
|
"AbstractWidget",
|
|
317
|
+
"ActionMenu",
|
|
312
318
|
"Align",
|
|
313
319
|
"AsyncioEventLoop",
|
|
314
320
|
"AttrMap",
|
|
@@ -369,6 +375,7 @@ __all__: tuple[str, ...] = (
|
|
|
369
375
|
"ListWalker",
|
|
370
376
|
"ListWalkerError",
|
|
371
377
|
"MainLoop",
|
|
378
|
+
"MenuItem",
|
|
372
379
|
"MetaSignals",
|
|
373
380
|
"MetaSuper",
|
|
374
381
|
"MonitoredDeque",
|
|
@@ -387,6 +394,7 @@ __all__: tuple[str, ...] = (
|
|
|
387
394
|
"Pile",
|
|
388
395
|
"PileError",
|
|
389
396
|
"PopUpLauncher",
|
|
397
|
+
"PopUpPlacement",
|
|
390
398
|
"PopUpTarget",
|
|
391
399
|
"ProgressBar",
|
|
392
400
|
"RadioButton",
|
|
@@ -418,6 +426,10 @@ __all__: tuple[str, ...] = (
|
|
|
418
426
|
"Tabs",
|
|
419
427
|
"TabsError",
|
|
420
428
|
"TagMarkupException",
|
|
429
|
+
"TermCanvas",
|
|
430
|
+
"TermCharset",
|
|
431
|
+
"TermModes",
|
|
432
|
+
"TerminalOutput",
|
|
421
433
|
"Text",
|
|
422
434
|
"TextCanvas",
|
|
423
435
|
"TextError",
|
|
@@ -515,9 +527,9 @@ else:
|
|
|
515
527
|
|
|
516
528
|
# OS Specific
|
|
517
529
|
if sys.platform != "win32":
|
|
518
|
-
from .vterm import
|
|
530
|
+
from .vterm import Terminal
|
|
519
531
|
|
|
520
|
-
__all__ += ("
|
|
532
|
+
__all__ += ("Terminal",)
|
|
521
533
|
|
|
522
534
|
# ZMQEventLoop cause interpreter crash on Windows
|
|
523
535
|
try:
|
|
@@ -46,8 +46,14 @@ __all__ = ("deprecated", "warn")
|
|
|
46
46
|
_PACKAGE_PREFIX: typing.Final[str] = f"{pathlib.Path(__file__).absolute().parent}{os.sep}"
|
|
47
47
|
|
|
48
48
|
|
|
49
|
-
def warn(
|
|
50
|
-
|
|
49
|
+
def warn(
|
|
50
|
+
message: str,
|
|
51
|
+
*,
|
|
52
|
+
since: str,
|
|
53
|
+
removed_in: str | None,
|
|
54
|
+
category: type[DeprecationWarning | PendingDeprecationWarning] = DeprecationWarning,
|
|
55
|
+
) -> None:
|
|
56
|
+
"""Emit a deprecation warning attributed to the first frame outside urwid.
|
|
51
57
|
|
|
52
58
|
The warning points at the application line that used the deprecated API,
|
|
53
59
|
also when the check runs several urwid frames deep (a ``Padding`` passing its argument to ``WidgetDecoration``).
|
|
@@ -56,6 +62,8 @@ def warn(message: str, *, since: str, removed_in: str | None) -> None:
|
|
|
56
62
|
:param message: what is deprecated and what to use instead, as complete sentences
|
|
57
63
|
:param since: the release that deprecated it
|
|
58
64
|
:param removed_in: the release that removes it, or ``None`` when no removal release is decided
|
|
65
|
+
:param category: :exc:`PendingDeprecationWarning` for the quiet first stage of a deprecation,
|
|
66
|
+
which Python hides by default
|
|
59
67
|
"""
|
|
60
68
|
if removed_in is None:
|
|
61
69
|
full_message = f"{message} Deprecated since urwid {since}."
|
|
@@ -63,7 +71,7 @@ def warn(message: str, *, since: str, removed_in: str | None) -> None:
|
|
|
63
71
|
full_message = f"{message} Deprecated since urwid {since}, will be removed in version {removed_in}."
|
|
64
72
|
|
|
65
73
|
if sys.version_info >= (3, 12):
|
|
66
|
-
warnings.warn(full_message,
|
|
74
|
+
warnings.warn(full_message, category, skip_file_prefixes=(_PACKAGE_PREFIX,))
|
|
67
75
|
else:
|
|
68
76
|
# The frame calling warnings.warn() is stack level 1.
|
|
69
77
|
frame = inspect.currentframe()
|
|
@@ -71,4 +79,4 @@ def warn(message: str, *, since: str, removed_in: str | None) -> None:
|
|
|
71
79
|
while frame is not None and frame.f_code.co_filename.startswith(_PACKAGE_PREFIX):
|
|
72
80
|
frame = frame.f_back
|
|
73
81
|
stacklevel += 1
|
|
74
|
-
warnings.warn(full_message,
|
|
82
|
+
warnings.warn(full_message, category, stacklevel=stacklevel)
|