python-kacl 0.4.6__tar.gz → 0.4.7__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.
- {python-kacl-0.4.6/python_kacl.egg-info → python_kacl-0.4.7}/PKG-INFO +5 -1
- {python-kacl-0.4.6 → python_kacl-0.4.7}/kacl/__init__.py +1 -1
- {python-kacl-0.4.6 → python_kacl-0.4.7}/kacl/document.py +9 -3
- {python-kacl-0.4.6 → python_kacl-0.4.7}/kacl/version.py +1 -1
- {python-kacl-0.4.6 → python_kacl-0.4.7/python_kacl.egg-info}/PKG-INFO +5 -1
- {python-kacl-0.4.6 → python_kacl-0.4.7}/setup.py +2 -2
- {python-kacl-0.4.6 → python_kacl-0.4.7}/tests/test_kacl.py +24 -0
- {python-kacl-0.4.6 → python_kacl-0.4.7}/LICENSE +0 -0
- {python-kacl-0.4.6 → python_kacl-0.4.7}/MANIFEST.in +0 -0
- {python-kacl-0.4.6 → python_kacl-0.4.7}/README.md +0 -0
- {python-kacl-0.4.6 → python_kacl-0.4.7}/kacl/__main__.py +0 -0
- {python-kacl-0.4.6 → python_kacl-0.4.7}/kacl/changes.py +0 -0
- {python-kacl-0.4.6 → python_kacl-0.4.7}/kacl/config/kacl-default.yml +0 -0
- {python-kacl-0.4.6 → python_kacl-0.4.7}/kacl/config.py +0 -0
- {python-kacl-0.4.6 → python_kacl-0.4.7}/kacl/element.py +0 -0
- {python-kacl-0.4.6 → python_kacl-0.4.7}/kacl/exception.py +0 -0
- {python-kacl-0.4.6 → python_kacl-0.4.7}/kacl/kacl_cli.py +0 -0
- {python-kacl-0.4.6 → python_kacl-0.4.7}/kacl/link_provider.py +0 -0
- {python-kacl-0.4.6 → python_kacl-0.4.7}/kacl/parser.py +0 -0
- {python-kacl-0.4.6 → python_kacl-0.4.7}/kacl/serializer.py +0 -0
- {python-kacl-0.4.6 → python_kacl-0.4.7}/kacl/validation.py +0 -0
- {python-kacl-0.4.6 → python_kacl-0.4.7}/python_kacl.egg-info/SOURCES.txt +0 -0
- {python-kacl-0.4.6 → python_kacl-0.4.7}/python_kacl.egg-info/dependency_links.txt +0 -0
- {python-kacl-0.4.6 → python_kacl-0.4.7}/python_kacl.egg-info/entry_points.txt +0 -0
- {python-kacl-0.4.6 → python_kacl-0.4.7}/python_kacl.egg-info/not-zip-safe +0 -0
- {python-kacl-0.4.6 → python_kacl-0.4.7}/python_kacl.egg-info/requires.txt +0 -0
- {python-kacl-0.4.6 → python_kacl-0.4.7}/python_kacl.egg-info/top_level.txt +0 -0
- {python-kacl-0.4.6 → python_kacl-0.4.7}/setup.cfg +0 -0
- {python-kacl-0.4.6 → python_kacl-0.4.7}/tests/__init__.py +0 -0
- {python-kacl-0.4.6 → python_kacl-0.4.7}/tests/snapshot_directory.py +0 -0
- {python-kacl-0.4.6 → python_kacl-0.4.7}/tests/test_cli.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: python-kacl
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.7
|
|
4
4
|
Summary: Python module and CLI tool for validating and modifying Changelogs in "keep-a-changelog" format"
|
|
5
5
|
Home-page: https://gitlab.com/schmieder.matthias/python-kacl.git
|
|
6
6
|
Author: Matthias Schmieder
|
|
@@ -14,6 +14,10 @@ Classifier: Topic :: Software Development :: Version Control
|
|
|
14
14
|
Requires-Python: >=3.7
|
|
15
15
|
Description-Content-Type: text/markdown
|
|
16
16
|
License-File: LICENSE
|
|
17
|
+
Requires-Dist: click
|
|
18
|
+
Requires-Dist: semver
|
|
19
|
+
Requires-Dist: gitpython
|
|
20
|
+
Requires-Dist: pyyaml
|
|
17
21
|
|
|
18
22
|
# python-kacl
|
|
19
23
|
|
|
@@ -229,12 +229,20 @@ class KACLDocument:
|
|
|
229
229
|
version {[str]} -- semantic versioning string
|
|
230
230
|
increment {[str]} -- use either 'patch', 'minor', or 'major' to automatically increment the last version
|
|
231
231
|
"""
|
|
232
|
+
|
|
233
|
+
# check if 'post_release_version_prefix' is set
|
|
234
|
+
post_release_version_prefix = self.config.post_release_version_prefix
|
|
235
|
+
|
|
232
236
|
if increment:
|
|
233
237
|
v = self.current_version()
|
|
234
238
|
if v:
|
|
235
239
|
sv = semver.VersionInfo.parse(v)
|
|
236
240
|
if "post" == increment:
|
|
237
|
-
|
|
241
|
+
if not post_release_version_prefix:
|
|
242
|
+
raise KACLException(
|
|
243
|
+
"No 'post_release_version_prefix' set in the config. Incrementing not possible"
|
|
244
|
+
)
|
|
245
|
+
sv = sv.bump_prerelease(token=post_release_version_prefix)
|
|
238
246
|
elif "patch" == increment:
|
|
239
247
|
sv = sv.bump_patch()
|
|
240
248
|
elif "minor" == increment:
|
|
@@ -282,8 +290,6 @@ class KACLDocument:
|
|
|
282
290
|
patch=future_version.patch,
|
|
283
291
|
)
|
|
284
292
|
|
|
285
|
-
# check if 'post_release_version_prefix' is set
|
|
286
|
-
post_release_version_prefix = self.config.post_release_version_prefix
|
|
287
293
|
comp_result = 0
|
|
288
294
|
if post_release_version_prefix:
|
|
289
295
|
# 2.1 Check if 'future version' is a 'post version'
|
|
@@ -215,7 +215,7 @@ class KACLVersion(KACLElement):
|
|
|
215
215
|
KACLValidationError(
|
|
216
216
|
line=element.raw(),
|
|
217
217
|
line_number=element.line_number(),
|
|
218
|
-
error_message=f'"{title}" is not a valid section for a version. Options are [{",".join(
|
|
218
|
+
error_message=f'"{title}" is not a valid section for a version. Options are [{",".join(config.allowed_version_sections)}]',
|
|
219
219
|
start_character_pos=start_pos,
|
|
220
220
|
end_character_pos=end_pos,
|
|
221
221
|
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: python-kacl
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.7
|
|
4
4
|
Summary: Python module and CLI tool for validating and modifying Changelogs in "keep-a-changelog" format"
|
|
5
5
|
Home-page: https://gitlab.com/schmieder.matthias/python-kacl.git
|
|
6
6
|
Author: Matthias Schmieder
|
|
@@ -14,6 +14,10 @@ Classifier: Topic :: Software Development :: Version Control
|
|
|
14
14
|
Requires-Python: >=3.7
|
|
15
15
|
Description-Content-Type: text/markdown
|
|
16
16
|
License-File: LICENSE
|
|
17
|
+
Requires-Dist: click
|
|
18
|
+
Requires-Dist: semver
|
|
19
|
+
Requires-Dist: gitpython
|
|
20
|
+
Requires-Dist: pyyaml
|
|
17
21
|
|
|
18
22
|
# python-kacl
|
|
19
23
|
|
|
@@ -11,9 +11,9 @@ this_directory = path.abspath(path.dirname(__file__))
|
|
|
11
11
|
with open(path.join(this_directory, "README.md"), encoding="utf-8") as f:
|
|
12
12
|
long_description = f.read()
|
|
13
13
|
|
|
14
|
-
version = "0.4.
|
|
14
|
+
version = "0.4.7"
|
|
15
15
|
|
|
16
|
-
version = f"{version}{os.environ.get('PIP_VERSION_POSTFIX','')}"
|
|
16
|
+
version = f"{version}{os.environ.get('PIP_VERSION_POSTFIX', '')}"
|
|
17
17
|
|
|
18
18
|
# read the requirements from requirements.txt
|
|
19
19
|
requirements = []
|
|
@@ -240,6 +240,7 @@ class TestKacl(TestCase):
|
|
|
240
240
|
|
|
241
241
|
for increment, expected_version in fail_tests.items():
|
|
242
242
|
changelog = kacl.load(changelog_file)
|
|
243
|
+
changelog.config.post_release_version_prefix = None
|
|
243
244
|
|
|
244
245
|
msg = "This is my first added change"
|
|
245
246
|
changelog.add("Added", msg)
|
|
@@ -269,6 +270,28 @@ class TestKacl(TestCase):
|
|
|
269
270
|
changelog.release(increment=increment)
|
|
270
271
|
self.assertEqual(expected_version, changelog.current_version())
|
|
271
272
|
|
|
273
|
+
def test_release_with_increment_extension_hotfix(self):
|
|
274
|
+
tests = {
|
|
275
|
+
"major": "2.0.0",
|
|
276
|
+
"minor": "1.1.0",
|
|
277
|
+
"patch": "1.0.1",
|
|
278
|
+
"post": "1.0.0-hotfix.1",
|
|
279
|
+
}
|
|
280
|
+
changelog_file = os.path.join(
|
|
281
|
+
os.path.dirname(os.path.realpath(__file__)), "data/CHANGELOG.md"
|
|
282
|
+
)
|
|
283
|
+
|
|
284
|
+
for increment, expected_version in tests.items():
|
|
285
|
+
changelog = kacl.load(changelog_file)
|
|
286
|
+
changelog.config.post_release_version_prefix = "hotfix"
|
|
287
|
+
|
|
288
|
+
msg = "This is my first added change"
|
|
289
|
+
changelog.add("Added", msg)
|
|
290
|
+
|
|
291
|
+
self.assertTrue(changelog.has_changes())
|
|
292
|
+
changelog.release(increment=increment)
|
|
293
|
+
self.assertEqual(expected_version, changelog.current_version())
|
|
294
|
+
|
|
272
295
|
def test_post_release_with_increment(self):
|
|
273
296
|
tests = {
|
|
274
297
|
"major": "2.0.0",
|
|
@@ -282,6 +305,7 @@ class TestKacl(TestCase):
|
|
|
282
305
|
|
|
283
306
|
for increment, expected_version in tests.items():
|
|
284
307
|
changelog = kacl.load(changelog_file)
|
|
308
|
+
changelog.config.post_release_version_prefix = "post"
|
|
285
309
|
|
|
286
310
|
msg = "This is my first added change"
|
|
287
311
|
changelog.add("Added", msg)
|
|
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
|