python-semantic-release 8.0.0a5__tar.gz → 8.0.0a7__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 (110) hide show
  1. {python-semantic-release-8.0.0a5/python_semantic_release.egg-info → python-semantic-release-8.0.0a7}/PKG-INFO +11 -3
  2. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/README.rst +10 -2
  3. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/pyproject.toml +13 -41
  4. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7/python_semantic_release.egg-info}/PKG-INFO +11 -3
  5. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/python_semantic_release.egg-info/SOURCES.txt +4 -0
  6. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/python_semantic_release.egg-info/entry_points.txt +1 -0
  7. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/python_semantic_release.egg-info/requires.txt +5 -2
  8. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/semantic_release/__init__.py +1 -1
  9. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/semantic_release/cli/commands/main.py +23 -10
  10. python-semantic-release-8.0.0a7/semantic_release/cli/commands/publish.py +46 -0
  11. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/semantic_release/cli/commands/version.py +69 -8
  12. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/semantic_release/cli/config.py +8 -103
  13. python-semantic-release-8.0.0a7/semantic_release/cli/github_actions_output.py +74 -0
  14. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/semantic_release/commit_parser/token.py +26 -0
  15. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/semantic_release/const.py +9 -0
  16. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/semantic_release/data/templates/CHANGELOG.md.j2 +4 -4
  17. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/semantic_release/data/templates/release_notes.md.j2 +2 -2
  18. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/semantic_release/hvcs/_base.py +2 -9
  19. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/semantic_release/hvcs/gitea.py +0 -19
  20. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/semantic_release/hvcs/github.py +3 -16
  21. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/semantic_release/hvcs/gitlab.py +2 -26
  22. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/semantic_release/hvcs/util.py +1 -0
  23. python-semantic-release-8.0.0a7/tests/command_line/test_main.py +32 -0
  24. python-semantic-release-8.0.0a7/tests/command_line/test_publish.py +37 -0
  25. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/tests/command_line/test_version.py +75 -165
  26. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/tests/unit/semantic_release/changelog/test_changelog_context.py +4 -4
  27. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/tests/unit/semantic_release/cli/test_config.py +0 -1
  28. python-semantic-release-8.0.0a7/tests/unit/semantic_release/cli/test_github_actions_output.py +63 -0
  29. python-semantic-release-8.0.0a7/tests/unit/semantic_release/commit_parser/test_token.py +22 -0
  30. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/tests/unit/semantic_release/hvcs/test_gitea.py +0 -33
  31. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/tests/unit/semantic_release/hvcs/test_github.py +0 -33
  32. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/tests/unit/semantic_release/hvcs/test_gitlab.py +0 -14
  33. python-semantic-release-8.0.0a5/semantic_release/cli/commands/publish.py +0 -86
  34. python-semantic-release-8.0.0a5/tests/command_line/test_main.py +0 -18
  35. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/AUTHORS.rst +0 -0
  36. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/LICENSE +0 -0
  37. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/MANIFEST.in +0 -0
  38. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/python_semantic_release.egg-info/dependency_links.txt +0 -0
  39. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/python_semantic_release.egg-info/top_level.txt +0 -0
  40. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/semantic_release/__main__.py +0 -0
  41. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/semantic_release/changelog/__init__.py +0 -0
  42. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/semantic_release/changelog/context.py +0 -0
  43. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/semantic_release/changelog/release_history.py +0 -0
  44. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/semantic_release/changelog/template.py +0 -0
  45. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/semantic_release/cli/__init__.py +0 -0
  46. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/semantic_release/cli/commands/__init__.py +0 -0
  47. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/semantic_release/cli/commands/changelog.py +0 -0
  48. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/semantic_release/cli/commands/generate_config.py +0 -0
  49. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/semantic_release/cli/common.py +0 -0
  50. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/semantic_release/cli/const.py +0 -0
  51. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/semantic_release/cli/masking_filter.py +0 -0
  52. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/semantic_release/cli/util.py +0 -0
  53. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/semantic_release/commit_parser/__init__.py +0 -0
  54. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/semantic_release/commit_parser/_base.py +0 -0
  55. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/semantic_release/commit_parser/angular.py +0 -0
  56. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/semantic_release/commit_parser/emoji.py +0 -0
  57. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/semantic_release/commit_parser/scipy.py +0 -0
  58. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/semantic_release/commit_parser/tag.py +0 -0
  59. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/semantic_release/commit_parser/util.py +0 -0
  60. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/semantic_release/enums.py +0 -0
  61. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/semantic_release/errors.py +0 -0
  62. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/semantic_release/helpers.py +0 -0
  63. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/semantic_release/hvcs/__init__.py +0 -0
  64. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/semantic_release/hvcs/token_auth.py +0 -0
  65. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/semantic_release/version/__init__.py +0 -0
  66. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/semantic_release/version/algorithm.py +0 -0
  67. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/semantic_release/version/declaration.py +0 -0
  68. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/semantic_release/version/translator.py +0 -0
  69. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/semantic_release/version/version.py +0 -0
  70. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/setup.cfg +0 -0
  71. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/setup.py +0 -0
  72. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/tests/command_line/__init__.py +0 -0
  73. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/tests/command_line/conftest.py +0 -0
  74. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/tests/command_line/test_changelog.py +0 -0
  75. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/tests/command_line/test_generate_config.py +0 -0
  76. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/tests/command_line/test_help.py +0 -0
  77. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/tests/fixtures/__init__.py +0 -0
  78. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/tests/fixtures/commit_parsers.py +0 -0
  79. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/tests/fixtures/example_project.py +0 -0
  80. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/tests/fixtures/git_repo.py +0 -0
  81. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/tests/fixtures/scipy.py +0 -0
  82. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/tests/scenario/__init__.py +0 -0
  83. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/tests/scenario/test_next_version.py +0 -0
  84. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/tests/scenario/test_release_history.py +0 -0
  85. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/tests/scenario/test_template_render.py +0 -0
  86. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/tests/unit/__init__.py +0 -0
  87. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/tests/unit/semantic_release/__init__.py +0 -0
  88. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/tests/unit/semantic_release/changelog/__init__.py +0 -0
  89. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/tests/unit/semantic_release/changelog/test_default_changelog.py +0 -0
  90. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/tests/unit/semantic_release/changelog/test_release_notes.py +0 -0
  91. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/tests/unit/semantic_release/changelog/test_template.py +0 -0
  92. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/tests/unit/semantic_release/cli/__init__.py +0 -0
  93. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/tests/unit/semantic_release/cli/test_masking_filter.py +0 -0
  94. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/tests/unit/semantic_release/cli/test_version.py +0 -0
  95. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/tests/unit/semantic_release/commit_parser/__init__.py +0 -0
  96. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/tests/unit/semantic_release/commit_parser/helper.py +0 -0
  97. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/tests/unit/semantic_release/commit_parser/test_angular.py +0 -0
  98. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/tests/unit/semantic_release/commit_parser/test_emoji.py +0 -0
  99. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/tests/unit/semantic_release/commit_parser/test_scipy.py +0 -0
  100. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/tests/unit/semantic_release/commit_parser/test_tag.py +0 -0
  101. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/tests/unit/semantic_release/commit_parser/test_util.py +0 -0
  102. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/tests/unit/semantic_release/hvcs/__init__.py +0 -0
  103. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/tests/unit/semantic_release/hvcs/test__base.py +0 -0
  104. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/tests/unit/semantic_release/hvcs/test_token_auth.py +0 -0
  105. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/tests/unit/semantic_release/hvcs/test_util.py +0 -0
  106. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/tests/unit/semantic_release/version/__init__.py +0 -0
  107. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/tests/unit/semantic_release/version/test_algorithm.py +0 -0
  108. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/tests/unit/semantic_release/version/test_declaration.py +0 -0
  109. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/tests/unit/semantic_release/version/test_translator.py +0 -0
  110. {python-semantic-release-8.0.0a5 → python-semantic-release-8.0.0a7}/tests/unit/semantic_release/version/test_version.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-semantic-release
