60
60
61
61
install : dependencies
62
62
63
+ # # Dependency management
63
64
dependencies :
64
65
@echo " ################################################################################"
65
66
@echo " ## Dependencies: ###############################################################"
66
67
@echo " ################################################################################"
67
68
${PACKAGE_TOOL} install -r requirements.txt
68
69
@echo " ################################################################################"
69
70
71
+ outdated :
72
+ ${PACKAGE_TOOL} list --outdated
73
+
74
+ update :
75
+ ${PACKAGE_TOOL} freeze > requirements.txt
76
+
77
+ upgrade :
78
+ ${PACKAGE_TOOL} list --outdated | cut -f1 -d' ' | tr " " " \n" | awk ' {if(NR>=3)print}' | cut -d' ' -f1 | xargs -n1 pip3 install -U
79
+
80
+ clean :
81
+ ${PACKAGE_TOOL} freeze > unins ; ${PACKAGE_TOOL} uninstall -y -r unins ; rm unins
82
+ rm -f .coverage
83
+ rm -fr .pytest_cache
84
+ rm -fr htmlcov
85
+ rm -fr coverage
86
+ rm -fr build
87
+ find . -path " */*.pyc" -delete -print || true
88
+ find . -path " */*.pyo" -delete -print || true
89
+ find . -path " */__pycache__" -type d -print -exec rm -fr {} ' ;' || true
90
+
91
+ # # Building process
92
+ build : env
93
+ rsync -av --prune-empty-dirs \
94
+ --exclude '*_test.py' \
95
+ --exclude '*.pyc' \
96
+ --exclude '.venv' \
97
+ --exclude '__pycache__' \
98
+ src/ build/
99
+
100
+ # # Source code linting and formatting
70
101
lint/json :
71
102
prettier --check ./src/** /* .json
72
103
@@ -78,15 +109,6 @@ lint/yaml:
78
109
79
110
lint : lint/markdown lint/yaml lint/json test/styling test/static
80
111
81
- test/static : dependencies
82
- ${RUNTIME_TOOL} -m pylint --verbose --recursive yes src/
83
- ${RUNTIME_TOOL} -m flake8 --verbose src/
84
- ${RUNTIME_TOOL} -m pyright --verbose src/
85
-
86
- test/styling : dependencies
87
- ${RUNTIME_TOOL} -m pycodestyle --statistics src/
88
- ${RUNTIME_TOOL} -m autopep8 --diff --recursive --exit-code --verbose .
89
-
90
112
format/json :
91
113
prettier --write ./src/** /* .json
92
114
@@ -95,14 +117,17 @@ format/sources:
95
117
96
118
format : format/sources format/json
97
119
98
- build : env
99
- rsync -av --prune-empty-dirs \
100
- --exclude '*_test.py' \
101
- --exclude '*.pyc' \
102
- --exclude '.venv' \
103
- --exclude '__pycache__' \
104
- src/ build/
120
+ # # Static code analysis
121
+ test/static : dependencies
122
+ ${RUNTIME_TOOL} -m pylint --verbose --recursive yes src/
123
+ ${RUNTIME_TOOL} -m flake8 --verbose src/
124
+ ${RUNTIME_TOOL} -m pyright --verbose src/
105
125
126
+ test/styling : dependencies
127
+ ${RUNTIME_TOOL} -m pycodestyle --statistics src/
128
+ ${RUNTIME_TOOL} -m autopep8 --diff --recursive --exit-code --verbose .
129
+
130
+ # # Unit tests and coverage
106
131
test : env dependencies
107
132
${RUNTIME_TOOL} -m coverage run -m \
108
133
pytest --verbose \
@@ -118,26 +143,7 @@ coverage/html: test
118
143
${RUNTIME_TOOL} -m coverage html
119
144
open htmlcov/index.html
120
145
121
- outdated :
122
- ${PACKAGE_TOOL} list --outdated
123
-
124
- update :
125
- ${PACKAGE_TOOL} freeze > requirements.txt
126
-
127
- upgrade :
128
- ${PACKAGE_TOOL} list --outdated | cut -f1 -d' ' | tr " " " \n" | awk ' {if(NR>=3)print}' | cut -d' ' -f1 | xargs -n1 pip3 install -U
129
-
130
- clean :
131
- ${PACKAGE_TOOL} freeze > unins ; ${PACKAGE_TOOL} uninstall -y -r unins ; rm unins
132
- rm -f .coverage
133
- rm -fr .pytest_cache
134
- rm -fr htmlcov
135
- rm -fr coverage
136
- rm -fr build
137
- find . -path " */*.pyc" -delete -print || true
138
- find . -path " */*.pyo" -delete -print || true
139
- find . -path " */__pycache__" -type d -print -exec rm -fr {} ' ;' || true
140
-
146
+ # # Docker Compose commands
141
147
compose/build : env
142
148
${DOCKER_COMPOSE} --profile lint build
143
149
${DOCKER_COMPOSE} --profile testing build
0 commit comments