2

I am working on an app which has frontend (angularjs) and backend(python, flask framework). I am creating a Makefile for this app.

To install backend dependencies using requirements.txt file, I want to check if virtualenv has been activated or not.

If virtualenv is activated then only installs dependencies using requirements.txt file otherwise not.

dummy:

if virtualenv_activated:
   install_dependencies

I checked this link: running inside virtualenv but didn't understand much about writing this in Makefile.

Any useful help will be appreciated!

Community
  • 1
  • 1
yugantar kumar
  • 1,982
  • 1
  • 23
  • 33

1 Answers1

3

Finally I found out the way to do this, we can write it as:

ifeq ($(VIRTUAL_ENV), )
    @echo "virtual env is not activated"
else
    @echo "virtual env is activated"
endif

So, this way we can check for virtual_env activation.

Thanks!

yugantar kumar
  • 1,982
  • 1
  • 23
  • 33