How to use virtualenv in makefile

后端 未结 8 1070
-上瘾入骨i
-上瘾入骨i 2020-12-24 04:55

I want to perform several operations while working on a specified virtualenv.

For example command

make install

would be equivalent

相关标签:
8条回答
  • 2020-12-24 05:41

    You also could use the environment variable called "VIRTUALENVWRAPPER_SCRIPT". Like this:

    install:
        ( \
           source $$VIRTUALENVWRAPPER_SCRIPT; \
           pip install -r requirements.txt; \
        )
    
    0 讨论(0)
  • 2020-12-24 05:42

    This is an alternate way to run things that you want to run in virtualenv.

    BIN=venv/bin/
    
    install:
        $(BIN)pip install -r requirements.txt
    
    run:
        $(BIN)python main.py
    

    PS: This doesn't activate the virtualenv, but gets thing done. Hope you find it clean and useful.

    0 讨论(0)
提交回复
热议问题