pythonnative 0.20.0__tar.gz → 0.22.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.
- {pythonnative-0.20.0/src/pythonnative.egg-info → pythonnative-0.22.0}/PKG-INFO +10 -2
- {pythonnative-0.20.0 → pythonnative-0.22.0}/README.md +4 -1
- {pythonnative-0.20.0 → pythonnative-0.22.0}/pyproject.toml +12 -1
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/__init__.py +14 -3
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/animated.py +420 -135
- pythonnative-0.22.0/src/pythonnative/cli/pn.py +784 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/components.py +519 -235
- pythonnative-0.22.0/src/pythonnative/events.py +210 -0
- pythonnative-0.22.0/src/pythonnative/gestures.py +875 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/layout.py +463 -149
- pythonnative-0.22.0/src/pythonnative/mutations.py +130 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/native_views/__init__.py +161 -97
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/native_views/android.py +1050 -1124
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/native_views/base.py +108 -18
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/native_views/desktop.py +460 -417
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/native_views/ios.py +1918 -1916
- pythonnative-0.22.0/src/pythonnative/project/__init__.py +68 -0
- pythonnative-0.22.0/src/pythonnative/project/android.py +504 -0
- pythonnative-0.22.0/src/pythonnative/project/builder.py +555 -0
- pythonnative-0.22.0/src/pythonnative/project/config.py +642 -0
- pythonnative-0.22.0/src/pythonnative/project/doctor.py +233 -0
- pythonnative-0.22.0/src/pythonnative/project/icons.py +247 -0
- pythonnative-0.22.0/src/pythonnative/project/ios.py +344 -0
- pythonnative-0.22.0/src/pythonnative/project/permissions.py +343 -0
- pythonnative-0.22.0/src/pythonnative/project/runtime_assets.py +272 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/reconciler.py +540 -470
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/screen.py +5 -2
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/sdk/_components.py +2 -2
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/android_template/app/build.gradle +2 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0/src/pythonnative.egg-info}/PKG-INFO +10 -2
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative.egg-info/SOURCES.txt +15 -1
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative.egg-info/requires.txt +8 -0
- pythonnative-0.22.0/tests/test_animated.py +469 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/tests/test_async_hooks.py +1 -24
- {pythonnative-0.20.0 → pythonnative-0.22.0}/tests/test_cli.py +89 -61
- {pythonnative-0.20.0 → pythonnative-0.22.0}/tests/test_components.py +23 -11
- {pythonnative-0.20.0 → pythonnative-0.22.0}/tests/test_desktop_backend.py +2 -3
- pythonnative-0.22.0/tests/test_events.py +202 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/tests/test_extended_components.py +60 -21
- pythonnative-0.22.0/tests/test_gestures.py +340 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/tests/test_hooks.py +3 -43
- {pythonnative-0.20.0 → pythonnative-0.22.0}/tests/test_hot_reload.py +2 -31
- {pythonnative-0.20.0 → pythonnative-0.22.0}/tests/test_incremental_render.py +2 -53
- {pythonnative-0.20.0 → pythonnative-0.22.0}/tests/test_metric_hooks.py +2 -35
- pythonnative-0.22.0/tests/test_mutations.py +239 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/tests/test_native_modules.py +2 -29
- pythonnative-0.22.0/tests/test_native_views.py +486 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/tests/test_navigation.py +81 -43
- {pythonnative-0.20.0 → pythonnative-0.22.0}/tests/test_new_components.py +108 -31
- {pythonnative-0.20.0 → pythonnative-0.22.0}/tests/test_reconciler.py +48 -91
- {pythonnative-0.20.0 → pythonnative-0.22.0}/tests/test_ref.py +4 -37
- {pythonnative-0.20.0 → pythonnative-0.22.0}/tests/test_screen.py +1 -1
- {pythonnative-0.20.0 → pythonnative-0.22.0}/tests/test_sdk.py +21 -9
- {pythonnative-0.20.0 → pythonnative-0.22.0}/tests/test_storage.py +1 -24
- pythonnative-0.20.0/src/pythonnative/cli/pn.py +0 -1290
- pythonnative-0.20.0/src/pythonnative/templates/android_template/app/src/main/java/com/pythonnative/android_template/PNVirtualListView.java +0 -129
- pythonnative-0.20.0/tests/test_animated.py +0 -268
- pythonnative-0.20.0/tests/test_native_views.py +0 -326
- {pythonnative-0.20.0 → pythonnative-0.22.0}/LICENSE +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/setup.cfg +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/_ios_log.py +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/alerts.py +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/cli/__init__.py +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/element.py +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/hooks.py +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/hot_reload.py +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/native_modules/__init__.py +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/native_modules/app_state.py +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/native_modules/battery.py +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/native_modules/biometrics.py +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/native_modules/camera.py +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/native_modules/clipboard.py +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/native_modules/file_system.py +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/native_modules/haptics.py +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/native_modules/linking.py +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/native_modules/location.py +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/native_modules/net_info.py +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/native_modules/notifications.py +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/native_modules/permissions.py +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/native_modules/secure_store.py +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/native_modules/share.py +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/navigation.py +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/net.py +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/platform.py +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/platform_metrics.py +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/preview.py +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/runtime.py +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/sdk/__init__.py +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/storage.py +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/style.py +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/android_template/app/proguard-rules.pro +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/android_template/app/src/androidTest/java/com/pythonnative/android_template/ExampleInstrumentedTest.kt +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/android_template/app/src/main/AndroidManifest.xml +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/android_template/app/src/main/java/com/pythonnative/android_template/MainActivity.kt +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/android_template/app/src/main/java/com/pythonnative/android_template/Navigator.kt +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/android_template/app/src/main/java/com/pythonnative/android_template/ScreenFragment.kt +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/android_template/app/src/main/res/drawable/ic_launcher_background.xml +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/android_template/app/src/main/res/drawable-v24/ic_launcher_foreground.xml +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/android_template/app/src/main/res/layout/activity_main.xml +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-hdpi/ic_launcher.webp +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-mdpi/ic_launcher.webp +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-xhdpi/ic_launcher.webp +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/android_template/app/src/main/res/navigation/nav_graph.xml +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/android_template/app/src/main/res/values/colors.xml +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/android_template/app/src/main/res/values/strings.xml +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/android_template/app/src/main/res/values/themes.xml +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/android_template/app/src/main/res/values-night/themes.xml +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/android_template/app/src/main/res/xml/backup_rules.xml +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/android_template/app/src/main/res/xml/data_extraction_rules.xml +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/android_template/app/src/test/java/com/pythonnative/android_template/ExampleUnitTest.kt +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/android_template/build.gradle +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/android_template/gradle/wrapper/gradle-wrapper.jar +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/android_template/gradle/wrapper/gradle-wrapper.properties +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/android_template/gradle.properties +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/android_template/gradlew +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/android_template/gradlew.bat +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/android_template/settings.gradle +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/ios_template/ios_template/AppDelegate.swift +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/ios_template/ios_template/Assets.xcassets/AccentColor.colorset/Contents.json +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/ios_template/ios_template/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/ios_template/ios_template/Assets.xcassets/Contents.json +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/ios_template/ios_template/Base.lproj/LaunchScreen.storyboard +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/ios_template/ios_template/Base.lproj/Main.storyboard +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/ios_template/ios_template/Info.plist +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/ios_template/ios_template/SceneDelegate.swift +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/ios_template/ios_template/ViewController.swift +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/ios_template/ios_template.xcodeproj/project.pbxproj +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/ios_template/ios_template.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/ios_template/ios_templateTests/ios_templateTests.swift +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/ios_template/ios_templateUITests/ios_templateUITests.swift +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/templates/ios_template/ios_templateUITests/ios_templateUITestsLaunchTests.swift +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative/utils.py +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative.egg-info/dependency_links.txt +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative.egg-info/entry_points.txt +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/src/pythonnative.egg-info/top_level.txt +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/tests/test_alert.py +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/tests/test_element.py +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/tests/test_ios_log.py +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/tests/test_layout.py +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/tests/test_net.py +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/tests/test_platform.py +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/tests/test_platform_metrics.py +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/tests/test_runtime.py +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/tests/test_smoke.py +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/tests/test_style.py +0 -0
- {pythonnative-0.20.0 → pythonnative-0.22.0}/tests/test_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pythonnative
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.22.0
|
|
4
4
|
Summary: Cross-platform native UI toolkit for Android and iOS
|
|
5
5
|
Author: Owen Carey
|
|
6
6
|
License: MIT License
|
|
@@ -42,8 +42,11 @@ Requires-Python: >=3.10
|
|
|
42
42
|
Description-Content-Type: text/markdown
|
|
43
43
|
License-File: LICENSE
|
|
44
44
|
Requires-Dist: requests>=2.31.0
|
|
45
|
+
Requires-Dist: tomli>=2.0; python_version < "3.11"
|
|
45
46
|
Provides-Extra: ios
|
|
46
47
|
Requires-Dist: rubicon-objc<0.5.0,>=0.4.6; extra == "ios"
|
|
48
|
+
Provides-Extra: build
|
|
49
|
+
Requires-Dist: Pillow>=10.0; extra == "build"
|
|
47
50
|
Provides-Extra: docs
|
|
48
51
|
Requires-Dist: mkdocs>=1.5; extra == "docs"
|
|
49
52
|
Requires-Dist: mkdocs-material[imaging]>=9.5; extra == "docs"
|
|
@@ -56,12 +59,14 @@ Requires-Dist: ruff>=0.5; extra == "dev"
|
|
|
56
59
|
Requires-Dist: mypy>=1.10; extra == "dev"
|
|
57
60
|
Requires-Dist: pytest>=8.0; extra == "dev"
|
|
58
61
|
Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
|
|
62
|
+
Requires-Dist: Pillow>=10.0; extra == "dev"
|
|
59
63
|
Provides-Extra: ci
|
|
60
64
|
Requires-Dist: black>=24.0; extra == "ci"
|
|
61
65
|
Requires-Dist: ruff>=0.5; extra == "ci"
|
|
62
66
|
Requires-Dist: mypy>=1.10; extra == "ci"
|
|
63
67
|
Requires-Dist: pytest>=8.0; extra == "ci"
|
|
64
68
|
Requires-Dist: pytest-asyncio>=0.23; extra == "ci"
|
|
69
|
+
Requires-Dist: Pillow>=10.0; extra == "ci"
|
|
65
70
|
Dynamic: license-file
|
|
66
71
|
|
|
67
72
|
<p align="center">
|
|
@@ -102,7 +107,10 @@ PythonNative is a cross-platform toolkit for building native Android and iOS app
|
|
|
102
107
|
- **Hooks and function components:** Manage state with `use_state`, side effects with `use_effect`, and navigation with `use_navigation`, all through one consistent pattern.
|
|
103
108
|
- **Typed `style` prop:** Pass all visual and layout properties through a single `style` dict, fully described by the `pn.Style` `TypedDict` and the ergonomic `pn.style(...)` helper for IDE autocomplete and static checking. Compose reusable styles with `StyleSheet`.
|
|
104
109
|
- **Cross-platform flexbox engine:** A pure-Python, Yoga-style layout engine computes frames once and applies them to native views, so `flex`, `padding`, `aspect_ratio`, and `position: "absolute"` produce the same geometry on Android and iOS.
|
|
105
|
-
- **Virtual view tree + reconciler:** Element trees are diffed and patched with minimal native mutations, similar to React's reconciliation. State updates re-render **locally** — only the component whose state changed (and its subtree) re-runs, and unchanged leaves reuse cached intrinsic measurements — so deep UIs stay responsive instead of re-rendering the whole app from the root on every tap.
|
|
110
|
+
- **Virtual view tree + reconciler:** Element trees are diffed and patched with minimal native mutations, similar to React's reconciliation. Each commit lands as **one batched transaction** of mutation ops, and event callbacks are routed through a tag-based registry so re-renders that only change closures cost zero native calls. State updates re-render **locally** — only the component whose state changed (and its subtree) re-runs, and unchanged leaves reuse cached intrinsic measurements — so deep UIs stay responsive instead of re-rendering the whole app from the root on every tap.
|
|
111
|
+
- **Native-driven animations:** The `Animated` API (timing / spring / decay, awaitable or fire-and-forget) hands animations to Core Animation and `ViewPropertyAnimator` whenever possible, so no Python code runs per frame; a pure-Python ticker covers the rest.
|
|
112
|
+
- **Native gesture system:** Attach `Tap`, `LongPress`, `Pan`, `Swipe`, `Pinch`, and `Rotation` recognizers to any view via the `gestures=` prop — backed by `UIGestureRecognizer` on iOS and a unit-testable pure-Python arbiter on Android and desktop.
|
|
113
|
+
- **Virtualized lists:** `FlatList` / `SectionList` window their rows in Python over the platform scroll view — uniform, exact, or measured variable heights, grids, headers/footers, infinite scroll, and an imperative scroll controller, identical on every platform.
|
|
106
114
|
- **Direct native bindings:** Python calls platform APIs directly through Chaquopy and rubicon-objc, with no JavaScript bridge.
|
|
107
115
|
- **Custom-component SDK:** Wrap any platform widget as a first-class element with type-checked props via `pythonnative.sdk` (`Props`, `@native_component`, `element_factory`). Plugins distributed on PyPI auto-register through the `pythonnative.handlers` entry-point group.
|
|
108
116
|
- **CLI scaffolding:** `pn init` creates a ready-to-run project; `pn run android` and `pn run ios` build and launch your app.
|
|
@@ -36,7 +36,10 @@ PythonNative is a cross-platform toolkit for building native Android and iOS app
|
|
|
36
36
|
- **Hooks and function components:** Manage state with `use_state`, side effects with `use_effect`, and navigation with `use_navigation`, all through one consistent pattern.
|
|
37
37
|
- **Typed `style` prop:** Pass all visual and layout properties through a single `style` dict, fully described by the `pn.Style` `TypedDict` and the ergonomic `pn.style(...)` helper for IDE autocomplete and static checking. Compose reusable styles with `StyleSheet`.
|
|
38
38
|
- **Cross-platform flexbox engine:** A pure-Python, Yoga-style layout engine computes frames once and applies them to native views, so `flex`, `padding`, `aspect_ratio`, and `position: "absolute"` produce the same geometry on Android and iOS.
|
|
39
|
-
- **Virtual view tree + reconciler:** Element trees are diffed and patched with minimal native mutations, similar to React's reconciliation. State updates re-render **locally** — only the component whose state changed (and its subtree) re-runs, and unchanged leaves reuse cached intrinsic measurements — so deep UIs stay responsive instead of re-rendering the whole app from the root on every tap.
|
|
39
|
+
- **Virtual view tree + reconciler:** Element trees are diffed and patched with minimal native mutations, similar to React's reconciliation. Each commit lands as **one batched transaction** of mutation ops, and event callbacks are routed through a tag-based registry so re-renders that only change closures cost zero native calls. State updates re-render **locally** — only the component whose state changed (and its subtree) re-runs, and unchanged leaves reuse cached intrinsic measurements — so deep UIs stay responsive instead of re-rendering the whole app from the root on every tap.
|
|
40
|
+
- **Native-driven animations:** The `Animated` API (timing / spring / decay, awaitable or fire-and-forget) hands animations to Core Animation and `ViewPropertyAnimator` whenever possible, so no Python code runs per frame; a pure-Python ticker covers the rest.
|
|
41
|
+
- **Native gesture system:** Attach `Tap`, `LongPress`, `Pan`, `Swipe`, `Pinch`, and `Rotation` recognizers to any view via the `gestures=` prop — backed by `UIGestureRecognizer` on iOS and a unit-testable pure-Python arbiter on Android and desktop.
|
|
42
|
+
- **Virtualized lists:** `FlatList` / `SectionList` window their rows in Python over the platform scroll view — uniform, exact, or measured variable heights, grids, headers/footers, infinite scroll, and an imperative scroll controller, identical on every platform.
|
|
40
43
|
- **Direct native bindings:** Python calls platform APIs directly through Chaquopy and rubicon-objc, with no JavaScript bridge.
|
|
41
44
|
- **Custom-component SDK:** Wrap any platform widget as a first-class element with type-checked props via `pythonnative.sdk` (`Props`, `@native_component`, `element_factory`). Plugins distributed on PyPI auto-register through the `pythonnative.handlers` entry-point group.
|
|
42
45
|
- **CLI scaffolding:** `pn init` creates a ready-to-run project; `pn run android` and `pn run ios` build and launch your app.
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "pythonnative"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.22.0"
|
|
8
8
|
description = "Cross-platform native UI toolkit for Android and iOS"
|
|
9
9
|
authors = [
|
|
10
10
|
{ name = "Owen Carey" }
|
|
@@ -25,12 +25,16 @@ classifiers = [
|
|
|
25
25
|
]
|
|
26
26
|
dependencies = [
|
|
27
27
|
"requests>=2.31.0",
|
|
28
|
+
"tomli>=2.0; python_version < '3.11'",
|
|
28
29
|
]
|
|
29
30
|
|
|
30
31
|
[project.optional-dependencies]
|
|
31
32
|
ios = [
|
|
32
33
|
"rubicon-objc>=0.4.6,<0.5.0",
|
|
33
34
|
]
|
|
35
|
+
build = [
|
|
36
|
+
"Pillow>=10.0",
|
|
37
|
+
]
|
|
34
38
|
docs = [
|
|
35
39
|
"mkdocs>=1.5",
|
|
36
40
|
"mkdocs-material[imaging]>=9.5",
|
|
@@ -44,6 +48,7 @@ dev = [
|
|
|
44
48
|
"mypy>=1.10",
|
|
45
49
|
"pytest>=8.0",
|
|
46
50
|
"pytest-asyncio>=0.23",
|
|
51
|
+
"Pillow>=10.0",
|
|
47
52
|
]
|
|
48
53
|
ci = [
|
|
49
54
|
"black>=24.0",
|
|
@@ -51,6 +56,7 @@ ci = [
|
|
|
51
56
|
"mypy>=1.10",
|
|
52
57
|
"pytest>=8.0",
|
|
53
58
|
"pytest-asyncio>=0.23",
|
|
59
|
+
"Pillow>=10.0",
|
|
54
60
|
]
|
|
55
61
|
|
|
56
62
|
[project.scripts]
|
|
@@ -73,6 +79,8 @@ Documentation = "https://docs.pythonnative.com/"
|
|
|
73
79
|
|
|
74
80
|
|
|
75
81
|
|
|
82
|
+
|
|
83
|
+
|
|
76
84
|
[tool.setuptools.packages.find]
|
|
77
85
|
where = ["src"]
|
|
78
86
|
|
|
@@ -120,6 +128,9 @@ ignore = ["D107", "D105", "D203", "D213"]
|
|
|
120
128
|
"src/pythonnative/native_views/android.py" = ["D101", "D102"]
|
|
121
129
|
"src/pythonnative/native_views/ios.py" = ["D101", "D102"]
|
|
122
130
|
"src/pythonnative/native_views/desktop.py" = ["D101", "D102"]
|
|
131
|
+
# ios.py embeds a LaunchScreen storyboard as an XML string literal whose
|
|
132
|
+
# lines exceed the limit; the XML must stay on single lines for Xcode.
|
|
133
|
+
"src/pythonnative/project/ios.py" = ["E501"]
|
|
123
134
|
|
|
124
135
|
[tool.ruff.lint.pydocstyle]
|
|
125
136
|
convention = "google"
|
|
@@ -26,7 +26,16 @@ Key building blocks:
|
|
|
26
26
|
PythonNative ships a fully-typed [`Style`][pythonnative.style.Style]
|
|
27
27
|
TypedDict so editors and ``mypy`` validate every key as you type.
|
|
28
28
|
- **Animations** use the ``Animated`` namespace, modeled on React
|
|
29
|
-
Native's animation API.
|
|
29
|
+
Native's animation API. Animations are driven natively (Core
|
|
30
|
+
Animation / ``ViewPropertyAnimator``) whenever possible.
|
|
31
|
+
- **Gestures** attach to any view via the ``gestures=`` prop using
|
|
32
|
+
descriptors from ``pythonnative.gestures``
|
|
33
|
+
([`Tap`][pythonnative.gestures.Tap],
|
|
34
|
+
[`LongPress`][pythonnative.gestures.LongPress],
|
|
35
|
+
[`Pan`][pythonnative.gestures.Pan],
|
|
36
|
+
[`Swipe`][pythonnative.gestures.Swipe],
|
|
37
|
+
[`Pinch`][pythonnative.gestures.Pinch],
|
|
38
|
+
[`Rotation`][pythonnative.gestures.Rotation]).
|
|
30
39
|
- **Custom native components** can be authored with the
|
|
31
40
|
``pythonnative.sdk`` package: define a typed
|
|
32
41
|
[`Props`][pythonnative.sdk.Props] dataclass, implement a
|
|
@@ -51,9 +60,9 @@ Example:
|
|
|
51
60
|
```
|
|
52
61
|
"""
|
|
53
62
|
|
|
54
|
-
__version__ = "0.
|
|
63
|
+
__version__ = "0.22.0"
|
|
55
64
|
|
|
56
|
-
from . import runtime, sdk
|
|
65
|
+
from . import gestures, runtime, sdk
|
|
57
66
|
from .alerts import Alert
|
|
58
67
|
from .animated import Animated, AnimatedValue, use_animated_value
|
|
59
68
|
from .components import (
|
|
@@ -321,6 +330,8 @@ __all__ = [
|
|
|
321
330
|
"Animated",
|
|
322
331
|
"AnimatedValue",
|
|
323
332
|
"use_animated_value",
|
|
333
|
+
# Gestures
|
|
334
|
+
"gestures",
|
|
324
335
|
# Imperative
|
|
325
336
|
"Alert",
|
|
326
337
|
# Native modules
|