This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -62,18 +62,23 @@ Unsolicited pull requests for issues that are already assigned or already have a
## Project layout (high‑level)
- `src/pythonnative/`: installable library and CLI
- `pythonnative/`: core cross‑platform UI components and utilities
- Core Python modules, UI components, and utilities
- `bridge/`: JSON codec and per-platform transports into the native rendering core
- `cli/`: `pn` command
- `project/`: config loading, template configuration, native plugin staging, and the builder behind `pn`
- `templates/`: Android/iOS project templates (bundled with the package)
- `ios_template/PythonNativeKit/`: Swift package with the iOS rendering core (component managers, gestures, animations, native modules) and its XCTest target
- `android_template/pythonnative/`: Gradle library module with the Android rendering core and its JUnit target
- `native/`: native libraries and their tests, bundled with the Python package
- `ios/`: `PythonNativeKit` Swift package and its XCTest target
- `android/`: Android rendering library and its JUnit target
- `yoga/`: vendored Yoga source, native build definitions, and the host Python binding
- `sdk/`: native contract definitions, code generation, and generator templates
- `devserver/static/`: browser preview assets, including the vendored Yoga JavaScript/WebAssembly distribution
- `templates/`: Android/iOS app shells; the builder stages native libraries into generated app projects
- `tests/`: unit tests for the library, plus the Maestro E2E suite
- `e2e/`: the comprehensive E2E suite (see [E2E tests](#e2e-tests-maestro) below and `tests/e2e/AGENTS.md`)
- `examples/`: runnable example apps
- `hello-world/`: minimal marketing demo
- `e2e-suite/`: comprehensive feature catalog that drives the Maestro E2E suite
- `inbox/`: offline reference app with a custom native extension
- Python never imports platform code. Everything that touches `UIView` or `android.view.View` lives in Swift (`PythonNativeKit`) or Kotlin (the `pythonnative` Gradle module) and is reached through `pythonnative.bridge`; see `docs/concepts/bridge.md` for the protocol. Bump `PROTOCOL_VERSION` on both sides when the wire format changes.
- Add/extend tests under `tests/` for new behavior. Native changes get XCTest / JUnit coverage next to the code they touch.
- Don't commit generated artifacts or large binaries; templates live under `src/pythonnative/templates/`.
- Commit source, reviewed generated contracts, dependency locks, and vendored dependencies as described in [Generated source and vendored dependencies](#generated-source-and-vendored-dependencies). Don't commit local build outputs or caches.
- Docstrings: Google style throughout. Ruff is configured with the Google
convention (`pydocstyle.convention = "google"`) and enforces the `D` rule
set on `src/pythonnative/`. See the
Expand All
@@ -101,10 +106,53 @@ uv run black src examples tests # format
uv run --group docs mkdocs serve # preview the docs site locally
# native rendering core (macOS with Xcode for the Swift package; JDK 17 for Gradle)
- `scripts`: developer scripts under `scripts/` (e.g., `check.sh`)
- `templates`: Android/iOS project templates under `src/pythonnative/templates/`
- `kit`: the Swift rendering core (`templates/ios_template/PythonNativeKit/`)
- `runtime-android`: the Kotlin rendering core (`templates/android_template/pythonnative/`)
- `kit`: the Swift rendering core (`native/ios/`)
- `runtime-android`: the Kotlin rendering core (`native/android/`)
- `tests`: unit/integration/E2E tests under `tests/`
- `workflows`: CI pipelines under `.github/workflows/`
Expand Down
Expand Up
@@ -281,7 +329,8 @@ Co-authored-by: Name <email>
- Lint/format: `uv run ruff check .` and `uv run black --check src examples tests` pass.
- Docs: update `README.md` if behavior changes.
- Templates: update `src/pythonnative/templates/` if generator output changes.
- No generated artifacts committed.
- Generated contracts and example schemas are regenerated and reviewed when changed; vendored dependencies retain their licenses and provenance.
- No local build outputs, caches, credentials, or machine-specific files are committed.
## Versioning and releases
Expand Down
Expand Up
@@ -372,7 +421,7 @@ When you add a new public symbol you must also:
### CI
- **CI** (`ci.yml`): runs formatter, linter, type checker, and tests on every push and PR.
- **E2E** (`e2e.yml`): builds the hello-world example on Android (Linux emulator) and iOS (macOS simulator), then runs Maestro flows. Triggers on pushes to `main`, PRs, and manual dispatch.
- **E2E** (`e2e.yml`): builds the `e2e-suite` example on Android (Linux emulator) and iOS (macOS simulator), then runs Maestro flows. Triggers on pushes to `main`, PRs, and manual dispatch.
- **Packages** (`packages.yml`): resolves the PyPI compatibility matrix in `tests/packages/matrix.toml` against the live indexes with `scripts/package-matrix.py --check`, weekly and on changes to the resolver or manifest, and uploads the rendered Markdown table for `docs/guides/pypi-packages.md`.
- **PR Lint** (`pr-lint.yml`): validates the PR title against Conventional Commits format (protects squash merges) and checks individual commit messages via commitlint (protects rebase merges). Recommended: add the **PR title** job as a required status check in branch-protection settings.
- **Release** (`release.yml`): runs on merge to `main`; computes version, generates changelog, tags, creates GitHub Release, and (when `DRAFT_RELEASE` is `"false"`) publishes to PyPI.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(runtime)!: overhaul native rendering and app architecture #80
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
feat(runtime)!: overhaul native rendering and app architecture #80
Filter by extension
Only manifest files
Deleted files Viewed files
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.