##// END OF EJS Templates
makefile: added ruff check
super-admin -
r5176:5680b223 default
parent child Browse files
Show More
@@ -1,172 +1,178 b''
1 1 # required for pushd to work..
2 2 SHELL = /bin/bash
3 3
4 4
5 5 # set by: PATH_TO_OUTDATED_PACKAGES=/some/path/outdated_packages.py
6 6 OUTDATED_PACKAGES = ${PATH_TO_OUTDATED_PACKAGES}
7 7
8 8 NODE_PATH=./node_modules
9 9 WEBPACK=./node_binaries/webpack
10 10 GRUNT=./node_binaries/grunt
11 11
12 12 .PHONY: clean
13 13 ## Cleanup compiled and cache py files
14 14 clean:
15 15 make test-clean
16 16 find . -type f \( -iname '*.c' -o -iname '*.pyc' -o -iname '*.so' -o -iname '*.orig' \) -exec rm '{}' ';'
17 17 find . -type d -name "build" -prune -exec rm -rf '{}' ';'
18 18
19 19 .PHONY: test
20 20 ## run test-clean and tests
21 21 test:
22 22 make test-clean
23 23 make test-only
24 24
25 25
26 26 .PHONY: test-clean
27 27 ## run test-clean and tests
28 28 test-clean:
29 29 rm -rf coverage.xml htmlcov junit.xml pylint.log result
30 30 find . -type d -name "__pycache__" -prune -exec rm -rf '{}' ';'
31 31 find . -type f \( -iname '.coverage.*' \) -exec rm '{}' ';'
32 32
33 33
34 34 .PHONY: test-only
35 35 ## Run tests only without cleanup
36 36 test-only:
37 37 PYTHONHASHSEED=random \
38 38 py.test -x -vv -r xw -p no:sugar \
39 39 --cov-report=term-missing --cov-report=html \
40 40 --cov=rhodecode rhodecode
41 41
42 42
43 43 .PHONY: test-only-mysql
44 44 ## run tests against mysql
45 45 test-only-mysql:
46 46 PYTHONHASHSEED=random \
47 47 py.test -x -vv -r xw -p no:sugar \
48 48 --cov-report=term-missing --cov-report=html \
49 49 --ini-config-override='{"app:main": {"sqlalchemy.db1.url": "mysql://root:qweqwe@localhost/rhodecode_test?charset=utf8"}}' \
50 50 --cov=rhodecode rhodecode
51 51
52 52
53 53 .PHONY: test-only-postgres
54 54 ## run tests against postgres
55 55 test-only-postgres:
56 56 PYTHONHASHSEED=random \
57 57 py.test -x -vv -r xw -p no:sugar \
58 58 --cov-report=term-missing --cov-report=html \
59 59 --ini-config-override='{"app:main": {"sqlalchemy.db1.url": "postgresql://postgres:qweqwe@localhost/rhodecode_test"}}' \
60 60 --cov=rhodecode rhodecode
61 61
62 .PHONY: ruff-check
63 ## run a ruff analysis
64 ruff-check:
65 ruff check --ignore F401 --ignore I001 --ignore E402 --ignore E501 --ignore F841 --exclude rhodecode/lib/dbmigrate --exclude .eggs --exclude .dev .
66
67
62 68 .PHONY: docs
63 69 ## build docs
64 70 docs:
65 71 (cd docs; nix-build default.nix -o result; make clean html)
66 72
67 73
68 74 .PHONY: docs-clean
69 75 ## Cleanup docs
70 76 docs-clean:
71 77 (cd docs; make clean)
72 78
73 79
74 80 .PHONY: docs-cleanup
75 81 ## Cleanup docs
76 82 docs-cleanup:
77 83 (cd docs; make cleanup)
78 84
79 85
80 86 .PHONY: web-build
81 87 ## Build JS packages static/js
82 88 # https://hub.docker.com/r/huli/grunt
83 89 web-build:
84 90 NODE_PATH=$(NODE_PATH) $(GRUNT)
85 91
86 92 # check required files
87 93 STATIC_CHECK="/robots.txt /502.html \
88 94 /js/scripts.min.js /js/rhodecode-components.js \
89 95 /css/style.css /css/style-polymer.css /css/style-ipython.css"
90 96
91 97 for file in $STATIC_CHECK;
92 98 do
93 99 if [ ! -f rhodecode/public/$file ]; then
94 100 echo "Missing $file expected after web-build"
95 101 exit 1
96 102 fi
97 103 done
98 104
99 105 .PHONY: pip-packages
100 106 ## Show outdated packages
101 107 pip-packages:
102 108 python ${OUTDATED_PACKAGES}
103 109
104 110
105 111 .PHONY: build
106 112 ## Build sdist/egg
107 113 build:
108 114 python -m build
109 115
110 116
111 117 .PHONY: dev-env
112 118 ## make dev-env based on the requirements files and install develop of packages
113 119 dev-env:
114 120 pip install build virtualenv
115 121 pushd ../rhodecode-vcsserver/ && make dev-env && popd
116 122 pip wheel --wheel-dir=/home/rhodecode/.cache/pip/wheels -r requirements.txt -r requirements_rc_tools.txt -r requirements_test.txt -r requirements_debug.txt
117 123 pip install --no-index --find-links=/home/rhodecode/.cache/pip/wheels -r requirements.txt -r requirements_rc_tools.txt -r requirements_test.txt -r requirements_debug.txt
118 124 pip install -e .
119 125
120 126
121 127 .PHONY: dev-srv
122 128 ## run develop server instance, docker exec -it $(docker ps -q --filter 'name=dev-enterprise-ce') /bin/bash
123 129 dev-srv:
124 130 pserve --reload .dev/dev.ini
125 131
126 132 .PHONY: dev-srv-g
127 133 ## run gunicorn multi process workers
128 134 dev-srv-g:
129 135 gunicorn --paste .dev/dev.ini --bind=0.0.0.0:10020 --config=.dev/gunicorn_config.py
130 136
131 137
132 138 # Default command on calling make
133 139 .DEFAULT_GOAL := show-help
134 140
135 141 .PHONY: show-help
136 142 show-help:
137 143 @echo "$$(tput bold)Available rules:$$(tput sgr0)"
138 144 @echo
139 145 @sed -n -e "/^## / { \
140 146 h; \
141 147 s/.*//; \
142 148 :doc" \
143 149 -e "H; \
144 150 n; \
145 151 s/^## //; \
146 152 t doc" \
147 153 -e "s/:.*//; \
148 154 G; \
149 155 s/\\n## /---/; \
150 156 s/\\n/ /g; \
151 157 p; \
152 158 }" ${MAKEFILE_LIST} \
153 159 | LC_ALL='C' sort --ignore-case \
154 160 | awk -F '---' \
155 161 -v ncol=$$(tput cols) \
156 162 -v indent=19 \
157 163 -v col_on="$$(tput setaf 6)" \
158 164 -v col_off="$$(tput sgr0)" \
159 165 '{ \
160 166 printf "%s%*s%s ", col_on, -indent, $$1, col_off; \
161 167 n = split($$2, words, " "); \
162 168 line_length = ncol - indent; \
163 169 for (i = 1; i <= n; i++) { \
164 170 line_length -= length(words[i]) + 1; \
165 171 if (line_length <= 0) { \
166 172 line_length = ncol - indent - length(words[i]) - 1; \
167 173 printf "\n%*s ", -indent, " "; \
168 174 } \
169 175 printf "%s ", words[i]; \
170 176 } \
171 177 printf "\n"; \
172 178 }'
General Comments 0
You need to be logged in to leave comments. Login now