gitflow-manager 2.0.0__tar.gz → 3.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.
- {gitflow_manager-2.0.0 → gitflow_manager-3.0.0}/PKG-INFO +84 -16
- gitflow_manager-3.0.0/README.md +129 -0
- gitflow_manager-3.0.0/gitflow_manager/__init__.py +1 -0
- gitflow_manager-3.0.0/gitflow_manager/changelog.py +506 -0
- {gitflow_manager-2.0.0 → gitflow_manager-3.0.0}/gitflow_manager/file_utils.py +2 -1
- {gitflow_manager-2.0.0 → gitflow_manager-3.0.0}/gitflow_manager/git_hosts.py +118 -23
- {gitflow_manager-2.0.0 → gitflow_manager-3.0.0}/gitflow_manager/gitflow_manager.py +444 -70
- {gitflow_manager-2.0.0 → gitflow_manager-3.0.0}/gitflow_manager/run.py +103 -13
- gitflow_manager-3.0.0/gitflow_manager/start.py +337 -0
- {gitflow_manager-2.0.0 → gitflow_manager-3.0.0}/gitflow_manager.egg-info/PKG-INFO +84 -16
- {gitflow_manager-2.0.0 → gitflow_manager-3.0.0}/gitflow_manager.egg-info/SOURCES.txt +7 -1
- {gitflow_manager-2.0.0 → gitflow_manager-3.0.0}/gitflow_manager.egg-info/entry_points.txt +1 -0
- {gitflow_manager-2.0.0 → gitflow_manager-3.0.0}/gitflow_manager.egg-info/top_level.txt +1 -0
- {gitflow_manager-2.0.0 → gitflow_manager-3.0.0}/pyproject.toml +2 -1
- gitflow_manager-3.0.0/tests/test_changelog.py +174 -0
- gitflow_manager-3.0.0/tests/test_file_utils.py +22 -0
- gitflow_manager-3.0.0/tests/test_git_hosts.py +171 -0
- gitflow_manager-3.0.0/tests/test_gitflow_manager.py +634 -0
- gitflow_manager-3.0.0/tests/test_run.py +118 -0
- gitflow_manager-3.0.0/tests/test_start.py +252 -0
- gitflow_manager-2.0.0/README.md +0 -61
- gitflow_manager-2.0.0/gitflow_manager/__init__.py +0 -1
- gitflow_manager-2.0.0/gitflow_manager/changelog.py +0 -319
- gitflow_manager-2.0.0/gitflow_manager/start.py +0 -143
- {gitflow_manager-2.0.0 → gitflow_manager-3.0.0}/gitflow_manager/errors.py +0 -0
- {gitflow_manager-2.0.0 → gitflow_manager-3.0.0}/gitflow_manager.egg-info/dependency_links.txt +0 -0
- {gitflow_manager-2.0.0 → gitflow_manager-3.0.0}/gitflow_manager.egg-info/requires.txt +0 -0
- {gitflow_manager-2.0.0 → gitflow_manager-3.0.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: gitflow_manager
|
|
3
|
-
Version:
|
|
3
|
+
Version: 3.0.0
|
|
4
4
|
Summary: This package contains the Anacision Git Manager.
|
|
5
5
|
Requires-Python: >=3.10
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
@@ -20,13 +20,13 @@ Requires-Dist: twine>=6.0.1; extra == "dev"
|
|
|
20
20
|
## Description
|
|
21
21
|
|
|
22
22
|
The gitflow manager is a tool that helps maintaining clean versioning and documentation in code projects.
|
|
23
|
-
By using the gitflow manager one can make sure to stick to the
|
|
23
|
+
By using the gitflow manager one can make sure to stick to the
|
|
24
24
|
[GitFlow](https://nvie.com/posts/a-successful-git-branching-model) rules. Furthermore, it helps maintain a good
|
|
25
25
|
changelog and documentation.
|
|
26
26
|
Whenever you want to start a new branch or merging it back to dev/main run the `gfm` command.
|
|
27
|
-
It uses a dialog to define the type of new branch (feature, bugfix, hotfix, release) or merge option as well as setting
|
|
27
|
+
It uses a dialog to define the type of new branch (feature, bugfix, hotfix, release) or merge option as well as setting
|
|
28
28
|
the required changelog messages.
|
|
29
|
-
It then automatically updates version numbers, checks out corresponding branches and commits/merges according to the
|
|
29
|
+
It then automatically updates version numbers, checks out corresponding branches and commits/merges according to the
|
|
30
30
|
GitFlow.
|
|
31
31
|
Changes are also pushed to the Git Host via ssh or https and for protected branches merge requests are initialized.
|
|
32
32
|
Currently, the gitflow manager supports Gitlab and Bitbucket as hosting platforms.
|
|
@@ -34,30 +34,30 @@ Currently, the gitflow manager supports Gitlab and Bitbucket as hosting platform
|
|
|
34
34
|
### Versioning
|
|
35
35
|
|
|
36
36
|
- Utilize the gitflow manager in projects to make sure that you easily stick to these rules:
|
|
37
|
-
- Versions are defined in the format *Major.Minor.Hotfix*. New versions are created when opening the hotfix or release
|
|
37
|
+
- Versions are defined in the format *Major.Minor.Hotfix*. New versions are created when opening the hotfix or release
|
|
38
38
|
branch.
|
|
39
|
-
- The hotfix branch is only allowed to be started from main branch, to increase the Hotfix version digit only and to
|
|
39
|
+
- The hotfix branch is only allowed to be started from main branch, to increase the Hotfix version digit only and to
|
|
40
40
|
be merged into main (+ dev thereafter).
|
|
41
|
-
- The release branch is only allowed to be started from dev, to increase the minor or major version digit and to be
|
|
41
|
+
- The release branch is only allowed to be started from dev, to increase the minor or major version digit and to be
|
|
42
42
|
merged into main (+ dev thereafter). In case of a new major version, the minor and hotfix digit is reset to 0. In case
|
|
43
43
|
of a new minor version, the hotfix digit is reset to 0.
|
|
44
|
-
- The bugfix and feature branches are only allowed to be started from dev, increase no version number and are merged
|
|
44
|
+
- The bugfix and feature branches are only allowed to be started from dev, increase no version number and are merged
|
|
45
45
|
back to dev.
|
|
46
46
|
- All new branches need a description in the change log, which has separate "Added", "Changed" and "Fixed" sections.
|
|
47
47
|
|
|
48
48
|
### Supported branches with gitflow manager
|
|
49
49
|
|
|
50
|
-
- **main**: Permanent, stable, (normally) protected branch used for deployment. Each commit has a new version. Merge
|
|
50
|
+
- **main**: Permanent, stable, (normally) protected branch used for deployment. Each commit has a new version. Merge
|
|
51
51
|
requests only come from release or hotfix branch.
|
|
52
52
|
- **dev**: Permanent development branch. Gets merge requests from feature, hotfix and release branch.
|
|
53
53
|
- **release/vX.X.X**: Release branch. Branched off from dev branch with new minor or major version. When the branch is
|
|
54
|
-
finished, it is merged into main and dev branch. Intermediate merges into dev are allowed, too. Merges from dev into
|
|
54
|
+
finished, it is merged into main and dev branch. Intermediate merges into dev are allowed, too. Merges from dev into
|
|
55
55
|
release branch are not allowed.
|
|
56
|
-
- **feature/xxxxxx**: For features to be developed. Branched off from dev branch and will be merged back into dev after
|
|
56
|
+
- **feature/xxxxxx**: For features to be developed. Branched off from dev branch and will be merged back into dev after
|
|
57
57
|
finishing feature.
|
|
58
|
-
- **bugfix/xxxxxx**: For bugs to be fixed. Branched off from dev branch and will be merged back into dev after
|
|
58
|
+
- **bugfix/xxxxxx**: For bugs to be fixed. Branched off from dev branch and will be merged back into dev after
|
|
59
59
|
finishing the fix.
|
|
60
|
-
- **hotfix/vX.X.X**: Hotfix branch for fixes from deployed code. Branched off from main branch with new hotfix
|
|
60
|
+
- **hotfix/vX.X.X**: Hotfix branch for fixes from deployed code. Branched off from main branch with new hotfix
|
|
61
61
|
version. When done, is merged into main and dev branch.
|
|
62
62
|
|
|
63
63
|
### Tagging
|
|
@@ -68,11 +68,79 @@ version. When done, is merged into main and dev branch.
|
|
|
68
68
|
|
|
69
69
|
### Installation
|
|
70
70
|
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
For a global CLI installation with uv, use:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
uv tool install gitflow-manager
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Alternatively, install it with pip:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
pip install gitflow-manager
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Restart the terminal if the `gfm` command is not available immediately after installation.
|
|
84
|
+
|
|
85
|
+
For local development from this repository, install the checkout in editable mode:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
python -m pip install -e .
|
|
89
|
+
```
|
|
73
90
|
|
|
74
91
|
### Usage
|
|
75
92
|
|
|
76
93
|
- When using the first time, run `gfm --init` in the root of the project.
|
|
77
|
-
-
|
|
94
|
+
- During init, `gfm` detects common version setups automatically (`VERSION`, dynamic pyproject versioning, `src`/flat
|
|
95
|
+
Python packages). Press Enter to accept the detected setup or type `edit` to override it.
|
|
96
|
+
- Subsequently, just type `gfm` each time you need to branch or merge (or add change log information), and follow the
|
|
78
97
|
dialog
|
|
98
|
+
- To regenerate the rendered changelog without starting a branch flow, run `gfm regenerate`.
|
|
99
|
+
|
|
100
|
+
### Changelog test
|
|
101
|
+
|
|
102
|
+
The generic changelog integration test is in [`tests/integrationstest/GFM_CHANGELOG_TESTS.md`](tests/integrationstest/GFM_CHANGELOG_TESTS.md).
|
|
103
|
+
Create a separate Git test project first, run `gfm --init` so that it contains
|
|
104
|
+
`.gitflow_manager.yml`, then adjust the two variables in the test instructions.
|
|
105
|
+
|
|
106
|
+
### Version file projects
|
|
107
|
+
|
|
108
|
+
Projects that do not use Python packaging can store their version in a plain version file. Create a file such as
|
|
109
|
+
`VERSION` with only the semantic version in it:
|
|
110
|
+
|
|
111
|
+
```text
|
|
112
|
+
1.2.3
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
During `gfm --init`, enter `VERSION` when asked for a version file path. Or add it manually:
|
|
116
|
+
|
|
117
|
+
```yaml
|
|
118
|
+
version_file: VERSION
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
When this option is set, `gfm` reads and updates that file instead of requiring `pyproject.toml` or a Python
|
|
122
|
+
`__init__.py`.
|
|
123
|
+
|
|
124
|
+
### Changelog fragments
|
|
125
|
+
|
|
126
|
+
`gfm` stores branch changelog entries under `docs/source/change_log.d/` and automatically includes them in the next
|
|
127
|
+
release or hotfix changelog.
|
|
128
|
+
|
|
129
|
+
### Monorepo projects
|
|
130
|
+
|
|
131
|
+
`gfm` can manage additional app versions in monorepos. Enable this during `gfm --init` or add it to
|
|
132
|
+
`.gitflow_manager.yml`:
|
|
133
|
+
|
|
134
|
+
```yaml
|
|
135
|
+
monorepo: true
|
|
136
|
+
monorepo_apps:
|
|
137
|
+
- src/app_a
|
|
138
|
+
- src/app_b
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
If `monorepo_apps` is empty, `gfm` auto-detects one-level apps under the configured project layout, for example
|
|
142
|
+
`src/*/__init__.py`. Each app must expose a `__version__ = "X.Y.Z"` value. `__app_name__` is optional and used only for
|
|
143
|
+
display.
|
|
144
|
+
|
|
145
|
+
On release branches, `gfm` increases the versions of apps that changed since branching off from `main`. On hotfix
|
|
146
|
+
branches, it asks which apps are affected.
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# Anacision Gitflow Manager
|
|
2
|
+
|
|
3
|
+
## Description
|
|
4
|
+
|
|
5
|
+
The gitflow manager is a tool that helps maintaining clean versioning and documentation in code projects.
|
|
6
|
+
By using the gitflow manager one can make sure to stick to the
|
|
7
|
+
[GitFlow](https://nvie.com/posts/a-successful-git-branching-model) rules. Furthermore, it helps maintain a good
|
|
8
|
+
changelog and documentation.
|
|
9
|
+
Whenever you want to start a new branch or merging it back to dev/main run the `gfm` command.
|
|
10
|
+
It uses a dialog to define the type of new branch (feature, bugfix, hotfix, release) or merge option as well as setting
|
|
11
|
+
the required changelog messages.
|
|
12
|
+
It then automatically updates version numbers, checks out corresponding branches and commits/merges according to the
|
|
13
|
+
GitFlow.
|
|
14
|
+
Changes are also pushed to the Git Host via ssh or https and for protected branches merge requests are initialized.
|
|
15
|
+
Currently, the gitflow manager supports Gitlab and Bitbucket as hosting platforms.
|
|
16
|
+
|
|
17
|
+
### Versioning
|
|
18
|
+
|
|
19
|
+
- Utilize the gitflow manager in projects to make sure that you easily stick to these rules:
|
|
20
|
+
- Versions are defined in the format *Major.Minor.Hotfix*. New versions are created when opening the hotfix or release
|
|
21
|
+
branch.
|
|
22
|
+
- The hotfix branch is only allowed to be started from main branch, to increase the Hotfix version digit only and to
|
|
23
|
+
be merged into main (+ dev thereafter).
|
|
24
|
+
- The release branch is only allowed to be started from dev, to increase the minor or major version digit and to be
|
|
25
|
+
merged into main (+ dev thereafter). In case of a new major version, the minor and hotfix digit is reset to 0. In case
|
|
26
|
+
of a new minor version, the hotfix digit is reset to 0.
|
|
27
|
+
- The bugfix and feature branches are only allowed to be started from dev, increase no version number and are merged
|
|
28
|
+
back to dev.
|
|
29
|
+
- All new branches need a description in the change log, which has separate "Added", "Changed" and "Fixed" sections.
|
|
30
|
+
|
|
31
|
+
### Supported branches with gitflow manager
|
|
32
|
+
|
|
33
|
+
- **main**: Permanent, stable, (normally) protected branch used for deployment. Each commit has a new version. Merge
|
|
34
|
+
requests only come from release or hotfix branch.
|
|
35
|
+
- **dev**: Permanent development branch. Gets merge requests from feature, hotfix and release branch.
|
|
36
|
+
- **release/vX.X.X**: Release branch. Branched off from dev branch with new minor or major version. When the branch is
|
|
37
|
+
finished, it is merged into main and dev branch. Intermediate merges into dev are allowed, too. Merges from dev into
|
|
38
|
+
release branch are not allowed.
|
|
39
|
+
- **feature/xxxxxx**: For features to be developed. Branched off from dev branch and will be merged back into dev after
|
|
40
|
+
finishing feature.
|
|
41
|
+
- **bugfix/xxxxxx**: For bugs to be fixed. Branched off from dev branch and will be merged back into dev after
|
|
42
|
+
finishing the fix.
|
|
43
|
+
- **hotfix/vX.X.X**: Hotfix branch for fixes from deployed code. Branched off from main branch with new hotfix
|
|
44
|
+
version. When done, is merged into main and dev branch.
|
|
45
|
+
|
|
46
|
+
### Tagging
|
|
47
|
+
|
|
48
|
+
- Currently, tagging is not done automatically. You can configure yourself a CI pipeline, that does the job for you.
|
|
49
|
+
|
|
50
|
+
## Getting started
|
|
51
|
+
|
|
52
|
+
### Installation
|
|
53
|
+
|
|
54
|
+
For a global CLI installation with uv, use:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
uv tool install gitflow-manager
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Alternatively, install it with pip:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
pip install gitflow-manager
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Restart the terminal if the `gfm` command is not available immediately after installation.
|
|
67
|
+
|
|
68
|
+
For local development from this repository, install the checkout in editable mode:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
python -m pip install -e .
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Usage
|
|
75
|
+
|
|
76
|
+
- When using the first time, run `gfm --init` in the root of the project.
|
|
77
|
+
- During init, `gfm` detects common version setups automatically (`VERSION`, dynamic pyproject versioning, `src`/flat
|
|
78
|
+
Python packages). Press Enter to accept the detected setup or type `edit` to override it.
|
|
79
|
+
- Subsequently, just type `gfm` each time you need to branch or merge (or add change log information), and follow the
|
|
80
|
+
dialog
|
|
81
|
+
- To regenerate the rendered changelog without starting a branch flow, run `gfm regenerate`.
|
|
82
|
+
|
|
83
|
+
### Changelog test
|
|
84
|
+
|
|
85
|
+
The generic changelog integration test is in [`tests/integrationstest/GFM_CHANGELOG_TESTS.md`](tests/integrationstest/GFM_CHANGELOG_TESTS.md).
|
|
86
|
+
Create a separate Git test project first, run `gfm --init` so that it contains
|
|
87
|
+
`.gitflow_manager.yml`, then adjust the two variables in the test instructions.
|
|
88
|
+
|
|
89
|
+
### Version file projects
|
|
90
|
+
|
|
91
|
+
Projects that do not use Python packaging can store their version in a plain version file. Create a file such as
|
|
92
|
+
`VERSION` with only the semantic version in it:
|
|
93
|
+
|
|
94
|
+
```text
|
|
95
|
+
1.2.3
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
During `gfm --init`, enter `VERSION` when asked for a version file path. Or add it manually:
|
|
99
|
+
|
|
100
|
+
```yaml
|
|
101
|
+
version_file: VERSION
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
When this option is set, `gfm` reads and updates that file instead of requiring `pyproject.toml` or a Python
|
|
105
|
+
`__init__.py`.
|
|
106
|
+
|
|
107
|
+
### Changelog fragments
|
|
108
|
+
|
|
109
|
+
`gfm` stores branch changelog entries under `docs/source/change_log.d/` and automatically includes them in the next
|
|
110
|
+
release or hotfix changelog.
|
|
111
|
+
|
|
112
|
+
### Monorepo projects
|
|
113
|
+
|
|
114
|
+
`gfm` can manage additional app versions in monorepos. Enable this during `gfm --init` or add it to
|
|
115
|
+
`.gitflow_manager.yml`:
|
|
116
|
+
|
|
117
|
+
```yaml
|
|
118
|
+
monorepo: true
|
|
119
|
+
monorepo_apps:
|
|
120
|
+
- src/app_a
|
|
121
|
+
- src/app_b
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
If `monorepo_apps` is empty, `gfm` auto-detects one-level apps under the configured project layout, for example
|
|
125
|
+
`src/*/__init__.py`. Each app must expose a `__version__ = "X.Y.Z"` value. `__app_name__` is optional and used only for
|
|
126
|
+
display.
|
|
127
|
+
|
|
128
|
+
On release branches, `gfm` increases the versions of apps that changed since branching off from `main`. On hotfix
|
|
129
|
+
branches, it asks which apps are affected.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__="3.0.0"
|