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