pdm icon indicating copy to clipboard operation
pdm copied to clipboard

Install an build a project from github

Open ioangatop opened this issue 1 year ago • 3 comments

Hi! I would like to install a library from Github, but as it has some C++ dependencies, I would like to build it - basically it includes ext_modules

For that, I would have to pass an env variable MMCV_WITH_OPS=1. Specifically, with pip I'm doing the following:

pip install torch==2.1.0
MMCV_WITH_OPS=1 pip install git+https://github.com/open-mmlab/mmcv

How can I do this with pdm? The command MMCV_WITH_OPS=1 pdm add git+https://github.com/open-mmlab/mmcv does not seem to work - it installs the wheel but does not seem to build it

Thank you

ioangatop avatar Apr 02 '24 21:04 ioangatop

It is worth to note that I tried to add in pyproject the following:

[[tool.pdm.source]]
type = "find_links"
url = "https://download.openmmlab.com/mmcv/dist/cpu/torch2.1/index.html"
name = "mmcv"

and i have the following logs: Terminal.log

👉 this is the one from pip: Terminal.log

which seems to build smthing... but does it use the setup.py of mmcv?

however the following command does not work:

pdm run python -c "import mmcv; from mmcv.ops import get_compiler_version"

ioangatop avatar Apr 02 '24 23:04 ioangatop

it installs the wheel but does not seem to build it

I don't have much time to investigate but there is no wheel for a git dependency and the log clearly shows it was building the package.

frostming avatar Apr 03 '24 07:04 frostming

@frostming yes indeed, I'm also not sure what is going on... probably in the near future try to investigate more and keep you posted

ioangatop avatar Apr 05 '24 12:04 ioangatop