lumiview 0.1.0.dev0__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.
Files changed (39) hide show
  1. lumiview-0.1.0.dev0/.github/workflows/publish-to-pypi.yml +142 -0
  2. lumiview-0.1.0.dev0/.gitignore +222 -0
  3. lumiview-0.1.0.dev0/CONTRIBUTING.md +61 -0
  4. lumiview-0.1.0.dev0/Cargo.lock +2177 -0
  5. lumiview-0.1.0.dev0/Cargo.toml +30 -0
  6. lumiview-0.1.0.dev0/LICENSE +373 -0
  7. lumiview-0.1.0.dev0/PKG-INFO +162 -0
  8. lumiview-0.1.0.dev0/README.md +129 -0
  9. lumiview-0.1.0.dev0/README_zh.md +129 -0
  10. lumiview-0.1.0.dev0/examples/bridge_demo.py +87 -0
  11. lumiview-0.1.0.dev0/examples/custom_titlebar.py +80 -0
  12. lumiview-0.1.0.dev0/examples/events.py +65 -0
  13. lumiview-0.1.0.dev0/examples/fastapi_demo.py +99 -0
  14. lumiview-0.1.0.dev0/examples/hello_world.py +39 -0
  15. lumiview-0.1.0.dev0/examples/hello_world_sync.py +39 -0
  16. lumiview-0.1.0.dev0/examples/multi_window.py +63 -0
  17. lumiview-0.1.0.dev0/pyproject.toml +51 -0
  18. lumiview-0.1.0.dev0/python/lumiview/__init__.py +142 -0
  19. lumiview-0.1.0.dev0/python/lumiview/_app.py +612 -0
  20. lumiview-0.1.0.dev0/python/lumiview/_binding.py +110 -0
  21. lumiview-0.1.0.dev0/python/lumiview/_bridge.py +316 -0
  22. lumiview-0.1.0.dev0/python/lumiview/_core.pyi +501 -0
  23. lumiview-0.1.0.dev0/python/lumiview/_events.py +47 -0
  24. lumiview-0.1.0.dev0/python/lumiview/_scope.py +381 -0
  25. lumiview-0.1.0.dev0/python/lumiview/_task.py +195 -0
  26. lumiview-0.1.0.dev0/python/lumiview/_window.py +1074 -0
  27. lumiview-0.1.0.dev0/python/lumiview/plugins/__init__.py +5 -0
  28. lumiview-0.1.0.dev0/python/lumiview/plugins/window_controls.py +168 -0
  29. lumiview-0.1.0.dev0/python/lumiview/serve/__init__.py +46 -0
  30. lumiview-0.1.0.dev0/python/lumiview/serve/asgi.py +224 -0
  31. lumiview-0.1.0.dev0/python/lumiview/serve/base.py +159 -0
  32. lumiview-0.1.0.dev0/python/lumiview/serve/static.py +142 -0
  33. lumiview-0.1.0.dev0/python/lumiview/serve/wsgi.py +233 -0
  34. lumiview-0.1.0.dev0/python/lumiview/utils.py +43 -0
  35. lumiview-0.1.0.dev0/src/event_loop.rs +240 -0
  36. lumiview-0.1.0.dev0/src/events.rs +553 -0
  37. lumiview-0.1.0.dev0/src/lib.rs +54 -0
  38. lumiview-0.1.0.dev0/src/types.rs +394 -0
  39. lumiview-0.1.0.dev0/src/window.rs +556 -0