3
- Version: 8.0.0a5
3
+ Version: 8.0.0a7
4
4
  Summary: Automatic Semantic Versioning for Python projects
5
5
  Author-email: Rolf Erik Lekang <me@rolflekang.com>
6
6
  License: MIT
@@ -53,7 +53,15 @@ Read more about the setup and configuration in our `getting started guide`_.
53
53
  .. _GitHub Action: https://python-semantic-release.readthedocs.io/en/latest/automatic-releases/github-actions.html
54
54
  .. _conda-forge: https://anaconda.org/conda-forge/python-semantic-release
55
55
 
56
- .. |Test Status| image:: https://img.shields.io/github/workflow/status/relekang/python-semantic-release/Test%20%26%20Release?label=Tests&logo=github
56
+ .. |Test Status| image:: https://img.shields.io/github/actions/workflow/status/python-semantic-release/python-semantic-release/main.yml?branch=master&label=Test%20Status&logo=github
57
+ :target: https://github.com/python-semantic-release/python-semantic-release/actions/workflows/main.yml
58
+ :alt: test-status
57
59
  .. |PyPI Version| image:: https://img.shields.io/pypi/v/python-semantic-release?label=PyPI&logo=pypi
60
+ :target: https://pypi.org/project/python-semantic-release/
61
+ :alt: pypi
58
62
  .. |conda-forge Version| image:: https://img.shields.io/conda/vn/conda-forge/python-semantic-release?logo=anaconda
