semvergit 0.4.0__tar.gz → 0.4.2__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.
- {semvergit-0.4.0/src/semvergit.egg-info → semvergit-0.4.2}/PKG-INFO +19 -13
- {semvergit-0.4.0 → semvergit-0.4.2}/README.md +18 -12
- {semvergit-0.4.0 → semvergit-0.4.2}/src/semvergit/app.py +2 -0
- {semvergit-0.4.0 → semvergit-0.4.2}/src/semvergit/git_utils.py +7 -0
- {semvergit-0.4.0 → semvergit-0.4.2/src/semvergit.egg-info}/PKG-INFO +19 -13
- {semvergit-0.4.0 → semvergit-0.4.2}/tests/test_git_utils.py +18 -0
- {semvergit-0.4.0 → semvergit-0.4.2}/LICENSE +0 -0
- {semvergit-0.4.0 → semvergit-0.4.2}/pyproject.toml +0 -0
- {semvergit-0.4.0 → semvergit-0.4.2}/requirements/requirements-dev.txt +0 -0
- {semvergit-0.4.0 → semvergit-0.4.2}/requirements/requirements-test.txt +0 -0
- {semvergit-0.4.0 → semvergit-0.4.2}/setup.cfg +0 -0
- {semvergit-0.4.0 → semvergit-0.4.2}/src/semvergit/__init__.py +0 -0
- {semvergit-0.4.0 → semvergit-0.4.2}/src/semvergit/__main__.py +0 -0
- {semvergit-0.4.0 → semvergit-0.4.2}/src/semvergit/cli.py +0 -0
- {semvergit-0.4.0 → semvergit-0.4.2}/src/semvergit/file_utils.py +0 -0
- {semvergit-0.4.0 → semvergit-0.4.2}/src/semvergit/log_utils.py +0 -0
- {semvergit-0.4.0 → semvergit-0.4.2}/src/semvergit.egg-info/SOURCES.txt +0 -0
- {semvergit-0.4.0 → semvergit-0.4.2}/src/semvergit.egg-info/dependency_links.txt +0 -0
- {semvergit-0.4.0 → semvergit-0.4.2}/src/semvergit.egg-info/entry_points.txt +0 -0
- {semvergit-0.4.0 → semvergit-0.4.2}/src/semvergit.egg-info/requires.txt +0 -0
- {semvergit-0.4.0 → semvergit-0.4.2}/src/semvergit.egg-info/top_level.txt +0 -0
- {semvergit-0.4.0 → semvergit-0.4.2}/tests/test_app.py +0 -0
- {semvergit-0.4.0 → semvergit-0.4.2}/tests/test_cli.py +0 -0
- {semvergit-0.4.0 → semvergit-0.4.2}/tests/test_file_utils.py +0 -0
- {semvergit-0.4.0 → semvergit-0.4.2}/tests/test_integration.py +0 -0
- {semvergit-0.4.0 → semvergit-0.4.2}/tests/test_log_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: semvergit
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.2
|
|
4
4
|
Summary: Manage your project's version numbers.
|
|
5
5
|
Author-email: Roy Moore <roy@moore.co.il>
|
|
6
6
|
Project-URL: homepage, https://github.com/Tranquility2/semvergit
|
|
@@ -65,13 +65,12 @@ Requires-Dist: tomli==2.0.1; extra == "test"
|
|
|
65
65
|
|
|
66
66
|
|||
|
|
67
67
|
|-|-|
|
|
68
|
-
| CI/CD | [](https://github.com/Tranquility2/semvergit/actions/workflows/pytest.yml) [](https://github.com/Tranquility2/semvergit/actions/workflows/publish.yml) [](https://coveralls.io/github/Tranquility2/semvergit)|
|
|
69
|
-
| Package | [](https://pypi.org/project/semvergit/) [](https://pypi.org/project/semvergit/)|
|
|
70
|
-
| Meta | [](https://github.com/psf/black) [](https://pycqa.github.io/isort/) [](https://github.com/pylint-dev/pylint) [](http://mypy-lang.org/) [](https://spdx.org/licenses/) |
|
|
71
|
-
|||
|
|
68
|
+
| CI/CD | [](https://github.com/Tranquility2/semvergit/actions/workflows/pytest.yml) [](https://github.com/Tranquility2/semvergit/actions/workflows/publish.yml)  [](https://coveralls.io/github/Tranquility2/semvergit)|
|
|
69
|
+
| Package | [](https://pypi.org/project/semvergit/) [](https://pypi.org/project/semvergit/) [](https://pepy.tech/project/semvergit) |
|
|
70
|
+
| Meta | [](https://github.com/psf/black) [](https://github.com/PyCQA/bandit) [](https://pycqa.github.io/isort/) [](https://github.com/pylint-dev/pylint) [](http://mypy-lang.org/) [](https://spdx.org/licenses/) |
|
|
72
71
|
|
|
73
72
|
# semvergit
|
|
74
|
-

|
|
73
|
+

|
|
75
74
|
|
|
76
75
|
semvergit is a CLI tool to manage your project's version numbers.
|
|
77
76
|
It uses [Semantic Versioning](https://semver.org/) to bump the version number.
|
|
@@ -94,14 +93,14 @@ I created this tool to help me manage my project's version numbers.
|
|
|
94
93
|
I wanted a simple tool that I could use in my CI/CD pipeline to bump the version number and tag the commit.
|
|
95
94
|
|
|
96
95
|
## Features
|
|
97
|
-
❇️ Bump the version number and update the git tag in one command
|
|
98
|
-
❇️ Dry run mode
|
|
99
|
-
❇️ Verbose mode
|
|
100
|
-
❇️ Custom commit message
|
|
101
|
-
❇️ Auto commit message
|
|
102
|
-
🆕 Version 0.4+ introduces the ability to automatically update the version number in a file
|
|
96
|
+
❇️ Bump the version number and update the git tag in one command
|
|
97
|
+
❇️ Dry run mode
|
|
98
|
+
❇️ Verbose mode
|
|
99
|
+
❇️ Custom commit message*
|
|
100
|
+
❇️ Auto commit message*
|
|
101
|
+
🆕 Version 0.4+ introduces the ability to automatically update the version number in a file*
|
|
103
102
|
|
|
104
|
-
Please
|
|
103
|
+
<sup>*Please see the [limitations](#Limitations) section below</sup>
|
|
105
104
|
|
|
106
105
|
## How to use
|
|
107
106
|
|
|
@@ -134,6 +133,13 @@ Options:
|
|
|
134
133
|
--help Show this message and exit.
|
|
135
134
|
```
|
|
136
135
|
|
|
136
|
+
## Limitations
|
|
137
|
+
Please keep in mind that when using features like `commit message` / `auto commit message` and `version file` the tool will try and commit the changes to the git repo.
|
|
138
|
+
|
|
139
|
+
Even though this is quite handy, it should be used mannually as it **cannot be used directly in a CI/CD pipeline directed at `master` or `main` branches** as it will likly fail due to the commit not being allowed without a PR.
|
|
140
|
+
|
|
141
|
+
💡 Only git tags can be pushed to the remote without a PR *(and this is the main use case for this tool)*.
|
|
142
|
+
|
|
137
143
|
## Development
|
|
138
144
|
|
|
139
145
|
Please see [CONTRIBUTING.md](CONTRIBUTING.md)
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
|||
|
|
2
2
|
|-|-|
|
|
3
|
-
| CI/CD | [](https://github.com/Tranquility2/semvergit/actions/workflows/pytest.yml) [](https://github.com/Tranquility2/semvergit/actions/workflows/publish.yml) [](https://coveralls.io/github/Tranquility2/semvergit)|
|
|
4
|
-
| Package | [](https://pypi.org/project/semvergit/) [](https://pypi.org/project/semvergit/)|
|
|
5
|
-
| Meta | [](https://github.com/psf/black) [](https://pycqa.github.io/isort/) [](https://github.com/pylint-dev/pylint) [](http://mypy-lang.org/) [](https://spdx.org/licenses/) |
|
|
6
|
-
|||
|
|
3
|
+
| CI/CD | [](https://github.com/Tranquility2/semvergit/actions/workflows/pytest.yml) [](https://github.com/Tranquility2/semvergit/actions/workflows/publish.yml)  [](https://coveralls.io/github/Tranquility2/semvergit)|
|
|
4
|
+
| Package | [](https://pypi.org/project/semvergit/) [](https://pypi.org/project/semvergit/) [](https://pepy.tech/project/semvergit) |
|
|
5
|
+
| Meta | [](https://github.com/psf/black) [](https://github.com/PyCQA/bandit) [](https://pycqa.github.io/isort/) [](https://github.com/pylint-dev/pylint) [](http://mypy-lang.org/) [](https://spdx.org/licenses/) |
|
|
7
6
|
|
|
8
7
|
# semvergit
|
|
9
|
-

|
|
8
|
+

|
|
10
9
|
|
|
11
10
|
semvergit is a CLI tool to manage your project's version numbers.
|
|
12
11
|
It uses [Semantic Versioning](https://semver.org/) to bump the version number.
|
|
@@ -29,14 +28,14 @@ I created this tool to help me manage my project's version numbers.
|
|
|
29
28
|
I wanted a simple tool that I could use in my CI/CD pipeline to bump the version number and tag the commit.
|
|
30
29
|
|
|
31
30
|
## Features
|
|
32
|
-
❇️ Bump the version number and update the git tag in one command
|
|
33
|
-
❇️ Dry run mode
|
|
34
|
-
❇️ Verbose mode
|
|
35
|
-
❇️ Custom commit message
|
|
36
|
-
❇️ Auto commit message
|
|
37
|
-
🆕 Version 0.4+ introduces the ability to automatically update the version number in a file
|
|
31
|
+
❇️ Bump the version number and update the git tag in one command
|
|
32
|
+
❇️ Dry run mode
|
|
33
|
+
❇️ Verbose mode
|
|
34
|
+
❇️ Custom commit message*
|
|
35
|
+
❇️ Auto commit message*
|
|
36
|
+
🆕 Version 0.4+ introduces the ability to automatically update the version number in a file*
|
|
38
37
|
|
|
39
|
-
Please
|
|
38
|
+
<sup>*Please see the [limitations](#Limitations) section below</sup>
|
|
40
39
|
|
|
41
40
|
## How to use
|
|
42
41
|
|
|
@@ -69,6 +68,13 @@ Options:
|
|
|
69
68
|
--help Show this message and exit.
|
|
70
69
|
```
|
|
71
70
|
|
|
71
|
+
## Limitations
|
|
72
|
+
Please keep in mind that when using features like `commit message` / `auto commit message` and `version file` the tool will try and commit the changes to the git repo.
|
|
73
|
+
|
|
74
|
+
Even though this is quite handy, it should be used mannually as it **cannot be used directly in a CI/CD pipeline directed at `master` or `main` branches** as it will likly fail due to the commit not being allowed without a PR.
|
|
75
|
+
|
|
76
|
+
💡 Only git tags can be pushed to the remote without a PR *(and this is the main use case for this tool)*.
|
|
77
|
+
|
|
72
78
|
## Development
|
|
73
79
|
|
|
74
80
|
Please see [CONTRIBUTING.md](CONTRIBUTING.md)
|
|
@@ -10,6 +10,7 @@ from semver import VersionInfo
|
|
|
10
10
|
|
|
11
11
|
from semvergit.file_utils import update_verion_file
|
|
12
12
|
from semvergit.git_utils import (
|
|
13
|
+
add_file,
|
|
13
14
|
get_active_branch,
|
|
14
15
|
get_repo,
|
|
15
16
|
get_tags_with_prefix,
|
|
@@ -88,6 +89,7 @@ class SemverGit: # pylint: disable=too-few-public-methods
|
|
|
88
89
|
if version_file:
|
|
89
90
|
logger.info(f"📝 Writing version to {version_file}...")
|
|
90
91
|
update_verion_file(version_file, new_version, dry_run)
|
|
92
|
+
add_file(repo=self.current_repo, file_path=version_file, dry_run=dry_run)
|
|
91
93
|
|
|
92
94
|
if not commit_message:
|
|
93
95
|
# Upading the version file requires a commit message
|
|
@@ -64,6 +64,13 @@ def new_commit(repo: Repo, message: str) -> str:
|
|
|
64
64
|
return short_commit_id
|
|
65
65
|
|
|
66
66
|
|
|
67
|
+
@drywrap
|
|
68
|
+
def add_file(repo: Repo, file_path: str) -> None:
|
|
69
|
+
"""Add file."""
|
|
70
|
+
repo.index.add([file_path])
|
|
71
|
+
logger.debug(f"Added file {file_path}")
|
|
72
|
+
|
|
73
|
+
|
|
67
74
|
@drywrap
|
|
68
75
|
def set_tag(repo: Repo, tag: str) -> VersionInfo:
|
|
69
76
|
"""Set tag."""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: semvergit
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.2
|
|
4
4
|
Summary: Manage your project's version numbers.
|
|
5
5
|
Author-email: Roy Moore <roy@moore.co.il>
|
|
6
6
|
Project-URL: homepage, https://github.com/Tranquility2/semvergit
|
|
@@ -65,13 +65,12 @@ Requires-Dist: tomli==2.0.1; extra == "test"
|
|
|
65
65
|
|
|
66
66
|
|||
|
|
67
67
|
|-|-|
|
|
68
|
-
| CI/CD | [](https://github.com/Tranquility2/semvergit/actions/workflows/pytest.yml) [](https://github.com/Tranquility2/semvergit/actions/workflows/publish.yml) [](https://coveralls.io/github/Tranquility2/semvergit)|
|
|
69
|
-
| Package | [](https://pypi.org/project/semvergit/) [](https://pypi.org/project/semvergit/)|
|
|
70
|
-
| Meta | [](https://github.com/psf/black) [](https://pycqa.github.io/isort/) [](https://github.com/pylint-dev/pylint) [](http://mypy-lang.org/) [](https://spdx.org/licenses/) |
|
|
71
|
-
|||
|
|
68
|
+
| CI/CD | [](https://github.com/Tranquility2/semvergit/actions/workflows/pytest.yml) [](https://github.com/Tranquility2/semvergit/actions/workflows/publish.yml)  [](https://coveralls.io/github/Tranquility2/semvergit)|
|
|
69
|
+
| Package | [](https://pypi.org/project/semvergit/) [](https://pypi.org/project/semvergit/) [](https://pepy.tech/project/semvergit) |
|
|
70
|
+
| Meta | [](https://github.com/psf/black) [](https://github.com/PyCQA/bandit) [](https://pycqa.github.io/isort/) [](https://github.com/pylint-dev/pylint) [](http://mypy-lang.org/) [](https://spdx.org/licenses/) |
|
|
72
71
|
|
|
73
72
|
# semvergit
|
|
74
|
-

|
|
73
|
+

|
|
75
74
|
|
|
76
75
|
semvergit is a CLI tool to manage your project's version numbers.
|
|
77
76
|
It uses [Semantic Versioning](https://semver.org/) to bump the version number.
|
|
@@ -94,14 +93,14 @@ I created this tool to help me manage my project's version numbers.
|
|
|
94
93
|
I wanted a simple tool that I could use in my CI/CD pipeline to bump the version number and tag the commit.
|
|
95
94
|
|
|
96
95
|
## Features
|
|
97
|
-
❇️ Bump the version number and update the git tag in one command
|
|
98
|
-
❇️ Dry run mode
|
|
99
|
-
❇️ Verbose mode
|
|
100
|
-
❇️ Custom commit message
|
|
101
|
-
❇️ Auto commit message
|
|
102
|
-
🆕 Version 0.4+ introduces the ability to automatically update the version number in a file
|
|
96
|
+
❇️ Bump the version number and update the git tag in one command
|
|
97
|
+
❇️ Dry run mode
|
|
98
|
+
❇️ Verbose mode
|
|
99
|
+
❇️ Custom commit message*
|
|
100
|
+
❇️ Auto commit message*
|
|
101
|
+
🆕 Version 0.4+ introduces the ability to automatically update the version number in a file*
|
|
103
102
|
|
|
104
|
-
Please
|
|
103
|
+
<sup>*Please see the [limitations](#Limitations) section below</sup>
|
|
105
104
|
|
|
106
105
|
## How to use
|
|
107
106
|
|
|
@@ -134,6 +133,13 @@ Options:
|
|
|
134
133
|
--help Show this message and exit.
|
|
135
134
|
```
|
|
136
135
|
|
|
136
|
+
## Limitations
|
|
137
|
+
Please keep in mind that when using features like `commit message` / `auto commit message` and `version file` the tool will try and commit the changes to the git repo.
|
|
138
|
+
|
|
139
|
+
Even though this is quite handy, it should be used mannually as it **cannot be used directly in a CI/CD pipeline directed at `master` or `main` branches** as it will likly fail due to the commit not being allowed without a PR.
|
|
140
|
+
|
|
141
|
+
💡 Only git tags can be pushed to the remote without a PR *(and this is the main use case for this tool)*.
|
|
142
|
+
|
|
137
143
|
## Development
|
|
138
144
|
|
|
139
145
|
Please see [CONTRIBUTING.md](CONTRIBUTING.md)
|
|
@@ -8,6 +8,7 @@ from git import Repo
|
|
|
8
8
|
from pytest import MonkeyPatch, mark
|
|
9
9
|
|
|
10
10
|
from semvergit.git_utils import (
|
|
11
|
+
add_file,
|
|
11
12
|
drywrap,
|
|
12
13
|
get_active_branch,
|
|
13
14
|
get_repo,
|
|
@@ -147,6 +148,23 @@ def test_new_commit() -> None:
|
|
|
147
148
|
assert result == "112233"
|
|
148
149
|
|
|
149
150
|
|
|
151
|
+
def test_add_file() -> None:
|
|
152
|
+
"""Test add_file."""
|
|
153
|
+
|
|
154
|
+
class MockIndex: # pylint: disable=too-few-public-methods
|
|
155
|
+
"""Mock index."""
|
|
156
|
+
|
|
157
|
+
@staticmethod
|
|
158
|
+
def add(files: List[str]) -> None: # pylint: disable=unused-argument
|
|
159
|
+
"""Add."""
|
|
160
|
+
pass # pylint: disable=unnecessary-pass
|
|
161
|
+
|
|
162
|
+
test_repo = Repo()
|
|
163
|
+
|
|
164
|
+
MonkeyPatch().setattr("semvergit.git_utils.Repo.index", MockIndex)
|
|
165
|
+
add_file(test_repo, "testfile")
|
|
166
|
+
|
|
167
|
+
|
|
150
168
|
def test_set_tag() -> None:
|
|
151
169
|
"""Test set_tag."""
|
|
152
170
|
|
|
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
|