basedpyright icon indicating copy to clipboard operation
basedpyright copied to clipboard

android support

Open abrarishere opened this issue 1 year ago • 8 comments

When i tried to install basedpyright using

pip install basedpyright

It failed because it was unable to find cmake.

So I installed cmake and it downloaded

So, Please add following lines in documentation

> Before installing **basedpyright** make sure you have cmake installed.

abrarishere avatar Aug 08 '24 09:08 abrarishere

Could you please add your full system+python details and installation output. Basedpyright should not require cmake

KotlinIsland avatar Aug 08 '24 11:08 KotlinIsland

System info: Linux localhost 4.14.180-perf+ #2 SMP PREEMPT Sat Sep 3 23:17:03 CST 2022 aarch64 Android

Python info: python -V Python 3.11.9

I am using pip pip install basedpyright

Error occurs in this process:

Building wheel for nodejs-wheel-binaries (pyproject.toml)

abrarishere avatar Aug 09 '24 00:08 abrarishere

the issue is that nodejs-wheel (the package we use to automatically handle nodejs so that users don't have to) only bundles wheels for windows, macos and linux. but you're on android, so i would recommend raising an issue there to see if they're willing to publish wheels for android.

as a workaround, if you install nodejs manually, you can install the basedpyright npm package instead

DetachHead avatar Aug 09 '24 01:08 DetachHead

I installed basedpyright using Node.js as you suggested, but will it work with Neovim? When I try to install it using MasonInstall basedpyright, it attempts to use pip. Could you guide me through the process?

abrarishere avatar Aug 09 '24 01:08 abrarishere

hmm, it probably won't work with anything that expects the pypi package unfortunately.

perhaps we could also publish a nodeless release which would allow users on platforms other than windows/mac/linux to use a different node binary

DetachHead avatar Aug 12 '24 05:08 DetachHead

Ok, I am waiting for that.

abrarishere avatar Aug 12 '24 08:08 abrarishere

@DetachHead how do we want to handle this issue? we can't do anything about nodejs-wheel here. do we want to close this issue and open "publish a nodeless release which would allow users on platforms other than windows/mac/linux to use a different node binary"?

KotlinIsland avatar Aug 15 '24 22:08 KotlinIsland

there are other issues for supporting other OS's as well. i was just gonna leave them all open until we decide on a solution

DetachHead avatar Aug 15 '24 23:08 DetachHead

If you're using Termux I suggest manage your own language servers, instead of using mason.nvim. There are a couple of language servers couldn't be installed successfully in my experience. For example, some language servers do not provide arm64 binaries, even they can be found in official apt repositories and can be installed manually.

as a workaround, if you install nodejs manually, you can install the basedpyright npm package instead

You can install it through the following steps:

  1. Install basedpyright globally through npm:
npm i -g basedpyright

~~2. Soft link executables:~~

This step is not required after #953, please wait for npm package release

cd ~/../usr/bin
ln -s ../lib/node_modules/basedpyright/index.js basedpyright
ln -s ../lib/node_modules/basedpyright/langserver.index.js basedpyright-langserver

Then you'll have basedpyright and basedpyright-langserver directly in your PATH, and you're ready to go without that mason package.

TTsdzb avatar Dec 15 '24 04:12 TTsdzb

Then you'll have basedpyright and basedpyright-langserver directly in your PATH, and you're ready to go without that mason package.

If you're on Termux and the language server is installed but still can't be executed, check the header of the executable file:

nvim `which basedpyright`

You'll see the following line:

#!/usr/bin/env node

This will not work unless your Android distribution has /usr/bin/env inside. If so, change the line into:

#!/data/data/com.termux/files/usr/bin/env node

Then do the same thing for basedpyright-langserver.

TTsdzb avatar Dec 15 '24 10:12 TTsdzb

The Termux environment itself is way too different from a regular Linux system. If these looks too hacky, proot-distro can be used to create a normal Linux environment without root privilege.

TTsdzb avatar Dec 15 '24 10:12 TTsdzb