gitlab-projects-settings 1.1.0__tar.gz → 2.0.0__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.
Files changed (42) hide show
  1. {gitlab_projects_settings-1.1.0 → gitlab_projects_settings-2.0.0}/.gitlab-ci.yml +47 -10
  2. gitlab_projects_settings-2.0.0/CHANGELOG.md +63 -0
  3. {gitlab_projects_settings-1.1.0 → gitlab_projects_settings-2.0.0}/PKG-INFO +22 -22
  4. {gitlab_projects_settings-1.1.0 → gitlab_projects_settings-2.0.0}/README.md +21 -21
  5. {gitlab_projects_settings-1.1.0 → gitlab_projects_settings-2.0.0}/gitlab_projects_settings.egg-info/PKG-INFO +22 -22
  6. gitlab_projects_settings-2.0.0/gitlab_projects_settings.egg-info/SOURCES.txt +38 -0
  7. {gitlab_projects_settings-1.1.0 → gitlab_projects_settings-2.0.0}/setup.py +15 -5
  8. {gitlab_projects_settings-1.1.0/gitlab_projects_settings → gitlab_projects_settings-2.0.0/src}/__init__.py +1 -1
  9. {gitlab_projects_settings-1.1.0/gitlab_projects_settings → gitlab_projects_settings-2.0.0/src}/__main__.py +1 -1
  10. gitlab_projects_settings-1.1.0/gitlab_projects_settings/features/settings.py → gitlab_projects_settings-2.0.0/src/cli/entrypoint.py +35 -12
  11. {gitlab_projects_settings-1.1.0/gitlab_projects_settings → gitlab_projects_settings-2.0.0/src}/cli/main.py +8 -5
  12. {gitlab_projects_settings-1.1.0/gitlab_projects_settings → gitlab_projects_settings-2.0.0/src}/features/gitlab.py +25 -20
  13. gitlab_projects_settings-1.1.0/CHANGELOG.md +0 -28
  14. gitlab_projects_settings-1.1.0/gitlab_projects_settings.egg-info/SOURCES.txt +0 -38
  15. {gitlab_projects_settings-1.1.0 → gitlab_projects_settings-2.0.0}/.chglog/CHANGELOG.tpl.md +0 -0
  16. {gitlab_projects_settings-1.1.0 → gitlab_projects_settings-2.0.0}/.chglog/changelog.sh +0 -0
  17. {gitlab_projects_settings-1.1.0 → gitlab_projects_settings-2.0.0}/.chglog/config.yml +0 -0
  18. {gitlab_projects_settings-1.1.0 → gitlab_projects_settings-2.0.0}/.gitignore +0 -0
  19. {gitlab_projects_settings-1.1.0 → gitlab_projects_settings-2.0.0}/.markdownlint.json +0 -0
  20. {gitlab_projects_settings-1.1.0 → gitlab_projects_settings-2.0.0}/.style.yapf +0 -0
  21. {gitlab_projects_settings-1.1.0 → gitlab_projects_settings-2.0.0}/.vscode/extensions.json +0 -0
  22. {gitlab_projects_settings-1.1.0 → gitlab_projects_settings-2.0.0}/.vscode/settings.json +0 -0
  23. {gitlab_projects_settings-1.1.0 → gitlab_projects_settings-2.0.0}/LICENSE +0 -0
  24. {gitlab_projects_settings-1.1.0 → gitlab_projects_settings-2.0.0}/gitlab_projects_settings.egg-info/dependency_links.txt +0 -0
  25. {gitlab_projects_settings-1.1.0 → gitlab_projects_settings-2.0.0}/gitlab_projects_settings.egg-info/entry_points.txt +0 -0
  26. {gitlab_projects_settings-1.1.0 → gitlab_projects_settings-2.0.0}/gitlab_projects_settings.egg-info/requires.txt +0 -0
  27. {gitlab_projects_settings-1.1.0 → gitlab_projects_settings-2.0.0}/gitlab_projects_settings.egg-info/top_level.txt +0 -0
  28. {gitlab_projects_settings-1.1.0 → gitlab_projects_settings-2.0.0}/mypy.ini +0 -0
  29. {gitlab_projects_settings-1.1.0 → gitlab_projects_settings-2.0.0}/requirements/build.txt +0 -0
  30. {gitlab_projects_settings-1.1.0 → gitlab_projects_settings-2.0.0}/requirements/deploy.txt +0 -0
  31. {gitlab_projects_settings-1.1.0 → gitlab_projects_settings-2.0.0}/requirements/quality.txt +0 -0
  32. {gitlab_projects_settings-1.1.0 → gitlab_projects_settings-2.0.0}/requirements/runtime.txt +0 -0
  33. {gitlab_projects_settings-1.1.0 → gitlab_projects_settings-2.0.0}/setup.cfg +0 -0
  34. {gitlab_projects_settings-1.1.0/gitlab_projects_settings → gitlab_projects_settings-2.0.0/src}/cli/__init__.py +0 -0
  35. {gitlab_projects_settings-1.1.0/gitlab_projects_settings → gitlab_projects_settings-2.0.0/src}/features/__init__.py +0 -0
  36. {gitlab_projects_settings-1.1.0/gitlab_projects_settings → gitlab_projects_settings-2.0.0/src}/package/__init__.py +0 -0
  37. {gitlab_projects_settings-1.1.0/gitlab_projects_settings → gitlab_projects_settings-2.0.0/src}/package/bundle.py +0 -0
  38. {gitlab_projects_settings-1.1.0/gitlab_projects_settings → gitlab_projects_settings-2.0.0/src}/package/version.py +0 -0
  39. {gitlab_projects_settings-1.1.0/gitlab_projects_settings → gitlab_projects_settings-2.0.0/src}/prints/__init__.py +0 -0
  40. {gitlab_projects_settings-1.1.0/gitlab_projects_settings → gitlab_projects_settings-2.0.0/src}/prints/colors.py +0 -0
  41. {gitlab_projects_settings-1.1.0/gitlab_projects_settings → gitlab_projects_settings-2.0.0/src}/system/__init__.py +0 -0
  42. {gitlab_projects_settings-1.1.0/gitlab_projects_settings → gitlab_projects_settings-2.0.0/src}/system/platform.py +0 -0
