@@ 93,6 93,12 @@ bin
endef
export HGIGNORE
+define REQUIREMENTS
+isort
+nose
+endef
+export REQUIREMENTS
+
.hgignore:
@echo "$$HGIGNORE" > $@
@@ 100,7 106,7 @@ setup.py:
@echo "$$SETUP" > $@
requirements.txt:
- echo nose > $@
+ echo "$$REQUIREMENTS" > $@
src/$(APP):
mkdir -p $@
@@ 134,6 140,17 @@ build: env
build: env/_done_install
# =============================================================================
+# utils
+# =============================================================================
+
+.PHONY: isort
+isort:
+ CPF=`hg st -nam | grep '\.py'`; \
+ test -n "$$CPF"\
+ && env/bin/isort --line-width 80 --order-by-type -m 5 $$CPF \
+ || echo "nothing to do (no changed python files)"
+
+# =============================================================================
# tests
# =============================================================================