Skip to content

Instantly share code, notes, and snippets.

@darvid
Created July 31, 2016 15:47
Show Gist options
  • Save darvid/3c51f6e67cee0eb8101141e143a683c6 to your computer and use it in GitHub Desktop.
Save darvid/3c51f6e67cee0eb8101141e143a683c6 to your computer and use it in GitHub Desktop.
REQUIREMENTS_DIR=requirements
REQUIREMENTS_ARTIFACTS=$(REQUIREMENTS_DIR)/%.txt
REQUIREMENTS_TARGETS=main qa test
PYENV_TEST_VERSIONS=2.7.11 3.5.1
.PHONY: clean clean_docs clean_requirements docs requirements test
clean_docs:
cd docs && make clean && rm -rf source/api
clean_requirements:
rm -rf requirements/*.txt
clean: clean_docs clean_requirements
find . -name "*.pyc" -delete
find . -path "*/__pycache__/*" -delete
find . -type d -name "__pycache__" -empty -delete
rm -rf .tox
python setup.py clean
docs:
python setup.py docs
$(REQUIREMENTS_ARTIFACTS): $(REQUIREMENTS_DIR)/src/%.in
pip-compile $< -o $@
requirements: clean_requirements $(patsubst %,$(REQUIREMENTS_ARTIFACTS),$(REQUIREMENTS_TARGETS))
test: requirements
pyenv local $(PYENV_TEST_VERSIONS)
tox -- -s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment