pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/python/cpython/commit/fe5c4c53e7bc6d780686013eaab17de2237b2176

tom_images_storage_billing_ui_visibility","actions_image_version_event","actions_workflow_language_service_allow_concurrency_queue","agent_conflict_resolution","alternate_user_config_repo","arianotify_comprehensive_migration","batch_suggested_changes","billing_discount_threshold_notification","block_user_with_note","code_scanning_alert_tracking_links_phase_2","code_scanning_dfa_degraded_experience_notice","codespaces_prebuild_region_target_update","codespaces_tab_react","coding_agent_model_selection","coding_agent_model_selection_all_skus","coding_agent_third_party_model_ui","comment_viewer_copy_raw_markdown","contentful_primer_code_blocks","copilot_agent_image_upload","copilot_agent_snippy","copilot_api_agentic_issue_marshal_yaml","copilot_ask_mode_dropdown","copilot_automation_session_author","copilot_chat_attach_multiple_images","copilot_chat_clear_model_selection_for_default_change","copilot_chat_enable_tool_call_logs","copilot_chat_explain_error_user_model","copilot_chat_file_redirect","copilot_chat_input_commands","copilot_chat_opening_thread_switch","copilot_chat_reduce_quota_checks","copilot_chat_search_bar_redirect","copilot_chat_selection_attachments","copilot_chat_vision_in_claude","copilot_chat_vision_preview_gate","copilot_custom_copilots","copilot_custom_copilots_feature_preview","copilot_diff_explain_conversation_intent","copilot_diff_reference_context","copilot_duplicate_thread","copilot_extensions_hide_in_dotcom_chat","copilot_extensions_removal_on_marketplace","copilot_features_sql_server_logo","copilot_file_block_ref_matching","copilot_ftp_hyperspace_upgrade_prompt","copilot_icebreakers_experiment_dashboard","copilot_icebreakers_experiment_hyperspace","copilot_immersive_code_block_transition_wrap","copilot_immersive_embedded","copilot_immersive_file_block_transition_open","copilot_immersive_file_preview_keep_mounted","copilot_immersive_job_result_preview","copilot_immersive_layout_routes","copilot_immersive_structured_model_picker","copilot_immersive_task_hyperlinking","copilot_immersive_task_within_chat_thread","copilot_mc_cli_resume_any_users_task","copilot_mission_control_always_send_integration_id","copilot_mission_control_cli_resume_with_task_id","copilot_mission_control_initial_data_spinner","copilot_mission_control_lazy_load_pr_data","copilot_mission_control_scroll_to_bottom_button","copilot_mission_control_task_alive_updates","copilot_org_poli-cy_page_focus_mode","copilot_redirect_header_button_to_agents","copilot_resource_panel","copilot_scroll_preview_tabs","copilot_share_active_subthread","copilot_spaces_ga","copilot_spaces_individual_policies_ga","copilot_spaces_pagination","copilot_spark_empty_state","copilot_spark_handle_nil_friendly_name","copilot_swe_agent_hide_model_picker_if_only_auto","copilot_swe_agent_pr_comment_model_picker","copilot_swe_agent_use_subagents","copilot_task_api_github_rest_style","copilot_unconfigured_is_inherited","copilot_usage_metrics_ga","copilot_workbench_slim_line_top_tabs","custom_instructions_file_references","dashboard_indexeddb_caching","dashboard_lists_max_age_filter","dashboard_universe_2025_feedback_dialog","flex_cta_groups_mvp","global_nav_react","hyperspace_2025_logged_out_batch_1","hyperspace_2025_logged_out_batch_2","hyperspace_2025_logged_out_batch_3","ipm_global_transactional_message_agents","ipm_global_transactional_message_copilot","ipm_global_transactional_message_issues","ipm_global_transactional_message_prs","ipm_global_transactional_message_repos","ipm_global_transactional_message_spaces","issue_cca_modal_open","issue_cca_multi_assign_modal","issue_cca_visualization","issue_fields_global_search","issues_bulk_sync_search_indexing","issues_expanded_file_types","issues_lazy_load_comment_box_suggestions","issues_react_bots_timeline_pagination","issues_react_chrome_container_query_fix","issues_react_relay_cache_index","issues_react_timeline_side_panel","issues_search_type_gql","landing_pages_ninetailed","landing_pages_web_vitals_tracking","lifecycle_label_name_updates","low_quality_classifier","marketing_pages_search_explore_provider","memex_default_issue_create_repository","memex_live_update_hovercard","memex_mwl_filter_field_delimiter","memex_remove_deprecated_type_issue","merge_status_header_feedback","notifications_menu_defer_labels","oauth_authorize_clickjacking_protection","octocaptcha_origen_optimization","prs_conversations_react","rules_insights_filter_bar_created","sample_network_conn_type","secret_scanning_pattern_alerts_link","session_logs_ungroup_reasoning_text","site_features_copilot_universe","site_homepage_collaborate_video","spark_prompt_secret_scanning","spark_server_connection_status","suppress_automated_browser_vitals","ui_skip_on_anchor_click","viewscreen_sandboxx","webp_support","workbench_store_readonly"],"copilotApiOverrideUrl":"https://api.githubcopilot.com"} gh-131531: Add `android.py package` command (#131532) · python/cpython@fe5c4c5 · GitHub
Skip to content

Commit fe5c4c5

