clip-reply-demo / Makefile
mattupson's picture
Resolves dependency issues from latest streamlit
f6ee7e4
raw
history blame
1.57 kB
#################################################################################
# GLOBALS #
#################################################################################
PYTHON_VERSION = python3.10
VIRTUALENV := .venv
#################################################################################
# COMMANDS #
#################################################################################
# Set the default location for the virtualenv to be stored
# Create the virtualenv by installing the requirements and test requirements
.PHONY: virtualenv
virtualenv: requirements.txt
@if [ -d $(VIRTUALENV) ]; then rm -rf $(VIRTUALENV); fi
@mkdir -p $(VIRTUALENV)
$(PYTHON_VERSION) -m venv $(VIRTUALENV)
$(VIRTUALENV)/bin/pip install --upgrade pip
$(VIRTUALENV)/bin/pip install --upgrade -r requirements.txt
touch $@
.PHONY: update-requirements-txt
update-requirements-txt: unpinned_requirements.txt
update-requirements-txt: VIRTUALENV := /tmp/update-requirements-virtualenv
update-requirements-txt:
@if [ -d $(VIRTUALENV) ]; then rm -rf $(VIRTUALENV); fi
@mkdir -p $(VIRTUALENV)
virtualenv --python $(PYTHON_VERSION) $(VIRTUALENV)
$(VIRTUALENV)/bin/pip install --upgrade pip
$(VIRTUALENV)/bin/pip install --upgrade -r unpinned_requirements.txt
echo "# Created by 'make update-requirements-txt'. DO NOT EDIT!" > requirements.txt
$(VIRTUALENV)/bin/pip freeze | grep -v pkg_resources==0.0.0 >> requirements.txt