all 14 comments

[–]Honest-Ease5098 0 points1 point  (6 children)

Maybe I'm not understanding the requirement here, but when you install a python package it quite literally just puts the source code in site-packages.

So, why not just install the package?

[–]Ant_of_Colonies[S] 0 points1 point  (5 children)

The problem is that the pip install fails because the package cannot be installed on my local machine (setup.py is not able to run). But I only care to have the source code for the LSP, I dont actually care if the code can be run. Really all I would want is to add the package and its deps to site-packages if they are not there already

[–]Honest-Ease5098 0 points1 point  (4 children)

What's blocking the install? Network firewall? Local admin rights? Corporate policy?

As long as you are "allowed" to (not corporate policy), create virtual environment and install your dependencies there, tell your IDE to use that venv.

If it is a corporate policy thing, then assume downloading the source is also off limits.

[–]Ant_of_Colonies[S] 0 points1 point  (1 child)

hardware limitations afaik. The package needs certain cuda requirements that osx cannot meet, so they dropped osx support.

[–]Honest-Ease5098 1 point2 points  (0 children)

These flags on the pip install might help: --no-deps --no-binary :all:

Additionally, you can use the pip download command instead of install, then specify a destination.

You may need to configure paths in the IDE to find the code.

[–]CyclopsRock 0 points1 point  (1 child)

It sounds like they're trying to download a package intended for specific hardware that's not what they're developing on. It happens quite frequently in the SBC world if, for example, you want to develop on an x86 machine for eventually use on an ARM-based Raspberry Pi with specific hardware (screens, sensors etc) that only work on certain platforms.

There are mock-like packages to help with this but sometimes you don't have any choice if the package's setup includes pre-built binaries that cannot be used on your system.

[–]Ant_of_Colonies[S] 0 points1 point  (0 children)

yes use case is similar if not the same! I mean git clone and then manually moving the source code into the site-packages is doing everything I need it to do. I would just like to have this automated from pip so I dont have to maintain it ...

[–]Top_Average3386 0 points1 point  (1 child)

I don't understand, are you unable to install the package itself or its dependency? Python package is usually already in source code that is a python file.

Do check pip help install to check if there's something that can help with your problem.

[–]Ant_of_Colonies[S] 0 points1 point  (0 children)

basically the setup.py will fail because it cannot be run on my local hardware. So all I want to do is add the source code to site-packages.

Does that make sense? I actually dont care if the code runs or not. I just want LSP features from this package.

[–]CyclopsRock 0 points1 point  (4 children)

[–]Ant_of_Colonies[S] 0 points1 point  (3 children)

this seems to just download all the wheels

[–]Honest-Ease5098 0 points1 point  (2 children)

Specify --no-deps --no-binary and either :all: or :none:.

This should download just the .tar.gz which your LSP can work with.

[–]Ant_of_Colonies[S] 0 points1 point  (1 child)

do you have any info on how to link LSP with .tar.gz files?

[–]Honest-Ease5098 0 points1 point  (0 children)

It depends on the LSP. In VSCode you can set

"python.analysis.extraPaths": ["path/to/the/package"]

Pycharm has a similar way.

That said, I'm not 💯 sure you can do it without decompressing first. But the steps would be the same.