@@ -53,6 +53,43 @@ changelog:
53
53
  rules:
54
54
  - if: $CI_LOCAL
55
55
 
56
+ readme:
57
+ stage: development
58
+ image: local:silent
59
+ script:
60
+ - |
61
+ export COLUMNS=120
62
+ mkdir -p ./.tmp/
63
+ PACKAGE_NAME=$(grep '^PROJECT_NAME =' ./setup.py | cut -d"'" -f2)
64
+ {
65
+ echo ''
66
+ echo '```yaml'
67
+ alignments='[ ]\{2,\}'
68
+ argument='[[:alnum:]][[:alnum:]_-]\{0,\}'
69
+ letter='[[:alnum:]_]\{1\}'
70
+ parameter='[-]\{1,2\}[[:alnum:]][[:alnum:]_-]\{0,\}'
71
+ word='[[:alnum:]_-]\{1,\}'
72
+ "${PACKAGE_NAME}" --help \
73
+ | sed '1d; $d' \
74
+ | sed "s/^\( ${parameter} ${word}${alignments}\)/\1# /g" \
75
+ | sed "s/^\( ${parameter}${alignments}\)/\1# /g" \
76
+ | sed "s/^\( ${parameter}, ${parameter}${alignments}\)/\1# /g" \
77
+ | sed "s/^\( ${argument}${alignments}\)/\1# /g"
78
+ echo '```'
79
+ echo ''
80
+ } >./.tmp/README.help.tmp
81
+ - |
82
+ lead='^<!-- readme-help-start -->$'
83
+ tail='^<!-- readme-help-stop -->$'
84
+ sed -i "/${lead}/,/${tail}/{ /${lead}/{ p; r ./.tmp/README.help.tmp
85
+ }; /${tail}/p; d }" ./README.md | head -n 100
86
+ - rm -f ./.tmp/README.help.tmp
87
+ - |
88
+ git -c color.diff=always --no-pager diff ./README.md | grep --color=never '.' && echo ''
89
+ echo ' > README: Updated successfully'
90
+ rules:
91
+ - if: $CI_LOCAL
92
+
56
93
  # =============================================================================
57
94
  # Stage: prepare
58
95
 
@@ -60,17 +97,17 @@ codestyle:
60
97
  stage: prepare
61
98
  image: registry.gitlab.com/adriandc/gitlabci-local/gitlabci-local:codestyle
62
99
  script:
63
- - yapf -i ./gitlab_projects_settings/*.py ./gitlab_projects_settings/*/*.py ./setup.py
64
- - unify -i --quote "'" ./gitlab_projects_settings/*.py ./gitlab_projects_settings/*/*.py ./setup.py
100
+ - yapf -i ./src/*.py ./src/*/*.py ./setup.py
101
+ - unify -i --quote "'" ./src/*.py ./src/*/*.py ./setup.py
65
102
  - echo '' && git diff --name-status
66
103
  - git diff --quiet
67
104
  rules:
68
105
  - if: $CI_COMMIT_REF_NAME == "develop"
69
106
  changes:
70
107
  - 'CHANGELOG.md'
71
- - 'gitlab_projects_settings/**/*'
72
108
  - 'requirements/**/*'
73
109
  - 'setup.py'
110
+ - 'src/**/*'
74
111
  - if: $CI_COMMIT_TAG || $CI_PIPELINE_SOURCE == "trigger" || $CI_PIPELINE_SOURCE == "web" || $CI_COMMIT_REF_NAME != "develop"
75
112
  when: on_success
76
113
  allow_failure: true
@@ -83,15 +120,15 @@ lint:
83
120
  before_script:
84
121
  - pip3 install -q -r ./requirements/runtime.txt --upgrade
85
122
  script:
86
- - pylint --errors-only ./gitlab_projects_settings/ ./setup.py
87
- - pylint --disable=missing-docstring --load-plugins=pylint.extensions.no_self_use ./gitlab_projects_settings/ ./setup.py
123
+ - pylint --errors-only ./src/ ./setup.py
124
+ - pylint --disable=missing-docstring --load-plugins=pylint.extensions.no_self_use ./src/ ./setup.py
88
125
  rules:
89
126
  - if: $CI_COMMIT_REF_NAME == "develop"
90
127
  changes:
91
128
  - 'CHANGELOG.md'
92
- - 'gitlab_projects_settings/**/*'
93
129
  - 'requirements/**/*'
