From 1b06c7fe98e20c96c5afc7d8c9b2a76cb8f2a4f4 Mon Sep 17 00:00:00 2001 From: Malcolm Smith Date: Thu, 18 Dec 2025 00:36:05 +0000 Subject: [PATCH] Begin Android support --- pandas/compat/__init__.py | 12 ++++++++++++ pandas/tests/io/conftest.py | 8 +++++++- pyproject.toml | 16 +++++++++++++++- 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/pandas/compat/__init__.py b/pandas/compat/__init__.py index 62278c413dd23..7fa2a1abe7361 100644 --- a/pandas/compat/__init__.py +++ b/pandas/compat/__init__.py @@ -101,6 +101,18 @@ def is_platform_mac() -> bool: return sys.platform == "darwin" +def is_platform_android() -> bool: + """ + Checking if the running platform is android. + + Returns + ------- + bool + True if the running platform is android. + """ + return sys.platform == "android" + + def is_platform_arm() -> bool: """ Checking if the running platform use ARM architecture. diff --git a/pandas/tests/io/conftest.py b/pandas/tests/io/conftest.py index a5ddda9d66e7a..78509280a0496 100644 --- a/pandas/tests/io/conftest.py +++ b/pandas/tests/io/conftest.py @@ -7,6 +7,7 @@ from pandas.compat import ( is_ci_environment, + is_platform_android, is_platform_arm, is_platform_mac, is_platform_windows, @@ -66,7 +67,12 @@ def s3_base(worker_id, monkeypatch): monkeypatch.setenv("AWS_ACCESS_KEY_ID", "foobar_key") monkeypatch.setenv("AWS_SECRET_ACCESS_KEY", "foobar_secret") if is_ci_environment(): - if is_platform_arm() or is_platform_mac() or is_platform_windows(): + if ( + is_platform_arm() + or is_platform_mac() + or is_platform_windows() + or is_platform_android() + ): # NOT RUN on Windows/macOS, only Ubuntu # - subprocess in CI can cause timeouts # - GitHub Actions do not support diff --git a/pyproject.toml b/pyproject.toml index 085d5c3bce07a..84414fe54487e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,9 @@ # Minimum requirements for the build system to execute. # See https://github.com/scipy/scipy/pull/12940 for the AIX issue. requires = [ - "meson-python>=0.13.1", + # TODO: use an official meson-python version once + # https://github.com/mesonbuild/meson-python/pull/824 has been released. + "meson-python @ git+https://github.com/mhsmith/meson-python@android", "meson>=1.2.1,<2", "wheel", "Cython<4.0.0a0", # Note: sync with setup.py, environment.yml and asv.conf.json @@ -164,6 +166,18 @@ test-command = """ enable = ["cpython-freethreading"] before-build = "PACKAGE_DIR={package} bash {package}/scripts/cibw_before_build.sh" +[tool.cibuildwheel.android] +test-command = """ + python -c '\ + import os; os.environ["PANDAS_CI"] = "1"; \ + import pandas as pd; \ + pd.test(extra_args=["-m not clipboard and not slow and not network and not db", "--no-strict-data-files"]);' \ + """ + +[tool.cibuildwheel.android.environment] +# Python 3.13 defaults to API level 21, which lacks some required math functions. +ANDROID_API_LEVEL = "24" + [tool.cibuildwheel.windows] before-build = "pip install delvewheel" repair-wheel-command = "delvewheel repair -w {dest_dir} {wheel}"