59
- .. |Read the Docs Status| image:: https://img.shields.io/readthedocs/python-semantic-release?label=Read%20the%20Docs&logo=read-the-docs
63
+ :target: https://anaconda.org/conda-forge/python-semantic-release
64
+ :alt: conda-forge
65
+ .. |Read the Docs Status| image:: https://img.shields.io/readthedocs/python-semantic-release?label=Read%20the%20Docs&logo=Read%20the%20Docs
66
+ :target: https://python-semantic-release.readthedocs.io/en/latest/
67
+ :alt: docs
@@ -30,7 +30,15 @@ Read more about the setup and configuration in our `getting started guide`_.
30
30
  .. _GitHub Action: https://python-semantic-release.readthedocs.io/en/latest/automatic-releases/github-actions.html
31
31
  .. _conda-forge: https://anaconda.org/conda-forge/python-semantic-release
32
32
 
33
- .. |Test Status| image:: https://img.shields.io/github/workflow/status/relekang/python-semantic-release/Test%20%26%20Release?label=Tests&logo=github
33
+ .. |Test Status| image:: https://img.shields.io/github/actions/workflow/status/python-semantic-release/python-semantic-release/main.yml?branch=master&label=Test%20Status&logo=github
34
+ :target: https://github.com/python-semantic-release/python-semantic-release/actions/workflows/main.yml
35
+ :alt: test-status
34
36
  .. |PyPI Version| image:: https://img.shields.io/pypi/v/python-semantic-release?label=PyPI&logo=pypi
37
+ :target: https://pypi.org/project/python-semantic-release/
38
+ :alt: pypi
35
39
  .. |conda-forge Version| image:: https://img.shields.io/conda/vn/conda-forge/python-semantic-release?logo=anaconda
36
- .. |Read the Docs Status| image:: https://img.shields.io/readthedocs/python-semantic-release?label=Read%20the%20Docs&logo=read-the-docs
40
+ :target: https://anaconda.org/conda-forge/python-semantic-release
41
+ :alt: conda-forge
42
+ .. |Read the Docs Status| image:: https://img.shields.io/readthedocs/python-semantic-release?label=Read%20the%20Docs&logo=Read%20the%20Docs
43
+ :target: https://python-semantic-release.readthedocs.io/en/latest/
44
+ :alt: docs
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
6
6
 
7
7
  [project]
8
8
  name = "python-semantic-release"
9
- version = "8.0.0-alpha.5"
9
+ version = "8.0.0-alpha.7"
10
10
  description = "Automatic Semantic Versioning for Python projects"
11
11
  requires-python = ">=3.7"
12
12
  license = { text = "MIT" }
