gitlab-projects-settings 5.2.0__tar.gz → 5.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/.hooks/configurations.py +17 -10
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/.hooks/prepare_commit_msg_template.py +59 -9
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/CHANGELOG.md +13 -0
- {gitlab_projects_settings-5.2.0/gitlab_projects_settings.egg-info → gitlab_projects_settings-5.2.1}/PKG-INFO +1 -1
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1/gitlab_projects_settings.egg-info}/PKG-INFO +1 -1
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/src/features/gitlab.py +1 -1
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/src/package/bundle.py +3 -0
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/src/package/version.py +1 -1
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/.cz.yaml +0 -0
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/.gitignore +0 -0
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/.gitlab-ci.yml +0 -0
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/.hooks/manage +0 -0
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/.markdownlint.json +0 -0
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/.pre-commit-config.yaml +0 -0
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/.style.yapf +0 -0
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/.vscode/extensions.json +0 -0
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/.vscode/settings.json +0 -0
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/LICENSE +0 -0
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/README.md +0 -0
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/config/cliff.toml +0 -0
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/gitlab_projects_settings.egg-info/SOURCES.txt +0 -0
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/gitlab_projects_settings.egg-info/dependency_links.txt +0 -0
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/gitlab_projects_settings.egg-info/entry_points.txt +0 -0
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/gitlab_projects_settings.egg-info/requires.txt +0 -0
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/gitlab_projects_settings.egg-info/top_level.txt +0 -0
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/mypy.ini +0 -0
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/requirements/build.txt +0 -0
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/requirements/deploy.txt +0 -0
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/requirements/quality.txt +0 -0
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/requirements/runtime.txt +0 -0
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/setup.cfg +0 -0
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/setup.py +0 -0
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/src/__init__.py +0 -0
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/src/__main__.py +0 -0
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/src/cli/__init__.py +0 -0
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/src/cli/entrypoint.py +0 -0
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/src/cli/main.py +0 -0
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/src/features/__init__.py +0 -0
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/src/package/__init__.py +0 -0
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/src/package/settings.py +0 -0
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/src/package/updates.py +0 -0
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/src/prints/__init__.py +0 -0
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/src/prints/boxes.py +0 -0
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/src/prints/colors.py +0 -0
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/src/prints/themes.py +0 -0
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/src/system/__init__.py +0 -0
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/src/system/platform.py +0 -0
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/src/types/__init__.py +0 -0
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/src/types/environments.py +0 -0
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/src/types/gitlab.py +0 -0
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/src/types/namespaces.py +0 -0
- {gitlab_projects_settings-5.2.0 → gitlab_projects_settings-5.2.1}/src/types/strings.py +0 -0
|
@@ -9,7 +9,7 @@ ChangesRegex = str
|
|
|
9
9
|
# Changes parsers class
|
|
10
10
|
class ChangesParsers(NamedTuple):
|
|
11
11
|
match: str
|
|
12
|
-
|
|
12
|
+
groups: List[int]
|
|
13
13
|
commit_type: str
|
|
14
14
|
|
|
15
15
|
# Changes evaluator class
|
|
@@ -43,6 +43,12 @@ COMMITS_DEFAULT_TYPE: str = 'type'
|
|
|
43
43
|
# Commits footers constants
|
|
44
44
|
COMMITS_FOOTER_SIGNOFF: str = 'Signed-off-by: '
|
|
45
45
|
|
|
46
|
+
# Regex constants
|
|
47
|
+
REGEX_EXT: str = r'[^/.]*'
|
|
48
|
+
REGEX_FOLDER: str = r'[^/]+'
|
|
49
|
+
REGEX_STEM: str = r'[^/]+'
|
|
50
|
+
REGEX_STEM_VISIBLE: str = r'[^/_\.]{1}[^/]+'
|
|
51
|
+
|
|
46
52
|
# Changes evaluators constants
|
|
47
53
|
CHANGES_EVALUATORS: List[ChangesEvaluator] = [
|
|
48
54
|
# Sources
|
|
@@ -52,8 +58,9 @@ CHANGES_EVALUATORS: List[ChangesEvaluator] = [
|
|
|
52
58
|
],
|
|
53
59
|
parsers=[
|
|
54
60
|
ChangesParsers(
|
|
55
|
-
match=
|
|
56
|
-
|
|
61
|
+
match=
|
|
62
|
+
fr'(({REGEX_FOLDER})/)?(({REGEX_FOLDER})/)?({REGEX_STEM_VISIBLE})\.{REGEX_EXT}$',
|
|
63
|
+
groups=[5, 4, 2],
|
|
57
64
|
commit_type='fix',
|
|
58
65
|
),
|
|
59
66
|
],
|
|
@@ -61,17 +68,17 @@ CHANGES_EVALUATORS: List[ChangesEvaluator] = [
|
|
|
61
68
|
# Yocto
|
|
62
69
|
ChangesEvaluator(
|
|
63
70
|
changes=[
|
|
64
|
-
|
|
71
|
+
fr'conf/(distro|machine)|recipes-{REGEX_STEM}',
|
|
65
72
|
],
|
|
66
73
|
parsers=[
|
|
67
74
|
ChangesParsers(
|
|
68
|
-
match=
|
|
69
|
-
|
|
75
|
+
match=fr'conf/(distro|machine)/{REGEX_STEM}.conf$',
|
|
76
|
+
groups=[1],
|
|
70
77
|
commit_type='fix',
|
|
71
78
|
),
|
|
72
79
|
ChangesParsers(
|
|
73
|
-
match=
|
|
74
|
-
|
|
80
|
+
match=fr'({REGEX_STEM})/{REGEX_STEM}\.(bb[^/.]*|inc)$',
|
|
81
|
+
groups=[1],
|
|
75
82
|
commit_type='fix',
|
|
76
83
|
),
|
|
77
84
|
],
|
|
@@ -93,12 +100,12 @@ CHANGES_MATCHERS: List[ChangesMatcher] = [
|
|
|
93
100
|
],
|
|
94
101
|
),
|
|
95
102
|
ChangesMatcher(
|
|
96
|
-
commit_scope='
|
|
103
|
+
commit_scope='hooks',
|
|
97
104
|
types=[
|
|
98
105
|
ChangesType(
|
|
99
106
|
commit_type='chore',
|
|
100
107
|
changes=[
|
|
101
|
-
r'
|
|
108
|
+
r'^\.hooks',
|
|
102
109
|
],
|
|
103
110
|
),
|
|
104
111
|
],
|
|
@@ -6,7 +6,7 @@ from pathlib import Path
|
|
|
6
6
|
from re import match, search
|
|
7
7
|
import sys
|
|
8
8
|
from sys import argv, exit as sys_exit, path
|
|
9
|
-
from typing import List, Optional, Tuple
|
|
9
|
+
from typing import List, NamedTuple, Optional, Tuple
|
|
10
10
|
|
|
11
11
|
# Bind sources
|
|
12
12
|
sys.dont_write_bytecode = True
|
|
@@ -74,29 +74,79 @@ def parse_commit_input(filepath: str) -> Tuple[bool, bool, str, List[str]]:
|
|
|
74
74
|
# Result
|
|
75
75
|
return empty, signoff, linesep.join(context), changes
|
|
76
76
|
|
|
77
|
-
# Prepare commit title, pylint: disable=too-many-nested-blocks
|
|
77
|
+
# Prepare commit title, pylint: disable=too-many-branches,too-many-locals,too-many-nested-blocks
|
|
78
78
|
def prepare_commit_title(changes: List[str]) -> Tuple[str, str]:
|
|
79
79
|
|
|
80
|
+
# Types
|
|
81
|
+
Result = NamedTuple('Result', [
|
|
82
|
+
('priority', int),
|
|
83
|
+
('level', int),
|
|
84
|
+
('commit_type', str),
|
|
85
|
+
('commit_scope', str),
|
|
86
|
+
])
|
|
87
|
+
|
|
88
|
+
# Variables
|
|
89
|
+
commit_scope: str = COMMITS_DEFAULT_SCOPE
|
|
90
|
+
commit_type: str = COMMITS_DEFAULT_TYPE
|
|
91
|
+
level: int
|
|
92
|
+
levels: List[int]
|
|
93
|
+
priority: int = 0
|
|
94
|
+
results: List[Result] = []
|
|
95
|
+
|
|
80
96
|
# Evaluate common changes
|
|
81
97
|
for changes_evaluator in CHANGES_EVALUATORS:
|
|
98
|
+
priority += 1
|
|
82
99
|
for type_change in changes_evaluator.changes:
|
|
83
100
|
for change in changes:
|
|
84
|
-
if search(type_change, change):
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
101
|
+
if not search(type_change, change):
|
|
102
|
+
continue
|
|
103
|
+
for parser in changes_evaluator.parsers:
|
|
104
|
+
matches = search(parser.match, change)
|
|
105
|
+
if not matches or not isinstance(matches.lastindex, int):
|
|
106
|
+
continue
|
|
107
|
+
level = 0
|
|
108
|
+
for group in parser.groups:
|
|
109
|
+
level += 1
|
|
110
|
+
if matches.lastindex >= group:
|
|
111
|
+
results += [
|
|
112
|
+
Result(
|
|
113
|
+
priority=priority,
|
|
114
|
+
level=level,
|
|
115
|
+
commit_type=parser.commit_type,
|
|
116
|
+
commit_scope=matches.group(group),
|
|
117
|
+
)
|
|
118
|
+
]
|
|
89
119
|
|
|
90
120
|
# Match common changes
|
|
91
121
|
for changes_matcher in CHANGES_MATCHERS:
|
|
122
|
+
priority += 1
|
|
92
123
|
for matcher_type in changes_matcher.types:
|
|
93
124
|
for type_change in matcher_type.changes:
|
|
94
125
|
for change in changes:
|
|
95
126
|
if search(type_change, change):
|
|
96
|
-
|
|
127
|
+
results += [
|
|
128
|
+
Result(
|
|
129
|
+
priority=priority,
|
|
130
|
+
level=0,
|
|
131
|
+
commit_type=matcher_type.commit_type,
|
|
132
|
+
commit_scope=changes_matcher.commit_scope,
|
|
133
|
+
)
|
|
134
|
+
]
|
|
135
|
+
|
|
136
|
+
# Parse results
|
|
137
|
+
if results:
|
|
138
|
+
priority = min((result.priority for result in results))
|
|
139
|
+
results = [result for result in set(results) if result.priority == priority]
|
|
140
|
+
levels = sorted([result.level for result in results])
|
|
141
|
+
level = min((level for level in set(levels) if levels.count(level) == 1),
|
|
142
|
+
default=levels[-1])
|
|
143
|
+
for result in [result for result in set(results) if result.level == level]:
|
|
144
|
+
commit_type = result.commit_type
|
|
145
|
+
commit_scope = result.commit_scope
|
|
146
|
+
break
|
|
97
147
|
|
|
98
148
|
# Result
|
|
99
|
-
return
|
|
149
|
+
return commit_type, commit_scope
|
|
100
150
|
|
|
101
151
|
# Prepare commit message
|
|
102
152
|
def prepare_commit_template(
|
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
<a name="5.2.1"></a>
|
|
4
|
+
## [5.2.1](https://gitlab.com/RadianDevCore/tools/gitlab-projects-settings/compare/5.2.0...5.2.1) (2024-08-16)
|
|
5
|
+
|
|
6
|
+
### 🐛 Bug Fixes
|
|
7
|
+
|
|
8
|
+
- **gitlab:** fix '--protect-tags' unknown protection level error ([f745f7e](https://gitlab.com/RadianDevCore/tools/gitlab-projects-settings/commit/f745f7e82acf831145d205c48b1dc6a42bcebefe))
|
|
9
|
+
- **package:** fix package name for 'importlib' version detection ([b5bf779](https://gitlab.com/RadianDevCore/tools/gitlab-projects-settings/commit/b5bf7799f19425fcad86381e63240cd0292044c3))
|
|
10
|
+
|
|
11
|
+
### ⚙️ Cleanups
|
|
12
|
+
|
|
13
|
+
- **hooks:** implement evaluators and matchers priority parser ([c59fa17](https://gitlab.com/RadianDevCore/tools/gitlab-projects-settings/commit/c59fa17b44d3bb1f3f2d08fd31c4adfea834ab6b))
|
|
14
|
+
|
|
15
|
+
|
|
3
16
|
<a name="5.2.0"></a>
|
|
4
17
|
## [5.2.0](https://gitlab.com/RadianDevCore/tools/gitlab-projects-settings/compare/5.1.0...5.2.0) (2024-08-15)
|
|
5
18
|
|
|
@@ -480,7 +480,7 @@ class GitLabFeature:
|
|
|
480
480
|
elif protect_level == ProtectionLevels.DEVELOPERS:
|
|
481
481
|
access_level = 30
|
|
482
482
|
else:
|
|
483
|
-
raise SyntaxError(f'Unknown protection level: {
|
|
483
|
+
raise SyntaxError(f'Unknown protection level: {protect_level}')
|
|
484
484
|
|
|
485
485
|
# Acquire protected tags
|
|
486
486
|
protectedtags = [
|
|
@@ -22,7 +22,7 @@ class Version:
|
|
|
22
22
|
# Acquire version from metadata
|
|
23
23
|
try:
|
|
24
24
|
from importlib import metadata # pylint: disable=import-outside-toplevel
|
|
25
|
-
return metadata.version(Bundle.
|
|
25
|
+
return metadata.version(Bundle.PACKAGE)
|
|
26
26
|
except Exception: # pylint: disable=broad-exception-caught # pragma: no cover
|
|
27
27
|
pass
|
|
28
28
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|