python-semantic-release 9.4.0__tar.gz → 9.4.1__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.
Files changed (146) hide show
  1. {python-semantic-release-9.4.0/python_semantic_release.egg-info → python-semantic-release-9.4.1}/PKG-INFO +3 -3
  2. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/pyproject.toml +3 -3
  3. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1/python_semantic_release.egg-info}/PKG-INFO +3 -3
  4. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/python_semantic_release.egg-info/requires.txt +2 -2
  5. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/semantic_release/__init__.py +1 -1
  6. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/semantic_release/cli/github_actions_output.py +2 -1
  7. python-semantic-release-9.4.1/tests/unit/semantic_release/cli/test_github_actions_output.py +77 -0
  8. python-semantic-release-9.4.0/tests/unit/semantic_release/cli/test_github_actions_output.py +0 -66
  9. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/AUTHORS.rst +0 -0
  10. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/LICENSE +0 -0
  11. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/MANIFEST.in +0 -0
  12. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/README.rst +0 -0
  13. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/docs/Makefile +0 -0
  14. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/docs/algorithm.rst +0 -0
  15. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/docs/automatic-releases/cronjobs.rst +0 -0
  16. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/docs/automatic-releases/github-actions.rst +0 -0
  17. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/docs/automatic-releases/index.rst +0 -0
  18. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/docs/automatic-releases/travis.rst +0 -0
  19. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/docs/changelog_templates.rst +0 -0
  20. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/docs/commands.rst +0 -0
  21. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/docs/commit-parsing.rst +0 -0
  22. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/docs/conf.py +0 -0
  23. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/docs/configuration.rst +0 -0
  24. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/docs/contributing.rst +0 -0
  25. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/docs/contributors.rst +0 -0
  26. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/docs/github-action.rst +0 -0
  27. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/docs/index.rst +0 -0
  28. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/docs/make.bat +0 -0
  29. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/docs/migrating_from_v7.rst +0 -0
  30. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/docs/multibranch_releases.rst +0 -0
  31. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/docs/strict_mode.rst +0 -0
  32. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/docs/troubleshooting.rst +0 -0
  33. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/python_semantic_release.egg-info/SOURCES.txt +0 -0
  34. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/python_semantic_release.egg-info/dependency_links.txt +0 -0
  35. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/python_semantic_release.egg-info/entry_points.txt +0 -0
  36. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/python_semantic_release.egg-info/top_level.txt +0 -0
  37. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/semantic_release/__main__.py +0 -0
  38. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/semantic_release/changelog/__init__.py +0 -0
  39. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/semantic_release/changelog/context.py +0 -0
  40. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/semantic_release/changelog/release_history.py +0 -0
  41. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/semantic_release/changelog/template.py +0 -0
  42. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/semantic_release/cli/__init__.py +0 -0
  43. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/semantic_release/cli/commands/__init__.py +0 -0
  44. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/semantic_release/cli/commands/changelog.py +0 -0
  45. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/semantic_release/cli/commands/cli_context.py +0 -0
  46. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/semantic_release/cli/commands/generate_config.py +0 -0
  47. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/semantic_release/cli/commands/main.py +0 -0
  48. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/semantic_release/cli/commands/publish.py +0 -0
  49. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/semantic_release/cli/commands/version.py +0 -0
  50. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/semantic_release/cli/common.py +0 -0
  51. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/semantic_release/cli/config.py +0 -0
  52. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/semantic_release/cli/const.py +0 -0
  53. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/semantic_release/cli/masking_filter.py +0 -0
  54. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/semantic_release/cli/util.py +0 -0
  55. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/semantic_release/commit_parser/__init__.py +0 -0
  56. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/semantic_release/commit_parser/_base.py +0 -0
  57. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/semantic_release/commit_parser/angular.py +0 -0
  58. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/semantic_release/commit_parser/emoji.py +0 -0
  59. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/semantic_release/commit_parser/scipy.py +0 -0
  60. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/semantic_release/commit_parser/tag.py +0 -0
  61. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/semantic_release/commit_parser/token.py +0 -0
  62. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/semantic_release/commit_parser/util.py +0 -0
  63. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/semantic_release/const.py +0 -0
  64. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/semantic_release/data/templates/CHANGELOG.md.j2 +0 -0
  65. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/semantic_release/data/templates/release_notes.md.j2 +0 -0
  66. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/semantic_release/enums.py +0 -0
  67. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/semantic_release/errors.py +0 -0
  68. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/semantic_release/helpers.py +0 -0
  69. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/semantic_release/hvcs/__init__.py +0 -0
  70. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/semantic_release/hvcs/_base.py +0 -0
  71. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/semantic_release/hvcs/bitbucket.py +0 -0
  72. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/semantic_release/hvcs/gitea.py +0 -0
  73. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/semantic_release/hvcs/github.py +0 -0
  74. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/semantic_release/hvcs/gitlab.py +0 -0
  75. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/semantic_release/hvcs/token_auth.py +0 -0
  76. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/semantic_release/hvcs/util.py +0 -0
  77. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/semantic_release/version/__init__.py +0 -0
  78. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/semantic_release/version/algorithm.py +0 -0
  79. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/semantic_release/version/declaration.py +0 -0
  80. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/semantic_release/version/translator.py +0 -0
  81. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/semantic_release/version/version.py +0 -0
  82. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/setup.cfg +0 -0
  83. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/__init__.py +0 -0
  84. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/command_line/__init__.py +0 -0
  85. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/command_line/conftest.py +0 -0
  86. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/command_line/test_changelog.py +0 -0
  87. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/command_line/test_generate_config.py +0 -0
  88. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/command_line/test_help.py +0 -0
  89. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/command_line/test_main.py +0 -0
  90. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/command_line/test_publish.py +0 -0
  91. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/command_line/test_version.py +0 -0
  92. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/conftest.py +0 -0
  93. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/const.py +0 -0
  94. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/fixtures/__init__.py +0 -0
  95. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/fixtures/commit_parsers.py +0 -0
  96. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/fixtures/example_project.py +0 -0
  97. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/fixtures/git_repo.py +0 -0
  98. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/fixtures/repos/__init__.py +0 -0
  99. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/fixtures/repos/git_flow/__init__.py +0 -0
  100. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/fixtures/repos/git_flow/repo_w_2_release_channels.py +0 -0
  101. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/fixtures/repos/git_flow/repo_w_3_release_channels.py +0 -0
  102. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/fixtures/repos/github_flow/__init__.py +0 -0
  103. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/fixtures/repos/github_flow/repo_w_release_channels.py +0 -0
  104. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/fixtures/repos/trunk_based_dev/__init__.py +0 -0
  105. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/fixtures/repos/trunk_based_dev/repo_w_no_tags.py +0 -0
  106. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/fixtures/repos/trunk_based_dev/repo_w_prereleases.py +0 -0
  107. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/fixtures/repos/trunk_based_dev/repo_w_tags.py +0 -0
  108. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/fixtures/scipy.py +0 -0
  109. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/scenario/__init__.py +0 -0
  110. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/scenario/test_next_version.py +0 -0
  111. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/scenario/test_release_history.py +0 -0
  112. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/scenario/test_template_render.py +0 -0
  113. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/unit/__init__.py +0 -0
  114. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/unit/semantic_release/__init__.py +0 -0
  115. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/unit/semantic_release/changelog/__init__.py +0 -0
  116. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/unit/semantic_release/changelog/test_default_changelog.py +0 -0
  117. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/unit/semantic_release/changelog/test_release_notes.py +0 -0
  118. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/unit/semantic_release/changelog/test_template.py +0 -0
  119. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/unit/semantic_release/cli/__init__.py +0 -0
  120. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/unit/semantic_release/cli/test_config.py +0 -0
  121. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/unit/semantic_release/cli/test_masking_filter.py +0 -0
  122. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/unit/semantic_release/cli/test_util.py +0 -0
  123. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/unit/semantic_release/cli/test_version.py +0 -0
  124. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/unit/semantic_release/commit_parser/__init__.py +0 -0
  125. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/unit/semantic_release/commit_parser/helper.py +0 -0
  126. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/unit/semantic_release/commit_parser/test_angular.py +0 -0
  127. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/unit/semantic_release/commit_parser/test_emoji.py +0 -0
  128. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/unit/semantic_release/commit_parser/test_scipy.py +0 -0
  129. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/unit/semantic_release/commit_parser/test_tag.py +0 -0
  130. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/unit/semantic_release/commit_parser/test_token.py +0 -0
  131. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/unit/semantic_release/commit_parser/test_util.py +0 -0
  132. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/unit/semantic_release/hvcs/__init__.py +0 -0
  133. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/unit/semantic_release/hvcs/test__base.py +0 -0
  134. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/unit/semantic_release/hvcs/test_bitbucket.py +0 -0
  135. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/unit/semantic_release/hvcs/test_gitea.py +0 -0
  136. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/unit/semantic_release/hvcs/test_github.py +0 -0
  137. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/unit/semantic_release/hvcs/test_gitlab.py +0 -0
  138. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/unit/semantic_release/hvcs/test_token_auth.py +0 -0
  139. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/unit/semantic_release/hvcs/test_util.py +0 -0
  140. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/unit/semantic_release/test_helpers.py +0 -0
  141. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/unit/semantic_release/version/__init__.py +0 -0
  142. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/unit/semantic_release/version/test_algorithm.py +0 -0
  143. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/unit/semantic_release/version/test_declaration.py +0 -0
  144. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/unit/semantic_release/version/test_translator.py +0 -0
  145. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/unit/semantic_release/version/test_version.py +0 -0
  146. {python-semantic-release-9.4.0 → python-semantic-release-9.4.1}/tests/util.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-semantic-release
3
- Version: 9.4.0
3
+ Version: 9.4.1
4
4
  Summary: Automatic Semantic Versioning for Python projects
5
5
  Author-email: Rolf Erik Lekang <me@rolflekang.com>
6
6
  License: MIT
@@ -53,9 +53,9 @@ Requires-Dist: types-pytest-lazy-fixture~=0.6.3; extra == "test"
53
53
  Provides-Extra: dev
54
54
  Requires-Dist: pre-commit~=3.5; extra == "dev"
55
55
  Requires-Dist: tox~=4.11; extra == "dev"
56
- Requires-Dist: ruff==0.3.4; extra == "dev"
56
+ Requires-Dist: ruff==0.3.5; extra == "dev"
57
57
  Provides-Extra: mypy
58
- Requires-Dist: mypy==1.8.0; extra == "mypy"
58
+ Requires-Dist: mypy==1.9.0; extra == "mypy"
59
59
  Requires-Dist: types-requests~=2.31.0; extra == "mypy"
60
60
 
61
61
  Python Semantic Release
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
6
6
 
7
7
  [project]
8
8
  name = "python-semantic-release"
9
- version = "9.4.0"
9
+ version = "9.4.1"
10
10
  description = "Automatic Semantic Versioning for Python projects"
11
11
  requires-python = ">=3.8"
