@@ -21,18 +21,54 @@ help:
21
21
DOCKER = docker-compose -p pysus -f docker/docker-compose.yaml
22
22
SERVICE :=
23
23
24
- # Docker basic
25
- run_jupyter_pysus : # # build and deploy all containers
24
+
25
+ # * Installation
26
+ .PHONY : install
27
+ install : clean # # install the package to the active Python's site-packages
28
+ python setup.py install
29
+
30
+ .PHONY : pre-commit-install
31
+ develop-install : clean # # install the package in development mode
32
+ pip install -e ' .[dev]'
33
+ pre-commit install
34
+
35
+ # * Linting
36
+ .PHONY : check-codestyle
37
+ check-codestyle : # # check style with flake8
38
+ # stop the build if there are Python syntax errors or undefined names
39
+ flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
40
+ # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
41
+ flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
42
+
43
+ # * Docker basic
44
+ .PHONY : run-jupyter-pysus
45
+ run-jupyter-pysus : # # build and deploy all containers
26
46
$(DOCKER ) up -d --build
27
47
28
- down_jupyter_pysus : # # stop and remove containers for all services
48
+ .PHONY : down-jupyter-pysus
49
+ down-jupyter-pysus : # # stop and remove containers for all services
29
50
$(DOCKER ) down -v --remove-orphans
30
51
31
- test_jupyter_pysus : # # run pytest for notebooks inside jupyter container
52
+ # * Tests
53
+ .PHONY : test-jupyter-pysus
54
+ test-jupyter-pysus : # # run pytest for notebooks inside jupyter container
32
55
$(DOCKER ) exec -T jupyter bash /test_notebooks.sh
33
56
57
+ .PHONY : test
58
+ test : # # run tests quickly with the default Python
59
+ py.test
60
+
61
+ coverage : # # check code coverage quickly with the default Python
62
+ coverage run --source pysus/tests/ -m pytest
63
+ coverage report -m
64
+ coverage html
65
+ $(BROWSER ) htmlcov/index.html
66
+
67
+ # Cleaning
68
+ .PHONY : clean
34
69
clean : clean-build clean-pyc clean-test # # remove all build, test, coverage and Python artifacts
35
70
71
+ .PHONY : clean-build
36
72
clean-build : # # remove build artifacts
37
73
rm -fr build/
38
74
rm -fr dist/
@@ -44,37 +80,16 @@ clean-build: ## remove build artifacts
44
80
find . -name ' *.egg-info' -exec rm -fr {} +
45
81
find . -name ' *.egg' -exec rm -f {} +
46
82
47
-
83
+ .PHONY : clean-pyc
48
84
clean-pyc : # # remove Python file artifacts
49
85
find . -name ' *.pyc' -exec rm -f {} +
50
86
find . -name ' *.pyo' -exec rm -f {} +
51
87
find . -name ' *~' -exec rm -f {} +
52
88
find . -name ' __pycache__' -exec rm -fr {} +
53
89
90
+ .PHONY : clean-test
54
91
clean-test : # # remove test and coverage artifacts
55
92
rm -fr .tox/
56
93
rm -f .coverage
57
94
rm -fr htmlcov/
58
95
rm -fr .pytest_cache
59
-
60
- lint : # # check style with flake8
61
- # stop the build if there are Python syntax errors or undefined names
62
- flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
63
- # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
64
- flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
65
-
66
- install : clean # # install the package to the active Python's site-packages
67
- python setup.py install
68
-
69
- develop : clean # # install the package in development mode
70
- pip install -e ' .[dev]'
71
- pre-commit install
72
-
73
- test : # # run tests quickly with the default Python
74
- py.test
75
-
76
- coverage : # # check code coverage quickly with the default Python
77
- coverage run --source pysus/tests/ -m pytest
78
- coverage report -m
79
- coverage html
80
- $(BROWSER ) htmlcov/index.html
0 commit comments