Skip to content

Commit 0c93f23

Browse files
committed
manually merge PR63 to add 'make fmt' support for autopep8 integration. Verbatim merge, so perhaps it should have the explicit '--max-line-length=80' appended as we talked about.
git-svn-id: svn+ssh://svn.code.sf.net/p/migrid/code/trunk@6061 b75ad72c-e7d7-11dd-a971-7dbc132099af
1 parent c624e78 commit 0c93f23

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
ifndef MIG_ENV
2+
MIG_ENV = 'local'
3+
endif
14
ifeq ($(PY),2)
25
PYTHON_BIN = './envhelp/python2'
36
else
@@ -17,6 +20,14 @@ info:
1720
@echo "'make test' - run the test suite"
1821
@echo "'make PY=2 test' - run the test suite (python 2)"
1922

23+
.PHONY: fmt
24+
fmt:
25+
ifneq ($(MIG_ENV),'local')
26+
@echo "unavailable outside local development environment"
27+
@exit 1
28+
endif
29+
$(PYTHON_BIN) -m autopep8 --ignore E402 -i
30+
2031
.PHONY: clean
2132
clean:
2233
@rm -f ./envhelp/py2.imageid
@@ -35,10 +46,19 @@ test: dependencies
3546
.PHONY: dependencies
3647
dependencies: ./envhelp/venv/pyvenv.cfg ./envhelp/py3.depends
3748

49+
ifeq ($(MIG_ENV),'local')
50+
./envhelp/py3.depends: $(REQS_PATH) local-requirements.txt
51+
else
3852
./envhelp/py3.depends: $(REQS_PATH)
53+
endif
3954
@rm -f ./envhelp/py3.depends
4055
@echo "installing dependencies from $(REQS_PATH)"
4156
@./envhelp/venv/bin/pip3 install -r $(REQS_PATH)
57+
ifeq ($(MIG_ENV),'local')
58+
@echo ""
59+
@echo "installing development dependencies"
60+
@./envhelp/venv/bin/pip3 install -r local-requirements.txt
61+
endif
4262
@touch ./envhelp/py3.depends
4363

4464
./envhelp/venv/pyvenv.cfg:

local-requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# migrid dependencies on a format suitable for pip install as described on
2+
# https://pip.pypa.io/en/stable/reference/requirement-specifiers/
3+
autopep8

0 commit comments

Comments
 (0)