Skip to content

Conversation

@timrid
Copy link

@timrid timrid commented Jan 10, 2026

Fixes #10752

Copy link

@thunder-coding thunder-coding left a comment

Choose a reason for hiding this comment

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

Seems like someone beat me to this even before I started working on this yesterday (should have searched in open PRs). Have provided some feedback, please do give a look.

Also while we are at it, why not also also apply the following patch for auto detection of android platform on Android. Node.js is supported as an experimental platform on Android, and there is a significant amount of work I've done to ensure that Node.js works well on Android (inside Termux specifically):

diff --git a/packages/pyright-internal/src/common/fullAccessHost.ts b/packages/pyright-internal/src/common/fullAccessHost.ts
index b8adae491..f881b25b5 100644
--- a/packages/pyright-internal/src/common/fullAccessHost.ts
+++ b/packages/pyright-internal/src/common/fullAccessHost.ts
@@ -58,6 +58,8 @@ export class LimitedAccessHost extends NoAccessHost {
             return PythonPlatform.Linux;
         } else if (process.platform === 'win32') {
             return PythonPlatform.Windows;
+        } else if (process.platform === 'android') {
+            return PythonPlatform.Android;
         }
 
         return undefined;

} else if (execEnv.pythonPlatform === PythonPlatform.iOS) {
return 'ios';
} else if (execEnv.pythonPlatform === PythonPlatform.Android) {
return 'android';
Copy link

@thunder-coding thunder-coding Jan 12, 2026

Choose a reason for hiding this comment

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

Suggested change
return 'android';
// Python >= 3.13 reports Android as 'android', earlier used to report it as 'linux'
if (execEnv.pythonVersion.major === 3 && execEnv.pythonVersion.minor >= 13) {
return 'android';
} else {
return 'linux';
}

This isn't a simple replacement. Python versions before 3.13 used to return "linux" on Android for sys.platform. Although those versions weren't officially supported. Not sure what the take of PyRight devs is on this one. But I think we should be preserving some sort of backward compatibility here

Copy link
Author

Choose a reason for hiding this comment

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

I like the idea of backward compatibility. I have expanded the PR with your suggestions.

@timrid timrid force-pushed the pythonplatform-ios-and-android branch from 56eacb3 to 50d87b4 Compare January 15, 2026 18:28
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.

Add support for Android and iOS

2 participants