semvergit 0.2.1__tar.gz → 0.3.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.
- {semvergit-0.2.1/src/semvergit.egg-info → semvergit-0.3.0}/PKG-INFO +6 -11
- {semvergit-0.2.1 → semvergit-0.3.0}/README.md +1 -4
- {semvergit-0.2.1 → semvergit-0.3.0}/pyproject.toml +10 -8
- {semvergit-0.2.1 → semvergit-0.3.0/requirements}/requirements-dev.txt +13 -7
- semvergit-0.3.0/requirements/requirements-test.txt +14 -0
- {semvergit-0.2.1 → semvergit-0.3.0}/src/semvergit/app.py +4 -1
- {semvergit-0.2.1 → semvergit-0.3.0/src/semvergit.egg-info}/PKG-INFO +6 -11
- {semvergit-0.2.1 → semvergit-0.3.0}/src/semvergit.egg-info/SOURCES.txt +3 -3
- {semvergit-0.2.1 → semvergit-0.3.0}/src/semvergit.egg-info/requires.txt +4 -6
- {semvergit-0.2.1 → semvergit-0.3.0}/tests/test_app.py +58 -4
- semvergit-0.3.0/tests/test_integration.py +136 -0
- semvergit-0.2.1/requirements-test.txt +0 -8
- semvergit-0.2.1/requirements.txt +0 -6
- {semvergit-0.2.1 → semvergit-0.3.0}/LICENSE +0 -0
- {semvergit-0.2.1 → semvergit-0.3.0}/setup.cfg +0 -0
- {semvergit-0.2.1 → semvergit-0.3.0}/src/semvergit/__init__.py +0 -0
- {semvergit-0.2.1 → semvergit-0.3.0}/src/semvergit/__main__.py +0 -0
- {semvergit-0.2.1 → semvergit-0.3.0}/src/semvergit/cli.py +0 -0
- {semvergit-0.2.1 → semvergit-0.3.0}/src/semvergit/git_utils.py +0 -0
- {semvergit-0.2.1 → semvergit-0.3.0}/src/semvergit/log_utils.py +0 -0
- {semvergit-0.2.1 → semvergit-0.3.0}/src/semvergit.egg-info/dependency_links.txt +0 -0
- {semvergit-0.2.1 → semvergit-0.3.0}/src/semvergit.egg-info/entry_points.txt +0 -0
- {semvergit-0.2.1 → semvergit-0.3.0}/src/semvergit.egg-info/top_level.txt +0 -0
- {semvergit-0.2.1 → semvergit-0.3.0}/tests/test_cli.py +0 -0
- {semvergit-0.2.1 → semvergit-0.3.0}/tests/test_git_utils.py +0 -0
- {semvergit-0.2.1 → semvergit-0.3.0}/tests/test_log_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: semvergit
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
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
|
|
@@ -18,12 +18,10 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
18
18
|
Requires-Python: >=3.8
|
|
19
19
|
Description-Content-Type: text/markdown
|
|
20
20
|
License-File: LICENSE
|
|
21
|
-
Requires-Dist:
|
|
22
|
-
Requires-Dist:
|
|
23
|
-
Requires-Dist:
|
|
24
|
-
Requires-Dist:
|
|
25
|
-
Requires-Dist: semver==3.0.2
|
|
26
|
-
Requires-Dist: smmap==5.0.1
|
|
21
|
+
Requires-Dist: gitpython>=3.0.0
|
|
22
|
+
Requires-Dist: semver>=3.0.0
|
|
23
|
+
Requires-Dist: loguru>=0.7.0
|
|
24
|
+
Requires-Dist: click>=8.0.0
|
|
27
25
|
Provides-Extra: dev
|
|
28
26
|
Requires-Dist: astroid==3.1.0; extra == "dev"
|
|
29
27
|
Requires-Dist: bandit==1.7.8; extra == "dev"
|
|
@@ -73,10 +71,7 @@ Requires-Dist: tomli==2.0.1; extra == "test"
|
|
|
73
71
|
|||
|
|
74
72
|
|
|
75
73
|
# semvergit
|
|
76
|
-
|
|
77
|
-
Manage your project's version numbers.
|
|
78
|
-
|
|
79
|
-
## Semantic Versioning
|
|
74
|
+

|
|
80
75
|
|
|
81
76
|
semvergit is a CLI tool to manage your project's version numbers.
|
|
82
77
|
It uses [Semantic Versioning](https://semver.org/) to bump the version number.
|
|
@@ -6,10 +6,7 @@
|
|
|
6
6
|
|||
|
|
7
7
|
|
|
8
8
|
# semvergit
|
|
9
|
-
|
|
10
|
-
Manage your project's version numbers.
|
|
11
|
-
|
|
12
|
-
## Semantic Versioning
|
|
9
|
+

|
|
13
10
|
|
|
14
11
|
semvergit is a CLI tool to manage your project's version numbers.
|
|
15
12
|
It uses [Semantic Versioning](https://semver.org/) to bump the version number.
|
|
@@ -7,7 +7,6 @@ name = "semvergit"
|
|
|
7
7
|
description = "Manage your project's version numbers."
|
|
8
8
|
readme = "README.md"
|
|
9
9
|
license = { file = "LICENSE.md" }
|
|
10
|
-
requires-python = ">=3.8"
|
|
11
10
|
keywords = ["packaging", "publishing", "release", "versioning"]
|
|
12
11
|
authors = [{ name = "Roy Moore", email = "roy@moore.co.il" }]
|
|
13
12
|
classifiers = [
|
|
@@ -21,15 +20,19 @@ classifiers = [
|
|
|
21
20
|
"Programming Language :: Python :: 3.11",
|
|
22
21
|
"Programming Language :: Python :: 3.12",
|
|
23
22
|
]
|
|
23
|
+
requires-python = ">=3.8"
|
|
24
|
+
dependencies = [
|
|
25
|
+
"gitpython>=3.0.0",
|
|
26
|
+
"semver>=3.0.0",
|
|
27
|
+
"loguru>=0.7.0",
|
|
28
|
+
"click>=8.0.0",
|
|
29
|
+
]
|
|
24
30
|
|
|
25
|
-
dynamic = ["version", "
|
|
26
|
-
|
|
27
|
-
[tool.setuptools.dynamic.dependencies]
|
|
28
|
-
file = ["requirements.txt"]
|
|
31
|
+
dynamic = ["version", "optional-dependencies"]
|
|
29
32
|
|
|
30
33
|
[tool.setuptools.dynamic.optional-dependencies]
|
|
31
|
-
dev = { file = ["requirements-dev.txt"] }
|
|
32
|
-
test = { file = ["requirements-test.txt"] }
|
|
34
|
+
dev = { file = ["requirements/requirements-dev.txt"] }
|
|
35
|
+
test = { file = ["requirements/requirements-test.txt"] }
|
|
33
36
|
|
|
34
37
|
[project.scripts]
|
|
35
38
|
semvergit = "semvergit.cli:cli"
|
|
@@ -50,7 +53,6 @@ rmprefix = "v"
|
|
|
50
53
|
quiet = true
|
|
51
54
|
rebuild = true
|
|
52
55
|
strip-extras = true
|
|
53
|
-
no-header = true
|
|
54
56
|
annotation-style = "line"
|
|
55
57
|
|
|
56
58
|
[tool.black]
|
|
@@ -1,26 +1,32 @@
|
|
|
1
|
+
#
|
|
2
|
+
# This file is autogenerated by pip-compile with Python 3.8
|
|
3
|
+
# by the following command:
|
|
4
|
+
#
|
|
5
|
+
# pip-compile --annotation-style=line --output-file=requirements/requirements-dev.txt --strip-extras requirements/requirements-dev.in
|
|
6
|
+
#
|
|
1
7
|
astroid==3.1.0 # via pylint
|
|
2
|
-
bandit==1.7.8 # via -r requirements-dev.in
|
|
3
|
-
black==24.3.0 # via -r requirements-dev.in
|
|
8
|
+
bandit==1.7.8 # via -r requirements/requirements-dev.in
|
|
9
|
+
black==24.3.0 # via -r requirements/requirements-dev.in
|
|
4
10
|
cfgv==3.4.0 # via pre-commit
|
|
5
|
-
click==8.1.7 # via -c requirements.txt, black
|
|
11
|
+
click==8.1.7 # via -c requirements/requirements.txt, black
|
|
6
12
|
dill==0.3.8 # via pylint
|
|
7
13
|
distlib==0.3.8 # via virtualenv
|
|
8
14
|
filelock==3.13.3 # via virtualenv
|
|
9
15
|
identify==2.5.35 # via pre-commit
|
|
10
|
-
isort==5.13.2 # via -r requirements-dev.in, pylint
|
|
16
|
+
isort==5.13.2 # via -r requirements/requirements-dev.in, pylint
|
|
11
17
|
markdown-it-py==3.0.0 # via rich
|
|
12
18
|
mccabe==0.7.0 # via pylint
|
|
13
19
|
mdurl==0.1.2 # via markdown-it-py
|
|
14
|
-
mypy==1.9.0 # via -r requirements-dev.in
|
|
20
|
+
mypy==1.9.0 # via -r requirements/requirements-dev.in
|
|
15
21
|
mypy-extensions==1.0.0 # via black, mypy
|
|
16
22
|
nodeenv==1.8.0 # via pre-commit
|
|
17
23
|
packaging==24.0 # via black
|
|
18
24
|
pathspec==0.12.1 # via black
|
|
19
25
|
pbr==6.0.0 # via stevedore
|
|
20
26
|
platformdirs==4.2.0 # via black, pylint, virtualenv
|
|
21
|
-
pre-commit==3.5.0 # via -r requirements-dev.in
|
|
27
|
+
pre-commit==3.5.0 # via -r requirements/requirements-dev.in
|
|
22
28
|
pygments==2.17.2 # via rich
|
|
23
|
-
pylint==3.1.0 # via -r requirements-dev.in
|
|
29
|
+
pylint==3.1.0 # via -r requirements/requirements-dev.in
|
|
24
30
|
pyyaml==6.0.1 # via bandit, pre-commit
|
|
25
31
|
rich==13.7.1 # via bandit
|
|
26
32
|
stevedore==5.2.0 # via bandit
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#
|
|
2
|
+
# This file is autogenerated by pip-compile with Python 3.8
|
|
3
|
+
# by the following command:
|
|
4
|
+
#
|
|
5
|
+
# pip-compile --annotation-style=line --output-file=requirements/requirements-test.txt --strip-extras requirements/requirements-test.in
|
|
6
|
+
#
|
|
7
|
+
coverage==7.4.4 # via pytest-cov
|
|
8
|
+
exceptiongroup==1.2.0 # via pytest
|
|
9
|
+
iniconfig==2.0.0 # via pytest
|
|
10
|
+
packaging==24.0 # via pytest
|
|
11
|
+
pluggy==1.4.0 # via pytest
|
|
12
|
+
pytest==8.1.1 # via -r requirements/requirements-test.in, pytest-cov
|
|
13
|
+
pytest-cov==5.0.0 # via -r requirements/requirements-test.in
|
|
14
|
+
tomli==2.0.1 # via coverage, pytest
|
|
@@ -52,7 +52,10 @@ class SemverGit: # pylint: disable=too-few-public-methods
|
|
|
52
52
|
logger.info("Pulling...")
|
|
53
53
|
pull_remote(self.current_repo)
|
|
54
54
|
self.versions = self.get_versions()
|
|
55
|
-
|
|
55
|
+
if self.versions:
|
|
56
|
+
self.latest_version = max(self.versions)
|
|
57
|
+
else:
|
|
58
|
+
self.latest_version = VersionInfo.parse("0.0.0")
|
|
56
59
|
|
|
57
60
|
def get_versions(self) -> List[VersionInfo]:
|
|
58
61
|
"""Get versions."""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: semvergit
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
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
|
|
@@ -18,12 +18,10 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
18
18
|
Requires-Python: >=3.8
|
|
19
19
|
Description-Content-Type: text/markdown
|
|
20
20
|
License-File: LICENSE
|
|
21
|
-
Requires-Dist:
|
|
22
|
-
Requires-Dist:
|
|
23
|
-
Requires-Dist:
|
|
24
|
-
Requires-Dist:
|
|
25
|
-
Requires-Dist: semver==3.0.2
|
|
26
|
-
Requires-Dist: smmap==5.0.1
|
|
21
|
+
Requires-Dist: gitpython>=3.0.0
|
|
22
|
+
Requires-Dist: semver>=3.0.0
|
|
23
|
+
Requires-Dist: loguru>=0.7.0
|
|
24
|
+
Requires-Dist: click>=8.0.0
|
|
27
25
|
Provides-Extra: dev
|
|
28
26
|
Requires-Dist: astroid==3.1.0; extra == "dev"
|
|
29
27
|
Requires-Dist: bandit==1.7.8; extra == "dev"
|
|
@@ -73,10 +71,7 @@ Requires-Dist: tomli==2.0.1; extra == "test"
|
|
|
73
71
|
|||
|
|
74
72
|
|
|
75
73
|
# semvergit
|
|
76
|
-
|
|
77
|
-
Manage your project's version numbers.
|
|
78
|
-
|
|
79
|
-
## Semantic Versioning
|
|
74
|
+

|
|
80
75
|
|
|
81
76
|
semvergit is a CLI tool to manage your project's version numbers.
|
|
82
77
|
It uses [Semantic Versioning](https://semver.org/) to bump the version number.
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
LICENSE
|
|
2
2
|
README.md
|
|
3
3
|
pyproject.toml
|
|
4
|
-
requirements-dev.txt
|
|
5
|
-
requirements-test.txt
|
|
6
|
-
requirements.txt
|
|
4
|
+
requirements/requirements-dev.txt
|
|
5
|
+
requirements/requirements-test.txt
|
|
7
6
|
src/semvergit/__init__.py
|
|
8
7
|
src/semvergit/__main__.py
|
|
9
8
|
src/semvergit/app.py
|
|
@@ -19,4 +18,5 @@ src/semvergit.egg-info/top_level.txt
|
|
|
19
18
|
tests/test_app.py
|
|
20
19
|
tests/test_cli.py
|
|
21
20
|
tests/test_git_utils.py
|
|
21
|
+
tests/test_integration.py
|
|
22
22
|
tests/test_log_utils.py
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Test app."""
|
|
2
2
|
|
|
3
|
-
from typing import Optional
|
|
3
|
+
from typing import List, Optional
|
|
4
4
|
|
|
5
5
|
from pytest import CaptureFixture, LogCaptureFixture, mark
|
|
6
6
|
from semver import VersionInfo
|
|
@@ -59,6 +59,58 @@ def test_app(pull_branch: bool, expected: VersionInfo) -> None:
|
|
|
59
59
|
assert svg.latest_version == VersionInfo(0, 0, 4)
|
|
60
60
|
|
|
61
61
|
|
|
62
|
+
@mark.parametrize(
|
|
63
|
+
"dry_run",
|
|
64
|
+
[
|
|
65
|
+
True,
|
|
66
|
+
False,
|
|
67
|
+
],
|
|
68
|
+
)
|
|
69
|
+
@mark.parametrize(
|
|
70
|
+
"bump_type, expected_version",
|
|
71
|
+
[
|
|
72
|
+
(str(BumpType.MAJOR), VersionInfo(1, 0, 0)),
|
|
73
|
+
(str(BumpType.MINOR), VersionInfo(0, 1, 0)),
|
|
74
|
+
(str(BumpType.PATCH), VersionInfo(0, 0, 1)),
|
|
75
|
+
(str(BumpType.PRERELEASE), VersionInfo(0, 0, 1, "dev.1")),
|
|
76
|
+
],
|
|
77
|
+
)
|
|
78
|
+
@mark.parametrize(
|
|
79
|
+
"commit_message, auto_message",
|
|
80
|
+
[
|
|
81
|
+
("testmessage", False),
|
|
82
|
+
(None, True),
|
|
83
|
+
(None, False),
|
|
84
|
+
],
|
|
85
|
+
)
|
|
86
|
+
# type: ignore[no-untyped-def]
|
|
87
|
+
def test_app_no_versions_update( # pylint: disable=too-many-arguments
|
|
88
|
+
bump_type: str,
|
|
89
|
+
expected_version: VersionInfo,
|
|
90
|
+
dry_run: bool,
|
|
91
|
+
commit_message: Optional[str],
|
|
92
|
+
auto_message: bool,
|
|
93
|
+
mock_get_tags_empty, # pylint: disable=unused-argument
|
|
94
|
+
) -> None:
|
|
95
|
+
"""Test app with no versions."""
|
|
96
|
+
svg = SemverGit()
|
|
97
|
+
assert svg is not None
|
|
98
|
+
assert svg.branch.name == "test_branch"
|
|
99
|
+
assert svg.versions == []
|
|
100
|
+
assert svg.latest_version == VersionInfo(0, 0, 0)
|
|
101
|
+
new_version = svg.update(bump_type, dry_run=dry_run, commit_message=commit_message, auto_message=auto_message)
|
|
102
|
+
expected_tag_str = f"{svg.version_prefix}{str(expected_version)}"
|
|
103
|
+
assert new_version == expected_tag_str
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
def check_substring(substring_match: str, strings_list: List[str]) -> bool:
|
|
107
|
+
"""Check if list contains substring."""
|
|
108
|
+
for item in strings_list:
|
|
109
|
+
if substring_match in item:
|
|
110
|
+
return True
|
|
111
|
+
return False
|
|
112
|
+
|
|
113
|
+
|
|
62
114
|
@mark.parametrize(
|
|
63
115
|
"dry_run",
|
|
64
116
|
[
|
|
@@ -99,9 +151,11 @@ def test_app_update( # pylint: disable=too-many-arguments
|
|
|
99
151
|
expected_tag_str = f"{svg.version_prefix}{str(expected_version)}"
|
|
100
152
|
assert f"Created mock-set-tag-{expected_tag_str}" in caplog.messages
|
|
101
153
|
if commit_message or auto_message:
|
|
102
|
-
assert "
|
|
103
|
-
|
|
154
|
+
assert check_substring("Committing...", caplog.messages)
|
|
155
|
+
if dry_run:
|
|
156
|
+
assert check_substring("Dry run (no tag set or pushed)", caplog.messages)
|
|
157
|
+
assert check_substring("Pushing...", caplog.messages)
|
|
104
158
|
assert capsys.readouterr().out == expected_tag_str
|
|
105
159
|
assert new_version == expected_tag_str
|
|
106
160
|
print(f"{caplog.messages=}")
|
|
107
|
-
assert f"
|
|
161
|
+
assert check_substring(f"New version tag: {expected_tag_str}", caplog.messages)
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"""Integration tests for the semvergit package."""
|
|
2
|
+
|
|
3
|
+
import subprocess
|
|
4
|
+
import tempfile
|
|
5
|
+
from typing import Optional, Tuple
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class RunCommandException(Exception):
|
|
9
|
+
"""Exception raised when a command fails."""
|
|
10
|
+
|
|
11
|
+
def __init__(self, message: str) -> None:
|
|
12
|
+
"""Initialize the exception."""
|
|
13
|
+
super().__init__(message)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def run_command(command: str, cwd: str, validation_string: Optional[str] = None) -> Tuple[str, str]:
|
|
17
|
+
"""Run a command in a subprocess and return the output. Raise an exception if the command fails."""
|
|
18
|
+
result = subprocess.run(command, capture_output=True, shell=True, text=True, check=False, cwd=cwd)
|
|
19
|
+
if result.returncode != 0:
|
|
20
|
+
raise RunCommandException(f"Error {result.stderr}, Code: {result.returncode}, Command output: {result.stdout}")
|
|
21
|
+
if validation_string:
|
|
22
|
+
print(f"[v] {validation_string}")
|
|
23
|
+
return (result.stdout, result.stderr)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def add_file_to_repo(filename: str, repodirname: str, content: str) -> None:
|
|
27
|
+
"""Add a file to a git repository and commit it."""
|
|
28
|
+
with open(repodirname + "/" + filename, "w", encoding="utf-8") as f:
|
|
29
|
+
f.write(content)
|
|
30
|
+
run_command(f"git add {filename}", repodirname, f"Added {filename} to the index")
|
|
31
|
+
run_command(f'git commit -m "Added {filename}"', repodirname, f"Committed {filename}")
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def check_git_log(repodirname: str, expected: str) -> None:
|
|
35
|
+
"""Check the git log for the last commit."""
|
|
36
|
+
result, _ = run_command('git --no-pager log --pretty=format:"%h%d %s [%an]"', repodirname, "Checked the commit log")
|
|
37
|
+
print(f"Git Log:\n{result}")
|
|
38
|
+
assert expected in result
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def update_version(repodirname: str, version_type: str, target_version: str) -> None:
|
|
42
|
+
"""Run the semvergit command to update the version."""
|
|
43
|
+
result, logs = run_command(f"semvergit -v -t {version_type}", repodirname, "Created a new version")
|
|
44
|
+
print(logs, end="")
|
|
45
|
+
assert result == target_version
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def set_credentials(repodirname: str) -> None:
|
|
49
|
+
"""Set the git credentials for the repository."""
|
|
50
|
+
run_command("git config user.email 'test@test'", repodirname, "Set user email")
|
|
51
|
+
run_command("git config user.name 'Test User'", repodirname, "Set user name")
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
class TestIntegration:
|
|
55
|
+
"""Integration tests for the semvergit package."""
|
|
56
|
+
|
|
57
|
+
# pylint: disable=attribute-defined-outside-init
|
|
58
|
+
def setup_method(self) -> None:
|
|
59
|
+
"""Create a git repository and clone it."""
|
|
60
|
+
self.tmpdirname = tempfile.mkdtemp()
|
|
61
|
+
self.repodirname = self.tmpdirname + "/repo"
|
|
62
|
+
run_command(f"mkdir {self.repodirname}", self.tmpdirname, f"Created repo directory: {self.repodirname}")
|
|
63
|
+
run_command("git -c init.defaultBranch=master init", self.repodirname, "Initialized git repository")
|
|
64
|
+
set_credentials(self.repodirname)
|
|
65
|
+
run_command("touch initial.txt", self.repodirname, "Created initial.txt")
|
|
66
|
+
run_command("git add .", self.repodirname, "Added initial.txt to the index")
|
|
67
|
+
run_command('git commit -m "Initial commit"', self.repodirname, "Committed initial.txt")
|
|
68
|
+
check_git_log(self.repodirname, "Initial commit")
|
|
69
|
+
self.clonedirname = self.tmpdirname + "/clone"
|
|
70
|
+
run_command(
|
|
71
|
+
f"git clone {self.repodirname} {self.clonedirname}", self.repodirname, f"Cloned to {self.clonedirname}"
|
|
72
|
+
)
|
|
73
|
+
set_credentials(self.clonedirname)
|
|
74
|
+
|
|
75
|
+
def teardown_method(self) -> None:
|
|
76
|
+
"""Remove the temporary directory."""
|
|
77
|
+
run_command(f"rm -rf {self.tmpdirname}", self.tmpdirname)
|
|
78
|
+
|
|
79
|
+
def test_integration_patch(self) -> None:
|
|
80
|
+
"""Test the integration of the semvergit package with a patch version update."""
|
|
81
|
+
add_file_to_repo("test.txt", self.clonedirname, "Hello, World!")
|
|
82
|
+
check_git_log(self.clonedirname, "Added test.txt")
|
|
83
|
+
update_version(self.clonedirname, "patch", "v0.0.1")
|
|
84
|
+
add_file_to_repo("test2.txt", self.clonedirname, "New content")
|
|
85
|
+
check_git_log(self.clonedirname, "Added test2.txt")
|
|
86
|
+
update_version(self.clonedirname, "patch", "v0.0.2")
|
|
87
|
+
check_git_log(self.clonedirname, "v0.0.2")
|
|
88
|
+
|
|
89
|
+
def test_integration_minor(self) -> None:
|
|
90
|
+
"""Test the integration of the semvergit package with a minor version update."""
|
|
91
|
+
add_file_to_repo("test.txt", self.clonedirname, "Hello, World!")
|
|
92
|
+
check_git_log(self.clonedirname, "Added test.txt")
|
|
93
|
+
update_version(self.clonedirname, "minor", "v0.1.0")
|
|
94
|
+
add_file_to_repo("test2.txt", self.clonedirname, "New content")
|
|
95
|
+
check_git_log(self.clonedirname, "Added test2.txt")
|
|
96
|
+
update_version(self.clonedirname, "minor", "v0.2.0")
|
|
97
|
+
check_git_log(self.clonedirname, "v0.2.0")
|
|
98
|
+
|
|
99
|
+
def test_integration_major(self) -> None:
|
|
100
|
+
"""Test the integration of the semvergit package with a major version update."""
|
|
101
|
+
add_file_to_repo("test.txt", self.clonedirname, "Hello, World!")
|
|
102
|
+
check_git_log(self.clonedirname, "Added test.txt")
|
|
103
|
+
update_version(self.clonedirname, "major", "v1.0.0")
|
|
104
|
+
add_file_to_repo("test2.txt", self.clonedirname, "New content")
|
|
105
|
+
check_git_log(self.clonedirname, "Added test2.txt")
|
|
106
|
+
update_version(self.clonedirname, "major", "v2.0.0")
|
|
107
|
+
check_git_log(self.clonedirname, "v2.0.0")
|
|
108
|
+
|
|
109
|
+
def test_integration_prerelease(self) -> None:
|
|
110
|
+
"""Test the integration of the semvergit package with a prerelease version update."""
|
|
111
|
+
add_file_to_repo("test.txt", self.clonedirname, "Hello, World!")
|
|
112
|
+
check_git_log(self.clonedirname, "Added test.txt")
|
|
113
|
+
update_version(self.clonedirname, "prerelease", "v0.0.1-dev.1")
|
|
114
|
+
add_file_to_repo("test2.txt", self.clonedirname, "New content")
|
|
115
|
+
check_git_log(self.clonedirname, "Added test2.txt")
|
|
116
|
+
update_version(self.clonedirname, "prerelease", "v0.0.1-dev.2")
|
|
117
|
+
check_git_log(self.clonedirname, "v0.0.1-dev.2")
|
|
118
|
+
|
|
119
|
+
def test_integration_stack(self) -> None:
|
|
120
|
+
"""Test the integration of the semvergit package with multiple version updates."""
|
|
121
|
+
add_file_to_repo("test.txt", self.clonedirname, "Hello, World!")
|
|
122
|
+
check_git_log(self.clonedirname, "Added test.txt")
|
|
123
|
+
update_version(self.clonedirname, "patch", "v0.0.1")
|
|
124
|
+
add_file_to_repo("test2.txt", self.clonedirname, "New content")
|
|
125
|
+
check_git_log(self.clonedirname, "Added test2.txt")
|
|
126
|
+
update_version(self.clonedirname, "minor", "v0.1.0")
|
|
127
|
+
add_file_to_repo("test3.txt", self.clonedirname, "More content")
|
|
128
|
+
check_git_log(self.clonedirname, "Added test3.txt")
|
|
129
|
+
update_version(self.clonedirname, "major", "v1.0.0")
|
|
130
|
+
add_file_to_repo("test4.txt", self.clonedirname, "Even more content")
|
|
131
|
+
check_git_log(self.clonedirname, "Added test4.txt")
|
|
132
|
+
update_version(self.clonedirname, "minor", "v1.1.0")
|
|
133
|
+
add_file_to_repo("test5.txt", self.clonedirname, "Some more content")
|
|
134
|
+
check_git_log(self.clonedirname, "Added test5.txt")
|
|
135
|
+
update_version(self.clonedirname, "patch", "v1.1.1")
|
|
136
|
+
check_git_log(self.clonedirname, "v1.1.1")
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
coverage==7.4.4 # via pytest-cov
|
|
2
|
-
exceptiongroup==1.2.0 # via pytest
|
|
3
|
-
iniconfig==2.0.0 # via pytest
|
|
4
|
-
packaging==24.0 # via pytest
|
|
5
|
-
pluggy==1.4.0 # via pytest
|
|
6
|
-
pytest==8.1.1 # via -r requirements-test.in, pytest-cov
|
|
7
|
-
pytest-cov==5.0.0 # via -r requirements-test.in
|
|
8
|
-
tomli==2.0.1 # via coverage, pytest
|
semvergit-0.2.1/requirements.txt
DELETED
|
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
|