python-semantic-release 9.6.0__tar.gz → 9.7.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.6.0/python_semantic_release.egg-info → python_semantic_release-9.7.1}/PKG-INFO +3 -3
  2. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/docs/configuration.rst +28 -4
  3. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/docs/github-action.rst +5 -2
  4. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/pyproject.toml +13 -10
  5. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1/python_semantic_release.egg-info}/PKG-INFO +3 -3
  6. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/python_semantic_release.egg-info/requires.txt +2 -2
  7. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/semantic_release/__init__.py +1 -1
  8. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/semantic_release/cli/commands/version.py +34 -3
  9. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/command_line/test_version.py +30 -2
  10. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/AUTHORS.rst +0 -0
  11. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/LICENSE +0 -0
  12. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/MANIFEST.in +0 -0
  13. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/README.rst +0 -0
  14. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/docs/Makefile +0 -0
  15. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/docs/algorithm.rst +0 -0
  16. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/docs/automatic-releases/cronjobs.rst +0 -0
  17. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/docs/automatic-releases/github-actions.rst +0 -0
  18. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/docs/automatic-releases/index.rst +0 -0
  19. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/docs/automatic-releases/travis.rst +0 -0
  20. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/docs/changelog_templates.rst +0 -0
  21. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/docs/commands.rst +0 -0
  22. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/docs/commit-parsing.rst +0 -0
  23. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/docs/conf.py +0 -0
  24. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/docs/contributing.rst +0 -0
  25. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/docs/contributors.rst +0 -0
  26. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/docs/index.rst +0 -0
  27. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/docs/make.bat +0 -0
  28. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/docs/migrating_from_v7.rst +0 -0
  29. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/docs/multibranch_releases.rst +0 -0
  30. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/docs/strict_mode.rst +0 -0
  31. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/docs/troubleshooting.rst +0 -0
  32. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/python_semantic_release.egg-info/SOURCES.txt +0 -0
  33. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/python_semantic_release.egg-info/dependency_links.txt +0 -0
  34. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/python_semantic_release.egg-info/entry_points.txt +0 -0
  35. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/python_semantic_release.egg-info/top_level.txt +0 -0
  36. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/semantic_release/__main__.py +0 -0
  37. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/semantic_release/changelog/__init__.py +0 -0
  38. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/semantic_release/changelog/context.py +0 -0
  39. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/semantic_release/changelog/release_history.py +0 -0
  40. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/semantic_release/changelog/template.py +0 -0
  41. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/semantic_release/cli/__init__.py +0 -0
  42. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/semantic_release/cli/commands/__init__.py +0 -0
  43. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/semantic_release/cli/commands/changelog.py +0 -0
  44. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/semantic_release/cli/commands/cli_context.py +0 -0
  45. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/semantic_release/cli/commands/generate_config.py +0 -0
  46. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/semantic_release/cli/commands/main.py +0 -0
  47. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/semantic_release/cli/commands/publish.py +0 -0
  48. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/semantic_release/cli/common.py +0 -0
  49. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/semantic_release/cli/config.py +0 -0
  50. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/semantic_release/cli/const.py +0 -0
  51. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/semantic_release/cli/github_actions_output.py +0 -0
  52. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/semantic_release/cli/masking_filter.py +0 -0
  53. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/semantic_release/cli/util.py +0 -0
  54. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/semantic_release/commit_parser/__init__.py +0 -0
  55. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/semantic_release/commit_parser/_base.py +0 -0
  56. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/semantic_release/commit_parser/angular.py +0 -0
  57. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/semantic_release/commit_parser/emoji.py +0 -0
  58. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/semantic_release/commit_parser/scipy.py +0 -0
  59. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/semantic_release/commit_parser/tag.py +0 -0
  60. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/semantic_release/commit_parser/token.py +0 -0
  61. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/semantic_release/commit_parser/util.py +0 -0
  62. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/semantic_release/const.py +0 -0
  63. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/semantic_release/data/templates/CHANGELOG.md.j2 +0 -0
  64. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/semantic_release/data/templates/release_notes.md.j2 +0 -0
  65. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/semantic_release/enums.py +0 -0
  66. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/semantic_release/errors.py +0 -0
  67. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/semantic_release/helpers.py +0 -0
  68. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/semantic_release/hvcs/__init__.py +0 -0
  69. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/semantic_release/hvcs/_base.py +0 -0
  70. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/semantic_release/hvcs/bitbucket.py +0 -0
  71. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/semantic_release/hvcs/gitea.py +0 -0
  72. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/semantic_release/hvcs/github.py +0 -0
  73. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/semantic_release/hvcs/gitlab.py +0 -0
  74. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/semantic_release/hvcs/remote_hvcs_base.py +0 -0
  75. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/semantic_release/hvcs/token_auth.py +0 -0
  76. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/semantic_release/hvcs/util.py +0 -0
  77. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/semantic_release/version/__init__.py +0 -0
  78. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/semantic_release/version/algorithm.py +0 -0
  79. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/semantic_release/version/declaration.py +0 -0
  80. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/semantic_release/version/translator.py +0 -0
  81. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/semantic_release/version/version.py +0 -0
  82. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/setup.cfg +0 -0
  83. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/__init__.py +0 -0
  84. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/command_line/__init__.py +0 -0
  85. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/command_line/conftest.py +0 -0
  86. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/command_line/test_changelog.py +0 -0
  87. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/command_line/test_generate_config.py +0 -0
  88. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/command_line/test_help.py +0 -0
  89. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/command_line/test_main.py +0 -0
  90. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/command_line/test_publish.py +0 -0
  91. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/conftest.py +0 -0
  92. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/const.py +0 -0
  93. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/fixtures/__init__.py +0 -0
  94. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/fixtures/commit_parsers.py +0 -0
  95. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/fixtures/example_project.py +0 -0
  96. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/fixtures/git_repo.py +0 -0
  97. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/fixtures/repos/__init__.py +0 -0
  98. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/fixtures/repos/git_flow/__init__.py +0 -0
  99. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/fixtures/repos/git_flow/repo_w_2_release_channels.py +0 -0
  100. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/fixtures/repos/git_flow/repo_w_3_release_channels.py +0 -0
  101. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/fixtures/repos/github_flow/__init__.py +0 -0
  102. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/fixtures/repos/github_flow/repo_w_release_channels.py +0 -0
  103. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/fixtures/repos/trunk_based_dev/__init__.py +0 -0
  104. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/fixtures/repos/trunk_based_dev/repo_w_no_tags.py +0 -0
  105. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/fixtures/repos/trunk_based_dev/repo_w_prereleases.py +0 -0
  106. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/fixtures/repos/trunk_based_dev/repo_w_tags.py +0 -0
  107. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/fixtures/scipy.py +0 -0
  108. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/scenario/__init__.py +0 -0
  109. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/scenario/test_next_version.py +0 -0
  110. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/scenario/test_release_history.py +0 -0
  111. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/scenario/test_template_render.py +0 -0
  112. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/unit/__init__.py +0 -0
  113. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/unit/semantic_release/__init__.py +0 -0
  114. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/unit/semantic_release/changelog/__init__.py +0 -0
  115. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/unit/semantic_release/changelog/test_changelog_context.py +0 -0
  116. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/unit/semantic_release/changelog/test_default_changelog.py +0 -0
  117. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/unit/semantic_release/changelog/test_release_notes.py +0 -0
  118. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/unit/semantic_release/changelog/test_template.py +0 -0
  119. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/unit/semantic_release/cli/__init__.py +0 -0
  120. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/unit/semantic_release/cli/test_config.py +0 -0
  121. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/unit/semantic_release/cli/test_github_actions_output.py +0 -0
  122. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/unit/semantic_release/cli/test_masking_filter.py +0 -0
  123. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/unit/semantic_release/cli/test_util.py +0 -0
  124. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/unit/semantic_release/cli/test_version.py +0 -0
  125. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/unit/semantic_release/commit_parser/__init__.py +0 -0
  126. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/unit/semantic_release/commit_parser/test_angular.py +0 -0
  127. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/unit/semantic_release/commit_parser/test_emoji.py +0 -0
  128. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/unit/semantic_release/commit_parser/test_parsed_commit.py +0 -0
  129. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/unit/semantic_release/commit_parser/test_scipy.py +0 -0
  130. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/unit/semantic_release/commit_parser/test_tag.py +0 -0
  131. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/unit/semantic_release/commit_parser/test_util.py +0 -0
  132. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/unit/semantic_release/hvcs/__init__.py +0 -0
  133. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/unit/semantic_release/hvcs/test__base.py +0 -0
  134. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/unit/semantic_release/hvcs/test_bitbucket.py +0 -0
  135. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/unit/semantic_release/hvcs/test_gitea.py +0 -0
  136. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/unit/semantic_release/hvcs/test_github.py +0 -0
  137. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/unit/semantic_release/hvcs/test_gitlab.py +0 -0
  138. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/unit/semantic_release/hvcs/test_token_auth.py +0 -0
  139. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/unit/semantic_release/hvcs/test_util.py +0 -0
  140. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/unit/semantic_release/test_helpers.py +0 -0
  141. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/unit/semantic_release/version/__init__.py +0 -0
  142. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/unit/semantic_release/version/test_algorithm.py +0 -0
  143. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/unit/semantic_release/version/test_declaration.py +0 -0
  144. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/unit/semantic_release/version/test_translator.py +0 -0
  145. {python_semantic_release-9.6.0 → python_semantic_release-9.7.1}/tests/unit/semantic_release/version/test_version.py +0 -0
  146. {python_semantic_release-9.6.0 → python_semantic_release-9.7.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.6.0
3
+ Version: 9.7.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.4.1; extra == "dev"
56
+ Requires-Dist: ruff==0.4.3; extra == "dev"
57
57
  Provides-Extra: mypy
58
- Requires-Dist: mypy==1.9.0; extra == "mypy"
58
+ Requires-Dist: mypy==1.10.0; extra == "mypy"
59
59
  Requires-Dist: types-requests~=2.31.0; extra == "mypy"
60
60
 
61
61
  Python Semantic Release
@@ -141,10 +141,34 @@ This setting is discussed in more detail at :ref:`multibranch-releases`
141
141
 
142
142
  .. _config-build-command:
143
143
 
144
- ``build_command (Optional[str])``
145
- """""""""""""""""""""""""""""""""
146
-
147
- Command to use when building the current project during :ref:`cmd-version`
144
+ ``build_command``
145
+ """""""""""""""""
146
+
147
+ **Type:** ``Optional[str]``
148
+
149
+ Command to use to build the current project during :ref:`cmd-version`.
150
+
151
+ Python Semantic Release will execute the build command in the OS default
152
+ shell with a subset of environment variables. PSR provides the variable
153
+ ``NEW_VERSION`` in the environment with the value of the next determined
154
+ version. The following table summarizes all the environment variables that
155
+ are passed on to the ``build_command`` runtime if they exist in the parent
156
+ process.
157
+
158
+ ======================== ======================================================================
159
+ Variable Name Description
160
+ ======================== ======================================================================
161
+ CI Pass-through ``true`` if exists in process env, unset otherwise
162
+ BITBUCKET_CI ``true`` if Bitbucket CI variables exist in env, unset otherwise
163
+ GITHUB_ACTIONS Pass-through ``true`` if exists in process env, unset otherwise
164
+ GITEA_ACTIONS Pass-through ``true`` if exists in process env, unset otherwise
165
+ GITLAB_CI Pass-through ``true`` if exists in process env, unset otherwise
166
+ HOME Pass-through ``HOME`` of parent process
167
+ NEW_VERSION Semantically determined next version (ex. ``1.2.3``)
168
+ PATH Pass-through ``PATH`` of parent process
169
+ PSR_DOCKER_GITHUB_ACTION Pass-through ``true`` if exists in process env, unset otherwise
170
+ VIRTUAL_ENV Pass-through ``VIRTUAL_ENV`` if exists in process env, unset otherwise
171
+ ======================== ======================================================================
148
172
 
149
173
  **Default:** ``None`` (not specified)
150
174
 
@@ -106,8 +106,8 @@ defaults as their corresponding command line option.
106
106
  In general, the input for an action corresponding to a command line option has the same
107
107
  name, with dashes (``-``) replaced by underscores.
108
108
 
109
- The command line arguments ``--patch``, ``--minor`` and ``--major`` are mutually
110
- exclusive, and are supplied via the ``force`` input.
109
+ The command line arguments ``--prerelease``, ``--patch``, ``--minor`` and ``--major``
110
+ are mutually exclusive, and are supplied via the ``force`` input.
111
111
 
112
112
  Flags, which require either ``--<option>`` or ``--no-<option>`` to be passed on the
113
113
  command-line, should be specified using the option name (with dashes replaced by
@@ -115,6 +115,9 @@ underscores), and set to the value ``"true"`` to supply ``--<option>`` on the
115
115
  command-line, and ``"false"`` to specify ``--no-<option>``.
116
116
  Any other values are not accepted.
117
117
 
118
+ The flag ``--as-prerelease`` is uniquely provided as just the ``prerelease`` flag value.
119
+ This is for compatibility reasons.
120
+
118
121
  For command line options requiring a value, set the input to the required value.
119
122
 
120
123
  For example, to specify ``--patch --no-push --build-metadata abc123``, you should
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
6
6
 
7
7
  [project]
8
8
  name = "python-semantic-release"
9
- version = "9.6.0"
9
+ version = "9.7.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.4.1"
74
+ "ruff == 0.4.3"
75
75
  ]
