File tree Expand file tree Collapse file tree 3 files changed +35
-17
lines changed Expand file tree Collapse file tree 3 files changed +35
-17
lines changed Original file line number Diff line number Diff line change 1
1
ENVIRONMENT := development
2
+ ROOTDIR =./
3
+ VENV =$(ROOTDIR ) venv/bin/
4
+
5
+ .PHONY : venv
6
+ venv :
7
+ test -d venv || python -m venv $(ROOTDIR ) venv
2
8
3
9
OS := $(shell uname -s)
4
10
5
11
.PHONY : build
6
- build : verify-dev-env
12
+ build : verify-dev-env venv
7
13
cd go && $(MAKE ) build-all ENVIRONMENT=$(ENVIRONMENT )
8
14
cd python && $(MAKE ) build
9
15
18
24
endif
19
25
20
26
.PHONY : develop
21
- develop : verify-dev-env
27
+ develop : verify-dev-env venv
22
28
cd go && $(MAKE ) build
23
29
cd go && $(MAKE ) install
24
- cd python && python setup.py develop
30
+ cd python && $(MAKE ) develop
31
+ @printf " \nPython venv created at $( ROOTDIR) venv. Run ` tput bold` source $( ROOTDIR) venv/bin/activate` tput sgr0` to activate the venv in your shell.\n"
32
+ @printf " If you're using vscode, select this venv as the Python interpretor in the bottom left.\n"
25
33
26
34
.PHONY : install-test-dependencies
27
- install-test-dependencies :
28
- pip install -r requirements-test.txt
35
+ install-test-dependencies : venv
36
+ $( VENV ) pip install -r requirements-test.txt
29
37
30
38
.PHONY : test
31
39
test : install-test-dependencies develop
Original file line number Diff line number Diff line change
1
+ ROOTDIR =../
2
+ VENV =$(ROOTDIR ) venv/bin/
3
+
1
4
.PHONY : test
2
5
test :
3
- pytest -m " not external"
6
+ $( VENV ) pytest -m " not external"
4
7
5
8
.PHONY : test-external
6
9
test-external :
7
- pytest
10
+ $( VENV ) pytest
Original file line number Diff line number Diff line change
1
+ ROOTDIR =../
2
+ VENV =$(ROOTDIR ) venv/bin/
3
+
1
4
.PHONY : pre-commit
2
5
pre-commit : lint
3
6
4
7
.PHONY : fmt
5
8
fmt :
6
- black .
9
+ $(VENV ) black .
10
+
11
+ .PHONY : develop
12
+ develop :
13
+ $(VENV ) python setup.py develop
7
14
8
15
# --import-mode makes pytest import from globally installed package by default instead of local replicate/ module.
9
16
# This assumes you've run `make develop` before running tests
10
17
# https://docs.pytest.org/en/stable/pythonpath.html#pythonpath
11
18
.PHONY : test
12
19
test : lint
13
- pytest --import-mode=importlib -m " not external"
20
+ $( VENV ) pytest --import-mode=importlib -m " not external"
14
21
15
22
.PHONY : test-external
16
23
test-external : lint
17
- pytest --import-mode=importlib
24
+ $( VENV ) pytest --import-mode=importlib
18
25
19
26
.PHONY : lint
20
27
lint :
21
- mypy .
22
- black --check .
28
+ $( VENV ) mypy .
29
+ $( VENV ) black --check .
23
30
24
31
.PHONY : clean
25
32
clean :
@@ -42,15 +49,15 @@ clean:
42
49
# https://docs.python.org/3/distutils/apiref.html#distutils.util.get_platform
43
50
.PHONY : build
44
51
build : clean
45
- pip install wheel
46
- python setup.py bdist_wheel --plat-name manylinux1_x86_64
47
- python setup.py bdist_wheel --plat-name macosx_10_9_x86_64
52
+ $( VENV ) pip install wheel
53
+ $( VENV ) python setup.py bdist_wheel --plat-name manylinux1_x86_64
54
+ $( VENV ) python setup.py bdist_wheel --plat-name macosx_10_9_x86_64
48
55
49
56
.PHONY : targets
50
57
targets :
51
58
@$(MAKE ) -pRrq -f $(lastword $(MAKEFILE_LIST ) ) : 2> /dev/null | awk -v RS= -F: ' /^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e ' ^[^[:alnum:]]' -e ' ^$@$$'
52
59
53
60
.PHONY : vendor
54
61
vendor :
55
- pip install vendoring
56
- vendoring sync -v .
62
+ $( VENV ) pip install vendoring
63
+ $( VENV ) vendoring sync -v .
You can’t perform that action at this time.
0 commit comments