94
130
  - 'setup.py'
131
+ - 'src/**/*'
95
132
  - if: $CI_COMMIT_TAG || $CI_PIPELINE_SOURCE == "trigger" || $CI_PIPELINE_SOURCE == "web" || $CI_COMMIT_REF_NAME != "develop"
96
133
  when: on_success
97
134
  allow_failure: true
@@ -106,17 +143,17 @@ typings:
106
143
  - set +x
107
144
  - |
108
145
  if [ $(git rev-list --count HEAD) -gt 1 ]; then
109
- mypy --follow-imports silent --pretty $(git diff --name-only $(git diff --exit-code >/dev/null && echo 'HEAD^' || echo 'HEAD') ./gitlab_projects_settings/ ./setup.py) 2>/dev/null || true
146
+ mypy --follow-imports silent --pretty $(git diff --name-only $(git diff --exit-code >/dev/null && echo 'HEAD^' || echo 'HEAD') ./src/ ./setup.py) 2>/dev/null || true
110
147
  fi
111
148
  - sleep 1
112
- - mypy --follow-imports silent --pretty ./gitlab_projects_settings/ ./setup.py
149
+ - mypy --follow-imports silent --pretty ./src/ ./setup.py
113
150
  rules:
114
151
  - if: $CI_COMMIT_REF_NAME == "develop"
115
152
  changes:
116
153
  - 'CHANGELOG.md'
117
- - 'gitlab_projects_settings/**/*'
118
154
  - 'requirements/**/*'
119
155
  - 'setup.py'
156
+ - 'src/**/*'
120
157
  - if: $CI_COMMIT_TAG || $CI_PIPELINE_SOURCE == "trigger" || $CI_PIPELINE_SOURCE == "web" || $CI_COMMIT_REF_NAME != "develop"
121
158
  when: on_success
122
159
  allow_failure: true
@@ -137,8 +174,8 @@ build:
137
174
  - if: $CI_COMMIT_REF_NAME == "develop"
138
175
  changes:
139
176
  - 'CHANGELOG.md'
140
- - 'gitlab_projects_settings/**/*'
141
177
  - 'requirements/**/*'
178
+ - 'src/**/*'
142
179
  - if: $CI_COMMIT_TAG || $CI_PIPELINE_SOURCE == "trigger" || $CI_PIPELINE_SOURCE == "web" || $CI_COMMIT_REF_NAME != "develop"
143
180
  when: on_success
144
181
  artifacts:
@@ -0,0 +1,63 @@
1
+
2
+ <a name="2.0.0"></a>
3
+ ## [2.0.0](https://gitlab.com/AdrianDC/gitlab-projects-settings/compare/1.1.0...2.0.0) (2024-04-27)
4
+
5
+ ### Bug Fixes
6
+
7
+ * **gitlab:** enforce '--dry-run' usage and improve Python codestyle
8
+ * **settings:** apply 'subgroup' feature to subgroup groups
9
+
10
+ ### Ci
11
+
12
+ * **gitlab-ci:** implement 'readme' local job to update README details
13
+
14
+ ### Cleanups
15
+
16
+ * **gitlab:** minor Python codestyle improvements
17
+ * **settings:** minor Python codestyle improvements
18
+ * **src:** ignore 'import-error' over '__init__' and '__main__'
19
+
20
+ ### Code Refactoring
21
+
22
+ * **entrypoint:** minor Python codestyle improvements
23
+ * **src:** isolate all sources under 'src/'
24
+
25
+ ### Documentation
26
+
27
+ * **readme:** regenerate '--help' details in 'README.md'
28
+
29
+ ### Features
30
+
31
+ * **cli:** isolate 'features/settings.py' to 'cli/entrypoint.py'
32
+ * **main:** align 'RawTextHelpFormatter' to 30 chars columns
33
+ * **main:** change '--set-description' metavar to 'TEXT'
34
+ * **settings:** change project/group descriptions color
35
+
36
+
37
+ <a name="1.1.0"></a>
38
+ ## [1.1.0](https://gitlab.com/AdrianDC/gitlab-projects-settings/compare/1.0.1...1.1.0) (2024-04-25)
39
+
40
+ ### Code Refactoring
41
+
42
+ * **settings:** minor functions codestyle improvement
43
+
44
+ ### Features
45
+
46
+ * **main:** rename '--avoid-*' parameters to '--exclude-*'
47
+
48
+
49
+ <a name="1.0.1"></a>
50
+ ## [1.0.1](https://gitlab.com/AdrianDC/gitlab-projects-settings/compare/1.0.0...1.0.1) (2024-04-24)
51
+
52
+ ### Documentation
53
+
54
+ * **setup:** fix PyPI 'gitlab-projects-settings' documentation
55
+
56
+
57
+ <a name="1.0.0"></a>
58
+ ## 1.0.0 (2024-04-24)
59
+
60
+ ### Features
61
+
62
+ * **gitlab-projects-settings:** initial sources implementation
63
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: gitlab-projects-settings
3
- Version: 1.1.0
3
+ Version: 2.0.0
4
4
  Summary: Configure GitLab groups and projects settings automatically
5
5
  Home-page: https://gitlab.com/AdrianDC/gitlab-projects-settings
6
6
  Author: Adrian DC
@@ -55,47 +55,47 @@ for example protecting tags and branches, or setting a new avatar recursively.
55
55
  ## Usage
56
56
 
57
57
  <!-- prettier-ignore-start -->
58
+ <!-- readme-help-start -->
58
59
 
59
60
  ```yaml
60
- usage: gitlab-projects-settings [-h] [--version] [-t TOKEN] [--dry-run] [--exclude-group]
61
- [--exclude-subgroups] [--exclude-projects] [--reset-features]
62
- [--reset-members] [--set-avatar FILE] [--set-description TEXT]
63
- [--update-description] [--protect-branches]
61
+ usage: gitlab-projects-settings [-h] [--version] [-t TOKEN] [--dry-run] [--exclude-group] [--exclude-subgroups]
62
+ [--exclude-projects] [--reset-features] [--reset-members] [--set-avatar FILE]
63
+ [--set-description TEXT] [--update-description] [--protect-branches]
64
64
  [--protect-tags LEVEL]
65
65
  [gitlab] [path]
66
66
 
67
67
  gitlab-projects-settings: Configure GitLab groups and projects settings automatically
68
68
 
69
69
  internal arguments:
70
- -h, --help # Show this help message
71
- --version # Show the current version
70
+ -h, --help # Show this help message
71
+ --version # Show the current version
72
72
 
73
73
  credentials arguments:
74
- -t TOKEN # GitLab API token (default: GITLAB_TOKEN environment)
74
+ -t TOKEN # GitLab API token (default: GITLAB_TOKEN environment)
75
75
 
76
76
  common settings arguments:
77
- --dry-run # Enable dry run mode to check without saving
78
- --exclude-group # Exclude parent group settings
79
- --exclude-subgroups # Exclude children subgroups settings
80
- --exclude-projects # Exclude children projects settings
77
+ --dry-run # Enable dry run mode to check without saving
78
+ --exclude-group # Exclude parent group settings
79
+ --exclude-subgroups # Exclude children subgroups settings
80
+ --exclude-projects # Exclude children projects settings
81
81
 
82
82
  general settings arguments:
83
- --reset-features # Reset features of GitLab projects based on usage
84
- --reset-members # Reset members of GitLab projects and groups
85
- --set-avatar FILE # Set avatar of GitLab projects and groups
86
- --set-description TEXT
87
- # Set description of GitLab projects and groups
88
- --update-description # Update description of GitLab projects and groups automatically
83
+ --reset-features # Reset features of GitLab projects based on usage
84
+ --reset-members # Reset members of GitLab projects and groups
85
+ --set-avatar FILE # Set avatar of GitLab projects and groups
86
+ --set-description TEXT # Set description of GitLab projects and groups
87
+ --update-description # Update description of GitLab projects and groups automatically
89
88
 
90
89
  repository settings arguments:
91
- --protect-branches # Protect branches with default master/main, develop and staging
92
- --protect-tags LEVEL # Protect tags at level [no-one,admins,maintainers,developers]
90
+ --protect-branches # Protect branches with default master/main, develop and staging
91
+ --protect-tags LEVEL # Protect tags at level [no-one,admins,maintainers,developers]
93
92
 
94
93
  positional arguments:
95
- gitlab # GitLab URL (default: https://gitlab.com)
96
- path # GitLab group or project path
94
+ gitlab # GitLab URL (default: https://gitlab.com)
95
+ path # GitLab group or project path
97
96
  ```
98
97
 
98
+ <!-- readme-help-stop -->
99
99
  <!-- prettier-ignore-end -->
100
100
 
101
101
  ---
@@ -21,47 +21,47 @@ for example protecting tags and branches, or setting a new avatar recursively.
21
21
  ## Usage
22
22
 
23
23
  <!-- prettier-ignore-start -->
24
+ <!-- readme-help-start -->
24
25
 
25
26
  ```yaml
26
- usage: gitlab-projects-settings [-h] [--version] [-t TOKEN] [--dry-run] [--exclude-group]
27
- [--exclude-subgroups] [--exclude-projects] [--reset-features]
28
- [--reset-members] [--set-avatar FILE] [--set-description TEXT]
29
- [--update-description] [--protect-branches]
27
+ usage: gitlab-projects-settings [-h] [--version] [-t TOKEN] [--dry-run] [--exclude-group] [--exclude-subgroups]
28
+ [--exclude-projects] [--reset-features] [--reset-members] [--set-avatar FILE]
29
+ [--set-description TEXT] [--update-description] [--protect-branches]
30
30
  [--protect-tags LEVEL]
31
31
  [gitlab] [path]
32
32
 
33
33
  gitlab-projects-settings: Configure GitLab groups and projects settings automatically
34
34
 
35
35
  internal arguments:
36
- -h, --help # Show this help message
37
- --version # Show the current version
36
+ -h, --help # Show this help message
37
+ --version # Show the current version
38
38
 
39
39
  credentials arguments:
40
- -t TOKEN # GitLab API token (default: GITLAB_TOKEN environment)
40
+ -t TOKEN # GitLab API token (default: GITLAB_TOKEN environment)
41
41
 
42
42
  common settings arguments:
43
- --dry-run # Enable dry run mode to check without saving
44
- --exclude-group # Exclude parent group settings
45
- --exclude-subgroups # Exclude children subgroups settings
46
- --exclude-projects # Exclude children projects settings
43
+ --dry-run # Enable dry run mode to check without saving
44
+ --exclude-group # Exclude parent group settings
45
+ --exclude-subgroups # Exclude children subgroups settings
46
+ --exclude-projects # Exclude children projects settings
47
47
 
48
48
  general settings arguments:
49
- --reset-features # Reset features of GitLab projects based on usage
50
- --reset-members # Reset members of GitLab projects and groups
51
- --set-avatar FILE # Set avatar of GitLab projects and groups
52
- --set-description TEXT
53
- # Set description of GitLab projects and groups
54
- --update-description # Update description of GitLab projects and groups automatically
49
+ --reset-features # Reset features of GitLab projects based on usage
50
+ --reset-members # Reset members of GitLab projects and groups
51
+ --set-avatar FILE # Set avatar of GitLab projects and groups
52
+ --set-description TEXT # Set description of GitLab projects and groups
53
+ --update-description # Update description of GitLab projects and groups automatically
55
54
 
56
55
  repository settings arguments:
57
- --protect-branches # Protect branches with default master/main, develop and staging
58
- --protect-tags LEVEL # Protect tags at level [no-one,admins,maintainers,developers]
56
+ --protect-branches # Protect branches with default master/main, develop and staging
57
+ --protect-tags LEVEL # Protect tags at level [no-one,admins,maintainers,developers]
59
58
 
60
59
  positional arguments:
61
- gitlab # GitLab URL (default: https://gitlab.com)
62
- path # GitLab group or project path
60
+ gitlab # GitLab URL (default: https://gitlab.com)
61
+ path # GitLab group or project path
63
62
  ```
64
63
 
64
+ <!-- readme-help-stop -->
65
65
  <!-- prettier-ignore-end -->
66
66
 
67
67
  ---
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: gitlab-projects-settings
3
- Version: 1.1.0
3
+ Version: 2.0.0
4
4
  Summary: Configure GitLab groups and projects settings automatically
5
5
  Home-page: https://gitlab.com/AdrianDC/gitlab-projects-settings
6
6
  Author: Adrian DC
@@ -55,47 +55,47 @@ for example protecting tags and branches, or setting a new avatar recursively.
55
55
  ## Usage
56
56
 
57
57
  <!-- prettier-ignore-start -->
58
+ <!-- readme-help-start -->
58
59
 
59
60
  ```yaml
60
- usage: gitlab-projects-settings [-h] [--version] [-t TOKEN] [--dry-run] [--exclude-group]
61
- [--exclude-subgroups] [--exclude-projects] [--reset-features]
62
- [--reset-members] [--set-avatar FILE] [--set-description TEXT]
63
- [--update-description] [--protect-branches]
61
+ usage: gitlab-projects-settings [-h] [--version] [-t TOKEN] [--dry-run] [--exclude-group] [--exclude-subgroups]
62
+ [--exclude-projects] [--reset-features] [--reset-members] [--set-avatar FILE]
63
+ [--set-description TEXT] [--update-description] [--protect-branches]
64
64
  [--protect-tags LEVEL]
65
65
  [gitlab] [path]
66
66
 
67
67
  gitlab-projects-settings: Configure GitLab groups and projects settings automatically
68
68
 
69
69
  internal arguments:
70
- -h, --help # Show this help message
71
- --version # Show the current version
70
+ -h, --help # Show this help message
71
+ --version # Show the current version
72
72
 
73
73
  credentials arguments:
74
- -t TOKEN # GitLab API token (default: GITLAB_TOKEN environment)
74
+ -t TOKEN # GitLab API token (default: GITLAB_TOKEN environment)
75
75
 
76
76
  common settings arguments:
77
- --dry-run # Enable dry run mode to check without saving
78
- --exclude-group # Exclude parent group settings
79
- --exclude-subgroups # Exclude children subgroups settings
80
- --exclude-projects # Exclude children projects settings
77
+ --dry-run # Enable dry run mode to check without saving
78
+ --exclude-group # Exclude parent group settings
79
+ --exclude-subgroups # Exclude children subgroups settings
80
+ --exclude-projects # Exclude children projects settings
81
81
 
82
82
  general settings arguments:
83
- --reset-features # Reset features of GitLab projects based on usage
84
- --reset-members # Reset members of GitLab projects and groups
85
- --set-avatar FILE # Set avatar of GitLab projects and groups
86
- --set-description TEXT
87
- # Set description of GitLab projects and groups
88
- --update-description # Update description of GitLab projects and groups automatically
83
+ --reset-features # Reset features of GitLab projects based on usage
84
+ --reset-members # Reset members of GitLab projects and groups
85
+ --set-avatar FILE # Set avatar of GitLab projects and groups
86
+ --set-description TEXT # Set description of GitLab projects and groups
87
+ --update-description # Update description of GitLab projects and groups automatically
89
88
 
90
89
  repository settings arguments:
91
- --protect-branches # Protect branches with default master/main, develop and staging
92
- --protect-tags LEVEL # Protect tags at level [no-one,admins,maintainers,developers]
90
+ --protect-branches # Protect branches with default master/main, develop and staging
91
+ --protect-tags LEVEL # Protect tags at level [no-one,admins,maintainers,developers]
93
92
 
94
93
  positional arguments:
95
- gitlab # GitLab URL (default: https://gitlab.com)
96
- path # GitLab group or project path
94
+ gitlab # GitLab URL (default: https://gitlab.com)
95
+ path # GitLab group or project path
97
96
  ```
98
97
 
98
+ <!-- readme-help-stop -->
99
99
  <!-- prettier-ignore-end -->
100
100
 
101
101
  ---
@@ -0,0 +1,38 @@
1
+ .gitignore
2
+ .gitlab-ci.yml
3
+ .markdownlint.json
4
+ .style.yapf
5
+ CHANGELOG.md
6
+ LICENSE
7
+ README.md
8
+ mypy.ini
9
+ setup.py
10
+ .chglog/CHANGELOG.tpl.md
11
+ .chglog/changelog.sh
12
+ .chglog/config.yml
13
+ .vscode/extensions.json
14
+ .vscode/settings.json
15
+ gitlab_projects_settings.egg-info/PKG-INFO
16
+ gitlab_projects_settings.egg-info/SOURCES.txt
17
+ gitlab_projects_settings.egg-info/dependency_links.txt
18
+ gitlab_projects_settings.egg-info/entry_points.txt
19
+ gitlab_projects_settings.egg-info/requires.txt
20
+ gitlab_projects_settings.egg-info/top_level.txt
21
+ requirements/build.txt
22
+ requirements/deploy.txt
23
+ requirements/quality.txt
24
+ requirements/runtime.txt
25
+ src/__init__.py
26
+ src/__main__.py
27
+ src/cli/__init__.py
28
+ src/cli/entrypoint.py
29
+ src/cli/main.py
30
+ src/features/__init__.py
31
+ src/features/gitlab.py
32
+ src/package/__init__.py
33
+ src/package/bundle.py
34
+ src/package/version.py
35
+ src/prints/__init__.py
36
+ src/prints/colors.py
37
+ src/system/__init__.py
38
+ src/system/platform.py
@@ -23,14 +23,14 @@ PROJECT_EMAIL = 'radian.dc@gmail.com'
23
23
  PROJECT_KEYWORDS = 'gitlab issues sync'
24
24
  PROJECT_NAME = 'gitlab-projects-settings'
25
25
  PROJECT_OWNER = 'AdrianDC'
26
- PROJECT_PACKAGE = 'gitlab-projects-settings'
26
+ PROJECT_PACKAGE = 'gitlab_projects_settings'
27
27
  PROJECT_SCRIPTS = [
28
28
  'gitlab-projects-settings = gitlab_projects_settings.cli.main:main',
29
29
  ]
30
30
 
31
31
  # Setup configurations