@@ -0,0 +1,142 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ linux:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - name: Install webkit2gtk
18
+ run: |
19
+ sudo apt-get update
20
+ sudo apt-get install -y libwebkit2gtk-4.1-dev libgtk-3-dev libglib2.0-dev
21
+ - uses: actions/setup-python@v5
22
+ with:
23
+ python-version: "3.12"
24
+
25
+ - name: Build wheel
26
+ uses: PyO3/maturin-action@v1
27
+ with:
28
+ args: --release --out dist
29
+ - name: Repair manylinux (exclude GTK3/GLib — system provides them)
30
+ run: |
31
+ pip install auditwheel
32
+ auditwheel repair \
33
+ --exclude 'libgtk-3.so.*' \
34
+ --exclude 'libgdk-3.so.*' \
35
+ --exclude 'libglib-2.0.so.*' \
36
+ --exclude 'libgobject-2.0.so.*' \
37
+ --exclude 'libgio-2.0.so.*' \
38
+ --exclude 'libgmodule-2.0.so.*' \
39
+ --exclude 'libgdk_pixbuf-2.0.so.*' \
40
+ --exclude 'libpango-1.0.so.*' \
41
+ --exclude 'libcairo.so.*' \
42
+ -w dist dist/lumiview-*.whl
43
+ rm -f dist/*-linux_x86_64.whl
44
+ - name: Upload wheels
45
+ uses: actions/upload-artifact@v4
46
+ with:
47
+ name: wheels-linux
48
+ path: dist
49
+
50
+ windows:
51
+ runs-on: windows-latest
52
+ steps:
53
+ - uses: actions/checkout@v4
54
+ - uses: actions/setup-python@v5
55
+ with:
56
+ python-version: "3.12"
57
+ - name: Build wheel
58
+ uses: PyO3/maturin-action@v1
59
+ with:
60
+ args: --release --out dist
61
+ - name: Upload wheels
62
+ uses: actions/upload-artifact@v4
63
+ with:
64
+ name: wheels-windows
65
+ path: dist
66
+
67
+ macos:
68
+ runs-on: ${{ matrix.platform.runner }}
69
+ strategy:
70
+ matrix:
71
+ platform:
72
+ - runner: macos-14
73
+ target: x86_64
74
+ - runner: macos-latest
75
+ target: aarch64
76
+ steps:
77
+ - uses: actions/checkout@v4
78
+ - uses: actions/setup-python@v5
79
+ with:
80
+ python-version: "3.12"
81
+ - name: Build wheel
82
+ uses: PyO3/maturin-action@v1
83
+ with:
84
+ target: ${{ matrix.platform.target }}
85
+ args: --release --out dist
86
+ - name: Upload wheels
87
+ uses: actions/upload-artifact@v4
88
+ with:
89
+ name: wheels-macos-${{ matrix.platform.target }}
90
+ path: dist
91
+
92
+ sdist:
93
+ runs-on: ubuntu-latest
94
+ steps:
95
+ - uses: actions/checkout@v4
96
+ - name: Build sdist
97
+ uses: PyO3/maturin-action@v1
98
+ with:
99
+ command: sdist
100
+ args: --out dist
101
+ - name: Upload sdist
102
+ uses: actions/upload-artifact@v4
103
+ with:
104
+ name: wheels-sdist
105
+ path: dist
106
+
107
+ pypi-publish:
108
+ runs-on: ubuntu-latest
109
+ if: startsWith(github.ref, 'refs/tags/v')
110
+ needs: [linux, windows, macos, sdist]
111
+ permissions:
112
+ id-token: write
113
+ contents: read
114
+ environment:
115
+ name: pypi
116
+ url: https://pypi.org/project/lumiview/
117
+ steps:
118
+ - uses: actions/checkout@v4
119
+
120
+ - name: Validate version match
121
+ shell: pwsh
122
+ run: |
123
+ $pyprojectVersion = (Select-String -Path pyproject.toml -Pattern 'version = "(.+?)"').Matches.Groups[1].Value
124
+ $gitTag = "${{ github.ref }}".Split('/')[-1]
125
+ $gitTagVersion = $gitTag.TrimStart('v')
126
+ if ($pyprojectVersion -ne $gitTagVersion) {
127
+ Write-Error "Version mismatch: pyproject.toml=$pyprojectVersion vs tag=$gitTag"
128
+ exit 1
129
+ }
130
+ Write-Host "Versions match: $pyprojectVersion"
131
+
132
+ - name: Retrieve release distributions
133
+ uses: actions/download-artifact@v4
134
+ with:
135
+ pattern: wheels-*
136
+ path: dist/
137
+ merge-multiple: true
138
+
139
+ - name: Publish release distributions to PyPI
140
+ uses: pypa/gh-action-pypi-publish@release/v1
141
+ with:
142
+ packages-dir: dist/
@@ -0,0 +1,222 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ parts/
18
+ sdist/
19
+ var/
20
+ wheels/
21
+ share/python-wheels/
22
+ *.egg-info/
23
+ .installed.cfg
24
+ *.egg
25
+ MANIFEST
26
+
27
+ # PyInstaller
28
+ # Usually these files are written by a python script from a template
29
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
30
+ *.manifest
31
+ *.spec
32
+
33
+ # Installer logs
34
+ pip-log.txt
35
+ pip-delete-this-directory.txt
36
+
37
+ # Unit test / coverage reports
38
+ htmlcov/
39
+ .tox/
40
+ .nox/
41
+ .coverage
42
+ .coverage.*
43
+ .cache
44
+ nosetests.xml
45
+ coverage.xml
46
+ *.cover
47
+ *.py.cover
48
+ .hypothesis/
49
+ .pytest_cache/
50
+ cover/
51
+
52
+ # Translations
53
+ *.mo
54
+ *.pot
55
+
56
+ # Django stuff:
57
+ *.log
58
+ local_settings.py
59
+ db.sqlite3
60
+ db.sqlite3-journal
61
+
62
+ # Flask stuff:
63
+ instance/
64
+ .webassets-cache
65
+
66
+ # Scrapy stuff:
67
+ .scrapy
68
+
69
+ # Sphinx documentation
70
+ docs/_build/
71
+
72
+ # PyBuilder
73
+ .pybuilder/
74
+ target/
75
+
76
+ # Jupyter Notebook
77
+ .ipynb_checkpoints
78
+
79
+ # IPython
80
+ profile_default/
81
+ ipython_config.py
82
+
83
+ # pyenv
84
+ # For a library or package, you might want to ignore these files since the code is
85
+ # intended to run in multiple environments; otherwise, check them in:
86
+ # .python-version
87
+
88
+ # pipenv
89
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
90
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
91
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
92
+ # install all needed dependencies.
93
+ #Pipfile.lock
94
+
95
+ # UV
96
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
97
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
98
+ # commonly ignored for libraries.
99
+ #uv.lock
100
+
101
+ # poetry
102
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
103
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
104
+ # commonly ignored for libraries.
105
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
106
+ #poetry.lock
107
+ #poetry.toml
108
+
109
+ # pdm
110
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
111
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
112
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
113
+ #pdm.lock
114
+ #pdm.toml
115
+ .pdm-python
116
+ .pdm-build/
117
+
118
+ # pixi
119
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
120
+ #pixi.lock
121
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
122
+ # in the .venv directory. It is recommended not to include this directory in version control.
123
+ .pixi
124
+
125
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
126
+ __pypackages__/
127
+
128
+ # Celery stuff
129
+ celerybeat-schedule
130
+ celerybeat.pid
131
+
132
+ # SageMath parsed files
133
+ *.sage.py
134
+
135
+ # Environments
136
+ .env
137
+ .envrc
138
+ .venv
139
+ env/
140
+ venv/
141
+ ENV/
142
+ env.bak/
143
+ venv.bak/
144
+
145
+ # Spyder project settings
146
+ .spyderproject
147
+ .spyproject
148
+
149
+ # Rope project settings
150
+ .ropeproject
151
+
152
+ # mkdocs documentation
153
+ /site
154
+
155
+ # mypy
156
+ .mypy_cache/
157
+ .dmypy.json
158
+ dmypy.json
159
+
160
+ # Pyre type checker
161
+ .pyre/
162
+
163
+ # pytype static type analyzer
164
+ .pytype/
165
+
166
+ # Cython debug symbols
167
+ cython_debug/
168
+
169
+ # PyCharm
170
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
171
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
172
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
173
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
174
+ .idea/
175
+
176
+ # Abstra
177
+ # Abstra is an AI-powered process automation framework.
178
+ # Ignore directories containing user credentials, local state, and settings.
179
+ # Learn more at https://abstra.io/docs
180
+ .abstra/
181
+
182
+ # Visual Studio Code
183
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
184
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
185
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
186
+ # you could uncomment the following to ignore the entire vscode folder
187
+ .vscode/
188
+
189
+ # Ruff stuff:
190
+ .ruff_cache/
191
+
192
+ # PyPI configuration file
193
+ .pypirc
194
+
195
+ # Cursor
196
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
197
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
198
+ # refer to https://docs.cursor.com/context/ignore-files
199
+ .cursorignore
200
+ .cursorindexingignore
201
+
202
+ # Marimo
203
+ marimo/_static/
204
+ marimo/_lsp/
205
+ __marimo__/
206
+
207
+
208
+ # stubs
209
+
210
+ stubs/
211
+
212
+ python/**/*.pyd
213
+ python/**/*.pdb
214
+
215
+ .claude
216
+ CLAUDE.md
217
+
218
+ .DS_Store
219
+
220
+ plan.md
221
+ TODO.md
222
+ docs/superpowers
@@ -0,0 +1,61 @@
1
+ # Contributing to LumiView
2
+
3
+ Thank you for your interest in contributing! LumiView is in early development, and we welcome feedback, bug reports, and thoughtful PRs.
4
+
5
+ **Before starting any significant work**, please open a [Discussion](https://github.com/xiaosuawa/LumiView/discussions) or [Issue](https://github.com/xiaosuawa/LumiView/issues) to align on the approach. Unsolicited PRs that touch the public API may not be merged if they conflict with the planned direction.
6
+
7
+ ## Ways to Contribute
8
+
9
+ ### 🐛 Bug Reports
10
+
11
+ - Check existing [Issues](https://github.com/xiaosuawa/LumiView/issues) first
12
+ - Include: OS + version, Python version, `lumiview` version, minimal repro code
13
+
14
+ ### 💡 Feature Ideas
15
+
16
+ - Use [Discussions](https://github.com/xiaosuawa/LumiView/discussions) for brainstorming
17
+ - Tell us about your use case — it helps us prioritize
18
+
19
+ ### 📖 Examples & Documentation
20
+
21
+ - Improvements to the [`examples/`](examples/) directory are always welcome
22
+ - Docstring improvements and typo fixes don't need prior discussion
23
+
24
+ ### 🔧 Code Contributions
25
+
26
+ 1. **Discuss first** — open an issue or discussion for anything beyond small fixes
27
+ 2. **Follow existing patterns** — match the code style, type annotations, and docstring conventions
28
+ 3. **Keep PRs focused** — one thing per PR
29
+
30
+ ## Development Setup
31
+
32
+ ```bash
33
+ # Clone and install dev dependencies
34
+ git clone https://github.com/xiaosuawa/LumiView.git
35
+ cd lumiview
36
+ pip install maturin
37
+
38
+ # Build and install in debug mode
39
+ maturin develop
40
+
41
+ # Run an example
42
+ python examples/hello_world.py
43
+ ```
44
+
45
+ ## Project Structure
46
+
47
+ ```
48
+ src/ Rust bindings (PyO3 + tao + wryview)
49
+ python/lumiview/ Python layer (App, Window, Bridge, Task, serve)
50
+ examples/ Runnable example scripts
51
+ ```
52
+
53
+ ## Code Style
54
+
55
+ - Python: follow existing type annotation patterns (all public APIs are typed)
56
+ - Rust: standard `cargo fmt` + `cargo clippy`
57
+ - Docstrings: Google-style for Python, `///` for Rust
58
+
59
+ ## License
60
+
61
+ By contributing, you agree that your contributions will be licensed under the [MPL-2.0](LICENSE).