12
12
  license = { text = "MIT" }
@@ -71,10 +71,10 @@ test = [
71
71
  dev = [
72
72
  "pre-commit ~= 3.5",
73
73
  "tox ~= 4.11",
74
- "ruff == 0.3.4"
74
+ "ruff == 0.3.5"
75
75
  ]
76
76
  mypy = [
77
- "mypy == 1.8.0",
77
+ "mypy == 1.9.0",
78
78
  "types-requests ~= 2.31.0"
79
79
  ]
80
80
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-semantic-release
3
- Version: 9.4.0
3
+ Version: 9.4.1
4
4
  Summary: Automatic Semantic Versioning for Python projects
5
5
  Author-email: Rolf Erik Lekang <me@rolflekang.com>
6
6
  License: MIT
@@ -53,9 +53,9 @@ Requires-Dist: types-pytest-lazy-fixture~=0.6.3; extra == "test"
53
53
  Provides-Extra: dev
54
54
  Requires-Dist: pre-commit~=3.5; extra == "dev"
55
55
  Requires-Dist: tox~=4.11; extra == "dev"
56
- Requires-Dist: ruff==0.3.4; extra == "dev"
56
+ Requires-Dist: ruff==0.3.5; extra == "dev"
57
57
  Provides-Extra: mypy
58
- Requires-Dist: mypy==1.8.0; extra == "mypy"
58
+ Requires-Dist: mypy==1.9.0; extra == "mypy"
59
59
  Requires-Dist: types-requests~=2.31.0; extra == "mypy"
60
60
 
61
61
  Python Semantic Release
@@ -14,7 +14,7 @@ shellingham~=1.5
14
14
  [dev]
15
15
  pre-commit~=3.5
16
16
  tox~=4.11
17
- ruff==0.3.4
17
+ ruff==0.3.5
18
18
 
19
19
  [docs]
20
20
  Sphinx~=6.0
@@ -23,7 +23,7 @@ sphinx-autobuild==2024.2.4
23
23
  furo~=2023.3
24
24
 
25
25
  [mypy]
26
- mypy==1.8.0
26
+ mypy==1.9.0
27
27
  types-requests~=2.31.0
28
28
 
29
29
  [test]
@@ -24,7 +24,7 @@ from semantic_release.version import (
24
24
  tags_and_versions,
25
25
  )
26
26
 
27
- __version__ = "9.4.0"
27
+ __version__ = "9.4.1"
28
28
 
29
29
 
30
30
  def setup_hook(argv: list[str]) -> None:
@@ -62,7 +62,8 @@ class VersionGitHubActionsOutput:
62
62
  "version": str(self.version),
63
63
  "tag": self.tag,
64
64
  }
65
- return "\n".join(f"{key}={value!s}" for key, value in outputs.items())
65
+
66
+ return str.join("", [f"{key}={value!s}\n" for key, value in outputs.items()])
66
67
 
67
68
  def write_if_possible(self, filename: str | None = None) -> None:
68
69
  output_file = filename or os.getenv(self.OUTPUT_ENV_VAR)