76
76
  mypy = [
77
- "mypy == 1.9.0",
77
+ "mypy == 1.10.0",
78
78
  "types-requests ~= 2.31.0"
79
79
  ]
80
80
 
@@ -83,18 +83,21 @@ env = [
83
83
  "PYTHONHASHSEED = 123456"
84
84
  ]
85
85
  addopts = [
86
+ # TO DEBUG in single process, swap auto to 0
86
87
  "-nauto",
88
+ # "-n0",
87
89
  "-ra",
88
90
  "--diff-symbols",
89
91
  "--cache-clear",
90
- "--cov=semantic_release",
91
- "--cov-context=test",
92
- "--cov-report",
93
- "html:coverage-html",
94
- "--cov-report",
95
- "term",
92
+ # No default coverage - causes problems with debuggers
93
+ # "--cov=semantic_release",
94
+ # "--cov-context=test",
95
+ # "--cov-report=html:coverage-html",
96
+ # "--cov-report=term-missing",
97
+ ]
98
+ testpaths = [
99
+ "tests"
96
100
  ]
97
- python_files = ["tests/test_*.py", "tests/**/test_*.py"]
98
101
 
99
102
  [tool.coverage.html]
100
103
  show_contexts = true
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-semantic-release
3
- Version: 9.6.0
3
+ Version: 9.7.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.4.1; extra == "dev"
56
+ Requires-Dist: ruff==0.4.3; extra == "dev"
57
57
  Provides-Extra: mypy