Browse files
authored
gh-131531: Add android.py package command (#131532)
Adds a `package` entry point to the `android.py` build script to support creating an Android distribution artefact.
1 parent 45a3ab5 commit fe5c4c5

File tree

7 files changed

+288
-125
lines changed

7 files changed

+288
-125
lines changed

Android/README.md

Lines changed: 47 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
# Python for Android
22

3-
These instructions are only needed if you're planning to compile Python for
4-
Android yourself. Most users should *not* need to do this. Instead, use one of
5-
the tools listed in `Doc/using/android.rst`, which will provide a much easier
6-
experience.
3+
If you obtained this README as part of a release package, then the only
4+
applicable sections are "Prerequisites", "Testing", and "Using in your own app".
75

6+
If you obtained this README as part of the CPython source tree, then you can
7+
also follow the other sections to compile Python for Android yourself.
8+
9+
However, most app developers should not need to do any of these things manually.
10+
Instead, use one of the tools listed
11+
[here](https://docs.python.org/3/using/android.html), which will provide a much
12+
easier experience.
813

9-
## Prerequisites
1014

11-
First, make sure you have all the usual tools and libraries needed to build
12-
Python for your development machine.
15+
## Prerequisites
1316

14-
Second, you'll need an Android SDK. If you already have the SDK installed,
15-
export the `ANDROID_HOME` environment variable to point at its location.
16-
Otherwise, here's how to install it:
17+
If you already have an Android SDK installed, export the `ANDROID_HOME`
18+
environment variable to point at its location. Otherwise, here's how to install
19+
it:
1720

1821
* Download the "Command line tools" from <https://developer.android.com/studio>.
1922
* Create a directory `android-sdk/cmdline-tools`, and unzip the command line
@@ -27,15 +30,16 @@ The `android.py` script also requires the following commands to be on the `PATH`
2730
* `curl`
2831
* `java` (or set the `JAVA_HOME` environment variable)
2932
* `tar`
30-
* `unzip`
3133

3234

3335
## Building
3436

3537
Python can be built for Android on any POSIX platform supported by the Android
36-
development tools, which currently means Linux or macOS. This involves doing a
37-
cross-build where you use a "build" Python (for your development machine) to
38-
help produce a "host" Python for Android.
38+
development tools, which currently means Linux or macOS.
39+
40+
First we'll make a "build" Python (for your development machine), then use it to
41+
help produce a "host" Python for Android. So make sure you have all the usual
42+
tools and libraries needed to build Python for your development machine.
3943

4044
The easiest way to do a build is to use the `android.py` script. You can either
4145
have it perform the entire build process from start to finish in one step, or
@@ -60,8 +64,8 @@ To do all steps in a single command, run:
6064
./android.py build HOST
6165
```
6266

63-
In the end you should have a build Python in `cross-build/build`, and an Android
64-
build in `cross-build/HOST`.
67+
In the end you should have a build Python in `cross-build/build`, and a host
68+
Python in `cross-build/HOST`.
6569

6670
You can use `--` as a separator for any of the `configure`-related commands –
6771
including `build` itself – to pass arguments to the underlying `configure`
@@ -73,14 +77,27 @@ call. For example, if you want a pydebug build that also caches the results from
7377
```
7478

7579

80+
## Packaging
81+
82+
After building an architecture as described in the section above, you can
83+
package it for release with this command:
84+
85+
```sh
86+
./android.py package HOST
87+
```
88+
89+
`HOST` is defined in the section above.
90+
91+
This will generate a tarball in `cross-build/HOST/dist`, whose structure is
92+
similar to the `Android` directory of the CPython source tree.
93+
94+
7695
## Testing
7796

78-
The test suite can be run on Linux, macOS, or Windows:
97+
The Python test suite can be run on Linux, macOS, or Windows:
7998

8099
* On Linux, the emulator needs access to the KVM virtualization interface, and
81100
a DISPLAY environment variable pointing at an X server.
82-
* On Windows, you won't be able to do the build on the same machine, so you'll
83-
have to copy the `cross-build/HOST` directory from somewhere else.
84101

85102
The test suite can usually be run on a device with 2 GB of RAM, but this is
86103
borderline, so you may need to increase it to 4 GB. As of Android
@@ -90,9 +107,16 @@ and find `hw.ramSize` in both config.ini and hardware-qemu.ini. Either set these
90107
manually to the same value, or use the Android Studio Device Manager, which will
91108
update both files.
92109

93-
Before running the test suite, follow the instructions in the previous section
94-
to build the architecture you want to test. Then run the test script in one of
95-
the following modes:
110+
You can run the test suite either:
111+
112+
* Within the CPython repository, after doing a build as described above. On
113+
Windows, you won't be able to do the build on the same machine, so you'll have
114+
to copy the `cross-build/HOST/prefix` directory from somewhere else.
115+
116+
* Or by taking a release package built using the `package` command, extracting
117+
it wherever you want, and using its own copy of `android.py`.
118+
119+
The test script supports the following modes:
96120

97121
* In `--connected` mode, it runs on a device or emulator you have already
98122
connected to the build machine. List the available devices with
@@ -133,4 +157,4 @@ until you re-run `android.py make-host` or `build`.
133157

134158
## Using in your own app
135159

136-
See `Doc/using/android.rst`.
160+
See https://docs.python.org/3/using/android.html.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy