Show More
@@ -1,130 +1,130 b'' | |||||
1 | .DEFAULT_GOAL := help |
|
1 | .DEFAULT_GOAL := help | |
2 |
|
2 | |||
3 | # Pretty print values cf. https://misc.flogisoft.com/bash/tip_colors_and_formatting |
|
3 | # Pretty print values cf. https://misc.flogisoft.com/bash/tip_colors_and_formatting | |
4 | RESET := \033[0m # Reset all formatting |
|
4 | RESET := \033[0m # Reset all formatting | |
5 | GREEN := \033[0;32m # Resets before setting 16b colour (32 -- green) |
|
5 | GREEN := \033[0;32m # Resets before setting 16b colour (32 -- green) | |
6 | YELLOW := \033[0;33m |
|
6 | YELLOW := \033[0;33m | |
7 | ORANGE := \033[0;38;5;208m # Reset then set 256b colour (208 -- orange) |
|
7 | ORANGE := \033[0;38;5;208m # Reset then set 256b colour (208 -- orange) | |
8 | PEACH := \033[0;38;5;216m |
|
8 | PEACH := \033[0;38;5;216m | |
9 |
|
9 | |||
10 |
|
10 | |||
11 | ## ---------------------------------------------------------------------------------- ## |
|
11 | ## ---------------------------------------------------------------------------------- ## | |
12 | ## ------------------------- Help usage builder ------------------------------------- ## |
|
12 | ## ------------------------- Help usage builder ------------------------------------- ## | |
13 | ## ---------------------------------------------------------------------------------- ## |
|
13 | ## ---------------------------------------------------------------------------------- ## | |
14 | # use '# >>> Build commands' to create section |
|
14 | # use '# >>> Build commands' to create section | |
15 | # use '# target: target description' to create help for target |
|
15 | # use '# target: target description' to create help for target | |
16 | .PHONY: help |
|
16 | .PHONY: help | |
17 | help: |
|
17 | help: | |
18 | @echo "Usage:" |
|
18 | @echo "Usage:" | |
19 | @cat $(MAKEFILE_LIST) | grep -E '^# >>>|^# [A-Za-z0-9_.-]+:' | sed -E 's/^# //' | awk ' \ |
|
19 | @cat $(MAKEFILE_LIST) | grep -E '^# >>>|^# [A-Za-z0-9_.-]+:' | sed -E 's/^# //' | awk ' \ | |
20 | BEGIN { \ |
|
20 | BEGIN { \ | |
21 | green="\033[32m"; \ |
|
21 | green="\033[32m"; \ | |
22 | yellow="\033[33m"; \ |
|
22 | yellow="\033[33m"; \ | |
23 | reset="\033[0m"; \ |
|
23 | reset="\033[0m"; \ | |
24 | section=""; \ |
|
24 | section=""; \ | |
25 | } \ |
|
25 | } \ | |
26 | /^>>>/ { \ |
|
26 | /^>>>/ { \ | |
27 | section=substr($$0, 5); \ |
|
27 | section=substr($$0, 5); \ | |
28 | printf "\n" green ">>> %s" reset "\n", section; \ |
|
28 | printf "\n" green ">>> %s" reset "\n", section; \ | |
29 | next; \ |
|
29 | next; \ | |
30 | } \ |
|
30 | } \ | |
31 | /^([A-Za-z0-9_.-]+):/ { \ |
|
31 | /^([A-Za-z0-9_.-]+):/ { \ | |
32 | target=$$1; \ |
|
32 | target=$$1; \ | |
33 | gsub(/:$$/, "", target); \ |
|
33 | gsub(/:$$/, "", target); \ | |
34 | description=substr($$0, index($$0, ":") + 2); \ |
|
34 | description=substr($$0, index($$0, ":") + 2); \ | |
35 | if (description == "") { description="-"; } \ |
|
35 | if (description == "") { description="-"; } \ | |
36 | printf " - " yellow "%-35s" reset " %s\n", target, description; \ |
|
36 | printf " - " yellow "%-35s" reset " %s\n", target, description; \ | |
37 | } \ |
|
37 | } \ | |
38 | ' |
|
38 | ' | |
39 |
|
39 | |||
40 | # required for pushd to work.. |
|
40 | # required for pushd to work.. | |
41 | SHELL = /bin/bash |
|
41 | SHELL = /bin/bash | |
42 |
|
42 | |||
43 | # >>> Tests commands |
|
43 | # >>> Tests commands | |
44 |
|
44 | |||
45 | .PHONY: clean |
|
45 | .PHONY: clean | |
46 | # clean: Cleanup compiled and cache py files |
|
46 | # clean: Cleanup compiled and cache py files | |
47 | clean: |
|
47 | clean: | |
48 | make test-clean |
|
48 | make test-clean | |
49 | find . -type f \( -iname '*.c' -o -iname '*.pyc' -o -iname '*.so' -o -iname '*.orig' \) -exec rm '{}' ';' |
|
49 | find . -type f \( -iname '*.c' -o -iname '*.pyc' -o -iname '*.so' -o -iname '*.orig' \) -exec rm '{}' ';' | |
50 | find . -type d -name "build" -prune -exec rm -rf '{}' ';' |
|
50 | find . -type d -name "build" -prune -exec rm -rf '{}' ';' | |
51 |
|
51 | |||
52 |
|
52 | |||
53 | .PHONY: test |
|
53 | .PHONY: test | |
54 | # test: run test-clean and tests |
|
54 | # test: run test-clean and tests | |
55 | test: |
|
55 | test: | |
56 | make test-clean |
|
56 | make test-clean | |
57 | unset RC_SQLALCHEMY_DB1_URL && unset RC_DB_URL && make test-only |
|
57 | make test-only | |
58 |
|
58 | |||
59 |
|
59 | |||
60 | .PHONY: test-clean |
|
60 | .PHONY: test-clean | |
61 | # test-clean: run test-clean and tests |
|
61 | # test-clean: run test-clean and tests | |
62 | test-clean: |
|
62 | test-clean: | |
63 | rm -rf coverage.xml htmlcov junit.xml pylint.log result |
|
63 | rm -rf coverage.xml htmlcov junit.xml pylint.log result | |
64 | find . -type d -name "__pycache__" -prune -exec rm -rf '{}' ';' |
|
64 | find . -type d -name "__pycache__" -prune -exec rm -rf '{}' ';' | |
65 | find . -type f \( -iname '.coverage.*' \) -exec rm '{}' ';' |
|
65 | find . -type f \( -iname '.coverage.*' \) -exec rm '{}' ';' | |
66 |
|
66 | |||
67 |
|
67 | |||
68 | .PHONY: test-only |
|
68 | .PHONY: test-only | |
69 | # test-only: Run tests only without cleanup |
|
69 | # test-only: Run tests only without cleanup | |
70 | test-only: |
|
70 | test-only: | |
71 | PYTHONHASHSEED=random \ |
|
71 | PYTHONHASHSEED=random \ | |
72 | py.test -x -vv -r xw -p no:sugar \ |
|
72 | py.test -x -vv -r xw -p no:sugar \ | |
73 | --cov-report=term-missing --cov-report=html \ |
|
73 | --cov-report=term-missing --cov-report=html \ | |
74 | --cov=vcsserver vcsserver |
|
74 | --cov=vcsserver vcsserver | |
75 |
|
75 | |||
76 | # >>> Dev commands |
|
76 | # >>> Dev commands | |
77 |
|
77 | |||
78 |
|
78 | |||
79 |
|
79 | |||
80 | .PHONY: dev-sh |
|
80 | .PHONY: dev-sh | |
81 | # dev-sh: make dev-sh |
|
81 | # dev-sh: make dev-sh | |
82 | dev-sh: |
|
82 | dev-sh: | |
83 | sudo echo "deb [trusted=yes] https://apt.fury.io/rsteube/ /" | sudo tee -a "/etc/apt/sources.list.d/fury.list" |
|
83 | sudo echo "deb [trusted=yes] https://apt.fury.io/rsteube/ /" | sudo tee -a "/etc/apt/sources.list.d/fury.list" | |
84 | sudo apt-get update |
|
84 | sudo apt-get update | |
85 | sudo apt-get install -y zsh carapace-bin |
|
85 | sudo apt-get install -y zsh carapace-bin | |
86 | rm -rf /home/rhodecode/.oh-my-zsh |
|
86 | rm -rf /home/rhodecode/.oh-my-zsh | |
87 | curl https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh |
|
87 | curl https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh | |
88 | @echo "source <(carapace _carapace)" > /home/rhodecode/.zsrc |
|
88 | @echo "source <(carapace _carapace)" > /home/rhodecode/.zsrc | |
89 | @echo "${RC_DEV_CMD_HELP}" |
|
89 | @echo "${RC_DEV_CMD_HELP}" | |
90 | @PROMPT='%(?.%F{green}√.%F{red}?%?)%f %B%F{240}%1~%f%b %# ' zsh |
|
90 | @PROMPT='%(?.%F{green}√.%F{red}?%?)%f %B%F{240}%1~%f%b %# ' zsh | |
91 |
|
91 | |||
92 |
|
92 | |||
93 | .PHONY: dev-cleanup |
|
93 | .PHONY: dev-cleanup | |
94 | # dev-cleanup: Cleanup: pip freeze | grep -v "^-e" | grep -v "@" | xargs pip uninstall -y |
|
94 | # dev-cleanup: Cleanup: pip freeze | grep -v "^-e" | grep -v "@" | xargs pip uninstall -y | |
95 | dev-cleanup: |
|
95 | dev-cleanup: | |
96 | pip freeze | grep -v "^-e" | grep -v "@" | xargs pip uninstall -y |
|
96 | pip freeze | grep -v "^-e" | grep -v "@" | xargs pip uninstall -y | |
97 | rm -rf /tmp/* |
|
97 | rm -rf /tmp/* | |
98 |
|
98 | |||
99 |
|
99 | |||
100 | .PHONY: dev-env |
|
100 | .PHONY: dev-env | |
101 | # dev-env: make dev-env based on the requirements files and install develop of packages |
|
101 | # dev-env: make dev-env based on the requirements files and install develop of packages | |
102 | ## Cleanup: pip freeze | grep -v "^-e" | grep -v "@" | xargs pip uninstall -y |
|
102 | ## Cleanup: pip freeze | grep -v "^-e" | grep -v "@" | xargs pip uninstall -y | |
103 | dev-env: |
|
103 | dev-env: | |
104 | sudo -u root chown rhodecode:rhodecode /home/rhodecode/.cache/pip/ |
|
104 | sudo -u root chown rhodecode:rhodecode /home/rhodecode/.cache/pip/ | |
105 | pip install build virtualenv |
|
105 | pip install build virtualenv | |
106 | pip wheel --wheel-dir=/home/rhodecode/.cache/pip/wheels -r requirements.txt -r requirements_test.txt -r requirements_debug.txt |
|
106 | pip wheel --wheel-dir=/home/rhodecode/.cache/pip/wheels -r requirements.txt -r requirements_test.txt -r requirements_debug.txt | |
107 | pip install --no-index --find-links=/home/rhodecode/.cache/pip/wheels -r requirements.txt -r requirements_test.txt -r requirements_debug.txt |
|
107 | pip install --no-index --find-links=/home/rhodecode/.cache/pip/wheels -r requirements.txt -r requirements_test.txt -r requirements_debug.txt | |
108 | pip install -e . |
|
108 | pip install -e . | |
109 |
|
109 | |||
110 |
|
110 | |||
111 | .PHONY: sh |
|
111 | .PHONY: sh | |
112 | # sh: shortcut for make dev-sh dev-env |
|
112 | # sh: shortcut for make dev-sh dev-env | |
113 | sh: |
|
113 | sh: | |
114 | make dev-env |
|
114 | make dev-env | |
115 | make dev-sh |
|
115 | make dev-sh | |
116 |
|
116 | |||
117 |
|
117 | |||
118 | ## Allows changes of workers e.g make dev-srv-g workers=2 |
|
118 | ## Allows changes of workers e.g make dev-srv-g workers=2 | |
119 | workers?=1 |
|
119 | workers?=1 | |
120 |
|
120 | |||
121 | .PHONY: dev-srv |
|
121 | .PHONY: dev-srv | |
122 | # dev-srv: run gunicorn web server with reloader, use workers=N to set multiworker mode, workers=N allows changes of workers |
|
122 | # dev-srv: run gunicorn web server with reloader, use workers=N to set multiworker mode, workers=N allows changes of workers | |
123 | dev-srv: |
|
123 | dev-srv: | |
124 | gunicorn --paste=.dev/dev.ini --bind=0.0.0.0:10010 --config=.dev/gunicorn_config.py --reload --workers=$(workers) |
|
124 | gunicorn --paste=.dev/dev.ini --bind=0.0.0.0:10010 --config=.dev/gunicorn_config.py --reload --workers=$(workers) | |
125 |
|
125 | |||
126 | .PHONY: ruff-check |
|
126 | .PHONY: ruff-check | |
127 | # ruff-check: run a ruff analysis |
|
127 | # ruff-check: run a ruff analysis | |
128 | ruff-check: |
|
128 | ruff-check: | |
129 | ruff check --ignore F401 --ignore I001 --ignore E402 --ignore E501 --ignore F841 --exclude rhodecode/lib/dbmigrate --exclude .eggs --exclude .dev . |
|
129 | ruff check --ignore F401 --ignore I001 --ignore E402 --ignore E501 --ignore F841 --exclude rhodecode/lib/dbmigrate --exclude .eggs --exclude .dev . | |
130 |
|
130 |
@@ -1,94 +1,89 b'' | |||||
1 | [build-system] |
|
1 | [build-system] | |
2 | requires = ["setuptools>=61.0.0", "wheel"] |
|
2 | requires = ["setuptools>=61.0.0", "wheel"] | |
3 | build-backend = "setuptools.build_meta" |
|
3 | build-backend = "setuptools.build_meta" | |
4 |
|
4 | |||
5 | [project] |
|
5 | [project] | |
6 | name = "rhodecode-vcsserver" |
|
6 | name = "rhodecode-vcsserver" | |
7 | description = "Version Control System Server for RhodeCode" |
|
7 | description = "Version Control System Server for RhodeCode" | |
8 | authors = [ |
|
8 | authors = [ | |
9 | {name = "RhodeCode GmbH", email = "support@rhodecode.com"}, |
|
9 | {name = "RhodeCode GmbH", email = "support@rhodecode.com"}, | |
10 | ] |
|
10 | ] | |
11 |
|
11 | |||
12 | license = {text = "GPL V3"} |
|
12 | license = {text = "GPL V3"} | |
13 | requires-python = ">=3.10" |
|
13 | requires-python = ">=3.10" | |
14 | dynamic = ["version", "readme", "dependencies", "optional-dependencies"] |
|
14 | dynamic = ["version", "readme", "dependencies", "optional-dependencies"] | |
15 | classifiers = [ |
|
15 | classifiers = [ | |
16 | 'Development Status :: 6 - Mature', |
|
16 | 'Development Status :: 6 - Mature', | |
17 | 'Intended Audience :: Developers', |
|
17 | 'Intended Audience :: Developers', | |
18 | 'Operating System :: OS Independent', |
|
18 | 'Operating System :: OS Independent', | |
19 | 'Topic :: Software Development :: Version Control', |
|
19 | 'Topic :: Software Development :: Version Control', | |
20 | 'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)', |
|
20 | 'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)', | |
21 | 'Programming Language :: Python :: 3.10', |
|
21 | 'Programming Language :: Python :: 3.10', | |
22 | ] |
|
22 | ] | |
23 |
|
23 | |||
24 | [project.entry-points."paste.app_factory"] |
|
24 | [project.entry-points."paste.app_factory"] | |
25 | main = "vcsserver.http_main:main" |
|
25 | main = "vcsserver.http_main:main" | |
26 |
|
26 | |||
27 |
|
27 | |||
28 | [tool.setuptools] |
|
28 | [tool.setuptools] | |
29 | packages = ["vcsserver"] |
|
29 | packages = ["vcsserver"] | |
30 |
|
30 | |||
31 | [tool.setuptools.dynamic] |
|
31 | [tool.setuptools.dynamic] | |
32 | readme = {file = ["README.rst"], content-type = "text/rst"} |
|
32 | readme = {file = ["README.rst"], content-type = "text/rst"} | |
33 | version = {file = "vcsserver/VERSION"} |
|
33 | version = {file = "vcsserver/VERSION"} | |
34 | dependencies = {file = ["requirements.txt"]} |
|
34 | dependencies = {file = ["requirements.txt"]} | |
35 | optional-dependencies.tests = {file = ["requirements_test.txt"]} |
|
35 | optional-dependencies.tests = {file = ["requirements_test.txt"]} | |
36 |
|
36 | |||
37 | [tool.ruff] |
|
37 | [tool.ruff] | |
38 |
|
38 | lint.select = [ | ||
39 | select = [ |
|
|||
40 | # Pyflakes |
|
39 | # Pyflakes | |
41 | "F", |
|
40 | "F", | |
42 | # Pycodestyle |
|
41 | # Pycodestyle | |
43 | "E", |
|
42 | "E", | |
44 | "W", |
|
43 | "W", | |
45 | # isort |
|
44 | # isort | |
46 | "I001" |
|
45 | "I001" | |
47 | ] |
|
46 | ] | |
48 |
|
47 | lint.ignore = [ | ||
49 | ignore = [ |
|
|||
50 | "E501", # line too long, handled by black |
|
48 | "E501", # line too long, handled by black | |
51 | ] |
|
49 | ] | |
52 |
|
||||
53 | # Same as Black. |
|
50 | # Same as Black. | |
54 | line-length = 120 |
|
51 | line-length = 120 | |
55 |
|
52 | |||
56 | [tool.ruff.isort] |
|
53 | [tool.ruff.lint.isort] | |
57 |
|
||||
58 | known-first-party = ["vcsserver"] |
|
54 | known-first-party = ["vcsserver"] | |
59 |
|
55 | |||
60 | [tool.ruff.format] |
|
56 | [tool.ruff.format] | |
61 |
|
57 | |||
62 | # Like Black, use double quotes for strings. |
|
58 | # Like Black, use double quotes for strings. | |
63 | quote-style = "double" |
|
59 | quote-style = "double" | |
64 |
|
60 | |||
65 | # Like Black, indent with spaces, rather than tabs. |
|
61 | # Like Black, indent with spaces, rather than tabs. | |
66 | indent-style = "space" |
|
62 | indent-style = "space" | |
67 |
|
63 | |||
68 | # Like Black, respect magic trailing commas. |
|
64 | # Like Black, respect magic trailing commas. | |
69 | skip-magic-trailing-comma = false |
|
65 | skip-magic-trailing-comma = false | |
70 |
|
66 | |||
71 | # Like Black, automatically detect the appropriate line ending. |
|
67 | # Like Black, automatically detect the appropriate line ending. | |
72 | line-ending = "auto" |
|
68 | line-ending = "auto" | |
73 |
|
69 | |||
74 |
|
||||
75 | [tool.bumpversion] |
|
70 | [tool.bumpversion] | |
76 | current_version = "5.4.0" |
|
71 | current_version = "5.4.0" | |
77 | parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)" |
|
72 | parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)" | |
78 | serialize = ["{major}.{minor}.{patch}"] |
|
73 | serialize = ["{major}.{minor}.{patch}"] | |
79 | search = "{current_version}" |
|
74 | search = "{current_version}" | |
80 | replace = "{new_version}" |
|
75 | replace = "{new_version}" | |
81 | regex = false |
|
76 | regex = false | |
82 | ignore_missing_version = false |
|
77 | ignore_missing_version = false | |
83 | ignore_missing_files = false |
|
78 | ignore_missing_files = false | |
84 | tag = false |
|
79 | tag = false | |
85 | sign_tags = false |
|
80 | sign_tags = false | |
86 | tag_name = "v{new_version}" |
|
81 | tag_name = "v{new_version}" | |
87 | tag_message = "release(version-bump): {current_version} → {new_version}" |
|
82 | tag_message = "release(version-bump): {current_version} → {new_version}" | |
88 | allow_dirty = false |
|
83 | allow_dirty = false | |
89 | commit = false |
|
84 | commit = false | |
90 | message = "release(version-bump): {current_version} → {new_version}" |
|
85 | message = "release(version-bump): {current_version} → {new_version}" | |
91 | commit_args = "" |
|
86 | commit_args = "" | |
92 | setup_hooks = [] |
|
87 | setup_hooks = [] | |
93 | pre_commit_hooks = [] |
|
88 | pre_commit_hooks = [] | |
94 | post_commit_hooks = [] |
|
89 | post_commit_hooks = [] |
General Comments 0
You need to be logged in to leave comments.
Login now