58
- Requires-Dist: mypy==1.9.0; extra == "mypy"
58
+ Requires-Dist: mypy==1.10.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.4.1
17
+ ruff==0.4.3
18
18
 
19
19
  [docs]
20
20
  Sphinx~=6.0
@@ -23,7 +23,7 @@ sphinx-autobuild==2024.2.4
23
23
  furo~=2024.1
24
24
 
25
25
  [mypy]
26
- mypy==1.9.0
26
+ mypy==1.10.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.6.0"
27
+ __version__ = "9.7.1"
28
28
 
29
29
 
30
30
  def setup_hook(argv: list[str]) -> None:
@@ -31,7 +31,7 @@ from semantic_release.version import Version, next_version, tags_and_versions
31
31
  log = logging.getLogger(__name__)
32
32
 
33
33
  if TYPE_CHECKING: # pragma: no cover
34
- from typing import ContextManager, Iterable
34
+ from typing import ContextManager, Iterable, Mapping
35
35
 
36
36
  from git import Repo
37
37
  from git.refs.tag import Tag
@@ -135,7 +135,9 @@ def apply_version_to_source_files(
135
135
  return paths
136
136
 
137
137
 
138
- def shell(cmd: str, *, check: bool = True) -> subprocess.CompletedProcess:
138
+ def shell(
139
+ cmd: str, *, env: Mapping[str, str] | None = None, check: bool = True
140
+ ) -> subprocess.CompletedProcess:
139
141
  shell: str | None
140
142
  try:
141
143
  shell, _ = shellingham.detect_shell()
@@ -149,6 +151,7 @@ def shell(cmd: str, *, check: bool = True) -> subprocess.CompletedProcess:
149
151
 
150
152
  return subprocess.run(
151
153
  [shell, "-c" if shell != "cmd" else "/c", cmd], # noqa: S603
154
+ env=(env or {}),
152
155
  check=check,
153
156
  )
154
157
 
@@ -507,7 +510,35 @@ def version( # noqa: C901
507
510
  "[bold green]:hammer_and_wrench: Running build command: "
508
511
  + build_command
509
512
  )
510
- shell(build_command, check=True)
513
+ shell(
514
+ build_command,
515
+ check=True,
516
+ env=dict(
517
+ filter(
518
+ lambda k_v: k_v[1] is not None, # type: ignore
519
+ {
520
+ "NEW_VERSION": str(new_version),
521
+ "PATH": os.getenv("PATH", ""),
522
+ "HOME": os.getenv("HOME", None),
523
+ "VIRTUAL_ENV": os.getenv("VIRTUAL_ENV", None),
524
+ # affects build decisions
525
+ "CI": os.getenv("CI", None),
526
+ # Identifies which CI environment
527
+ "GITHUB_ACTIONS": os.getenv("GITHUB_ACTIONS", None),
528
+ "GITLAB_CI": os.getenv("GITLAB_CI", None),
529
+ "GITEA_ACTIONS": os.getenv("GITEA_ACTIONS", None),
530
+ "BITBUCKET_CI": (
531
+ str(True).lower()
532
+ if os.getenv("BITBUCKET_REPO_FULL_NAME", None)
533
+ else None
534
+ ),
535
+ "PSR_DOCKER_GITHUB_ACTION": os.getenv(
536
+ "PSR_DOCKER_GITHUB_ACTION", None
537
+ ),
538
+ }.items(),
539
+ )
540
+ ),
541
+ )
511
542
  except subprocess.CalledProcessError as exc:
512
543
  ctx.fail(str(exc))
513
544
 
@@ -2,6 +2,7 @@ from __future__ import annotations
2
2
 
3
3
  import difflib
4
4
  import filecmp
5
+ import os
5
6
  import re
6
7
  import shutil
7
8
  from subprocess import CompletedProcess
@@ -558,13 +559,25 @@ def test_version_runs_build_command(
558
559
  build_command = "bash -c \"echo 'hello world'\""
559
560
  update_pyproject_toml("tool.semantic_release.build_command", build_command)
560
561
  exe = shell.split("/")[-1]
562
+ patched_os_environment = {
563
+ "CI": "true",
564
+ "PATH": os.getenv("PATH"),
565
+ "HOME": os.getenv("HOME"),
566
+ "VIRTUAL_ENV": os.getenv("VIRTUAL_ENV", "./.venv"),
567
+ # Simulate that all CI's are set
568
+ "GITHUB_ACTIONS": "true",
569
+ "GITLAB_CI": "true",
570
+ "GITEA_ACTIONS": "true",
571
+ "BITBUCKET_REPO_FULL_NAME": "python-semantic-release/python-semantic-release.git",
572
+ "PSR_DOCKER_GITHUB_ACTION": "true",
573
+ }
561
574
 
562
575
  # Mock out subprocess.run
563
576
  with mock.patch(
564
577
  "subprocess.run", return_value=CompletedProcess(args=(), returncode=0)
565
578
  ) as patched_subprocess_run, mock.patch(
566
579
  "shellingham.detect_shell", return_value=(exe, shell)
567
- ):
580
+ ), mock.patch.dict("os.environ", patched_os_environment, clear=True):
568
581
  # ACT: run & force a new version that will trigger the build command
569
582
  result = cli_runner.invoke(
570
583
  main, [version_subcmd or "version", "--patch", "--no-push"]
@@ -572,7 +585,22 @@ def test_version_runs_build_command(
572
585
  assert result.exit_code == 0
573
586
 
574
587
  patched_subprocess_run.assert_called_once_with(
575
- [exe, "-c", build_command], check=True
588
+ [exe, "-c", build_command],
589
+ check=True,
590
+ env={
591
+ "NEW_VERSION": "1.2.1", # injected into environment
592
+ "CI": patched_os_environment["CI"],
593
+ "BITBUCKET_CI": "true", # Converted
594
+ "GITHUB_ACTIONS": patched_os_environment["GITHUB_ACTIONS"],
595
+ "GITEA_ACTIONS": patched_os_environment["GITEA_ACTIONS"],
596
+ "GITLAB_CI": patched_os_environment["GITLAB_CI"],
597
+ "HOME": patched_os_environment["HOME"],
598
+ "PATH": patched_os_environment["PATH"],
599
+ "VIRTUAL_ENV": patched_os_environment["VIRTUAL_ENV"],
600
+ "PSR_DOCKER_GITHUB_ACTION": patched_os_environment[
601
+ "PSR_DOCKER_GITHUB_ACTION"
602
+ ],
603
+ },
576
604
  )
577
605
 
578
606