@@ -23,7 +23,6 @@ authors = [{ name = "Rolf Erik Lekang", email = "me@rolflekang.com" }]
23
23
  dependencies = [
24
24
  "click>=7,<9",
25
25
  "gitpython>=3.0.8,<4",
26
- "twine>=4,<5",
27
26
  "requests>=2.25,<3",
28
27
  "jinja2>=3.1.2,<4",
29
28
  "python-gitlab>=2,<4",
@@ -32,10 +31,13 @@ dependencies = [
32
31
  "dataclasses==0.8; python_version < '3.7.0'",
33
32
  "importlib-resources==5.7",
34
33
  "pydantic>=1.10.2,<2",
34
+ "rich>=12.5.1",
35
+ "shellingham>=1.5.0.post1",
35
36
  ]
36
37
 
37
38
  [project.scripts]
38
39
  semantic-release = "semantic_release.cli:main"
40
+ psr = "semantic_release.cli:main"
39
41
 
40
42
  [project.urls]
41
43
  "Project Url" = "http://github.com/python-semantic-release/python-semantic-release"
@@ -45,7 +47,8 @@ Homepage = "https://python-semantic-release.readthedocs.io"
45
47
  docs = [
46
48
  "Sphinx==5.2.3",
47
49
  "sphinxcontrib-apidoc==0.3.0",
48
- "sphinx-autobuild==2021.3.14",
50
+ "sphinx-autobuild==2021.03.14",
51
+ "furo>=2023.5.20",
49
52
  ]
50
53
  test = [
51
54
  "coverage[toml]>=6,<7",
@@ -56,6 +59,7 @@ test = [
56
59
  "pytest-cov>=4,<5",
57
60
  "responses==0.21.0",
58
61
  "requests-mock>=1.10.0,<2",
62
+ "types-pytest-lazy-fixture>=0.6.3.3",
59
63
  ]
60
64
  dev = ["tox", "isort", "black"]
61
65
  mypy = ["mypy", "types-requests"]
@@ -136,7 +140,10 @@ tag_format = "v{version}"
136
140
  commit_parser = "angular"
137
141
  commit_author = "semantic-release <semantic-release>"
138
142
  commit_message = "{version}\n\nAutomatically generated by python-semantic-release"
139
- build_command = "python setup.py sdist bdist_wheel"
143
+ build_command = """
144
+ python -m pip install build~=0.10.0
145
+ python -m build .
146
+ """
140
147
  major_on_zero = true
141
148
  assets = []
142
149
  version_variables = ["semantic_release/__init__.py:__version__"]
@@ -190,44 +197,9 @@ prerelease_token = "alpha"
190
197
  [tool.semantic_release.remote]
191
198
  name = "origin"
192
199
  type = "github"
193
- ignore_token_for_push = true
200
+ ignore_token_for_push = false
194
201
  token = { env = "GH_TOKEN" }
195
202
 
196
- [tool.semantic_release.upload]
203
+ [tool.semantic_release.publish]
197
204
  dist_glob_patterns = ["dist/*"]
198
- upload_to_repository = true
199
205
  upload_to_vcs_release = true
200
- sign = false
201
- sign_with = "gpg"
202
- config_file = "~/.pypirc"
203
- skip_existing = false
204
- repository_name = "pypi"
205
- disable_progress_bar = false
206
-
207
- [tool.semantic_release.upload.pypi_token]
208
- env = "PYPI_TOKEN"
209
-
210
- [tool.semantic_release.upload.identity]
211
- env = "GPG_IDENTITIY"
212
-
213
- [tool.semantic_release.upload.username]
214
- env = "REPOSITORY_USERNAME"
215
- default_env = "TWINE_USERNAME"
216
-
217
- [tool.semantic_release.upload.password]
218
- env = "REPOSITORY_PASSWORD"
219
- default_env = "TWINE_PASSWORD"
220
-
221
- [tool.semantic_release.upload.non_interactive]
222
- env = "TWINE_NON_INTERACTIVE"
223
- default = "true"
224
-
225
- [tool.semantic_release.upload.cacert]
226
- env = "TWINE_CERT"
227
-
228
- [tool.semantic_release.upload.client_cert]
229
- env = "TWINE_CLIENT_CERT"
230
-
231
- [tool.semantic_release.upload.repository_url]
232
- env = "REPOSITORY_URL"
233
- default_env = "TWINE_REPOSITORY_URL"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-semantic-release
3
- Version: 8.0.0a5
3
+ Version: 8.0.0a7
4
4
  Summary: Automatic Semantic Versioning for Python projects
5
5
  Author-email: Rolf Erik Lekang <me@rolflekang.com>
6
6
  License: MIT
@@ -53,7 +53,15 @@ Read more about the setup and configuration in our `getting started guide`_.
53
53
  .. _GitHub Action: https://python-semantic-release.readthedocs.io/en/latest/automatic-releases/github-actions.html
54
54
  .. _conda-forge: https://anaconda.org/conda-forge/python-semantic-release
55
55
 
56
- .. |Test Status| image:: https://img.shields.io/github/workflow/status/relekang/python-semantic-release/Test%20%26%20Release?label=Tests&logo=github
56
+ .. |Test Status| image:: https://img.shields.io/github/actions/workflow/status/python-semantic-release/python-semantic-release/main.yml?branch=master&label=Test%20Status&logo=github
57
+ :target: https://github.com/python-semantic-release/python-semantic-release/actions/workflows/main.yml
58
+ :alt: test-status
57
59
  .. |PyPI Version| image:: https://img.shields.io/pypi/v/python-semantic-release?label=PyPI&logo=pypi
60
+ :target: https://pypi.org/project/python-semantic-release/
61
+ :alt: pypi
58
62
  .. |conda-forge Version| image:: https://img.shields.io/conda/vn/conda-forge/python-semantic-release?logo=anaconda
59
- .. |Read the Docs Status| image:: https://img.shields.io/readthedocs/python-semantic-release?label=Read%20the%20Docs&logo=read-the-docs
63
+ :target: https://anaconda.org/conda-forge/python-semantic-release
64
+ :alt: conda-forge
65
+ .. |Read the Docs Status| image:: https://img.shields.io/readthedocs/python-semantic-release?label=Read%20the%20Docs&logo=Read%20the%20Docs
66
+ :target: https://python-semantic-release.readthedocs.io/en/latest/
67
+ :alt: docs
@@ -24,6 +24,7 @@ semantic_release/cli/__init__.py
24
24
  semantic_release/cli/common.py
25
25
  semantic_release/cli/config.py
26
26
  semantic_release/cli/const.py
27
+ semantic_release/cli/github_actions_output.py
27
28
  semantic_release/cli/masking_filter.py
28
29
  semantic_release/cli/util.py
29
30
  semantic_release/cli/commands/__init__.py
@@ -60,6 +61,7 @@ tests/command_line/test_changelog.py
60
61
  tests/command_line/test_generate_config.py
61
62
  tests/command_line/test_help.py
62
63
  tests/command_line/test_main.py
64
+ tests/command_line/test_publish.py
63
65
  tests/command_line/test_version.py
64
66
  tests/fixtures/__init__.py
65
67
  tests/fixtures/commit_parsers.py
@@ -79,6 +81,7 @@ tests/unit/semantic_release/changelog/test_release_notes.py
79
81
  tests/unit/semantic_release/changelog/test_template.py
80
82
  tests/unit/semantic_release/cli/__init__.py
81
83
  tests/unit/semantic_release/cli/test_config.py
84
+ tests/unit/semantic_release/cli/test_github_actions_output.py
82
85
  tests/unit/semantic_release/cli/test_masking_filter.py
83
86
  tests/unit/semantic_release/cli/test_version.py
84
87
  tests/unit/semantic_release/commit_parser/__init__.py
@@ -87,6 +90,7 @@ tests/unit/semantic_release/commit_parser/test_angular.py
87
90
  tests/unit/semantic_release/commit_parser/test_emoji.py
88
91
  tests/unit/semantic_release/commit_parser/test_scipy.py
89
92
  tests/unit/semantic_release/commit_parser/test_tag.py
93
+ tests/unit/semantic_release/commit_parser/test_token.py
90
94
  tests/unit/semantic_release/commit_parser/test_util.py
91
95
  tests/unit/semantic_release/hvcs/__init__.py
92
96
  tests/unit/semantic_release/hvcs/test__base.py
@@ -1,2 +1,3 @@
1
1
  [console_scripts]
2
+ psr = semantic_release.cli:main
2
3
  semantic-release = semantic_release.cli:main
@@ -1,6 +1,5 @@
1
1
  click<9,>=7
2
2
  gitpython<4,>=3.0.8
3
- twine<5,>=4
4
3
  requests<3,>=2.25
5
4
  jinja2<4,>=3.1.2
6
5
  python-gitlab<4,>=2
@@ -8,6 +7,8 @@ tomlkit~=0.10
8
7
  dotty-dict<2,>=1.3.0
9
8
  importlib-resources==5.7
10
9
  pydantic<2,>=1.10.2
10
+ rich>=12.5.1
11
+ shellingham>=1.5.0.post1
11
12
 
12
13
  [:python_version < "3.7.0"]
13
14
  dataclasses==0.8
@@ -20,7 +21,8 @@ black
20
21
  [docs]
21
22
  Sphinx==5.2.3
22
23
  sphinxcontrib-apidoc==0.3.0
23
- sphinx-autobuild==2021.3.14
24
+ sphinx-autobuild==2021.03.14
25
+ furo>=2023.5.20
24
26
 
25
27
  [mypy]
26
28
  mypy
@@ -35,3 +37,4 @@ pytest-lazy-fixture~=0.6.3
35
37
  pytest-cov<5,>=4
36
38
  responses==0.21.0
37
39
  requests-mock<2,>=1.10.0
40
+ types-pytest-lazy-fixture>=0.6.3.3
@@ -23,7 +23,7 @@ from semantic_release.version import (
23
23
  tags_and_versions as tags_and_versions,
24
24
  )
25
25
 
26
- __version__ = "8.0.0-alpha.5"
26
+ __version__ = "8.0.0-alpha.7"
27
27
 
28
28
 
29
29
  def setup_hook(argv: list[str]) -> None:
@@ -22,7 +22,7 @@ from semantic_release.cli.const import DEFAULT_CONFIG_FILE
22
22
  from semantic_release.cli.util import rprint
23
23
  from semantic_release.errors import InvalidConfiguration, NotAReleaseBranch
24
24
 
25
- FORMAT = "[%(name)s] %(module)s:%(funcName)s: %(message)s"
25
+ FORMAT = "[%(name)s] %(levelname)s %(module)s.%(funcName)s: %(message)s"
26
26
 
27
27
 
28
28
  @click.group(
@@ -54,12 +54,20 @@ FORMAT = "[%(name)s] %(module)s:%(funcName)s: %(message)s"
54
54
  show_default=True,
55
55
  type=click.IntRange(0, 2, clamp=True),
56
56
  )
57
+ @click.option(
58
+ "--strict",
59
+ "strict",
60
+ is_flag=True,
61
+ default=False,
62
+ help="Enable strict mode",
63
+ )
57
64
  @click.pass_context
58
65
  def main(
59
66
  ctx: click.Context,
60
67
  config_file: str = DEFAULT_CONFIG_FILE,
61
68
  verbosity: int = 0,
62
69
  noop: bool = False,
70
+ strict: bool = False,
63
71
  ) -> None:
64
72
  """
65
73
  Python Semantic Release
@@ -70,9 +78,6 @@ def main(
70
78
  Detect the next semantically correct version for a project based on the Git
71
79
  history, create and publish a changelog to a remote VCS, build a project.
72
80
 
73
- If the project is written in Python, distributions can also be
74
- uploaded to a remote Python package repository using twine.
75
-
76
81
  For more information, visit https://python-semantic-release.readthedocs.io/
77
82
  """
78
83
 
@@ -109,19 +114,24 @@ def main(
109
114
  ":shield: [bold cyan]You are running in no-operation mode, because the "
110
115
  "'--noop' flag was supplied"
111
116
  )
117
+
112
118
  cli_options = GlobalCommandLineOptions(
113
- noop=noop, verbosity=verbosity, config_file=config_file
119
+ noop=noop,
120
+ verbosity=verbosity,
121
+ config_file=config_file,
122
+ strict=strict,
114
123
  )
124
+ log.debug("global cli options: %s", cli_options)
115
125
 
116
126
  try:
117
- if config_file and config_file.endswith(".toml"):
127
+ if config_file.endswith(".toml"):
118
128
  log.info(f"Loading TOML configuration from {config_file}")
119
129
  config_text = read_toml(config_file)
120
- elif config_file and config_file.endswith(".json"):
130
+ elif config_file.endswith(".json"):
121
131
  log.info(f"Loading JSON configuration from {config_file}")
122
132
  raw_text = (Path() / config_file).resolve().read_text(encoding="utf-8")
123
133
  config_text = json.loads(raw_text)["semantic_release"]
124
- elif config_file:
134
+ else:
125
135
  *_, suffix = config_file.split(".")
126
136
  ctx.fail(f"{suffix!r} is not a supported configuration format")
127
137
  except (FileNotFoundError, InvalidConfiguration) as exc:
@@ -133,8 +143,11 @@ def main(
133
143
  raw_config, repo=repo, global_cli_options=cli_options
134
144
  )
135
145
  except NotAReleaseBranch as exc:
136
- rprint(f"[bold red]{str(exc)}")
137
- ctx.exit(2)
146
+ rprint(f"[bold {'red' if strict else 'orange1'}]{str(exc)}")
147
+ # If not strict, exit 0 so other processes can continue. For example, in
148
+ # multibranch CI it might be desirable to run a non-release branch's pipeline
149
+ # without specifying conditional execution of PSR based on branch name
150
+ ctx.exit(2 if strict else 0)
138
151
  except InvalidConfiguration as exc:
139
152
  ctx.fail(str(exc))
140
153
  ctx.obj = runtime
@@ -0,0 +1,46 @@
1
+ import logging
2
+
3
+ import click
4
+
5
+ from semantic_release.cli.util import noop_report
6
+ from semantic_release.version import tags_and_versions
7
+
8
+ log = logging.getLogger(__name__)
9
+
10
+
11
+ @click.command(
12
+ short_help="Publish distributions to VCS Releases",
13
+ context_settings={
14
+ "help_option_names": ["-h", "--help"],
15
+ },
16
+ )
17
+ @click.option(
18
+ "--tag",
19
+ "tag",
20
+ help="The tag associated with the release to publish to",
21
+ default="latest",
22
+ )
23
+ @click.pass_context
24
+ def publish(ctx: click.Context, tag: str = "latest") -> None:
25
+ """
26
+ Build and publish a distribution to a VCS release.
27
+ """
28
+ runtime = ctx.obj
29
+ repo = runtime.repo
30
+ hvcs_client = runtime.hvcs_client
31
+ translator = runtime.version_translator
32
+ dist_glob_patterns = runtime.dist_glob_patterns
33
+
34
+ if tag == "latest":
35
+ tag = str(tags_and_versions(repo.tags, translator)[0][0])
36
+ if runtime.global_cli_options.noop:
37
+ noop_report(
38
+ "would have uploaded files matching any of the globs "
39
+ + ", ".join(repr(g) for g in dist_glob_patterns)
40
+ + " to a remote VCS release, if supported"
41
+ )
42
+ ctx.exit(0)
43
+
44
+ log.info("Uploading distributions to release")
45
+ for pattern in dist_glob_patterns:
46
+ hvcs_client.upload_dists(tag=tag, dist_glob=pattern)
@@ -2,11 +2,13 @@ from __future__ import annotations
2
2
 
3
3
  import logging
4
4
  import os
5
+ import subprocess
5
6
  from contextlib import nullcontext
6
7
  from datetime import datetime
7
8
  from typing import TYPE_CHECKING, ContextManager
8
9
 
9
10
  import click
11
+ import shellingham # type: ignore[import]
10
12
 
11
13
  from semantic_release.changelog import ReleaseHistory, environment, recursive_render
12
14
  from semantic_release.changelog.context import make_changelog_context
@@ -14,8 +16,9 @@ from semantic_release.cli.common import (
14
16
  render_default_changelog_file,
15
17
  render_release_notes,
16
18
  )
19
+ from semantic_release.cli.github_actions_output import VersionGitHubActionsOutput
17
20
  from semantic_release.cli.util import indented, noop_report, rprint
18
- from semantic_release.const import DEFAULT_VERSION
21
+ from semantic_release.const import DEFAULT_SHELL, DEFAULT_VERSION
19
22
  from semantic_release.enums import LevelBump
20
23
  from semantic_release.version import (
21
24
  Version,
@@ -85,6 +88,21 @@ def apply_version_to_source_files(
85
88
  return paths
86
89
 
87
90
 
91
+ def shell(cmd: str, *, check: bool = True) -> subprocess.CompletedProcess:
92
+ shell: str | None
93
+ try:
94
+ shell, _ = shellingham.detect_shell()
95
+ except shellingham.ShellDetectionFailure:
96
+ log.warning("failed to detect shell, using default shell: %s", DEFAULT_SHELL)
97
+ log.debug("stack trace", exc_info=True)
98
+ shell = DEFAULT_SHELL
99
+
100
+ if not shell:
101
+ raise TypeError("'shell' is None")
102
+
103
+ return subprocess.run([shell, "-c", cmd], check=check)
104
+
105
+
88
106
  @click.command(
89
107
  short_help="Detect and apply a new version",
90
108
  context_settings={
@@ -152,7 +170,14 @@ def apply_version_to_source_files(
152
170
  "--build-metadata",
153
171
  "build_metadata",
154
172
  default=os.getenv("PSR_BUILD_METADATA"),
155
- help="Build metadata to append to the latest version",
173
+ help="Build metadata to append to the new version",
174
+ )
175
+ @click.option(
176
+ "--skip-build",
177
+ "skip_build",
178
+ default=False,
179
+ is_flag=True,
180
+ help="Skip building the current project",
156
181
  )
157
182
  @click.pass_context
158
183
  def version(
@@ -166,6 +191,7 @@ def version(
166
191
  push_changes: bool = True,
167
192
  make_vcs_release: bool = True,
168
193
  build_metadata: str | None = None,
194
+ skip_build: bool = False,
169
195
  ) -> str:
170
196
  """
171
197
  Detect the semantically correct next version that should be applied to your
@@ -200,7 +226,11 @@ def version(
200
226
  commit_author = runtime.commit_author
201
227
  commit_message = runtime.commit_message
202
228
  major_on_zero = runtime.major_on_zero
229
+ build_command = runtime.build_command
203
230
  opts = runtime.global_cli_options
231
+ gha_output = VersionGitHubActionsOutput()
232
+
233
+ ctx.call_on_close(gha_output.write_if_possible)
204
234
 
205
235
  if prerelease_token:
206
236
  log.info("Forcing use of %s as the prerelease token", prerelease_token)
@@ -254,14 +284,26 @@ def version(
254
284
  if build_metadata:
255
285
  new_version.build_metadata = build_metadata
256
286
 
257
- # If the new version has already been released, we fail and abort
287
+ gha_output.released = False
288
+ gha_output.version = new_version
289
+
290
+ # Print the new version so that command-line output capture will work
291
+ click.echo(str(new_version))
292
+
293
+ # If the new version has already been released, we fail and abort if strict;
294
+ # otherwise we exit with 0.
258
295
  if new_version in {v for _, v in tags_and_versions(repo.tags, translator)}:
259
- ctx.fail(
260
- f"No release will be made, {str(new_version)} has already been released!"
261
- )
296
+ if opts.strict:
297
+ ctx.fail(
298
+ f"No release will be made, {str(new_version)} has already been released!"
299
+ )
300
+ else:
301
+ rprint(
302
+ f"[bold orange1]No release will be made, {str(new_version)} has already been released!"
303
+ )
304
+ ctx.exit(0)
262
305
 
263
306
  if print_only:
264
- click.echo(str(new_version))
265
307
  ctx.exit(0)
266
308
 
267
309
  rprint(
@@ -276,6 +318,24 @@ def version(
276
318
  )
277
319
  all_paths_to_add = files_with_new_version_written + (assets or [])
278
320
 
321
+ # Build distributions before committing any changes - this way if the
322
+ # build fails, modifications to the source code won't be committed
323
+ if skip_build:
324
+ rprint("[bold orange1]Skipping build due to --skip-build flag")
325
+ elif not build_command:
326
+ rprint("[green]No build command specified, skipping")
327
+ elif runtime.global_cli_options.noop:
328
+ noop_report(f"would have run the build_command {build_command}")
329
+ else:
330
+ try:
331
+ log.info("Running build command %s", build_command)
332
+ rprint(
333
+ f"[bold green]:hammer_and_wrench: Running build command: {build_command}"
334
+ )
335
+ shell(build_command, check=True)
336
+ except subprocess.CalledProcessError as exc:
337
+ ctx.fail(str(exc))
338
+
279
339
  # Commit changes
280
340
  if commit_changes and opts.noop:
281
341
  # Indents the newlines so that terminal formatting is happy - note the
@@ -450,10 +510,11 @@ def version(
450
510
  )
451
511
  )
452
512
  else:
453
- # Wrap in GitCommandError handling - remove token
454
513
  repo.git.push(remote_url, active_branch)
455
514
  repo.git.push("--tags", remote_url, active_branch)
456
515
 
516
+ gha_output.released = True
517
+
457
518
  if make_vcs_release and opts.noop:
458
519
  noop_report(
459
520
  f"would have created a release for the tag {new_version.as_tag()!r}"