python-semantic-release 9.8.0__tar.gz → 9.8.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.8.0/python_semantic_release.egg-info → python_semantic_release-9.8.1}/PKG-INFO +1 -1
  2. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/docs/configuration.rst +27 -0
  3. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/pyproject.toml +1 -1
  4. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1/python_semantic_release.egg-info}/PKG-INFO +1 -1
  5. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/semantic_release/__init__.py +1 -1
  6. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/semantic_release/cli/commands/version.py +37 -0
  7. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/command_line/test_version.py +129 -1
  8. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/AUTHORS.rst +0 -0
  9. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/LICENSE +0 -0
  10. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/MANIFEST.in +0 -0
  11. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/README.rst +0 -0
  12. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/docs/Makefile +0 -0
  13. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/docs/algorithm.rst +0 -0
  14. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/docs/automatic-releases/cronjobs.rst +0 -0
  15. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/docs/automatic-releases/github-actions.rst +0 -0
  16. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/docs/automatic-releases/index.rst +0 -0
  17. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/docs/automatic-releases/travis.rst +0 -0
  18. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/docs/changelog_templates.rst +0 -0
  19. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/docs/commands.rst +0 -0
  20. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/docs/commit-parsing.rst +0 -0
  21. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/docs/conf.py +0 -0
  22. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/docs/contributing.rst +0 -0
  23. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/docs/contributors.rst +0 -0
  24. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/docs/github-action.rst +0 -0
  25. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/docs/index.rst +0 -0
  26. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/docs/make.bat +0 -0
  27. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/docs/migrating_from_v7.rst +0 -0
  28. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/docs/multibranch_releases.rst +0 -0
  29. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/docs/strict_mode.rst +0 -0
  30. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/docs/troubleshooting.rst +0 -0
  31. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/python_semantic_release.egg-info/SOURCES.txt +0 -0
  32. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/python_semantic_release.egg-info/dependency_links.txt +0 -0
  33. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/python_semantic_release.egg-info/entry_points.txt +0 -0
  34. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/python_semantic_release.egg-info/requires.txt +0 -0
  35. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/python_semantic_release.egg-info/top_level.txt +0 -0
  36. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/semantic_release/__main__.py +0 -0
  37. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/semantic_release/changelog/__init__.py +0 -0
  38. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/semantic_release/changelog/context.py +0 -0
  39. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/semantic_release/changelog/release_history.py +0 -0
  40. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/semantic_release/changelog/template.py +0 -0
  41. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/semantic_release/cli/__init__.py +0 -0
  42. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/semantic_release/cli/commands/__init__.py +0 -0
  43. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/semantic_release/cli/commands/changelog.py +0 -0
  44. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/semantic_release/cli/commands/cli_context.py +0 -0
  45. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/semantic_release/cli/commands/generate_config.py +0 -0
  46. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/semantic_release/cli/commands/main.py +0 -0
  47. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/semantic_release/cli/commands/publish.py +0 -0
  48. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/semantic_release/cli/common.py +0 -0
  49. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/semantic_release/cli/config.py +0 -0
  50. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/semantic_release/cli/const.py +0 -0
  51. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/semantic_release/cli/github_actions_output.py +0 -0
  52. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/semantic_release/cli/masking_filter.py +0 -0
  53. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/semantic_release/cli/util.py +0 -0
  54. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/semantic_release/commit_parser/__init__.py +0 -0
  55. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/semantic_release/commit_parser/_base.py +0 -0
  56. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/semantic_release/commit_parser/angular.py +0 -0
  57. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/semantic_release/commit_parser/emoji.py +0 -0
  58. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/semantic_release/commit_parser/scipy.py +0 -0
  59. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/semantic_release/commit_parser/tag.py +0 -0
  60. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/semantic_release/commit_parser/token.py +0 -0
  61. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/semantic_release/commit_parser/util.py +0 -0
  62. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/semantic_release/const.py +0 -0
  63. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/semantic_release/data/templates/CHANGELOG.md.j2 +0 -0
  64. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/semantic_release/data/templates/release_notes.md.j2 +0 -0
  65. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/semantic_release/enums.py +0 -0
  66. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/semantic_release/errors.py +0 -0
  67. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/semantic_release/helpers.py +0 -0
  68. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/semantic_release/hvcs/__init__.py +0 -0
  69. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/semantic_release/hvcs/_base.py +0 -0
  70. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/semantic_release/hvcs/bitbucket.py +0 -0
  71. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/semantic_release/hvcs/gitea.py +0 -0
  72. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/semantic_release/hvcs/github.py +0 -0
  73. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/semantic_release/hvcs/gitlab.py +0 -0
  74. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/semantic_release/hvcs/remote_hvcs_base.py +0 -0
  75. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/semantic_release/hvcs/token_auth.py +0 -0
  76. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/semantic_release/hvcs/util.py +0 -0
  77. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/semantic_release/version/__init__.py +0 -0
  78. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/semantic_release/version/algorithm.py +0 -0
  79. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/semantic_release/version/declaration.py +0 -0
  80. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/semantic_release/version/translator.py +0 -0
  81. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/semantic_release/version/version.py +0 -0
  82. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/setup.cfg +0 -0
  83. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/__init__.py +0 -0
  84. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/command_line/__init__.py +0 -0
  85. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/command_line/conftest.py +0 -0
  86. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/command_line/test_changelog.py +0 -0
  87. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/command_line/test_generate_config.py +0 -0
  88. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/command_line/test_help.py +0 -0
  89. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/command_line/test_main.py +0 -0
  90. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/command_line/test_publish.py +0 -0
  91. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/conftest.py +0 -0
  92. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/const.py +0 -0
  93. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/fixtures/__init__.py +0 -0
  94. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/fixtures/commit_parsers.py +0 -0
  95. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/fixtures/example_project.py +0 -0
  96. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/fixtures/git_repo.py +0 -0
  97. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/fixtures/repos/__init__.py +0 -0
  98. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/fixtures/repos/git_flow/__init__.py +0 -0
  99. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/fixtures/repos/git_flow/repo_w_2_release_channels.py +0 -0
  100. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/fixtures/repos/git_flow/repo_w_3_release_channels.py +0 -0
  101. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/fixtures/repos/github_flow/__init__.py +0 -0
  102. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/fixtures/repos/github_flow/repo_w_release_channels.py +0 -0
  103. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/fixtures/repos/trunk_based_dev/__init__.py +0 -0
  104. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/fixtures/repos/trunk_based_dev/repo_w_no_tags.py +0 -0
  105. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/fixtures/repos/trunk_based_dev/repo_w_prereleases.py +0 -0
  106. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/fixtures/repos/trunk_based_dev/repo_w_tags.py +0 -0
  107. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/fixtures/scipy.py +0 -0
  108. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/scenario/__init__.py +0 -0
  109. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/scenario/test_next_version.py +0 -0
  110. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/scenario/test_release_history.py +0 -0
  111. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/scenario/test_template_render.py +0 -0
  112. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/unit/__init__.py +0 -0
  113. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/unit/semantic_release/__init__.py +0 -0
  114. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/unit/semantic_release/changelog/__init__.py +0 -0
  115. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/unit/semantic_release/changelog/test_changelog_context.py +0 -0
  116. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/unit/semantic_release/changelog/test_default_changelog.py +0 -0
  117. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/unit/semantic_release/changelog/test_release_notes.py +0 -0
  118. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/unit/semantic_release/changelog/test_template.py +0 -0
  119. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/unit/semantic_release/cli/__init__.py +0 -0
  120. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/unit/semantic_release/cli/test_config.py +0 -0
  121. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/unit/semantic_release/cli/test_github_actions_output.py +0 -0
  122. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/unit/semantic_release/cli/test_masking_filter.py +0 -0
  123. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/unit/semantic_release/cli/test_util.py +0 -0
  124. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/unit/semantic_release/cli/test_version.py +0 -0
  125. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/unit/semantic_release/commit_parser/__init__.py +0 -0
  126. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/unit/semantic_release/commit_parser/test_angular.py +0 -0
  127. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/unit/semantic_release/commit_parser/test_emoji.py +0 -0
  128. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/unit/semantic_release/commit_parser/test_parsed_commit.py +0 -0
  129. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/unit/semantic_release/commit_parser/test_scipy.py +0 -0
  130. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/unit/semantic_release/commit_parser/test_tag.py +0 -0
  131. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/unit/semantic_release/commit_parser/test_util.py +0 -0
  132. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/unit/semantic_release/hvcs/__init__.py +0 -0
  133. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/unit/semantic_release/hvcs/test__base.py +0 -0
  134. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/unit/semantic_release/hvcs/test_bitbucket.py +0 -0
  135. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/unit/semantic_release/hvcs/test_gitea.py +0 -0
  136. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/unit/semantic_release/hvcs/test_github.py +0 -0
  137. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/unit/semantic_release/hvcs/test_gitlab.py +0 -0
  138. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/unit/semantic_release/hvcs/test_token_auth.py +0 -0
  139. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/unit/semantic_release/hvcs/test_util.py +0 -0
  140. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/unit/semantic_release/test_helpers.py +0 -0
  141. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/unit/semantic_release/version/__init__.py +0 -0
  142. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/unit/semantic_release/version/test_algorithm.py +0 -0
  143. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/unit/semantic_release/version/test_declaration.py +0 -0
  144. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/unit/semantic_release/version/test_translator.py +0 -0
  145. {python_semantic_release-9.8.0 → python_semantic_release-9.8.1}/tests/unit/semantic_release/version/test_version.py +0 -0
  146. {python_semantic_release-9.8.0 → python_semantic_release-9.8.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.8.0
3
+ Version: 9.8.1
4
4
  Summary: Automatic Semantic Versioning for Python projects
5
5
  Author-email: Rolf Erik Lekang <me@rolflekang.com>
6
6
  License: MIT
@@ -207,6 +207,33 @@ PSR_DOCKER_GITHUB_ACTION Pass-through ``true`` if exists in process env, unset
207
207
  VIRTUAL_ENV Pass-through ``VIRTUAL_ENV`` if exists in process env, unset otherwise
208
208
  ======================== ======================================================================
209
209
 
210
+ In addition, on windows systems these environment variables are passed:
211
+ ======================== ======================================================================
212
+ Variable Name Description
213
+ ======================== ======================================================================
214
+ ALLUSERSAPPDATA Pass-through ``ALLUSERAPPDATA`` if exists in process env, unset otherwise
215
+ ALLUSERSPROFILE Pass-through ``ALLUSERSPPPROFILE`` if exists in process env, unset otherwise
216
+ APPDATA Pass-through ``APPDATA`` if exists in process env, unset otherwise
217
+ COMMONPROGRAMFILES Pass-through ``COMMONPROGRAMFILES`` if exists in process env, unset otherwise
218
+ COMMONPROGRAMFILES(x86) Pass-through ``COMMONPROGRAMFILES(x86)`` if exists in process env, unset otherwise
219
+ DEFAULTUSERPROFILE Pass-through ``DEFAULTUSERPROFILE`` if exists in process env, unset otherwise
220
+ HOMEPATH Pass-through ``HOMEPATH`` if exists in process env, unset otherwise
221
+ PATHEXT Pass-through ``PATHEXT`` if exists in process env, unset otherwise
222
+ PROFILESFOLDER Pass-through ``PROFILESFOLDER`` if exists in process env, unset otherwise
223
+ PROGRAMFILES Pass-through ``PROGRAMFILES`` if exists in process env, unset otherwise
224
+ PROGRAMFILES(x86) Pass-through ``PROGRAMFILES(x86)`` if exists in process env, unset otherwise
225
+ SYSTEM Pass-through ``SYSTEM`` if exists in process env, unset otherwise
226
+ SYSTEM16 Pass-through ``SYSTEM16`` if exists in process env, unset otherwise
227
+ SYSTEM32 Pass-through ``SYSTEM32`` if exists in process env, unset otherwise
228
+ SYSTEMDRIVE Pass-through ``SYSTEMDRIVE`` if exists in process env, unset otherwise
229
+ SYSTEMROOT Pass-through ``SYSTEMROOT`` if exists in process env, unset otherwise
230
+ TEMP Pass-through ``TEMP`` if exists in process env, unset otherwise
231
+ TMP Pass-through ``TMP`` if exists in process env, unset otherwise
232
+ USERPROFILE Pass-through ``USERPROFILE`` if exists in process env, unset otherwise
233
+ USERSID Pass-through ``USERSID`` if exists in process env, unset otherwise
234
+ WINDIR Pass-through ``WINDIR`` if exists in process env, unset otherwise
235
+ ======================== ======================================================================
236
+
210
237
  **Default:** ``None`` (not specified)
211
238
 
212
239
  ----
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
6
6
 
7
7
  [project]
8
8
  name = "python-semantic-release"
9
- version = "9.8.0"
9
+ version = "9.8.1"
10
10
  description = "Automatic Semantic Versioning for Python projects"
11
11
  requires-python = ">=3.8"
12
12
  license = { text = "MIT" }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-semantic-release
3
- Version: 9.8.0
3
+ Version: 9.8.1
4
4
  Summary: Automatic Semantic Versioning for Python projects
5
5
  Author-email: Rolf Erik Lekang <me@rolflekang.com>
6
6
  License: MIT
@@ -24,7 +24,7 @@ from semantic_release.version import (
24
24
  tags_and_versions,
25
25
  )
26
26
 
27
- __version__ = "9.8.0"
27
+ __version__ = "9.8.1"
28
28
 
29
29
 
30
30
  def setup_hook(argv: list[str]) -> None:
@@ -3,6 +3,7 @@ from __future__ import annotations
3
3
  import logging
4
4
  import os
5
5
  import subprocess
6
+ import sys
6
7
  from contextlib import nullcontext
7
8
  from datetime import datetime
8
9
  from typing import TYPE_CHECKING
@@ -156,6 +157,40 @@ def shell(
156
157
  )
157
158
 
158
159
 
160
+ def is_windows() -> bool:
161
+ return sys.platform == "win32"
162
+
163
+
164
+ def get_windows_env() -> Mapping[str, str | None]:
165
+ return {
166
+ environment_variable: os.getenv(environment_variable, None)
167
+ for environment_variable in (
168
+ "ALLUSERSAPPDATA",
169
+ "ALLUSERSPROFILE",
170
+ "APPDATA",
171
+ "COMMONPROGRAMFILES",
172
+ "COMMONPROGRAMFILES(x86)",
173
+ "DEFAULTUSERPROFILE",
174
+ "HOMEPATH",
175
+ "PATHEXT",
176
+ "PROFILESFOLDER",
177
+ "PROGRAMFILES",
178
+ "PROGRAMFILES(x86)",
179
+ "SYSTEM",
180
+ "SYSTEM16",
181
+ "SYSTEM32",
182
+ "SYSTEMDRIVE",
183
+ "SYSTEMPROFILE",
184
+ "SYSTEMROOT",
185
+ "TEMP",
186
+ "TMP",
187
+ "USERPROFILE",
188
+ "USERSID",
189
+ "WINDIR",
190
+ )
191
+ }
192
+
193
+
159
194
  @click.command(
160
195
  short_help="Detect and apply a new version",
161
196
  context_settings={
@@ -522,6 +557,8 @@ def version( # noqa: C901
522
557
  "PATH": os.getenv("PATH", ""),
523
558
  "HOME": os.getenv("HOME", None),
524
559
  "VIRTUAL_ENV": os.getenv("VIRTUAL_ENV", None),
560
+ # Windows environment variables
561
+ **(get_windows_env() if is_windows() else {}),
525
562
  # affects build decisions
526
563
  "CI": os.getenv("CI", None),
527
564
  # Identifies which CI environment
@@ -619,6 +619,28 @@ def test_version_runs_build_command(
619
619
  "GITEA_ACTIONS": "true",
620
620
  "BITBUCKET_REPO_FULL_NAME": "python-semantic-release/python-semantic-release.git",
621
621
  "PSR_DOCKER_GITHUB_ACTION": "true",
622
+ # Windows
623
+ "ALLUSERSAPPDATA": "C:\\ProgramData",
624
+ "ALLUSERSPROFILE": "C:\\ProgramData",
625
+ "APPDATA": "C:\\Users\\Username\\AppData\\Roaming",
626
+ "COMMONPROGRAMFILES": "C:\\Program Files\\Common Files",
627
+ "COMMONPROGRAMFILES(x86)": "C:\\Program Files (x86)\\Common Files",
628
+ "DEFAULTUSERPROFILE": "C:\\Users\\Default",
629
+ "HOMEPATH": "\\Users\\Username",
630
+ "PATHEXT": ".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC",
631
+ "PROFILESFOLDER": "C:\\Users",
632
+ "PROGRAMFILES": "C:\\Program Files",
633
+ "PROGRAMFILES(x86)": "C:\\Program Files (x86)",
634
+ "SYSTEM": "C:\\Windows\\System32",
635
+ "SYSTEM16": "C:\\Windows\\System16",
636
+ "SYSTEM32": "C:\\Windows\\System32",
637
+ "SYSTEMDRIVE": "C:",
638
+ "SYSTEMROOT": "C:\\Windows",
639
+ "TEMP": "C:\\Users\\Username\\AppData\\Local\\Temp",
640
+ "TMP": "C:\\Users\\Username\\AppData\\Local\\Temp",
641
+ "USERPROFILE": "C:\\Users\\Username",
642
+ "USERSID": "S-1-5-21-1234567890-123456789-123456789-1234",
643
+ "WINDIR": "C:\\Windows",
622
644
  }
623
645
 
624
646
  # Mock out subprocess.run
@@ -626,7 +648,9 @@ def test_version_runs_build_command(
626
648
  "subprocess.run", return_value=CompletedProcess(args=(), returncode=0)
627
649
  ) as patched_subprocess_run, mock.patch(
628
650
  "shellingham.detect_shell", return_value=(exe, shell)
629
- ), mock.patch.dict("os.environ", patched_os_environment, clear=True):
651
+ ), mock.patch("sys.platform", "linux"), mock.patch.dict(
652
+ "os.environ", patched_os_environment, clear=True
653
+ ):
630
654
  # ACT: run & force a new version that will trigger the build command
631
655
  result = cli_runner.invoke(
632
656
  main, [version_subcmd or "version", "--patch", "--no-push"]
@@ -653,6 +677,110 @@ def test_version_runs_build_command(
653
677
  )
654
678
 
655
679
 
680
+ @pytest.mark.parametrize("shell", ("powershell", "cmd"))
681
+ def test_version_runs_build_command_windows(
682
+ repo_with_git_flow_angular_commits: Repo,
683
+ cli_runner: CliRunner,
684
+ update_pyproject_toml: UpdatePyprojectTomlFn,
685
+ shell: str,
686
+ ):
687
+ # Setup
688
+ build_command = "bash -c \"echo 'hello world'\""
689
+ update_pyproject_toml("tool.semantic_release.build_command", build_command)
690
+ exe = shell.split("/")[-1]
691
+ patched_os_environment = {
692
+ "CI": "true",
693
+ "PATH": os.getenv("PATH"),
694
+ "HOME": os.getenv("HOME"),
695
+ "VIRTUAL_ENV": os.getenv("VIRTUAL_ENV", "./.venv"),
696
+ # Simulate that all CI's are set
697
+ "GITHUB_ACTIONS": "true",
698
+ "GITLAB_CI": "true",
699
+ "GITEA_ACTIONS": "true",
700
+ "BITBUCKET_REPO_FULL_NAME": "python-semantic-release/python-semantic-release.git",
701
+ "PSR_DOCKER_GITHUB_ACTION": "true",
702
+ # Windows
703
+ "ALLUSERSAPPDATA": "C:\\ProgramData",
704
+ "ALLUSERSPROFILE": "C:\\ProgramData",
705
+ "APPDATA": "C:\\Users\\Username\\AppData\\Roaming",
706
+ "COMMONPROGRAMFILES": "C:\\Program Files\\Common Files",
707
+ "COMMONPROGRAMFILES(x86)": "C:\\Program Files (x86)\\Common Files",
708
+ "DEFAULTUSERPROFILE": "C:\\Users\\Default",
709
+ "HOMEPATH": "\\Users\\Username",
710
+ "PATHEXT": ".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC",
711
+ "PROFILESFOLDER": "C:\\Users",
712
+ "PROGRAMFILES": "C:\\Program Files",
713
+ "PROGRAMFILES(x86)": "C:\\Program Files (x86)",
714
+ "SYSTEM": "C:\\Windows\\System32",
715
+ "SYSTEM16": "C:\\Windows\\System16",
716
+ "SYSTEM32": "C:\\Windows\\System32",
717
+ "SYSTEMDRIVE": "C:",
718
+ "SYSTEMROOT": "C:\\Windows",
719
+ "TEMP": "C:\\Users\\Username\\AppData\\Local\\Temp",
720
+ "TMP": "C:\\Users\\Username\\AppData\\Local\\Temp",
721
+ "USERPROFILE": "C:\\Users\\Username",
722
+ "USERSID": "S-1-5-21-1234567890-123456789-123456789-1234",
723
+ "WINDIR": "C:\\Windows",
724
+ }
725
+
726
+ # Mock out subprocess.run
727
+ with mock.patch(
728
+ "subprocess.run", return_value=CompletedProcess(args=(), returncode=0)
729
+ ) as patched_subprocess_run, mock.patch(
730
+ "shellingham.detect_shell", return_value=(exe, shell)
731
+ ), mock.patch("sys.platform", "win32"), mock.patch.dict(
732
+ "os.environ", patched_os_environment, clear=True
733
+ ):
734
+ # ACT: run & force a new version that will trigger the build command
735
+ result = cli_runner.invoke(
736
+ main, [version_subcmd or "version", "--patch", "--no-push"]
737
+ )
738
+ assert result.exit_code == 0
739
+
740
+ patched_subprocess_run.assert_called_once_with(
741
+ [exe, "-c" if shell != "cmd" else "/c", build_command],
742
+ check=True,
743
+ env={
744
+ "NEW_VERSION": "1.2.1", # injected into environment
745
+ "CI": patched_os_environment["CI"],
746
+ "BITBUCKET_CI": "true", # Converted
747
+ "GITHUB_ACTIONS": patched_os_environment["GITHUB_ACTIONS"],
748
+ "GITEA_ACTIONS": patched_os_environment["GITEA_ACTIONS"],
749
+ "GITLAB_CI": patched_os_environment["GITLAB_CI"],
750
+ "HOME": patched_os_environment["HOME"],
751
+ "PATH": patched_os_environment["PATH"],
752
+ "VIRTUAL_ENV": patched_os_environment["VIRTUAL_ENV"],
753
+ "PSR_DOCKER_GITHUB_ACTION": patched_os_environment[
754
+ "PSR_DOCKER_GITHUB_ACTION"
755
+ ],
756
+ # Windows
757
+ "ALLUSERSAPPDATA": patched_os_environment["ALLUSERSAPPDATA"],
758
+ "ALLUSERSPROFILE": patched_os_environment["ALLUSERSPROFILE"],
759
+ "APPDATA": patched_os_environment["APPDATA"],
760
+ "COMMONPROGRAMFILES": patched_os_environment["COMMONPROGRAMFILES"],
761
+ "COMMONPROGRAMFILES(x86)": patched_os_environment[
762
+ "COMMONPROGRAMFILES(x86)"
763
+ ],
764
+ "DEFAULTUSERPROFILE": patched_os_environment["DEFAULTUSERPROFILE"],
765
+ "HOMEPATH": patched_os_environment["HOMEPATH"],
766
+ "PATHEXT": patched_os_environment["PATHEXT"],
767
+ "PROFILESFOLDER": patched_os_environment["PROFILESFOLDER"],
768
+ "PROGRAMFILES": patched_os_environment["PROGRAMFILES"],
769
+ "PROGRAMFILES(x86)": patched_os_environment["PROGRAMFILES(x86)"],
770
+ "SYSTEM": patched_os_environment["SYSTEM"],
771
+ "SYSTEM16": patched_os_environment["SYSTEM16"],
772
+ "SYSTEM32": patched_os_environment["SYSTEM32"],
773
+ "SYSTEMDRIVE": patched_os_environment["SYSTEMDRIVE"],
774
+ "SYSTEMROOT": patched_os_environment["SYSTEMROOT"],
775
+ "TEMP": patched_os_environment["TEMP"],
776
+ "TMP": patched_os_environment["TMP"],
777
+ "USERPROFILE": patched_os_environment["USERPROFILE"],
778
+ "USERSID": patched_os_environment["USERSID"],
779
+ "WINDIR": patched_os_environment["WINDIR"],
780
+ },
781
+ )
782
+
783
+
656
784
  def test_version_runs_build_command_w_user_env(
657
785
  repo_with_git_flow_angular_commits: Repo,
658
786
  cli_runner: CliRunner,