Skip to content

Instantly share code, notes, and snippets.

@nsorros
Last active April 22, 2021 17:47
Show Gist options
  • Save nsorros/733bd74ced9a3ae289a1a1df547b6922 to your computer and use it in GitHub Desktop.
Save nsorros/733bd74ced9a3ae289a1a1df547b6922 to your computer and use it in GitHub Desktop.
Update requirements txt file
update-requirements: VENV := /tmp/update-requirements-venv
update-requirements: ## updates requirements
@if [ -d $(VENV) ]; then rm -rf $(VENV); fi
@mkdir -p $(VENV)
$(PYTHON) -m venv $(VENV)
$(PIP) install --upgrade pip
$(PIP) install -r unpinned_requirements.txt
echo "Created by update-requirements. Do not edit." > requirements.txt
$(PIP) freeze | grep -v pkg-resources==0.0.0 >> requirements.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment