Skip to content

Add android as supported platform#130

Open
Mause wants to merge 2 commits intomagmax:masterfrom
Mause:patch-1
Open

Add android as supported platform#130
Mause wants to merge 2 commits intomagmax:masterfrom
Mause:patch-1

Conversation

@Mause
Copy link
Copy Markdown

@Mause Mause commented Mar 10, 2026

Python 3.13 changed the value returned by sys.platform() to now return android, instead of linux, on Android (such as via Termux)

Copy link
Copy Markdown
Collaborator

@Cube707 Cube707 left a comment

Choose a reason for hiding this comment

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

Please modify the README to mention the platform (as an untested platform)

@Cube707
Copy link
Copy Markdown
Collaborator

Cube707 commented Mar 11, 2026

I would like to have an initial test result document before merging this. Even if the platform will be listet as "no support".

Please modify the POSIX Testcode to be run on your platform (but don't commit that change!), run the tests on your system and post the results.
Also pleas run the manual test script and validate that typing stuff works as expected

@Mause
Copy link
Copy Markdown
Author

Mause commented Apr 2, 2026

hey there, apologies for the wait - is this text report sufficient?

============================= test session starts ==============================
platform android -- Python 3.13.12, pytest-9.0.2, pluggy-1.6.0
rootdir: /data/data/com.termux/files/home/python-readchar
configfile: .pytest.ini
testpaths: tests
plugins: cov-7.0.0
collected 273 items

tests/linux/test_import.py ...
tests/linux/test_keys.py ................................................................................................................
tests/linux/test_readchar.py .....................................................................................................................................
tests/linux/test_readkey.py .........................

=============================== warnings summary ===============================
.venv/lib/python3.13/site-packages/coverage/core.py:108
  /data/data/com.termux/files/home/python-readchar/.venv/lib/python3.13/site-packages/coverage/core.py:108: CoverageWarning: Couldn't import C tracer: No module named 'coverage.tracer' (no-ctracer); see https://coverage.readthedocs.io/en/7.13.5/messages.html#warning-no-ctracer
    warn(f"Couldn't import C tracer: {IMPORT_ERROR}", slug="no-ctracer", once=True)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================================ tests coverage ================================
______________ coverage: platform android, python 3.13.12-final-0 ______________

Name                      Stmts   Miss  Cover
---------------------------------------------
readchar/__init__.py         13      4    69%
readchar/_base_key.py        31      0   100%
readchar/_config.py           6      1    83%
readchar/_posix_key.py       30      0   100%
readchar/_posix_read.py      30      1    97%
readchar/_win_key.py         28     28     0%
readchar/_win_read.py        14     14     0%
readchar/key.py               5      5     0%
---------------------------------------------
TOTAL                       157     53    66%
======================== 273 passed, 1 warning in 0.99s ========================

running the manual test script also seems to work as expected

@rmhaiderali
Copy link
Copy Markdown

+1


- macOS
- FreeBSD / OpenBSD
- Termux
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- Termux
- Termux (Android)

Copy link
Copy Markdown

@rmhaiderali rmhaiderali Apr 2, 2026

Choose a reason for hiding this comment

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

Maybe we should just mention Android, since this change comes from upstream and not from Termux patches. Any android build of python based on upstream v3.13 onwards includes this change.

For example, the Coding Python app on the Play Store also reports sys.platform == "android" even though it does not include Termux patches.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Yes, If this is not specific to Termux, listing android directly should be better

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.

3 participants