python-kacl 0.7.1__tar.gz → 0.7.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.
- {python_kacl-0.7.1/python_kacl.egg-info → python_kacl-0.7.2}/PKG-INFO +1 -1
- {python_kacl-0.7.1 → python_kacl-0.7.2}/kacl/__init__.py +1 -1
- {python_kacl-0.7.1 → python_kacl-0.7.2}/kacl/document.py +5 -2
- {python_kacl-0.7.1 → python_kacl-0.7.2}/pyproject.toml +1 -1
- {python_kacl-0.7.1 → python_kacl-0.7.2/python_kacl.egg-info}/PKG-INFO +1 -1
- {python_kacl-0.7.1 → python_kacl-0.7.2}/tests/test_cli.py +34 -0
- {python_kacl-0.7.1 → python_kacl-0.7.2}/LICENSE +0 -0
- {python_kacl-0.7.1 → python_kacl-0.7.2}/MANIFEST.in +0 -0
- {python_kacl-0.7.1 → python_kacl-0.7.2}/README.md +0 -0
- {python_kacl-0.7.1 → python_kacl-0.7.2}/kacl/__main__.py +0 -0
- {python_kacl-0.7.1 → python_kacl-0.7.2}/kacl/changes.py +0 -0
- {python_kacl-0.7.1 → python_kacl-0.7.2}/kacl/config/kacl-default.yml +0 -0
- {python_kacl-0.7.1 → python_kacl-0.7.2}/kacl/config.py +0 -0
- {python_kacl-0.7.1 → python_kacl-0.7.2}/kacl/element.py +0 -0
- {python_kacl-0.7.1 → python_kacl-0.7.2}/kacl/exception.py +0 -0
- {python_kacl-0.7.1 → python_kacl-0.7.2}/kacl/jira_client.py +0 -0
- {python_kacl-0.7.1 → python_kacl-0.7.2}/kacl/kacl_cli.py +0 -0
- {python_kacl-0.7.1 → python_kacl-0.7.2}/kacl/link_provider.py +0 -0
- {python_kacl-0.7.1 → python_kacl-0.7.2}/kacl/parser.py +0 -0
- {python_kacl-0.7.1 → python_kacl-0.7.2}/kacl/serializer.py +0 -0
- {python_kacl-0.7.1 → python_kacl-0.7.2}/kacl/utils.py +0 -0
- {python_kacl-0.7.1 → python_kacl-0.7.2}/kacl/validation.py +0 -0
- {python_kacl-0.7.1 → python_kacl-0.7.2}/kacl/version.py +0 -0
- {python_kacl-0.7.1 → python_kacl-0.7.2}/python_kacl.egg-info/SOURCES.txt +0 -0
- {python_kacl-0.7.1 → python_kacl-0.7.2}/python_kacl.egg-info/dependency_links.txt +0 -0
- {python_kacl-0.7.1 → python_kacl-0.7.2}/python_kacl.egg-info/entry_points.txt +0 -0
- {python_kacl-0.7.1 → python_kacl-0.7.2}/python_kacl.egg-info/not-zip-safe +0 -0
- {python_kacl-0.7.1 → python_kacl-0.7.2}/python_kacl.egg-info/requires.txt +0 -0
- {python_kacl-0.7.1 → python_kacl-0.7.2}/python_kacl.egg-info/top_level.txt +0 -0
- {python_kacl-0.7.1 → python_kacl-0.7.2}/requirements.txt +0 -0
- {python_kacl-0.7.1 → python_kacl-0.7.2}/setup.cfg +0 -0
- {python_kacl-0.7.1 → python_kacl-0.7.2}/tests/test_cli_workflow.py +0 -0
- {python_kacl-0.7.1 → python_kacl-0.7.2}/tests/test_kacl.py +0 -0
|
@@ -369,14 +369,17 @@ class KACLDocument:
|
|
|
369
369
|
f.close()
|
|
370
370
|
|
|
371
371
|
# Clear the unreleased section by replacing it with an empty one
|
|
372
|
-
# Find and remove the current unreleased version
|
|
372
|
+
# Find and remove the current unreleased version but keep the link reference if it exists
|
|
373
|
+
link = None
|
|
374
|
+
|
|
373
375
|
for i, version in enumerate(self.__versions):
|
|
374
376
|
if version.version() == "Unreleased":
|
|
377
|
+
link = version.link()
|
|
375
378
|
self.__versions.pop(i)
|
|
376
379
|
break
|
|
377
380
|
|
|
378
381
|
# Add a new empty unreleased version
|
|
379
|
-
new_unreleased = KACLVersion(version="Unreleased")
|
|
382
|
+
new_unreleased = KACLVersion(version="Unreleased", link=link)
|
|
380
383
|
self.__versions.insert(0, new_unreleased)
|
|
381
384
|
|
|
382
385
|
return True
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "python-kacl"
|
|
7
|
-
version = "0.7.
|
|
7
|
+
version = "0.7.2"
|
|
8
8
|
description = "Python module and CLI tool for validating and modifying Changelogs in \"keep-a-changelog\" format\""
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.9"
|
|
@@ -654,6 +654,40 @@ def test_stash_with_pre_existing(tmp_path, snapshot):
|
|
|
654
654
|
snapshot_directory(snapshot=snapshot, directory_path=project_root_path)
|
|
655
655
|
|
|
656
656
|
|
|
657
|
+
@freeze_time("2023-01-01")
|
|
658
|
+
def test_stash_with_link(tmp_path, snapshot):
|
|
659
|
+
"""Test stashing when there is a pre-existing stash file with changes."""
|
|
660
|
+
runner = CliRunner()
|
|
661
|
+
resources_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "data/")
|
|
662
|
+
changelog_file = os.path.join(resources_dir, "CHANGELOG_with_changes_and_link.md")
|
|
663
|
+
stash_dir_source = os.path.join(resources_dir, "stash")
|
|
664
|
+
|
|
665
|
+
with runner.isolated_filesystem(temp_dir=tmp_path) as project_root_path:
|
|
666
|
+
shutil.copyfile(changelog_file, os.path.join(project_root_path, "CHANGELOG.md"))
|
|
667
|
+
# Copy pre-existing stash directory
|
|
668
|
+
shutil.copytree(
|
|
669
|
+
stash_dir_source, os.path.join(project_root_path, ".kacl_stash")
|
|
670
|
+
)
|
|
671
|
+
|
|
672
|
+
result = runner.invoke(
|
|
673
|
+
cli,
|
|
674
|
+
[
|
|
675
|
+
"-c",
|
|
676
|
+
os.path.join(resources_dir, "extension-config.yml"),
|
|
677
|
+
"-f",
|
|
678
|
+
"CHANGELOG.md",
|
|
679
|
+
"stash",
|
|
680
|
+
"-m",
|
|
681
|
+
],
|
|
682
|
+
catch_exceptions=False,
|
|
683
|
+
)
|
|
684
|
+
assert result.exit_code == 0, result.output
|
|
685
|
+
assert "Success: Unreleased changes have been moved to" in result.output
|
|
686
|
+
assert "Success: Changelog file CHANGELOG.md has been updated" in result.output
|
|
687
|
+
|
|
688
|
+
snapshot_directory(snapshot=snapshot, directory_path=project_root_path)
|
|
689
|
+
|
|
690
|
+
|
|
657
691
|
@freeze_time("2023-01-01")
|
|
658
692
|
def test_stash_no_changes(tmp_path, snapshot):
|
|
659
693
|
"""Test stashing when there are no unreleased 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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|