Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
blank_issues_enabled: true
contact_links:
- name: Security report (private)
url: https://github.com/Maksum867/PyMobile/blob/main/docs/SECURITY.md
about: Never open a public issue for a vulnerability; follow the Security Policy.
- name: Contributing guide
url: https://github.com/Maksum867/PyMobile/blob/main/docs/CONTRIBUTING.md#first-contribution-in-ten-minutes
about: Where a first patch goes, which checks to run, and what review looks for.
67 changes: 67 additions & 0 deletions .github/ISSUE_TEMPLATE/good_first_issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Good first contribution
description: A small, self-contained task that does not need Android or an SDK
title: "[Good first issue]: "
labels: [good first issue, help wanted, documentation]
body:
- type: markdown
attributes:
value: |
This form is for tasks that can be finished without an Android device, an
SDK or deep knowledge of the renderers. If you are new to the project,
read [Contributing](../blob/main/docs/CONTRIBUTING.md#first-contribution-in-ten-minutes)
first: it names the files, the commands and what a review looks for.

Claim a task by commenting on it, so two people do not write the same
fix. Nothing here needs permission from a maintainer to start.
- type: dropdown
id: kind
attributes:
label: What kind of task is it
options:
- Documentation (README, docs/, docstring, example)
- Test (a behaviour that should be pinned down)
- Small bug in a preview (web, Tk, text)
- Error message or hint that could be clearer
- Template or scaffold example
- Translation or wording
validations:
required: true
- type: textarea
id: problem
attributes:
label: What is wrong or missing today
description: Quote the current text or the current output if you can.
validations:
required: true
- type: textarea
id: expected
attributes:
label: What "done" looks like
description: One or two sentences. A docstring, a test name, the new message.
validations:
required: true
- type: input
id: files
attributes:
label: The files involved
description: Best guess is fine; a maintainer will confirm before you start.
placeholder: pymobile/core/ui/components.py, README.md
- type: dropdown
id: skills
attributes:
label: What it needs
options:
- Python only
- Documentation only
- Python and a browser (web preview)
- Python and a display (Tk preview)
- Java (needs the SDK, not a first task)
validations:
required: true
- type: markdown
attributes:
value: |
**Checks before opening a pull request:** `python -m pytest`,
`python -m ruff check pymobile`, `python -m mypy pymobile`. If a check
fails for a reason unrelated to your change, say so in the pull request
instead of hiding it.
30 changes: 30 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
version: 2

# Actions pinned by SHA in `.github/workflows/` are updated by the
# `github-actions` group; the comment next to each pin names the release it
# came from, so a diff shows "v4.1.7 → v4.2.1" and not a bare hash.
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
day: monday
groups:
github-actions:
patterns: ["*"]
commit-message:
prefix: "ci"
labels: ["dependencies", "ci"]

# Runtime and test dependencies. `[dev]` extras carry pytest, ruff and mypy,
# so a broken release of one of them arrives as a PR instead of as a red
# build on main.
- package-ecosystem: pip
directory: /
schedule:
interval: weekly
day: monday
open-pull-requests-limit: 5
commit-message:
prefix: "deps"
labels: ["dependencies"]
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ jobs:
runs-on: ubuntu-latest
environment: pypi
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: "3.13"
- run: python -m pip install --upgrade pip build twine
Expand All @@ -31,7 +31,7 @@ jobs:
# Never push an artifact whose metadata PyPI would reject anyway.
- run: python -m twine check --strict dist/*
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
uses: pypa/gh-action-pypi-publish@aef6c9b6e301dc803e1bc9133e9ce67ae9b0906b # v1.14.3
with:
# A version can be published by hand before the release is cut; do
# not fail the workflow over files that are already on PyPI.
Expand Down
70 changes: 61 additions & 9 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
matrix:
python: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: ${{ matrix.python }}
cache: pip
Expand All @@ -34,8 +34,8 @@ jobs:
name: Windows Python 3.14 (venv)
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: "3.14"
- run: python -m venv .windows-venv
Expand All @@ -57,8 +57,8 @@ jobs:
matrix:
python: ["3.15"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: ${{ matrix.python }}
allow-prereleases: true
Expand All @@ -75,7 +75,7 @@ jobs:
- if: hashFiles('tools/release_audit.py') != ''
run: python tools/release_audit.py dist --output release-audit.json
- name: Upload package audit
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: package-audit-py${{ matrix.python }}
path: |
Expand All @@ -86,11 +86,63 @@ jobs:

- name: Upload Android diagnostics
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: android-device-smoke-diagnostics
path: |
device-logcat.txt
device-logcat-full.txt
examples/device-smoke/build/*.apk
if-no-files-found: warn

android-build:
# C6: nothing used to build for Android in CI, so a change to the Java
# renderer, the manifest or the resource pipeline was only noticed by
# whoever ran `build --native` by hand. This produces a real signed APK and
# a real `.aab` on every push, and validates the bundle with bundletool.
name: Android APK + AAB
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-java@d1374f8ac74474200d16ef8ecee22c7ae7a51880 # v6.3.0
with:
distribution: temurin
java-version: "17"
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: "3.14"
cache: pip
- name: Install the package and the Android SDK
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"
python -m pymobile setup-sdk
# bundletool is what proves an .aab is uploadable; validate is not
# something the ZIP layout can stand in for.
curl -sSLo "$HOME/bundletool.jar" \
https://github.com/google/bundletool/releases/download/1.18.1/bundletool-all-1.18.1.jar
echo "PYMOBILE_BUNDLETOOL=$HOME/bundletool.jar" >> "$GITHUB_ENV"
- name: Build an app with the Java renderer
run: |
python -m pymobile init --name CiApp -t list /tmp/ci-app
cd /tmp/ci-app
python -m pymobile check
python -m pymobile build --native --bundle --verbose
# The artifact name comes from the project name (`CiApp` -> ciapp),
# so glob it instead of guessing: a hard-coded name broke this job
# while the build itself had succeeded.
ls -l apk/
python -m pymobile size apk/*.apk
- name: The APK must declare the level Play requires
run: |
cd /tmp/ci-app
java -jar "$PYMOBILE_BUNDLETOOL" dump manifest --bundle apk/*.aab \
| tee manifest.txt
grep -q 'targetSdkVersion="36"' manifest.txt
grep -q 'supportsRtl="true"' manifest.txt
- uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
with:
name: android-artifacts
path: |
/tmp/ci-app/apk/*.apk
/tmp/ci-app/apk/*.aab
if-no-files-found: error
Loading
Loading