@@ -0,0 +1,77 @@
1
+ from __future__ import annotations
2
+
3
+ from textwrap import dedent
4
+ from typing import TYPE_CHECKING
5
+
6
+ import pytest
7
+
8
+ from semantic_release import Version
9
+ from semantic_release.cli.github_actions_output import VersionGitHubActionsOutput
10
+
11
+ from tests.util import actions_output_to_dict
12
+
13
+ if TYPE_CHECKING:
14
+ from pathlib import Path
15
+
16
+
17
+ @pytest.mark.parametrize("released", (True, False))
18
+ def test_version_github_actions_output_format(released: bool):
19
+ version_str = "1.2.3"
20
+ expected_output = dedent(
21
+ f"""\
22
+ released={'true' if released else 'false'}
23
+ version={version_str}
24
+ tag=v{version_str}
25
+ """
26
+ )
27
+ output = VersionGitHubActionsOutput(
28
+ released=released,
29
+ version=Version.parse(version_str),
30
+ )
31
+
32
+ # Evaluate (expected -> actual)
33
+ assert expected_output == output.to_output_text()
34
+
35
+
36
+ def test_version_github_actions_output_fails_if_missing_output():
37
+ output = VersionGitHubActionsOutput(
38
+ version=Version.parse("1.2.3"),
39
+ )
40
+
41
+ # Execute with expected failure
42
+ with pytest.raises(ValueError, match="required outputs were not set"):
43
+ output.to_output_text()
44
+
45
+
46
+ def test_version_github_actions_output_writes_to_github_output_if_available(
47
+ monkeypatch: pytest.MonkeyPatch, tmp_path: Path
48
+ ):
49
+ mock_output_file = tmp_path / "action.out"
50
+ version_str = "1.2.3"
51
+ monkeypatch.setenv("GITHUB_OUTPUT", str(mock_output_file.resolve()))
52
+ output = VersionGitHubActionsOutput(
53
+ version=Version.parse(version_str),
54
+ released=True,
55
+ )
56
+
57
+ output.write_if_possible()
58
+
59
+ action_outputs = actions_output_to_dict(
60
+ mock_output_file.read_text(encoding="utf-8")
61
+ )
62
+
63
+ # Evaluate (expected -> actual)
64
+ assert version_str == action_outputs["version"]
65
+ assert str(True).lower() == action_outputs["released"]
66
+
67
+
68
+ def test_version_github_actions_output_no_error_if_not_in_gha(
69
+ monkeypatch: pytest.MonkeyPatch,
70
+ ):
71
+ output = VersionGitHubActionsOutput(
72
+ version=Version.parse("1.2.3"),
73
+ released=True,
74
+ )
75
+
76
+ monkeypatch.delenv("GITHUB_OUTPUT", raising=False)
77
+ output.write_if_possible()
@@ -1,66 +0,0 @@
1
- import pytest
2
-
3
- from semantic_release import Version
4
- from semantic_release.cli.github_actions_output import VersionGitHubActionsOutput
5
-
6
- from tests.util import actions_output_to_dict
7
-
8
-
9
- @pytest.mark.parametrize("released", (True, False))
10
- def test_version_github_actions_output_format(released):
11
- version = Version.parse("1.2.3")
12
- output = VersionGitHubActionsOutput()
13
-
14
- output.version = version
15
- output.released = released
16
-
17
- text = output.to_output_text()
18
- # fmt: off
19
- assert (
20
- text == f"released={str(released).lower()}\n"
21
- f"version={version!s}\n"
22
- f"tag={version.as_tag()}"
23
- )
24
- # fmt: on
25
-
26
-
27
- def test_version_github_actions_output_fails_if_missing_output():
28
- version = Version.parse("1.2.3")
29
- output = VersionGitHubActionsOutput()
30
-
31
- output.version = version
32
-
33
- with pytest.raises(ValueError, match="required outputs were not set"):
34
- output.to_output_text()
35
-
36
-
37
- def test_version_github_actions_output_writes_to_github_output_if_available(
38
- monkeypatch, tmp_path
39
- ):
40
- mock_output_file = tmp_path / "action.out"
41
- version = Version.parse("1.2.3")
42
- output = VersionGitHubActionsOutput()
43
-
44
- output.version = version
45
- output.released = True
46
-
47
- monkeypatch.setenv("GITHUB_OUTPUT", str(mock_output_file.resolve()))
48
- output.write_if_possible()
49
-
50
- action_outputs = actions_output_to_dict(
51
- mock_output_file.read_text(encoding="utf-8")
52
- )
53
-
54
- assert action_outputs["version"] == str(version)
55
- assert action_outputs["released"] == "true"
56
-
57
-
58
- def test_version_github_actions_output_no_error_if_not_in_gha(monkeypatch):
59
- version = Version.parse("1.2.3")
60
- output = VersionGitHubActionsOutput()
61
-
62
- output.version = version
63
- output.released = True
64
-
65
- monkeypatch.delenv("GITHUB_OUTPUT", raising=False)
66
- output.write_if_possible()