Changelog¶
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Highlights
for the most attractive new features.BREAKING
for breaking changes.Added
for new features.Changed
for changes in existing functionality.Deprecated
for soon-to-be removed features.Removed
for now removed features.Fixed
for any bug fixes.Security
in case of vulnerabilities.Docs
for documentation changes.YANKED
for deprecated releases.Internal
for internal changes. Only for maintainers.
Tip
This homepage is used to provide a blog-like changelog and BREAKING CHANGE
migration guide.
You can expand sub-projects to view detailed changelogs.
Unreleased¶
0.6.0¶
Highlights¶
create-pytauri-app
template generator¶
- #169 - docs: update docs for v0.6.0 .
Since version 0.6
, create-pytauri-app is the recommended way to start a new PyTauri project, even if it is still in development.
Usage
Refer to uv and copier, run the following command:
This will initialize the project in the form of an interactive questionnaire:
However, we still recommend reading the entire "Tutorial" section, as it will help you understand all the details of pytauri.
tauri-plugin-dialog
bingings¶
- #163 - feat(plugin): implement
tauri-plugin-dialog
bindings.
tauri-plugin-dialog
has now been integrated into pytauri
as the plugin-dialog
gated feature.
Usage
from pytauri_plugins.dialog import DialogExt, MessageDialogButtons, MessageDialogKind
@commands.command()
async def greet(
app_handle: AppHandle, webview_window: WebviewWindow
) -> bytes:
file_dialog_builder = DialogExt.file(app_handle)
file_dialog_builder.pick_files(
lambda files: print(f"Files selected: {files}"),
add_filter=("markdown", ["md"]),
set_parent=webview_window,
set_title="Select a Markdown file",
)
message_dialog_builder = DialogExt.message(app_handle, "Hello!")
message_dialog_builder.show(
lambda is_ok: print(f"Dialog closed with: {is_ok}"),
parent=webview_window,
buttons=MessageDialogButtons.OkCancelCustom("ok", "cancel"),
kind=MessageDialogKind.Info,
)
return b"null"
Integrate plugins as features¶
- #160 - feat(pytauri)!: integrate
plugin-notification
as a gated-feature ofpytauri
.
The rs/pytauri-plugin-notification
crate and the py/pytauri-plugin-notification
package have been removed. Instead, use the plugin-notification
feature of the rs/pytauri
crate.
For details, compare the v0.5
and v0.6
"tutorial/using-plugins" documentation.
Migration
# src-tauri/Cargo.toml
[dependencies]
-pytauri-plugin-notification = ...
+pytauri = { version = "...", features = ["plugin-notification"] }
BREAKING¶
-
#166 - fix(standalone)!: standalone binary not working on MacOS.
Patch
install_name
forlibpython3.*.dylib
ofpython-build-standalone
See: https://github.com/pytauri/pytauri/issues/99#issuecomment-2704556726.
The
install_name
oflibpython3.*.dylib
built bypython-build-standalone
does not include@rpath
, which makes therpath
set for the executable ineffective.Migration
Until this is fixed upstream in
python-build-standalone
, you need to manually patch theinstall_name
:Do not create more than one
App
instanceSee: https://github.com/tauri-apps/tauri/issues/12934
tauri
does not allow creating more than oneApp
instance per process. Previously, we were unaware of this limitation and suggested creating asample_app
to obtain theresource_dir
, which subsequently caused a panic inApp
in__init__.py
.Migration
-
#161 - refactor(pytauri)!: refactor
BuilderArgs
toTypedDict
. -
#157 - feat(pytauri)!:
Position.Physical(x, y)
->Position.Physical((x, y))
.These APIs have changed:
Position.Physical
Position.Logical
Size.Physical
Size.Logical
Migration
from pytauri import Position, PositionType, Size, SizeType def foo(pos: PositionType, size: SizeType) -> None: match pos: - case Position.Physical(x, y): + case Position.Physical((x, y)): print(f"Physical position: {x}, {y}") - case Position.Logical(x, y): + case Position.Logical((x, y)): print(f"Logical position: {x}, {y}") match size: - case Size.Physical(w, h): + case Size.Physical((w, h)): print(f"Physical size: {w}, {h}") - case Size.Logical(w, h): + case Size.Logical((w, h)): print(f"Logical size: {w}, {h}") -foo(pos=Position.Physical(1, 2), size=Size.Physical(3, 4)) +foo(pos=Position.Physical((1, 2)), size=Size.Physical((3, 4)))
Added¶
-
#157 - feat(pytauri): fully implement
tauri::RunEvent
bindings.-
mod tauri::
Theme
CloseRequestApi
ExitRequestApi
DragDropEvent
(DragDropEventType
)WebviewEvent
(WebviewEventType
)WindowEvent
(WindowEventType
)RunEvent::{ExitRequested::api, WebviewEvent::event, WindowEvent::event}
fieldswebview::WebviewWindow::{on_webview_event, on_window_event}
methodsAppHandle::set_theme
andwebview::WebviewWindow::{set_theme, theme}
methods
-
add
_NonExhaustive
field to all#[non_exhaustive]
enum
s
Usage
from pytauri import AppHandle, Manager, WindowEvent, WindowEventType def register_window_event_handler(app_handle: AppHandle): webview_window = Manager.get_webview_window(app_handle, "main") assert webview_window is not None close_requested = False def window_event_handler(event: WindowEventType) -> None: nonlocal close_requested match event: case WindowEvent.CloseRequested(api=api): if not close_requested: print("Preventing window closing") api.prevent_close() close_requested = True case WindowEvent.Focused(focused): print(f"Window focused: {focused}") case WindowEvent.Moved((x, y)): print(f"Moved to ({x}, {y})") case _: pass webview_window.on_window_event(window_event_handler)
-
-
#158 - chore: bump
pyo3
to0.25
.
0.5.0¶
Highlights¶
Wheel on Windows Arm64¶
- #139 - feat: add support for the
windows-11-arm
platform wheel.
You can now install pytauri-wheel
from PyPI on Windows 11 Arm64.
Using Unreleased Commits¶
- #147 - feat: support installation from git repository.
See: https://pytauri.github.io/pytauri/0.5/usage/using-unreleased-commits/
Accessing the request headers¶
- #136 - feat(pytauri): accessing the request headers in
Commands
.
See: https://pytauri.github.io/pytauri/0.5/usage/concepts/ipc/#accessing-request-headers
Protect source code¶
- #134 - docs: add tutorial on using
Cython
to protect source code.
See: https://pytauri.github.io/pytauri/0.5/usage/tutorial/build-standalone-cython/
BREAKING¶
- #136 -
tauri v2.5
requires upgrading@tauri-apps/api: ^2.5
andtauri-plugin-pytauri-api: ^0.5
. - #141 - feat(pytauri)!:
pytauri.path.PathResolver
now returns apathlib.Path
object instead of astr
. -
#133 - fix(pytauri)!: make
BuilderArgs.invoke_handler
as required parameter for #110.If you do not specify
invoke_handler
,pytauri
will not register thetauri-plugin-pytauri
plugin, which means you cannot usepyInvoke
in the frontend to callCommands
(you will receive an error like "plugin pytauri not found"). If this is indeed the behavior you expect, explicitly passNone
.
Added¶
- #141 - chore: bump
pyo3
to0.24.1
. - #124 - #136 - chore: bump
tauri
dependencies:tauri
to2.5.1
tauri-utils
to~2.4
tauri-build
to2.2
tauri-plugin
to2.2
tauri-plugin-notification
to2.2
tauri-plugin-opener
to2.2
@tauri-apps/api
to^2.5
@tauri-apps/plugin-opener
to^2.2
@tauri-apps/plugin-dialog
to^2.2
Docs¶
- #124 - docs: update example to use
App.run_return
instead ofApp.run
, allowing cleanup tasks to be performed after the app exits (e.g., shutting down thenicegui
server) and retrieving the exit code.
0.4.0¶
Highlights¶
Precompiled python wheel (goodbye Rust compiler)¶
In v0.4.0
, we have introduced an exciting new feature: precompiled Python wheel support! 🎉
This means you can use PyTauri without writing any Rust code or needing a Rust compiler.
This allows you to perform full-stack development in pure Python (like pywebview
but battery-included 🤓).
Please refer to the PyTauri Wheel documentation for more information.
New logo for PyTauri¶
Thanks to @ISOR3X in #111! PyTauri now has its own logo 🎉:
It is indeed a snake, but not eating a bean, or perhaps it was not intended to be. It is more so a combination of the Tauri logo (two dots with rings around them) and the Python logo (the snake, specifically the head). The left part is more intended to visualize the snake curling around. Perhaps it is a bit too abstract.
Changed¶
- #63 - chore: bump
tauri
tov2.3
.
Internal¶
- #119 - ci(rs/release): add
--no-verify
tocargo publish
so that we can release parallelly. - #113 - ci: add
macos-latest
os inlint-test
CI. - #111 - docs: added PyTauri logo and updated documentation colors
- #103 - chore: transfer repo to
pytauri
org.
0.3.0¶
Highlights¶
Changed¶
- #79 - bump
rust-version = "1.82"
Docs¶
- #88 - docs: add rust api reference section.
- #85 - docs: add concepts
IPC
andusing multiprocessing
sections. - #80 -
example/nicegui-app
:- Use
BuilderArgs.setup
for initialization instead of listening to theRunEvent.Ready
event. - Rewrite the
FrontServer
startup
/shutdown
event hook logic. - Modularize the code.
- Use
- #79 -
example/nicegui-app
:- use
tray
andmenu
feature - use
python3.10
match
statement instead ofif-else
statement - bump
requires-python = ">=3.10"
- use
Internal¶
- #81 - ci: add
clear-cache.yml
workflow.
0.2.0¶
BREAKING¶
- #70 - feat(notification): removed
NotificationBuilderArgs
. SeeCHANGELOG.md
ofpy/pytauri-plugin-notification
for how to migrate. - #57 - refactor(py/pytauri): remove
RunEventEnum
, use matchedRunEvent
directly. SeeCHANGELOG.md
ofpy/pytauri
for how to migrate. - #56 - perf(pytauri): all IPC methods that previously accepted
bytearray
as a parameter now only acceptbytes
as a parameter. - #52 - refactor(standalone)!: new API for preparing python interpreter.
The
pytauri::standalone
module has been completely rewritten. Previously, you usedprepare_freethreaded_python_with_executable
andappend_ext_mod
. Now, you need to usePythonInterpreterBuilder
. See thepytauri
crate rust API docs and tutorial (examples/tauri-app)main.rs
code for more information on how to migrate.
Docs¶
- #60 - update
examples
main.rs
to removeresource_dir()
UNC path prefix\\?\
forPythonInterpreterEnv::Standalone
. Fix pallets/jinja#1675 fornicegui-app
standalone example. - #55 - Add
integrate with nicegui
examplenicegui-app
. Seeexamples/nicegui-app
. - #52 - update
examples/tauri-app
main.rs
for new API to prepare python interpreter. - #52 - add the usage of
multiprocessing.freeze_support
inexamples/tauri-app
__main__.py
.
Changed¶
- #46 - bump
tauri
tov2.2
Internal¶
- #83 - chore: bump
pyo3
tov0.23.4
inCargo.lock
to fix PyO3/pyo3#4828. - #64 - test: add integration tests for
command
andchannel
ipc