32
32
  setup(
33
- name=PROJECT_PACKAGE,
33
+ name=PROJECT_NAME,
34
34
  use_scm_version=True,
35
35
  author=PROJECT_AUTHOR,
36
36
  author_email=PROJECT_EMAIL,
@@ -42,11 +42,21 @@ setup(
42
42
  project_urls={
43
43
  'Bug Reports': f'https://gitlab.com/{PROJECT_OWNER}/{PROJECT_NAME}/-/issues',
44
44
  'Changelog': f'https://gitlab.com/{PROJECT_OWNER}/{PROJECT_NAME}/blob/main/CHANGELOG.md',
45
- 'Documentation': f'https://gitlab.com/{PROJECT_OWNER}/{PROJECT_NAME}#{PROJECT_PACKAGE}',
45
+ 'Documentation': f'https://gitlab.com/{PROJECT_OWNER}/{PROJECT_NAME}#{PROJECT_NAME}',
46
46
  'Source': f'https://gitlab.com/{PROJECT_OWNER}/{PROJECT_NAME}',
47
- 'Statistics': f'https://pypistats.org/packages/{PROJECT_PACKAGE}'
47
+ 'Statistics': f'https://pypistats.org/packages/{PROJECT_NAME}'
48
+ },
49
+ packages=[
50
+ PROJECT_PACKAGE,
51
+ ] + [
52
+ f'{PROJECT_PACKAGE}.{module}' for module in find_packages(
53
+ where='src',
54
+ exclude=['tests'],
55
+ )
56
+ ],
57
+ package_dir={
58
+ PROJECT_PACKAGE: 'src',
48
59
  },
49
- packages=find_packages(exclude=['tests']),
50
60
  setup_requires=['setuptools_scm'],
51
61
  install_requires=requirements,
52
62
  classifiers=[
@@ -1,4 +1,4 @@
1
- # Components
1
+ # Components, pylint: disable=import-error
2
2
  from gitlab_projects_settings.package.version import Version
3
3
 
4
4
  # Version
@@ -1,4 +1,4 @@
1
- # Components
1
+ # Components, pylint: disable=import-error
2
2
  from gitlab_projects_settings.cli.main import main
3
3
 
4
4
  # Entrypoint
@@ -12,12 +12,12 @@ from ..features.gitlab import GitLabFeature
12
12
  from ..prints.colors import Colors
13
13
  from ..system.platform import Platform
14
14
 
15
- # SettingsFeature class, pylint: disable=too-few-public-methods
16
- class SettingsFeature:
15
+ # Entrypoint class, pylint: disable=too-few-public-methods
16
+ class Entrypoint:
17
17
 
18
- # Entrypoint
18
+ # CLI
19
19
  @staticmethod
20
- def entrypoint(options: Namespace) -> bool:
20
+ def cli(options: Namespace) -> bool:
21
21
 
22
22
  # Variables
23
23
  group: Group = None
@@ -27,7 +27,11 @@ class SettingsFeature:
27
27
  print(' ')
28
28
 
29
29
  # GitLab client
30
- gitlab = GitLabFeature(options.gitlab, options.token, options.dry_run)
30
+ gitlab = GitLabFeature(
31
+ options.gitlab,
32
+ options.token,
33
+ options.dry_run,
34
+ )
31
35
  print(f'{Colors.BOLD} - GitLab host: '
32
36
  f'{Colors.GREEN}{gitlab.url}'
33
37
  f'{Colors.RESET}')
@@ -37,28 +41,38 @@ class SettingsFeature:
37
41
  try:
38
42
  group = gitlab.group(options.path)
39
43
  print(f'{Colors.BOLD} - GitLab group: '
40
- f'{Colors.GREEN}{group.full_path} ({group.description})'
44
+ f'{Colors.GREEN}{group.full_path}'
45
+ f'{Colors.CYAN} ({group.description})'
41
46
  f'{Colors.RESET}')
42
47
  print(' ')
43
48
  Platform.flush()
44
49
  except GitlabGetError:
45
50
  project = gitlab.project(options.path)
46
51
  print(f'{Colors.BOLD} - GitLab project: '
47
- f'{Colors.GREEN}{project.path_with_namespace} ({project.description})'
52
+ f'{Colors.GREEN}{project.path_with_namespace}'
53
+ f'{Colors.CYAN} ({project.description})'
48
54
  f'{Colors.RESET}')
49
55
  print(' ')
50
56
  Platform.flush()
51
57
 
52
58
  # Handle single project
53
59
  if project:
54
- SettingsFeature.project(options, gitlab, project.id)
60
+ Entrypoint.project(
61
+ options,
62
+ gitlab,
63
+ project.id,
64
+ )
55
65
 
56
66
  # Handle group recursively
57
67
  elif group:
58
68
 
59
69
  # Handle group
60
70
  if not options.exclude_group:
61
- SettingsFeature.group(options, gitlab, group.id)
71
+ Entrypoint.group(
72
+ options,
73
+ gitlab,
74
+ group.id,
75
+ )
62
76
 
63
77
  # Iterate through subgroups
64
78
  if not options.exclude_subgroups:
@@ -68,7 +82,12 @@ class SettingsFeature:
68
82
  order_by='path',
69
83
  sort='asc',
70
84
  ):
71
- SettingsFeature.group(options, gitlab, group_subgroup.id)
85
+ Entrypoint.group(
86
+ options,
87
+ gitlab,
88
+ group_subgroup.id,
89
+ True,
90
+ )
72
91
 
73
92
  # Iterate through projects
74
93
  if not options.exclude_projects:
@@ -78,7 +97,11 @@ class SettingsFeature:
78
97
  order_by='path',
79
98
  sort='asc',
80
99
  ):
81
- SettingsFeature.project(options, gitlab, group_project.id)
100
+ Entrypoint.project(
101
+ options,
102
+ gitlab,
103
+ group_project.id,
104
+ )
82
105
 
83
106
  # Result
84
107
  return True
@@ -112,7 +135,7 @@ class SettingsFeature:
112
135
  # Update group description
113
136
  elif options.update_description:
114
137
  description = f'{group.name[:1].capitalize()}{group.name[1:]}' \
115
- f' - description'
138
+ f' - description'
116
139
  gitlab.group_set_description(criteria, description)
117
140
  print(f'{Colors.BOLD} - Updated description: '
118
141
  f'{Colors.CYAN}{description}'
@@ -6,11 +6,11 @@ from os import environ
6
6
  from sys import exit as sys_exit
7
7
 
8
8
  # Components
9
- from ..features.settings import SettingsFeature
10
9
  from ..package.bundle import Bundle
11
10
  from ..package.version import Version
12
11
  from ..prints.colors import Colors
13
12
  from ..system.platform import Platform
13
+ from .entrypoint import Entrypoint
14
14
 
15
15
  # Main, pylint: disable=too-many-statements
16
16
  def main() -> None:
@@ -24,7 +24,10 @@ def main() -> None:
24
24
  prog=Bundle.NAME,
25
25
  description=f'{Bundle.NAME}: {Bundle.DESCRIPTION}',
26
26
  add_help=False,
27
- formatter_class=RawTextHelpFormatter,
27
+ formatter_class=lambda prog: RawTextHelpFormatter(
28
+ prog,
29
+ max_help_position=30,
30
+ ),
28
31
  )
29
32
 
30
33
  # Arguments internal definitions
@@ -104,7 +107,7 @@ def main() -> None:
104
107
  '--set-description',
105
108
  dest='set_description',
106
109
  action='store',
107
- metavar='DESCRIPTION',
110
+ metavar='TEXT',
108
111
  help='Set description of GitLab projects and groups',
109
112
  )
