How to use virtualenv in makefile

后端 未结 8 1087
-上瘾入骨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:35

    In make you can run a shell as command. In this shell you can do everything you can do in a shell you started from comandline. Example:

    install:
        ( \
           source path/to/virtualenv/bin/activate; \
           pip install -r requirements.txt; \
        )
    

    Attention must be paid to the ;and the \.

    Everything between the open and close brace will be done in a single instance of a shell.

提交回复
热议问题