Makefile 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #################################################################################
  2. # GLOBALS #
  3. #################################################################################
  4. PROJECT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
  5. PROJECT_NAME = savta_depth
  6. PYTHON_INTERPRETER = python3
  7. ifeq (,$(shell which conda))
  8. HAS_CONDA=False
  9. else
  10. HAS_CONDA=True
  11. endif
  12. #################################################################################
  13. # COMMANDS #
  14. #################################################################################
  15. env:
  16. ifeq (True,$(HAS_CONDA))
  17. @echo ">>> Detected conda, creating conda environment."
  18. conda create -y --name $(PROJECT_NAME) python=3.7.6
  19. @echo ">>> New conda env created. Activate with:\nconda activate $(PROJECT_NAME)"
  20. else
  21. @echo ">>> No conda detected, creating venv environment."
  22. $(PYTHON_INTERPRETER) -m venv env
  23. @echo ">>> New virtual env created. Activate with:\nsource env/bin/activate ."
  24. endif
  25. load_requirements:
  26. @echo ">>> Installing requirements. Make sure your virtual environment is activated."
  27. $(PYTHON_INTERPRETER) -m pip install -U pip setuptools wheel
  28. $(PYTHON_INTERPRETER) -m pip install -r requirements.txt
  29. save_requirements:
  30. @echo ">>> Saving requirements."
  31. pip list --format=freeze > requirements.txt
Tip!

Press p or to see the previous file or, n or to see the next file