Skip to content

Commit 90b8442

Browse files
author
Gonzalo Diaz
committed
[REFACTOR] Makefile reorder.
1 parent cac6afd commit 90b8442

File tree

1 file changed

+42
-36
lines changed

1 file changed

+42
-36
lines changed

Makefile

Lines changed: 42 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,44 @@ env:
6060

6161
install: dependencies
6262

63+
## Dependency management
6364
dependencies:
6465
@echo "################################################################################"
6566
@echo "## Dependencies: ###############################################################"
6667
@echo "################################################################################"
6768
${PACKAGE_TOOL} install -r requirements.txt
6869
@echo "################################################################################"
6970

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
70101
lint/json:
71102
prettier --check ./src/**/*.json
72103

@@ -78,15 +109,6 @@ lint/yaml:
78109

79110
lint: lint/markdown lint/yaml lint/json test/styling test/static
80111

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-
90112
format/json:
91113
prettier --write ./src/**/*.json
92114

@@ -95,14 +117,17 @@ format/sources:
95117

96118
format: format/sources format/json
97119

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/
105125

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
106131
test: env dependencies
107132
${RUNTIME_TOOL} -m coverage run -m \
108133
pytest --verbose \
@@ -118,26 +143,7 @@ coverage/html: test
118143
${RUNTIME_TOOL} -m coverage html
119144
open htmlcov/index.html
120145

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
141147
compose/build: env
142148
${DOCKER_COMPOSE} --profile lint build
143149
${DOCKER_COMPOSE} --profile testing build

0 commit comments

Comments
 (0)