110
113
  group.add_argument(
@@ -180,8 +183,8 @@ def main() -> None:
180
183
  print(' ')
181
184
  Platform.flush()
182
185
 
183
- # Configure GitLab projects
184
- result = SettingsFeature.entrypoint(options)
186
+ # CLI entrypoint
187
+ result = Entrypoint.cli(options)
185
188
 
186
189
  # Footer
187
190
  print(' ')
@@ -42,23 +42,23 @@ class GitLabFeature:
42
42
  def group_set_avatar(self, criteria: str, file: str) -> None:
43
43
 
44
44
  # Set group avatar
45
- group = self.group(criteria)
46
- with open(file, 'rb') as avatar:
47
- group.avatar = avatar
45
+ if not self.__dry_run:
46
+ group = self.group(criteria)
47
+ with open(file, 'rb') as avatar:
48
+ group.avatar = avatar
48
49
 
49
- # Save group
50
- if not self.__dry_run:
50
+ # Save group
51
51
  group.save()
52
52
 
53
53
  # Group set description
54
54
  def group_set_description(self, criteria: str, description: str) -> None:
55
55
 
56
56
  # Set group description
57
- group = self.group(criteria)
58
- group.description = description
59
-
60
- # Save group
61
57
  if not self.__dry_run:
58
+ group = self.group(criteria)
59
+ group.description = description
60
+
61
+ # Save group
62
62
  group.save()
63
63
 
64
64
  # Project
@@ -282,30 +282,35 @@ class GitLabFeature:
282
282
  def project_reset_members(self, criteria: str) -> None:
283
283
 
284
284
  # Remove project members
285
- project = self.project(criteria)
286
- for member in project.members.list():
287
- if not self.__dry_run:
285
+ if not self.__dry_run:
286
+ project = self.project(criteria)
287
+ for member in project.members.list():
288
288
  project.members.delete(member.id)
289
289
 
290
- # Save project
291
- if not self.__dry_run:
290
+ # Save project
292
291
  project.save()
293
292
 
294
293
  # Project set avatar
295
294
  def project_set_avatar(self, criteria: str, file: str) -> None:
296
295
 
297
296
  # Set project avatar
298
- project = self.project(criteria)
299
- with open(file, 'rb') as avatar:
300
- project.avatar = avatar
301
- if not self.__dry_run:
297
+ if not self.__dry_run:
298
+ project = self.project(criteria)
299
+ with open(file, 'rb') as avatar:
300
+ project.avatar = avatar
301
+
302
+ # Save project
302
303
  project.save()
303
304
 
304
305
  # Project set description
305
306
  def project_set_description(self, criteria: str, description: str) -> None:
306
- project = self.project(criteria)
307
- project.description = description
307
+
308
+ # Set project description
308
309
  if not self.__dry_run:
310
+ project = self.project(criteria)
311
+ project.description = description
312
+
313
+ # Save project
309
314
  project.save()
310
315
 
311
316
  # URL
@@ -1,28 +0,0 @@
1
-
2
- <a name="1.1.0"></a>
3
- ## [1.1.0](https://gitlab.com/AdrianDC/gitlab-projects-settings/compare/1.0.1...1.1.0) (2024-04-25)
4
-
5
- ### Code Refactoring
6
-
7
- * **settings:** minor functions codestyle improvement
8
-
9
- ### Features
10
-
11
- * **main:** rename '--avoid-*' parameters to '--exclude-*'
12
-
13
-
14
- <a name="1.0.1"></a>
15
- ## [1.0.1](https://gitlab.com/AdrianDC/gitlab-projects-settings/compare/1.0.0...1.0.1) (2024-04-24)
16
-
17
- ### Documentation
18
-
19
- * **setup:** fix PyPI 'gitlab-projects-settings' documentation
20
-
21
-
22
- <a name="1.0.0"></a>
23
- ## 1.0.0 (2024-04-24)
24
-
25
- ### Features
26
-
27
- * **gitlab-projects-settings:** initial sources implementation
28
-
@@ -1,38 +0,0 @@
1
- .gitignore
2
- .gitlab-ci.yml
3
- .markdownlint.json
4
- .style.yapf
5
- CHANGELOG.md
6
- LICENSE
7
- README.md
8
- mypy.ini
9
- setup.py
10
- .chglog/CHANGELOG.tpl.md
11
- .chglog/changelog.sh
12
- .chglog/config.yml
13
- .vscode/extensions.json
14
- .vscode/settings.json
15
- gitlab_projects_settings/__init__.py
16
- gitlab_projects_settings/__main__.py
17
- gitlab_projects_settings.egg-info/PKG-INFO
18
- gitlab_projects_settings.egg-info/SOURCES.txt
19
- gitlab_projects_settings.egg-info/dependency_links.txt
20
- gitlab_projects_settings.egg-info/entry_points.txt
21
- gitlab_projects_settings.egg-info/requires.txt
22
- gitlab_projects_settings.egg-info/top_level.txt
23
- gitlab_projects_settings/cli/__init__.py
24
- gitlab_projects_settings/cli/main.py
25
- gitlab_projects_settings/features/__init__.py
26
- gitlab_projects_settings/features/gitlab.py
27
- gitlab_projects_settings/features/settings.py
28
- gitlab_projects_settings/package/__init__.py
29
- gitlab_projects_settings/package/bundle.py
30
- gitlab_projects_settings/package/version.py
31
- gitlab_projects_settings/prints/__init__.py
32
- gitlab_projects_settings/prints/colors.py
33
- gitlab_projects_settings/system/__init__.py
34
- gitlab_projects_settings/system/platform.py
35
- requirements/build.txt
36
- requirements/deploy.txt
37
- requirements/quality.txt
38
- requirements/runtime.txt