pytatui 1.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.
- pytatui-1.0.0/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
- pytatui-1.0.0/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- pytatui-1.0.0/.github/pull_request_template.md +96 -0
- pytatui-1.0.0/.github/workflows/ci.yml +393 -0
- pytatui-1.0.0/.gitignore +21 -0
- pytatui-1.0.0/CONTRIBUTING.md +45 -0
- pytatui-1.0.0/Cargo.lock +1805 -0
- pytatui-1.0.0/Cargo.toml +26 -0
- pytatui-1.0.0/Docs.md +2648 -0
- pytatui-1.0.0/LICENSE +21 -0
- pytatui-1.0.0/MISSING_BINDINGS.md +101 -0
- pytatui-1.0.0/PKG-INFO +217 -0
- pytatui-1.0.0/README.md +188 -0
- pytatui-1.0.0/SECURITY.md +102 -0
- pytatui-1.0.0/assets/banner.png +0 -0
- pytatui-1.0.0/examples/agent_dashboard.py +118 -0
- pytatui-1.0.0/examples/agent_quickstart.py +35 -0
- pytatui-1.0.0/examples/agent_render_capture.py +103 -0
- pytatui-1.0.0/examples/async_app.py +198 -0
- pytatui-1.0.0/examples/canvas.py +22 -0
- pytatui-1.0.0/examples/chart.py +57 -0
- pytatui-1.0.0/examples/dashboard.py +527 -0
- pytatui-1.0.0/examples/gauge.py +101 -0
- pytatui-1.0.0/examples/headless_api_tour.py +181 -0
- pytatui-1.0.0/examples/hello_world.py +24 -0
- pytatui-1.0.0/examples/inline.py +65 -0
- pytatui-1.0.0/examples/layout.py +66 -0
- pytatui-1.0.0/examples/list.py +264 -0
- pytatui-1.0.0/examples/map.py +19 -0
- pytatui-1.0.0/examples/monthly.py +242 -0
- pytatui-1.0.0/examples/prompts.py +126 -0
- pytatui-1.0.0/examples/styled_text.py +53 -0
- pytatui-1.0.0/examples/table.py +141 -0
- pytatui-1.0.0/pyproject.toml +61 -0
- pytatui-1.0.0/python/pytatui/__init__.py +801 -0
- pytatui-1.0.0/python/pytatui/_pytatui.pyi +3099 -0
- pytatui-1.0.0/python/pytatui/_terminal_modes.py +89 -0
- pytatui-1.0.0/python/pytatui/app.py +376 -0
- pytatui-1.0.0/python/pytatui/py.typed +0 -0
- pytatui-1.0.0/src/backend.rs +728 -0
- pytatui-1.0.0/src/buffer.rs +911 -0
- pytatui-1.0.0/src/calendar.rs +531 -0
- pytatui-1.0.0/src/canvas.rs +1605 -0
- pytatui-1.0.0/src/chart.rs +566 -0
- pytatui-1.0.0/src/crossterm/commands.rs +2691 -0
- pytatui-1.0.0/src/crossterm/event.rs +1893 -0
- pytatui-1.0.0/src/crossterm/mod.rs +14 -0
- pytatui-1.0.0/src/errors.rs +81 -0
- pytatui-1.0.0/src/layout.rs +1389 -0
- pytatui-1.0.0/src/lib.rs +47 -0
- pytatui-1.0.0/src/palette.rs +877 -0
- pytatui-1.0.0/src/prompts.rs +829 -0
- pytatui-1.0.0/src/style.rs +1193 -0
- pytatui-1.0.0/src/symbols.rs +1170 -0
- pytatui-1.0.0/src/terminal.rs +1756 -0
- pytatui-1.0.0/src/text.rs +972 -0
- pytatui-1.0.0/src/widgets/barchart.rs +402 -0
- pytatui-1.0.0/src/widgets/block.rs +506 -0
- pytatui-1.0.0/src/widgets/block_extra.rs +569 -0
- pytatui-1.0.0/src/widgets/clear.rs +39 -0
- pytatui-1.0.0/src/widgets/gauge.rs +300 -0
- pytatui-1.0.0/src/widgets/list.rs +379 -0
- pytatui-1.0.0/src/widgets/mascot.rs +91 -0
- pytatui-1.0.0/src/widgets/misc.rs +430 -0
- pytatui-1.0.0/src/widgets/mod.rs +110 -0
- pytatui-1.0.0/src/widgets/paragraph.rs +324 -0
- pytatui-1.0.0/src/widgets/scrollbar.rs +333 -0
- pytatui-1.0.0/src/widgets/sparkline.rs +179 -0
- pytatui-1.0.0/src/widgets/table.rs +679 -0
- pytatui-1.0.0/src/widgets/tabs.rs +143 -0
- pytatui-1.0.0/tests/__init__.py +0 -0
- pytatui-1.0.0/tests/python/__init__.py +0 -0
- pytatui-1.0.0/tests/python/test_agents_guide.py +45 -0
- pytatui-1.0.0/tests/python/test_bindings_async_extra.py +141 -0
- pytatui-1.0.0/tests/python/test_bindings_buffer_style_extra.py +305 -0
- pytatui-1.0.0/tests/python/test_bindings_canvas_extra.py +245 -0
- pytatui-1.0.0/tests/python/test_bindings_crossterm_extra.py +99 -0
- pytatui-1.0.0/tests/python/test_bindings_layout_text_extra.py +220 -0
- pytatui-1.0.0/tests/python/test_bindings_terminal_extra.py +301 -0
- pytatui-1.0.0/tests/python/test_bindings_widgets_extra.py +262 -0
- pytatui-1.0.0/tests/python/test_examples.py +26 -0
- pytatui-1.0.0/tests/python/test_hardening_conpty.py +335 -0
- pytatui-1.0.0/tests/python/test_hardening_gc.py +212 -0
- pytatui-1.0.0/tests/python/test_hardening_stubs.py +163 -0
- pytatui-1.0.0/tests/python/test_hardening_terminal.py +921 -0
- pytatui-1.0.0/tests/python/test_hardening_unicode.py +459 -0
- pytatui-1.0.0/tests/python/test_inline_viewport.py +276 -0
- pytatui-1.0.0/tests/python/test_pytatui.py +902 -0
- pytatui-1.0.0/tests/python/test_regressions.py +146 -0
- pytatui-1.0.0/tests/python/test_surface.py +627 -0
- pytatui-1.0.0/tests/stubtest_allowlist.txt +14 -0
- pytatui-1.0.0/tests/typing_examples.py +56 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: Create a report to help us improve
|
|
4
|
+
title: ''
|
|
5
|
+
labels: ''
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
**Describe the bug**
|
|
11
|
+
A clear and concise description of what the bug is.
|
|
12
|
+
|
|
13
|
+
**To Reproduce**
|
|
14
|
+
Steps to reproduce the behavior:
|
|
15
|
+
1. Go to '...'
|
|
16
|
+
2. Click on '....'
|
|
17
|
+
3. Scroll down to '....'
|
|
18
|
+
4. See error
|
|
19
|
+
|
|
20
|
+
**Expected behavior**
|
|
21
|
+
A clear and concise description of what you expected to happen.
|
|
22
|
+
|
|
23
|
+
**Screenshots**
|
|
24
|
+
If applicable, add screenshots to help explain your problem.
|
|
25
|
+
|
|
26
|
+
**Desktop (please complete the following information):**
|
|
27
|
+
- OS: [e.g. iOS]
|
|
28
|
+
- Browser [e.g. chrome, safari]
|
|
29
|
+
- Version [e.g. 22]
|
|
30
|
+
|
|
31
|
+
**Smartphone (please complete the following information):**
|
|
32
|
+
- Device: [e.g. iPhone6]
|
|
33
|
+
- OS: [e.g. iOS8.1]
|
|
34
|
+
- Browser [e.g. stock browser, safari]
|
|
35
|
+
- Version [e.g. 22]
|
|
36
|
+
|
|
37
|
+
**Additional context**
|
|
38
|
+
Add any other context about the problem here.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature request
|
|
3
|
+
about: Suggest an idea for this project
|
|
4
|
+
title: ''
|
|
5
|
+
labels: ''
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
**Is your feature request related to a problem? Please describe.**
|
|
11
|
+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
|
12
|
+
|
|
13
|
+
**Describe the solution you'd like**
|
|
14
|
+
A clear and concise description of what you want to happen.
|
|
15
|
+
|
|
16
|
+
**Describe alternatives you've considered**
|
|
17
|
+
A clear and concise description of any alternative solutions or features you've considered.
|
|
18
|
+
|
|
19
|
+
**Additional context**
|
|
20
|
+
Add any other context or screenshots about the feature request here.
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# Pull Request Template
|
|
2
|
+
|
|
3
|
+
## 📌 Description
|
|
4
|
+
|
|
5
|
+
Please include a clear and concise description of your changes.
|
|
6
|
+
|
|
7
|
+
* What does this PR do?
|
|
8
|
+
* Why is this change needed?
|
|
9
|
+
* What problem does it solve?
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 🔗 Related Issues
|
|
14
|
+
|
|
15
|
+
Link any related issues here (if applicable):
|
|
16
|
+
|
|
17
|
+
* Closes #
|
|
18
|
+
* Fixes #
|
|
19
|
+
* Related to #
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 🧪 Type of Change
|
|
24
|
+
|
|
25
|
+
Please mark the relevant option(s):
|
|
26
|
+
|
|
27
|
+
* [ ] 🐛 Bug fix
|
|
28
|
+
* [ ] ✨ New feature
|
|
29
|
+
* [ ] 💥 Breaking change
|
|
30
|
+
* [ ] 📝 Documentation update
|
|
31
|
+
* [ ] ♻️ Refactor
|
|
32
|
+
* [ ] ⚡ Performance improvement
|
|
33
|
+
* [ ] ✅ Test update
|
|
34
|
+
* [ ] 🔧 Chore / Maintenance
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## 🚀 How Has This Been Tested?
|
|
39
|
+
|
|
40
|
+
Describe the tests you ran and how to reproduce them:
|
|
41
|
+
|
|
42
|
+
* [ ] Unit tests
|
|
43
|
+
* [ ] Integration tests
|
|
44
|
+
* [ ] Manual testing
|
|
45
|
+
|
|
46
|
+
Provide details:
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
Steps to test:
|
|
50
|
+
1.
|
|
51
|
+
2.
|
|
52
|
+
3.
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## 📸 Screenshots (if applicable)
|
|
58
|
+
|
|
59
|
+
Add screenshots or screen recordings to help explain your changes.
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## ✅ Checklist
|
|
64
|
+
|
|
65
|
+
Before submitting your PR, please confirm:
|
|
66
|
+
|
|
67
|
+
* [ ] My code follows the project’s style guidelines
|
|
68
|
+
* [ ] I have performed a self-review of my code
|
|
69
|
+
* [ ] I have commented my code where necessary
|
|
70
|
+
* [ ] I have added/updated tests where applicable
|
|
71
|
+
* [ ] All tests pass locally
|
|
72
|
+
* [ ] Documentation has been updated (if needed)
|
|
73
|
+
* [ ] No sensitive data (API keys, secrets) is included
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## ⚠️ Breaking Changes
|
|
78
|
+
|
|
79
|
+
If this PR introduces breaking changes, describe them here:
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
Describe impact and migration steps
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## 💬 Additional Notes
|
|
88
|
+
|
|
89
|
+
Add any other context or information about this PR here.
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## 🙌 Reviewer Notes
|
|
94
|
+
|
|
95
|
+
(Optional) Highlight specific areas where you’d like feedback.
|
|
96
|
+
|
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
tags: ["v*"]
|
|
7
|
+
pull_request:
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
concurrency:
|
|
11
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
12
|
+
cancel-in-progress: true
|
|
13
|
+
|
|
14
|
+
env:
|
|
15
|
+
CARGO_TERM_COLOR: always
|
|
16
|
+
RUST_BACKTRACE: 1
|
|
17
|
+
CARGO_INCREMENTAL: 0
|
|
18
|
+
MATURIN_VERSION: "v1.8.1"
|
|
19
|
+
|
|
20
|
+
jobs:
|
|
21
|
+
check:
|
|
22
|
+
name: Check · ${{ matrix.os }}
|
|
23
|
+
runs-on: ${{ matrix.os }}
|
|
24
|
+
timeout-minutes: 45
|
|
25
|
+
strategy:
|
|
26
|
+
fail-fast: false
|
|
27
|
+
matrix:
|
|
28
|
+
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, windows-11-arm, macos-latest, macos-15-intel]
|
|
29
|
+
steps:
|
|
30
|
+
- uses: actions/checkout@v5
|
|
31
|
+
|
|
32
|
+
- name: Install Rust stable
|
|
33
|
+
run: rustup toolchain install stable --profile minimal --component clippy,rustfmt
|
|
34
|
+
|
|
35
|
+
- uses: Swatinem/rust-cache@v2
|
|
36
|
+
with:
|
|
37
|
+
shared-key: "pytatui-check-${{ matrix.os }}"
|
|
38
|
+
|
|
39
|
+
- uses: actions/setup-python@v6
|
|
40
|
+
with:
|
|
41
|
+
python-version: "3.12"
|
|
42
|
+
architecture: ${{ runner.arch == 'ARM64' && 'arm64' || 'x64' }}
|
|
43
|
+
cache: "pip"
|
|
44
|
+
cache-dependency-path: "pyproject.toml"
|
|
45
|
+
|
|
46
|
+
- name: Rust fmt
|
|
47
|
+
if: runner.os == 'Linux'
|
|
48
|
+
run: cargo fmt --all -- --check
|
|
49
|
+
|
|
50
|
+
- name: Rust clippy
|
|
51
|
+
run: cargo clippy --locked --all-targets -- -D warnings
|
|
52
|
+
|
|
53
|
+
- name: Rust tests
|
|
54
|
+
run: cargo test --locked
|
|
55
|
+
|
|
56
|
+
- name: Python tests
|
|
57
|
+
shell: bash
|
|
58
|
+
run: |
|
|
59
|
+
python -m venv .venv
|
|
60
|
+
if [ "$RUNNER_OS" = "Windows" ]; then
|
|
61
|
+
source .venv/Scripts/activate
|
|
62
|
+
else
|
|
63
|
+
source .venv/bin/activate
|
|
64
|
+
fi
|
|
65
|
+
python -m pip install --upgrade pip
|
|
66
|
+
pip install maturin pytest
|
|
67
|
+
if [ "$RUNNER_OS" = "Windows" ]; then
|
|
68
|
+
python -m pip install --only-binary=:all: "pywinpty==3.1.2"
|
|
69
|
+
fi
|
|
70
|
+
maturin develop --locked
|
|
71
|
+
pytest -q
|
|
72
|
+
|
|
73
|
+
build:
|
|
74
|
+
name: Build · ${{ matrix.name }}
|
|
75
|
+
runs-on: ${{ matrix.runner }}
|
|
76
|
+
|
|
77
|
+
strategy:
|
|
78
|
+
fail-fast: false
|
|
79
|
+
matrix:
|
|
80
|
+
include:
|
|
81
|
+
- name: Linux x86_64
|
|
82
|
+
runner: ubuntu-latest
|
|
83
|
+
target: x86_64-unknown-linux-gnu
|
|
84
|
+
os_type: linux
|
|
85
|
+
|
|
86
|
+
- name: Linux x86_64 musl
|
|
87
|
+
runner: ubuntu-latest
|
|
88
|
+
target: x86_64-unknown-linux-musl
|
|
89
|
+
os_type: linux-musl
|
|
90
|
+
|
|
91
|
+
- name: Linux ARM64
|
|
92
|
+
runner: ubuntu-24.04-arm
|
|
93
|
+
target: aarch64-unknown-linux-gnu
|
|
94
|
+
os_type: linux
|
|
95
|
+
|
|
96
|
+
- name: Linux ARM64 musl
|
|
97
|
+
runner: ubuntu-latest
|
|
98
|
+
target: aarch64-unknown-linux-musl
|
|
99
|
+
os_type: linux-musl
|
|
100
|
+
|
|
101
|
+
- name: macOS x86_64
|
|
102
|
+
runner: macos-15-intel
|
|
103
|
+
target: x86_64-apple-darwin
|
|
104
|
+
os_type: macos
|
|
105
|
+
|
|
106
|
+
- name: macOS arm64
|
|
107
|
+
runner: macos-latest
|
|
108
|
+
target: aarch64-apple-darwin
|
|
109
|
+
os_type: macos
|
|
110
|
+
|
|
111
|
+
- name: Windows x86_64
|
|
112
|
+
runner: windows-latest
|
|
113
|
+
target: x86_64-pc-windows-msvc
|
|
114
|
+
os_type: windows
|
|
115
|
+
|
|
116
|
+
- name: Windows ARM64
|
|
117
|
+
runner: windows-11-arm
|
|
118
|
+
target: aarch64-pc-windows-msvc
|
|
119
|
+
os_type: windows
|
|
120
|
+
|
|
121
|
+
permissions:
|
|
122
|
+
contents: read
|
|
123
|
+
id-token: write
|
|
124
|
+
attestations: write
|
|
125
|
+
|
|
126
|
+
steps:
|
|
127
|
+
- uses: actions/checkout@v5
|
|
128
|
+
|
|
129
|
+
- name: Install Rust stable
|
|
130
|
+
run: rustup toolchain install stable --profile minimal --target ${{ matrix.target }}
|
|
131
|
+
|
|
132
|
+
- uses: Swatinem/rust-cache@v2
|
|
133
|
+
with:
|
|
134
|
+
shared-key: "pytatui-${{ matrix.target }}"
|
|
135
|
+
cache-on-failure: true
|
|
136
|
+
|
|
137
|
+
- uses: actions/setup-python@v6
|
|
138
|
+
with:
|
|
139
|
+
python-version: "3.12"
|
|
140
|
+
architecture: ${{ runner.arch == 'ARM64' && 'arm64' || 'x64' }}
|
|
141
|
+
|
|
142
|
+
- name: Build wheel (Linux glibc)
|
|
143
|
+
if: matrix.os_type == 'linux'
|
|
144
|
+
uses: PyO3/maturin-action@v1
|
|
145
|
+
with:
|
|
146
|
+
maturin-version: ${{ env.MATURIN_VERSION }}
|
|
147
|
+
command: build
|
|
148
|
+
target: ${{ matrix.target }}
|
|
149
|
+
manylinux: auto
|
|
150
|
+
args: --release --strip --locked --out dist
|
|
151
|
+
|
|
152
|
+
- name: Build wheel (Linux musl)
|
|
153
|
+
if: matrix.os_type == 'linux-musl'
|
|
154
|
+
uses: PyO3/maturin-action@v1
|
|
155
|
+
with:
|
|
156
|
+
maturin-version: ${{ env.MATURIN_VERSION }}
|
|
157
|
+
command: build
|
|
158
|
+
target: ${{ matrix.target }}
|
|
159
|
+
manylinux: musllinux_1_2
|
|
160
|
+
args: --release --strip --locked --out dist
|
|
161
|
+
|
|
162
|
+
- name: Build wheel (macOS / Windows)
|
|
163
|
+
if: matrix.os_type != 'linux' && matrix.os_type != 'linux-musl'
|
|
164
|
+
uses: PyO3/maturin-action@v1
|
|
165
|
+
with:
|
|
166
|
+
maturin-version: ${{ env.MATURIN_VERSION }}
|
|
167
|
+
command: build
|
|
168
|
+
target: ${{ matrix.target }}
|
|
169
|
+
args: --release --strip --locked --out dist
|
|
170
|
+
|
|
171
|
+
- uses: actions/upload-artifact@v5
|
|
172
|
+
with:
|
|
173
|
+
name: wheels-${{ matrix.target }}
|
|
174
|
+
path: dist/*.whl
|
|
175
|
+
if-no-files-found: error
|
|
176
|
+
retention-days: 1
|
|
177
|
+
|
|
178
|
+
wheel-test:
|
|
179
|
+
name: Wheel · ${{ matrix.os }} · Python ${{ matrix.python }}
|
|
180
|
+
needs: build
|
|
181
|
+
runs-on: ${{ matrix.os }}
|
|
182
|
+
timeout-minutes: 20
|
|
183
|
+
strategy:
|
|
184
|
+
fail-fast: false
|
|
185
|
+
matrix:
|
|
186
|
+
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, windows-11-arm, macos-latest, macos-15-intel]
|
|
187
|
+
python: ["3.10", "3.x"]
|
|
188
|
+
exclude:
|
|
189
|
+
# The hosted Python distribution does not provide 3.10 for Windows ARM64.
|
|
190
|
+
- os: windows-11-arm
|
|
191
|
+
python: "3.10"
|
|
192
|
+
include:
|
|
193
|
+
- os: ubuntu-latest
|
|
194
|
+
target: x86_64-unknown-linux-gnu
|
|
195
|
+
architecture: x64
|
|
196
|
+
- os: ubuntu-24.04-arm
|
|
197
|
+
target: aarch64-unknown-linux-gnu
|
|
198
|
+
architecture: arm64
|
|
199
|
+
- os: windows-latest
|
|
200
|
+
target: x86_64-pc-windows-msvc
|
|
201
|
+
architecture: x64
|
|
202
|
+
- os: windows-11-arm
|
|
203
|
+
target: aarch64-pc-windows-msvc
|
|
204
|
+
architecture: arm64
|
|
205
|
+
- os: macos-latest
|
|
206
|
+
target: aarch64-apple-darwin
|
|
207
|
+
architecture: arm64
|
|
208
|
+
- os: macos-15-intel
|
|
209
|
+
target: x86_64-apple-darwin
|
|
210
|
+
architecture: x64
|
|
211
|
+
steps:
|
|
212
|
+
- uses: actions/checkout@v5
|
|
213
|
+
|
|
214
|
+
- uses: actions/download-artifact@v6
|
|
215
|
+
with:
|
|
216
|
+
name: wheels-${{ matrix.target }}
|
|
217
|
+
path: dist
|
|
218
|
+
|
|
219
|
+
- uses: actions/setup-python@v6
|
|
220
|
+
with:
|
|
221
|
+
python-version: ${{ matrix.python }}
|
|
222
|
+
architecture: ${{ matrix.architecture }}
|
|
223
|
+
check-latest: true
|
|
224
|
+
|
|
225
|
+
- name: Install the release wheel and test it
|
|
226
|
+
shell: bash
|
|
227
|
+
run: |
|
|
228
|
+
python -m pip install --upgrade pip
|
|
229
|
+
python -m pip install pytest
|
|
230
|
+
if [ "$RUNNER_OS" = "Windows" ]; then
|
|
231
|
+
python -m pip install --only-binary=:all: "pywinpty==3.1.2"
|
|
232
|
+
fi
|
|
233
|
+
python -m pip install --force-reinstall --no-deps dist/*.whl
|
|
234
|
+
python -c "import pathlib, sys, pytatui, pytatui._pytatui as native; paths = [pathlib.Path(pytatui.__file__).resolve(), pathlib.Path(native.__file__).resolve()]; print('Wheel imports:', *paths); assert all(p.is_relative_to(pathlib.Path(sys.prefix).resolve()) for p in paths)"
|
|
235
|
+
python -m pytest -q
|
|
236
|
+
|
|
237
|
+
wheel-test-musl:
|
|
238
|
+
name: Musl wheel · ${{ matrix.target }}
|
|
239
|
+
needs: build
|
|
240
|
+
runs-on: ${{ matrix.runner }}
|
|
241
|
+
timeout-minutes: 20
|
|
242
|
+
strategy:
|
|
243
|
+
fail-fast: false
|
|
244
|
+
matrix:
|
|
245
|
+
include:
|
|
246
|
+
- runner: ubuntu-latest
|
|
247
|
+
target: x86_64-unknown-linux-musl
|
|
248
|
+
- runner: ubuntu-24.04-arm
|
|
249
|
+
target: aarch64-unknown-linux-musl
|
|
250
|
+
steps:
|
|
251
|
+
- uses: actions/checkout@v5
|
|
252
|
+
|
|
253
|
+
- uses: actions/download-artifact@v6
|
|
254
|
+
with:
|
|
255
|
+
name: wheels-${{ matrix.target }}
|
|
256
|
+
path: dist
|
|
257
|
+
|
|
258
|
+
- name: Install and smoke-test the wheel in Alpine
|
|
259
|
+
run: |
|
|
260
|
+
for version in 3.10 3; do
|
|
261
|
+
docker run --rm -v "$PWD:/work" -w /work "python:${version}-alpine" sh -ec '
|
|
262
|
+
python --version
|
|
263
|
+
python -m pip install pytest
|
|
264
|
+
python -m pip install --force-reinstall --no-deps dist/*.whl
|
|
265
|
+
python -c "import pathlib, sys, pytatui, pytatui._pytatui as native; paths = [pathlib.Path(pytatui.__file__).resolve(), pathlib.Path(native.__file__).resolve()]; print(\"Wheel imports:\", *paths); assert all(p.is_relative_to(pathlib.Path(sys.prefix).resolve()) for p in paths)"
|
|
266
|
+
python -m pytest -q \
|
|
267
|
+
tests/python/test_bindings_terminal_extra.py::test_persistent_terminal_completed_frames_and_diffs \
|
|
268
|
+
tests/python/test_regressions.py::test_headless_draw_renders_and_expires_frame \
|
|
269
|
+
tests/python/test_inline_viewport.py::TestDrawingInline::test_the_default_still_takes_over_the_screen
|
|
270
|
+
'
|
|
271
|
+
done
|
|
272
|
+
|
|
273
|
+
typing:
|
|
274
|
+
name: Typing · Linux x86_64 · Python 3.12
|
|
275
|
+
needs: build
|
|
276
|
+
runs-on: ubuntu-latest
|
|
277
|
+
timeout-minutes: 10
|
|
278
|
+
steps:
|
|
279
|
+
- uses: actions/checkout@v5
|
|
280
|
+
|
|
281
|
+
- uses: actions/download-artifact@v6
|
|
282
|
+
with:
|
|
283
|
+
name: wheels-x86_64-unknown-linux-gnu
|
|
284
|
+
path: dist
|
|
285
|
+
|
|
286
|
+
- uses: actions/setup-python@v6
|
|
287
|
+
with:
|
|
288
|
+
python-version: "3.12"
|
|
289
|
+
|
|
290
|
+
- name: Check Python lint, types, and native stubs
|
|
291
|
+
run: |
|
|
292
|
+
python -m pip install "mypy==2.4.1" "ruff==0.17.5"
|
|
293
|
+
python -m pip install --force-reinstall --no-deps dist/*.whl
|
|
294
|
+
python -m ruff check .
|
|
295
|
+
python -m mypy python/pytatui tests/typing_examples.py
|
|
296
|
+
MYPYPATH=python python -m mypy.stubtest pytatui._pytatui --allowlist tests/stubtest_allowlist.txt --concise
|
|
297
|
+
|
|
298
|
+
release:
|
|
299
|
+
name: GitHub Release & PyPI Publish
|
|
300
|
+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
|
|
301
|
+
needs: [check, build, wheel-test, wheel-test-musl, typing]
|
|
302
|
+
runs-on: ubuntu-latest
|
|
303
|
+
environment: pypi
|
|
304
|
+
|
|
305
|
+
permissions:
|
|
306
|
+
contents: write
|
|
307
|
+
id-token: write
|
|
308
|
+
|
|
309
|
+
steps:
|
|
310
|
+
- uses: actions/checkout@v5
|
|
311
|
+
with:
|
|
312
|
+
fetch-depth: 0
|
|
313
|
+
|
|
314
|
+
- name: Extract version and verify tag
|
|
315
|
+
id: version
|
|
316
|
+
run: |
|
|
317
|
+
VERSION=$(python3 -c 'import tomllib; print(tomllib.load(open("pyproject.toml", "rb"))["project"]["version"])')
|
|
318
|
+
[ -n "$VERSION" ] || { echo "::error::Project version is empty"; exit 1; }
|
|
319
|
+
if [ "$GITHUB_REF_NAME" != "v$VERSION" ]; then
|
|
320
|
+
echo "::error::Tag $GITHUB_REF_NAME does not match project version v$VERSION"
|
|
321
|
+
exit 1
|
|
322
|
+
fi
|
|
323
|
+
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
|
324
|
+
|
|
325
|
+
- uses: actions/download-artifact@v6
|
|
326
|
+
with:
|
|
327
|
+
pattern: wheels-*
|
|
328
|
+
merge-multiple: true
|
|
329
|
+
path: dist/
|
|
330
|
+
|
|
331
|
+
- name: Build sdist
|
|
332
|
+
uses: PyO3/maturin-action@v1
|
|
333
|
+
with:
|
|
334
|
+
maturin-version: ${{ env.MATURIN_VERSION }}
|
|
335
|
+
command: sdist
|
|
336
|
+
args: --out dist
|
|
337
|
+
|
|
338
|
+
- name: Generate & verify SHA256SUMS
|
|
339
|
+
run: |
|
|
340
|
+
mkdir -p sha
|
|
341
|
+
cd dist
|
|
342
|
+
sha256sum *.whl *.tar.gz > ../sha/SHA256SUMS
|
|
343
|
+
while read SUM FILE; do
|
|
344
|
+
echo "Verifying $FILE"
|
|
345
|
+
echo "$SUM $FILE" | sha256sum -c --status || { echo "SHA256 mismatch for $FILE"; exit 1; }
|
|
346
|
+
done < ../sha/SHA256SUMS
|
|
347
|
+
|
|
348
|
+
- name: Determine previous tag
|
|
349
|
+
id: prev
|
|
350
|
+
run: |
|
|
351
|
+
# --force: a stale local tag must never fail a release fetch.
|
|
352
|
+
git fetch --tags --force
|
|
353
|
+
CURRENT="v${{ steps.version.outputs.version }}"
|
|
354
|
+
PREV=$(git tag --sort=-v:refname \
|
|
355
|
+
| grep -E '^v[0-9]+\.[0-9]+\.[0-9]+' \
|
|
356
|
+
| grep -v "^${CURRENT}$" \
|
|
357
|
+
| head -1 || true)
|
|
358
|
+
echo "previous=$PREV" >> "$GITHUB_OUTPUT"
|
|
359
|
+
|
|
360
|
+
- name: Build release notes
|
|
361
|
+
run: |
|
|
362
|
+
VERSION="${{ steps.version.outputs.version }}"
|
|
363
|
+
PREV="${{ steps.prev.outputs.previous }}"
|
|
364
|
+
{
|
|
365
|
+
echo "## pytatui v${VERSION}"
|
|
366
|
+
echo ""
|
|
367
|
+
if [ -z "$PREV" ]; then
|
|
368
|
+
echo "_Initial release_"
|
|
369
|
+
else
|
|
370
|
+
echo "### Full changelog"
|
|
371
|
+
echo "https://github.com/${{ github.repository }}/compare/${PREV}...v${VERSION}"
|
|
372
|
+
fi
|
|
373
|
+
} > release_body.md
|
|
374
|
+
|
|
375
|
+
- name: Publish to PyPI
|
|
376
|
+
# A duplicate filename must fail rather than hide a different artifact.
|
|
377
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
378
|
+
with:
|
|
379
|
+
packages-dir: dist/
|
|
380
|
+
|
|
381
|
+
- name: Create GitHub Release
|
|
382
|
+
uses: softprops/action-gh-release@v2
|
|
383
|
+
with:
|
|
384
|
+
tag_name: "v${{ steps.version.outputs.version }}"
|
|
385
|
+
name: "v${{ steps.version.outputs.version }}"
|
|
386
|
+
body_path: release_body.md
|
|
387
|
+
make_latest: true
|
|
388
|
+
files: |
|
|
389
|
+
dist/*.whl
|
|
390
|
+
dist/*.tar.gz
|
|
391
|
+
sha/SHA256SUMS
|
|
392
|
+
env:
|
|
393
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
pytatui-1.0.0/.gitignore
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
## Setup
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
git clone https://github.com/TIERFactory/PyTatui.git
|
|
7
|
+
cd pytatui
|
|
8
|
+
python -m venv .venv
|
|
9
|
+
source .venv/bin/activate
|
|
10
|
+
pip install -e ".[dev]"
|
|
11
|
+
pip install maturin
|
|
12
|
+
maturin develop
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Rust source lives in `src/`, the Python package in `python/pytatui/`.
|
|
16
|
+
|
|
17
|
+
## Checks
|
|
18
|
+
|
|
19
|
+
Run these before opening a pull request:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pytest
|
|
23
|
+
cargo test
|
|
24
|
+
cargo clippy --all-targets -- -D warnings
|
|
25
|
+
cargo fmt --all -- --check
|
|
26
|
+
ruff check . && ruff format --check .
|
|
27
|
+
mypy .
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
After changing Rust code, re-run `maturin develop` before `pytest`.
|
|
31
|
+
|
|
32
|
+
## Guidelines
|
|
33
|
+
|
|
34
|
+
* Keep changes focused; PyTatui is a binding library, not a widget
|
|
35
|
+
ecosystem — new third-party integrations belong in separate packages.
|
|
36
|
+
* Match the existing style: small functions, direct conversions, comments
|
|
37
|
+
only where something is non-obvious.
|
|
38
|
+
* Add tests for new behavior.
|
|
39
|
+
* Public API changes also need updates to
|
|
40
|
+
`python/pytatui/_pytatui.pyi` and `python/pytatui/__init__.py`.
|
|
41
|
+
|
|
42
|
+
## Issues
|
|
43
|
+
|
|
44
|
+
Include steps to reproduce, expected vs. actual behavior, and your OS,
|
|
45
|
+
Python, and Rust versions.
|