Show More
@@ -1,137 +1,144 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 | .PHONY: clean |
|
9 | 9 | ## Cleanup compiled and cache py files |
|
10 | 10 | clean: |
|
11 | 11 | make test-clean |
|
12 | 12 | find . -type f \( -iname '*.c' -o -iname '*.pyc' -o -iname '*.so' -o -iname '*.orig' \) -exec rm '{}' ';' |
|
13 | 13 | find . -type d -name "build" -prune -exec rm -rf '{}' ';' |
|
14 | 14 | |
|
15 | 15 | |
|
16 | 16 | .PHONY: test |
|
17 | 17 | ## run test-clean and tests |
|
18 | 18 | test: |
|
19 | 19 | make test-clean |
|
20 | 20 | make test-only |
|
21 | 21 | |
|
22 | 22 | |
|
23 | 23 | .PHONY: test-clean |
|
24 | 24 | ## run test-clean and tests |
|
25 | 25 | test-clean: |
|
26 | 26 | rm -rf coverage.xml htmlcov junit.xml pylint.log result |
|
27 | 27 | find . -type d -name "__pycache__" -prune -exec rm -rf '{}' ';' |
|
28 | 28 | find . -type f \( -iname '.coverage.*' \) -exec rm '{}' ';' |
|
29 | 29 | |
|
30 | 30 | |
|
31 | 31 | .PHONY: test-only |
|
32 | 32 | ## Run tests only without cleanup |
|
33 | 33 | test-only: |
|
34 | 34 | PYTHONHASHSEED=random \ |
|
35 | 35 | py.test -x -vv -r xw -p no:sugar \ |
|
36 | 36 | --cov-report=term-missing --cov-report=html \ |
|
37 | 37 | --cov=vcsserver vcsserver |
|
38 | 38 | |
|
39 | 39 | |
|
40 | 40 | .PHONY: ruff-check |
|
41 | 41 | ## run a ruff analysis |
|
42 | 42 | ruff-check: |
|
43 | 43 | ruff check --ignore F401 --ignore I001 --ignore E402 --ignore E501 --ignore F841 --exclude rhodecode/lib/dbmigrate --exclude .eggs --exclude .dev . |
|
44 | 44 | |
|
45 | 45 | .PHONY: pip-packages |
|
46 | 46 | ## Show outdated packages |
|
47 | 47 | pip-packages: |
|
48 | 48 | python ${OUTDATED_PACKAGES} |
|
49 | 49 | |
|
50 | 50 | |
|
51 | 51 | .PHONY: build |
|
52 | 52 | ## Build sdist/egg |
|
53 | 53 | build: |
|
54 | 54 | python -m build |
|
55 | 55 | |
|
56 | 56 | |
|
57 | 57 | .PHONY: dev-sh |
|
58 | 58 | ## make dev-sh |
|
59 | 59 | dev-sh: |
|
60 | 60 | sudo echo "deb [trusted=yes] https://apt.fury.io/rsteube/ /" | sudo tee -a "/etc/apt/sources.list.d/fury.list" |
|
61 | 61 | sudo apt-get update |
|
62 | 62 | sudo apt-get install -y zsh carapace-bin |
|
63 | 63 | rm -rf /home/rhodecode/.oh-my-zsh |
|
64 | 64 | curl https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh |
|
65 | 65 | @echo "source <(carapace _carapace)" > /home/rhodecode/.zsrc |
|
66 | 66 | @echo "${RC_DEV_CMD_HELP}" |
|
67 | 67 | @PROMPT='%(?.%F{green}β.%F{red}?%?)%f %B%F{240}%1~%f%b %# ' zsh |
|
68 | 68 | |
|
69 | 69 | |
|
70 | .PHONY: dev-cleanup | |
|
71 | ## Cleanup: pip freeze | grep -v "^-e" | grep -v "@" | xargs pip uninstall -y | |
|
72 | dev-cleanup: | |
|
73 | pip freeze | grep -v "^-e" | grep -v "@" | xargs pip uninstall -y | |
|
74 | rm -rf /tmp/* | |
|
75 | ||
|
76 | ||
|
70 | 77 | .PHONY: dev-env |
|
71 | 78 | ## make dev-env based on the requirements files and install develop of packages |
|
72 | 79 | ## Cleanup: pip freeze | grep -v "^-e" | grep -v "@" | xargs pip uninstall -y |
|
73 | 80 | dev-env: |
|
74 | 81 | sudo -u root chown rhodecode:rhodecode /home/rhodecode/.cache/pip/ |
|
75 | 82 | pip install build virtualenv |
|
76 | 83 | pip wheel --wheel-dir=/home/rhodecode/.cache/pip/wheels -r requirements.txt -r requirements_test.txt -r requirements_debug.txt |
|
77 | 84 | pip install --no-index --find-links=/home/rhodecode/.cache/pip/wheels -r requirements.txt -r requirements_test.txt -r requirements_debug.txt |
|
78 | 85 | pip install -e . |
|
79 | 86 | |
|
80 | 87 | |
|
81 | 88 | .PHONY: sh |
|
82 | 89 | ## shortcut for make dev-sh dev-env |
|
83 | 90 | sh: |
|
84 | 91 | make dev-env |
|
85 | 92 | make dev-sh |
|
86 | 93 | |
|
87 | 94 | |
|
88 | 95 | ## Allows changes of workers e.g make dev-srv-g workers=2 |
|
89 | 96 | workers?=1 |
|
90 | 97 | |
|
91 | 98 | .PHONY: dev-srv |
|
92 | 99 | ## run gunicorn web server with reloader, use workers=N to set multiworker mode |
|
93 | 100 | dev-srv: |
|
94 | 101 | gunicorn --paste=.dev/dev.ini --bind=0.0.0.0:10010 --config=.dev/gunicorn_config.py --reload --workers=$(workers) |
|
95 | 102 | |
|
96 | 103 | |
|
97 | 104 | # Default command on calling make |
|
98 | 105 | .DEFAULT_GOAL := show-help |
|
99 | 106 | |
|
100 | 107 | .PHONY: show-help |
|
101 | 108 | show-help: |
|
102 | 109 | @echo "$$(tput bold)Available rules:$$(tput sgr0)" |
|
103 | 110 | @echo |
|
104 | 111 | @sed -n -e "/^## / { \ |
|
105 | 112 | h; \ |
|
106 | 113 | s/.*//; \ |
|
107 | 114 | :doc" \ |
|
108 | 115 | -e "H; \ |
|
109 | 116 | n; \ |
|
110 | 117 | s/^## //; \ |
|
111 | 118 | t doc" \ |
|
112 | 119 | -e "s/:.*//; \ |
|
113 | 120 | G; \ |
|
114 | 121 | s/\\n## /---/; \ |
|
115 | 122 | s/\\n/ /g; \ |
|
116 | 123 | p; \ |
|
117 | 124 | }" ${MAKEFILE_LIST} \ |
|
118 | 125 | | LC_ALL='C' sort --ignore-case \ |
|
119 | 126 | | awk -F '---' \ |
|
120 | 127 | -v ncol=$$(tput cols) \ |
|
121 | 128 | -v indent=19 \ |
|
122 | 129 | -v col_on="$$(tput setaf 6)" \ |
|
123 | 130 | -v col_off="$$(tput sgr0)" \ |
|
124 | 131 | '{ \ |
|
125 | 132 | printf "%s%*s%s ", col_on, -indent, $$1, col_off; \ |
|
126 | 133 | n = split($$2, words, " "); \ |
|
127 | 134 | line_length = ncol - indent; \ |
|
128 | 135 | for (i = 1; i <= n; i++) { \ |
|
129 | 136 | line_length -= length(words[i]) + 1; \ |
|
130 | 137 | if (line_length <= 0) { \ |
|
131 | 138 | line_length = ncol - indent - length(words[i]) - 1; \ |
|
132 | 139 | printf "\n%*s ", -indent, " "; \ |
|
133 | 140 | } \ |
|
134 | 141 | printf "%s ", words[i]; \ |
|
135 | 142 | } \ |
|
136 | 143 | printf "\n"; \ |
|
137 | 144 | }' |
General Comments 0
You need to be logged in to leave comments.
Login now