Skip to content

Add Android support #265

New issue

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

Draft
wants to merge 19 commits into
base: master
Choose a base branch
from
Draft

Add Android support #265

wants to merge 19 commits into from

Conversation

mhsmith
Copy link
Member

@mhsmith mhsmith commented Jul 30, 2025

See the linked issue for details:

Since there will be no Android releases for Python 3.13 and earlier, the Android release job is skipped on those versions. See the "Temporarily point inputs ..." commit for a run that includes Android.

The lint and docs failures appear to be unrelated.

@mhsmith mhsmith marked this pull request as ready for review July 30, 2025 16:30
@mhsmith mhsmith requested a review from hugovk July 30, 2025 16:31
Copy link

@freakboy3742 freakboy3742 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the current state of python/cpython#137186, this makes sense to me

@hugovk
Copy link
Member

hugovk commented Aug 4, 2025

(Updated from main to fix mypy.)

Copy link
Member

@hugovk hugovk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's set the defaults to a 3.14 commit, so we test Android for regular PRs and don't break it by mistake:

# Set from inputs for workflow_dispatch, or set defaults to test push/PR events
env:
  GIT_REMOTE: ${{ github.event.inputs.git_remote || 'python' }}
  GIT_COMMIT: ${{ github.event.inputs.git_commit || '48f88310044c6ef877f3b0761cf7afece2f8fb3a' }}
  CPYTHON_RELEASE: ${{ github.event.inputs.cpython_release || '3.14.0rc1' }}

repository: "${{ env.GIT_REMOTE }}/cpython"
ref: "v${{ env.CPYTHON_RELEASE }}"

- uses: ./.github/actions/build-android
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: pending merge of python/cpython#137186, let's set this as a draft for now.

@hugovk hugovk marked this pull request as draft August 4, 2025 09:18
@mhsmith
Copy link
Member Author

mhsmith commented Aug 4, 2025

Let's set the defaults to a 3.14 commit, so we test Android for regular PRs and don't break it by mistake

I agree, but that'll have to wait until there's a a tag that includes the Android build action from python/cpython#137186.

@mhsmith mhsmith changed the title Add Android release job Add Android support Aug 6, 2025
@mhsmith
Copy link
Member Author

mhsmith commented Aug 9, 2025

python/cpython#137186 has been changed to use an android.py ci command rather than a composite action, so I've updated this PR to match. Once again, I've tested an Android run by pointing it at my own repository (in the actions of the "Update type annotations" commit), and then reverted to the previous inputs.

@mhsmith
Copy link
Member Author

mhsmith commented Aug 10, 2025

I've updated run_release.py to include Android, and tested the relevant functions using my own SSH server. Because the Android binaries are now released via the same mechanism as the source tarballs, the temporary directory has been renamed from src to downloads.

I've also created python/peps#4541 to make the corresponding changes to PEP 101.

Pending the merge of python/cpython#137186, I think this PR is now complete.

timeout-minutes: 60
strategy:
matrix:
arch: [aarch64, x86_64]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
arch: [aarch64, x86_64]

(python/cpython#137186 (comment))

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Comment on lines 198 to 205
if: |
!(
startsWith(needs.verify-input.outputs.cpython_release, '3.9.') ||
startsWith(needs.verify-input.outputs.cpython_release, '3.10.') ||
startsWith(needs.verify-input.outputs.cpython_release, '3.11.') ||
startsWith(needs.verify-input.outputs.cpython_release, '3.12.') ||
startsWith(needs.verify-input.outputs.cpython_release, '3.13.')
)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest computing another boolean output within verify-input similar to how build-context functions in python/cpython, which would help consolidate the decision logic closer to other checks.

And the use would look as follows:

Suggested change
if: |
!(
startsWith(needs.verify-input.outputs.cpython_release, '3.9.') ||
startsWith(needs.verify-input.outputs.cpython_release, '3.10.') ||
startsWith(needs.verify-input.outputs.cpython_release, '3.11.') ||
startsWith(needs.verify-input.outputs.cpython_release, '3.12.') ||
startsWith(needs.verify-input.outputs.cpython_release, '3.13.')
)
if: fromJSON(needs.verify-input.outputs.build-android)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. The "Fix typo" commit now demonstrates a run which builds Android but not docs, while the most recent "Revert to previous inputs" commit demonstrates the opposite. The other combinations are all covered by a unit test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants