python-common.mk 988 B

12345678910111213141516171819202122232425262728
  1. include $(DIR_MAKEFILET)/python.mk
  2. # for now: by default a project-related virtual environment is used (deprecated)
  3. # TODO: remove the deprecated setting and switch to "disabled by default"
  4. DISABLE_CUSTOM_VIRTUALENV ?= 0
  5. # defaults to empty in order to allow an explicit override of 'DISABLE_CUSTOM_VIRTUALENV'
  6. PYTHON_VIRTUALENV_ENABLE ?=
  7. ifeq ($(PYTHON_VIRTUALENV_ENABLE),1)
  8. include $(DIR_MAKEFILET)/python-virtualenv.mk
  9. else
  10. # `PYTHON_VIRTUALENV_ENABLE=0` will disable the obsolete 'DISABLE_CUSTOM_VIRTUALENV' handling
  11. ifneq ($(PYTHON_VIRTUALENV_ENABLE),0)
  12. ifneq ($(DISABLE_CUSTOM_VIRTUALENV),1)
  13. VIRTUALENV_REQUIREMENTS_FILE ?= requirements.txt
  14. ifneq ($(wildcard $(VIRTUALENV_REQUIREMENTS_FILE)),)
  15. include $(DIR_MAKEFILET)/python-virtualenv.mk
  16. endif
  17. endif
  18. endif
  19. endif
  20. ifneq ($(wildcard manage.py),)
  21. include $(DIR_MAKEFILET)/python-django.mk
  22. endif
  23. # set the test arguments if they were not overridden by another component (e.g. Django)
  24. PYTHON_TEST_ARGS ?= -m unittest discover