python-semantic-release 9.4.2__tar.gz → 9.5.0__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 (145) hide show
  1. {python_semantic_release-9.4.2/python_semantic_release.egg-info → python_semantic_release-9.5.0}/PKG-INFO +2 -2
  2. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/pyproject.toml +17 -45
  3. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0/python_semantic_release.egg-info}/PKG-INFO +2 -2
  4. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/python_semantic_release.egg-info/requires.txt +1 -1
  5. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/semantic_release/__init__.py +1 -1
  6. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/semantic_release/hvcs/github.py +95 -16
  7. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/command_line/test_changelog.py +1 -3
  8. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/unit/semantic_release/hvcs/test_github.py +65 -16
  9. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/AUTHORS.rst +0 -0
  10. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/LICENSE +0 -0
  11. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/MANIFEST.in +0 -0
  12. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/README.rst +0 -0
  13. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/docs/Makefile +0 -0
  14. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/docs/algorithm.rst +0 -0
  15. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/docs/automatic-releases/cronjobs.rst +0 -0
  16. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/docs/automatic-releases/github-actions.rst +0 -0
  17. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/docs/automatic-releases/index.rst +0 -0
  18. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/docs/automatic-releases/travis.rst +0 -0
  19. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/docs/changelog_templates.rst +0 -0
  20. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/docs/commands.rst +0 -0
  21. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/docs/commit-parsing.rst +0 -0
  22. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/docs/conf.py +0 -0
  23. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/docs/configuration.rst +0 -0
  24. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/docs/contributing.rst +0 -0
  25. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/docs/contributors.rst +0 -0
  26. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/docs/github-action.rst +0 -0
  27. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/docs/index.rst +0 -0
  28. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/docs/make.bat +0 -0
  29. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/docs/migrating_from_v7.rst +0 -0
  30. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/docs/multibranch_releases.rst +0 -0
  31. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/docs/strict_mode.rst +0 -0
  32. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/docs/troubleshooting.rst +0 -0
  33. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/python_semantic_release.egg-info/SOURCES.txt +0 -0
  34. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/python_semantic_release.egg-info/dependency_links.txt +0 -0
  35. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/python_semantic_release.egg-info/entry_points.txt +0 -0
  36. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/python_semantic_release.egg-info/top_level.txt +0 -0
  37. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/semantic_release/__main__.py +0 -0
  38. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/semantic_release/changelog/__init__.py +0 -0
  39. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/semantic_release/changelog/context.py +0 -0
  40. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/semantic_release/changelog/release_history.py +0 -0
  41. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/semantic_release/changelog/template.py +0 -0
  42. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/semantic_release/cli/__init__.py +0 -0
  43. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/semantic_release/cli/commands/__init__.py +0 -0
  44. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/semantic_release/cli/commands/changelog.py +0 -0
  45. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/semantic_release/cli/commands/cli_context.py +0 -0
  46. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/semantic_release/cli/commands/generate_config.py +0 -0
  47. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/semantic_release/cli/commands/main.py +0 -0
  48. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/semantic_release/cli/commands/publish.py +0 -0
  49. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/semantic_release/cli/commands/version.py +0 -0
  50. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/semantic_release/cli/common.py +0 -0
  51. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/semantic_release/cli/config.py +0 -0
  52. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/semantic_release/cli/const.py +0 -0
  53. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/semantic_release/cli/github_actions_output.py +0 -0
  54. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/semantic_release/cli/masking_filter.py +0 -0
  55. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/semantic_release/cli/util.py +0 -0
  56. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/semantic_release/commit_parser/__init__.py +0 -0
  57. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/semantic_release/commit_parser/_base.py +0 -0
  58. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/semantic_release/commit_parser/angular.py +0 -0
  59. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/semantic_release/commit_parser/emoji.py +0 -0
  60. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/semantic_release/commit_parser/scipy.py +0 -0
  61. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/semantic_release/commit_parser/tag.py +0 -0
  62. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/semantic_release/commit_parser/token.py +0 -0
  63. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/semantic_release/commit_parser/util.py +0 -0
  64. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/semantic_release/const.py +0 -0
  65. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/semantic_release/data/templates/CHANGELOG.md.j2 +0 -0
  66. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/semantic_release/data/templates/release_notes.md.j2 +0 -0
  67. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/semantic_release/enums.py +0 -0
  68. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/semantic_release/errors.py +0 -0
  69. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/semantic_release/helpers.py +0 -0
  70. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/semantic_release/hvcs/__init__.py +0 -0
  71. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/semantic_release/hvcs/_base.py +0 -0
  72. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/semantic_release/hvcs/bitbucket.py +0 -0
  73. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/semantic_release/hvcs/gitea.py +0 -0
  74. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/semantic_release/hvcs/gitlab.py +0 -0
  75. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/semantic_release/hvcs/token_auth.py +0 -0
  76. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/semantic_release/hvcs/util.py +0 -0
  77. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/semantic_release/version/__init__.py +0 -0
  78. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/semantic_release/version/algorithm.py +0 -0
  79. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/semantic_release/version/declaration.py +0 -0
  80. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/semantic_release/version/translator.py +0 -0
  81. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/semantic_release/version/version.py +0 -0
  82. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/setup.cfg +0 -0
  83. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/__init__.py +0 -0
  84. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/command_line/__init__.py +0 -0
  85. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/command_line/conftest.py +0 -0
  86. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/command_line/test_generate_config.py +0 -0
  87. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/command_line/test_help.py +0 -0
  88. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/command_line/test_main.py +0 -0
  89. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/command_line/test_publish.py +0 -0
  90. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/command_line/test_version.py +0 -0
  91. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/conftest.py +0 -0
  92. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/const.py +0 -0
  93. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/fixtures/__init__.py +0 -0
  94. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/fixtures/commit_parsers.py +0 -0
  95. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/fixtures/example_project.py +0 -0
  96. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/fixtures/git_repo.py +0 -0
  97. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/fixtures/repos/__init__.py +0 -0
  98. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/fixtures/repos/git_flow/__init__.py +0 -0
  99. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/fixtures/repos/git_flow/repo_w_2_release_channels.py +0 -0
  100. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/fixtures/repos/git_flow/repo_w_3_release_channels.py +0 -0
  101. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/fixtures/repos/github_flow/__init__.py +0 -0
  102. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/fixtures/repos/github_flow/repo_w_release_channels.py +0 -0
  103. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/fixtures/repos/trunk_based_dev/__init__.py +0 -0
  104. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/fixtures/repos/trunk_based_dev/repo_w_no_tags.py +0 -0
  105. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/fixtures/repos/trunk_based_dev/repo_w_prereleases.py +0 -0
  106. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/fixtures/repos/trunk_based_dev/repo_w_tags.py +0 -0
  107. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/fixtures/scipy.py +0 -0
  108. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/scenario/__init__.py +0 -0
  109. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/scenario/test_next_version.py +0 -0
  110. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/scenario/test_release_history.py +0 -0
  111. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/scenario/test_template_render.py +0 -0
  112. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/unit/__init__.py +0 -0
  113. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/unit/semantic_release/__init__.py +0 -0
  114. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/unit/semantic_release/changelog/__init__.py +0 -0
  115. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/unit/semantic_release/changelog/test_default_changelog.py +0 -0
  116. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/unit/semantic_release/changelog/test_release_notes.py +0 -0
  117. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/unit/semantic_release/changelog/test_template.py +0 -0
  118. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/unit/semantic_release/cli/__init__.py +0 -0
  119. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/unit/semantic_release/cli/test_config.py +0 -0
  120. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/unit/semantic_release/cli/test_github_actions_output.py +0 -0
  121. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/unit/semantic_release/cli/test_masking_filter.py +0 -0
  122. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/unit/semantic_release/cli/test_util.py +0 -0
  123. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/unit/semantic_release/cli/test_version.py +0 -0
  124. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/unit/semantic_release/commit_parser/__init__.py +0 -0
  125. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/unit/semantic_release/commit_parser/helper.py +0 -0
  126. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/unit/semantic_release/commit_parser/test_angular.py +0 -0
  127. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/unit/semantic_release/commit_parser/test_emoji.py +0 -0
  128. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/unit/semantic_release/commit_parser/test_scipy.py +0 -0
  129. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/unit/semantic_release/commit_parser/test_tag.py +0 -0
  130. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/unit/semantic_release/commit_parser/test_token.py +0 -0
  131. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/unit/semantic_release/commit_parser/test_util.py +0 -0
  132. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/unit/semantic_release/hvcs/__init__.py +0 -0
  133. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/unit/semantic_release/hvcs/test__base.py +0 -0
  134. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/unit/semantic_release/hvcs/test_bitbucket.py +0 -0
  135. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/unit/semantic_release/hvcs/test_gitea.py +0 -0
  136. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/unit/semantic_release/hvcs/test_gitlab.py +0 -0
  137. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/unit/semantic_release/hvcs/test_token_auth.py +0 -0
  138. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/unit/semantic_release/hvcs/test_util.py +0 -0
  139. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/unit/semantic_release/test_helpers.py +0 -0
  140. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/unit/semantic_release/version/__init__.py +0 -0
  141. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/unit/semantic_release/version/test_algorithm.py +0 -0
  142. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/unit/semantic_release/version/test_declaration.py +0 -0
  143. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/unit/semantic_release/version/test_translator.py +0 -0
  144. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/unit/semantic_release/version/test_version.py +0 -0
  145. {python_semantic_release-9.4.2 → python_semantic_release-9.5.0}/tests/util.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-semantic-release
3
- Version: 9.4.2
3
+ Version: 9.5.0
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,7 @@ Requires-Dist: types-pytest-lazy-fixture~=0.6.3; extra == "test"
53
53
  Provides-Extra: dev
54
54
  Requires-Dist: pre-commit~=3.5; extra == "dev"
55
55
  Requires-Dist: tox~=4.11; extra == "dev"
56
- Requires-Dist: ruff==0.3.5; extra == "dev"
56
+ Requires-Dist: ruff==0.4.1; extra == "dev"
57
57
  Provides-Extra: mypy
58
58
  Requires-Dist: mypy==1.9.0; extra == "mypy"
59
59
  Requires-Dist: types-requests~=2.31.0; extra == "mypy"
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
6
6
 
7
7
  [project]
8
8
  name = "python-semantic-release"
9
- version = "9.4.2"
9
+ version = "9.5.0"
10
10
  description = "Automatic Semantic Versioning for Python projects"
11
11
  requires-python = ">=3.8"
12
12
  license = { text = "MIT" }
@@ -71,7 +71,7 @@ test = [
71
71
  dev = [
72
72
  "pre-commit ~= 3.5",
73
73
  "tox ~= 4.11",
74
- "ruff == 0.3.5"
74
+ "ruff == 0.4.1"
75
75
  ]
76
76
  mypy = [
77
77
  "mypy == 1.9.0",
@@ -363,70 +363,42 @@ ignore_names = ["change_to_ex_proj_dir", "init_example_project"]
363
363
 
364
364
  [tool.semantic_release]
365
365
  logging_use_named_masks = true
366
- tag_format = "v{version}"
367
366
  commit_parser = "angular"
368
- commit_author = "semantic-release <semantic-release>"
369
- commit_message = "{version}\n\nAutomatically generated by python-semantic-release"
370
367
  build_command = """
371
368
  python -m pip install build~=0.10.0
372
369
  python -m build .
373
370
  """
374
371
  major_on_zero = true
375
- assets = []
376
372
  version_variables = ["semantic_release/__init__.py:__version__"]
377
373
  version_toml = ["pyproject.toml:project.version"]
378
374
 
379
- [tool.semantic_release.commit_parser_options]
380
- allowed_tags = [
381
- "build",
382
- "chore",
383
- "ci",
384
- "docs",
385
- "feat",
386
- "fix",
387
- "perf",
388
- "style",
389
- "refactor",
390
- "test",
391
- ]
392
- minor_tags = ["feat"]
393
- patch_tags = ["fix", "perf"]
394
-
395
375
  [tool.semantic_release.changelog]
396
- template_dir = "templates"
397
- changelog_file = "CHANGELOG.md"
398
- exclude_commit_patterns = []
399
-
400
- [tool.semantic_release.changelog.environment]
401
- block_start_string = "{%"
402
- block_end_string = "%}"
403
- variable_start_string = "{{"
404
- variable_end_string = "}}"
405
- comment_start_string = "{#"
406
- comment_end_string = "#}"
407
- trim_blocks = false
408
- lstrip_blocks = false
409
- newline_sequence = "\n"
410
- keep_trailing_newline = false
411
- extensions = []
412
- autoescape = true
376
+ exclude_commit_patterns = [
377
+ '''chore(?:\([^)]*?\))?: .+''',
378
+ '''ci(?:\([^)]*?\))?: .+''',
379
+ '''refactor(?:\([^)]*?\))?: .+''',
380
+ '''style(?:\([^)]*?\))?: .+''',
381
+ '''test(?:\([^)]*?\))?: .+''',
382
+ '''build\((?!deps\): .+)''',
383
+ '''Merged? .*''',
384
+ '''Initial Commit.*''',
385
+ # Old semantic-release version commits
386
+ '''^\d+\.\d+\.\d+''',
387
+ ]
413
388
 
414
389
  [tool.semantic_release.branches.main]
415
390
  match = "(main|master)"
416
391
  prerelease = false
417
392
  prerelease_token = "rc"
418
393
 
419
- [tool.semantic_release.branches."8.0.x"]
420
- match = "8.0.x"
394
+ [tool.semantic_release.branches.alpha]
395
+ match = "^(feat|fix|perf)/.+"
421
396
  prerelease = true
422
- prerelease_token = "rc"
397
+ prerelease_token = "alpha"
423
398
 
424
399
  [tool.semantic_release.remote]
425
- name = "origin"
426
400
  type = "github"
427
- ignore_token_for_push = false
428
401
  token = { env = "GH_TOKEN" }
429
402
 
430
403
  [tool.semantic_release.publish]
431
- dist_glob_patterns = ["dist/*"]
432
404
  upload_to_vcs_release = true
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-semantic-release
3
- Version: 9.4.2
3
+ Version: 9.5.0
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,7 @@ Requires-Dist: types-pytest-lazy-fixture~=0.6.3; extra == "test"
53
53
  Provides-Extra: dev
54
54
  Requires-Dist: pre-commit~=3.5; extra == "dev"
55
55
  Requires-Dist: tox~=4.11; extra == "dev"
56
- Requires-Dist: ruff==0.3.5; extra == "dev"
56
+ Requires-Dist: ruff==0.4.1; extra == "dev"
57
57
  Provides-Extra: mypy
58
58
  Requires-Dist: mypy==1.9.0; extra == "mypy"
59
59
  Requires-Dist: types-requests~=2.31.0; extra == "mypy"
@@ -14,7 +14,7 @@ shellingham~=1.5
14
14
  [dev]
15
15
  pre-commit~=3.5
16
16
  tox~=4.11
17
- ruff==0.3.5
17
+ ruff==0.4.1
18
18
 
19
19
  [docs]
20
20
  Sphinx~=6.0
@@ -24,7 +24,7 @@ from semantic_release.version import (
24
24
  tags_and_versions,
25
25
  )
26
26
 
27
- __version__ = "9.4.2"
27
+ __version__ = "9.5.0"
28
28
 
29
29
 
30
30
  def setup_hook(argv: list[str]) -> None:
@@ -50,18 +50,28 @@ class Github(HvcsBase):
50
50
  GitHub HVCS interface for interacting with GitHub repositories
51
51
 
52
52
  This class supports the following products:
53
+
53
54
  - GitHub Free, Pro, & Team
54
55
  - GitHub Enterprise Cloud
55
-
56
- This class does not support the following products:
57
56
  - GitHub Enterprise Server (on-premises installations)
57
+
58
+ This interface does its best to detect which product is configured based
59
+ on the provided domain. If it is the official `github.com`, the default
60
+ domain, then it is considered as GitHub Enterprise Cloud which uses the
61
+ subdomain `api.github.com` for api communication.
62
+
63
+ If the provided domain is anything else, than it is assumed to be communicating
64
+ with an on-premise or 3rd-party maintained GitHub instance which matches with
65
+ the GitHub Enterprise Server product. The on-prem server product uses a
66
+ path prefix for handling api requests which is configured to be
67
+ `server.domain/api/v3` based on the documentation in April 2024.
58
68
  """
59
69
 
60
- # TODO: Add support for GitHub Enterprise Server (on-premises installations)
61
- # DEFAULT_ONPREM_API_PATH = "/api/v3"
62
70
  DEFAULT_DOMAIN = "github.com"
63
71
  DEFAULT_API_SUBDOMAIN_PREFIX = "api"
64
72
  DEFAULT_API_DOMAIN = f"{DEFAULT_API_SUBDOMAIN_PREFIX}.{DEFAULT_DOMAIN}"
73
+ DEFAULT_API_PATH_CLOUD = "/" # no path prefix!
74
+ DEFAULT_API_PATH_ONPREM = "/api/v3"
65
75
  DEFAULT_ENV_TOKEN_NAME = "GH_TOKEN" # noqa: S105
66
76
 
67
77
  def __init__(
@@ -117,10 +127,15 @@ class Github(HvcsBase):
117
127
  # infer from Domain url and prepend the default api subdomain
118
128
  **{
119
129
  **self.hvcs_domain._asdict(),
120
- "host": f"{self.DEFAULT_API_SUBDOMAIN_PREFIX}.{self.hvcs_domain.host}",
121
- "path": "",
130
+ "host": self.hvcs_domain.host,
131
+ "path": str(
132
+ PurePosixPath(
133
+ str.lstrip(self.hvcs_domain.path or "", "/") or "/",
134
+ self.DEFAULT_API_PATH_ONPREM.lstrip("/"),
135
+ )
136
+ ),
122
137
  }
123
- ).url
138
+ ).url.rstrip("/")
124
139
  )
125
140
 
126
141
  if api_domain_parts.scheme == "http" and not allow_insecure:
@@ -138,16 +153,66 @@ class Github(HvcsBase):
138
153
  "Only http and https are supported."
139
154
  )
140
155
 
141
- # Strip any auth, query or fragment from the domain
142
- self.api_url = parse_url(
156
+ # As GitHub Enterprise Cloud and GitHub Enterprise Server (on-prem) have different api locations
157
+ # lets check what we have been given and set the api url accordingly
158
+ # NOTE: Github Server (on premise) uses a path prefix '/api/v3' for the api
159
+ # while GitHub Enterprise Cloud uses a separate subdomain as the base
160
+ is_github_cloud = bool(self.hvcs_domain.url == f"https://{self.DEFAULT_DOMAIN}")
161
+
162
+ # Calculate out the api url that we expect for GitHub Cloud
163
+ default_cloud_api_url = parse_url(
143
164
  Url(
144
- scheme=api_domain_parts.scheme,
145
- host=api_domain_parts.host,
146
- port=api_domain_parts.port,
147
- path=str(PurePosixPath(api_domain_parts.path or "/")),
165
+ # set api domain and append the default api path
166
+ **{
167
+ **self.hvcs_domain._asdict(),
168
+ "host": f"{self.DEFAULT_API_DOMAIN}",
169
+ "path": self.DEFAULT_API_PATH_CLOUD,
170
+ }
148
171
  ).url.rstrip("/")
149
172
  )
150
173
 
174
+ if (
175
+ is_github_cloud
176
+ and hvcs_api_domain
177
+ and api_domain_parts.url not in default_cloud_api_url.url
178
+ ):
179
+ # Api was provied but is not a subset of the expected one, raise an error
180
+ # we check for a subset because the user may not have provided the full api path
181
+ # but the correct domain. If they didn't, then we are erroring out here.
182
+ raise ValueError(
183
+ f"Invalid api domain {api_domain_parts.url} for GitHub Enterprise Cloud. "
184
+ f"Expected {default_cloud_api_url.url}."
185
+ )
186
+
187
+ # Set the api url to the default cloud one if we are on cloud, otherwise
188
+ # use the verified api domain for a on-prem server
189
+ self.api_url = (
190
+ default_cloud_api_url
191
+ if is_github_cloud
192
+ else parse_url(
193
+ # Strip any auth, query or fragment from the domain
194
+ Url(
195
+ scheme=api_domain_parts.scheme,
196
+ host=api_domain_parts.host,
197
+ port=api_domain_parts.port,
198
+ path=str(
199
+ PurePosixPath(
200
+ # pass any custom server prefix path but ensure we don't
201
+ # double up the api path in the case the user provided it
202
+ str.replace(
203
+ api_domain_parts.path or "",
204
+ self.DEFAULT_API_PATH_ONPREM,
205
+ "",
206
+ ).lstrip("/")
207
+ or "/",
208
+ # apply the on-prem api path
209
+ self.DEFAULT_API_PATH_ONPREM.lstrip("/"),
210
+ )
211
+ ),
212
+ ).url.rstrip("/")
213
+ )
214
+ )
215
+
151
216
  @lru_cache(maxsize=1)
152
217
  def _get_repository_owner_and_name(self) -> tuple[str, str]:
153
218
  # Github actions context
@@ -419,7 +484,7 @@ class Github(HvcsBase):
419
484
  lambda x: x[1] is not None,
420
485
  {
421
486
  "auth": auth,
422
- "path": str(PurePosixPath("/", path)),
487
+ "path": str(PurePosixPath("/", path.lstrip("/"))),
423
488
  "query": query,
424
489
  "fragment": fragment,
425
490
  }.items(),
@@ -439,7 +504,14 @@ class Github(HvcsBase):
439
504
  query: str | None = None,
440
505
  fragment: str | None = None,
441
506
  ) -> str:
442
- return self._derive_url(self.hvcs_domain, path, auth, query, fragment)
507
+ # Ensure any path prefix is transfered but not doubled up on the derived url
508
+ return self._derive_url(
509
+ self.hvcs_domain,
510
+ path=f"{self.hvcs_domain.path or ''}/{path.lstrip(self.hvcs_domain.path)}",
511
+ auth=auth,
512
+ query=query,
513
+ fragment=fragment,
514
+ )
443
515
 
444
516
  def create_api_url(
445
517
  self,
@@ -448,4 +520,11 @@ class Github(HvcsBase):
448
520
  query: str | None = None,
449
521
  fragment: str | None = None,
450
522
  ) -> str:
451
- return self._derive_url(self.api_url, endpoint, auth, query, fragment)
523
+ # Ensure any api path prefix is transfered but not doubled up on the derived api url
524
+ return self._derive_url(
525
+ self.api_url,
526
+ path=f"{self.api_url.path or ''}/{endpoint.lstrip(self.api_url.path)}",
527
+ auth=auth,
528
+ query=query,
529
+ fragment=fragment,
530
+ )
@@ -242,9 +242,7 @@ def test_changelog_post_to_release(
242
242
  session.mount("https://", mock_adapter)
243
243
 
244
244
  expected_request_url = "{api_url}/repos/{owner}/{repo_name}/releases".format(
245
- # TODO: Fix as this is likely not correct given a custom domain and the
246
- # use of GitHub which would be GitHub Enterprise Server which we don't yet support
247
- api_url=f"https://api.{EXAMPLE_HVCS_DOMAIN}", # GitHub API URL
245
+ api_url=f"https://{EXAMPLE_HVCS_DOMAIN}/api/v3", # GitHub API URL
248
246
  owner=EXAMPLE_REPO_OWNER,
249
247
  repo_name=EXAMPLE_REPO_NAME,
250
248
  )
@@ -55,12 +55,61 @@ def default_gh_client() -> Generator[Github, None, None]:
55
55
  ),
56
56
  [
57
57
  (
58
- # Default values
58
+ # Default values (GitHub Enterprise Cloud)
59
59
  {},
60
60
  None,
61
61
  None,
62
- f"https://{Github.DEFAULT_DOMAIN}",
63
- f"https://{Github.DEFAULT_API_DOMAIN}",
62
+ "https://github.com",
63
+ "https://api.github.com",
64
+ False,
65
+ ),
66
+ (
67
+ # Explicitly set default values (GitHub Enterprise Cloud)
68
+ {},
69
+ Github.DEFAULT_DOMAIN,
70
+ Github.DEFAULT_API_DOMAIN,
71
+ "https://github.com",
72
+ "https://api.github.com",
73
+ False,
74
+ ),
75
+ (
76
+ # Pull both locations from environment (GitHub Actions on Cloud)
77
+ {
78
+ "GITHUB_SERVER_URL": f"https://{Github.DEFAULT_DOMAIN}",
79
+ "GITHUB_API_URL": f"https://{Github.DEFAULT_API_DOMAIN}",
80
+ },
81
+ None,
82
+ None,
83
+ "https://github.com",
84
+ "https://api.github.com",
85
+ False,
86
+ ),
87
+ (
88
+ # Explicitly set custom values with full api path
89
+ {},
90
+ EXAMPLE_HVCS_DOMAIN,
91
+ f"{EXAMPLE_HVCS_DOMAIN}{Github.DEFAULT_API_PATH_ONPREM}",
92
+ f"https://{EXAMPLE_HVCS_DOMAIN}",
93
+ f"https://{EXAMPLE_HVCS_DOMAIN}{Github.DEFAULT_API_PATH_ONPREM}",
94
+ False,
95
+ ),
96
+ (
97
+ # Explicitly defined api as subdomain
98
+ # POSSIBLY WRONG ASSUMPTION of Api path for GitHub Enterprise Server (On Prem)
99
+ {},
100
+ f"https://{EXAMPLE_HVCS_DOMAIN}",
101
+ f"https://api.{EXAMPLE_HVCS_DOMAIN}",
102
+ f"https://{EXAMPLE_HVCS_DOMAIN}",
103
+ f"https://api.{EXAMPLE_HVCS_DOMAIN}{Github.DEFAULT_API_PATH_ONPREM}",
104
+ False,
105
+ ),
106
+ (
107
+ # Custom domain with path prefix
108
+ {},
109
+ "special.custom.server/vcs",
110
+ None,
111
+ "https://special.custom.server/vcs",
112
+ "https://special.custom.server/vcs/api/v3",
64
113
  False,
65
114
  ),
66
115
  (
@@ -69,19 +118,19 @@ def default_gh_client() -> Generator[Github, None, None]:
69
118
  None,
70
119
  None,
71
120
  "https://special.custom.server",
72
- "https://api.special.custom.server",
121
+ "https://special.custom.server/api/v3",
73
122
  False,
74
123
  ),
75
124
  (
76
- # Pull both locations from environment
125
+ # Pull both locations from environment (On-prem Actions Env)
77
126
  {
78
127
  "GITHUB_SERVER_URL": "https://special.custom.server/",
79
- "GITHUB_API_URL": "https://api2.special.custom.server/",
128
+ "GITHUB_API_URL": "https://special.custom.server/api/v3",
80
129
  },
81
130
  None,
82
131
  None,
83
132
  "https://special.custom.server",
84
- "https://api2.special.custom.server",
133
+ "https://special.custom.server/api/v3",
85
134
  False,
86
135
  ),
87
136
  (
@@ -91,25 +140,25 @@ def default_gh_client() -> Generator[Github, None, None]:
91
140
  f"https://{EXAMPLE_HVCS_DOMAIN}",
92
141
  None,
93
142
  f"https://{EXAMPLE_HVCS_DOMAIN}",
94
- f"https://api.{EXAMPLE_HVCS_DOMAIN}",
143
+ f"https://{EXAMPLE_HVCS_DOMAIN}/api/v3",
95
144
  False,
96
145
  ),
97
146
  (
98
147
  # Ignore environment & use provided parameter value (ie from user config)
99
148
  {"GITHUB_API_URL": "https://api.special.custom.server/"},
100
149
  f"https://{EXAMPLE_HVCS_DOMAIN}",
101
- f"https://api.{EXAMPLE_HVCS_DOMAIN}",
150
+ f"https://{EXAMPLE_HVCS_DOMAIN}/api/v3",
102
151
  f"https://{EXAMPLE_HVCS_DOMAIN}",
103
- f"https://api.{EXAMPLE_HVCS_DOMAIN}",
152
+ f"https://{EXAMPLE_HVCS_DOMAIN}/api/v3",
104
153
  False,
105
154
  ),
106
155
  (
107
156
  # Allow insecure http connections explicitly
108
157
  {},
109
158
  f"http://{EXAMPLE_HVCS_DOMAIN}",
110
- f"http://api.{EXAMPLE_HVCS_DOMAIN}",
159
+ f"http://{EXAMPLE_HVCS_DOMAIN}/api/v3",
111
160
  f"http://{EXAMPLE_HVCS_DOMAIN}",
112
- f"http://api.{EXAMPLE_HVCS_DOMAIN}",
161
+ f"http://{EXAMPLE_HVCS_DOMAIN}/api/v3",
113
162
  True,
114
163
  ),
115
164
  (
@@ -118,16 +167,16 @@ def default_gh_client() -> Generator[Github, None, None]:
118
167
  f"http://{EXAMPLE_HVCS_DOMAIN}",
119
168
  None,
120
169
  f"http://{EXAMPLE_HVCS_DOMAIN}",
121
- f"http://api.{EXAMPLE_HVCS_DOMAIN}",
170
+ f"http://{EXAMPLE_HVCS_DOMAIN}/api/v3",
122
171
  True,
123
172
  ),
124
173
  (
125
174
  # Infer insecure connection from user configuration
126
175
  {},
127
176
  EXAMPLE_HVCS_DOMAIN,
128
- f"api.{EXAMPLE_HVCS_DOMAIN}",
177
+ EXAMPLE_HVCS_DOMAIN,
129
178
  f"http://{EXAMPLE_HVCS_DOMAIN}",
130
- f"http://api.{EXAMPLE_HVCS_DOMAIN}",
179
+ f"http://{EXAMPLE_HVCS_DOMAIN}/api/v3",
131
180
  True,
132
181
  ),
133
182
  (
@@ -136,7 +185,7 @@ def default_gh_client() -> Generator[Github, None, None]:
136
185
  EXAMPLE_HVCS_DOMAIN,
137
186
  None,
138
187
  f"http://{EXAMPLE_HVCS_DOMAIN}",
139
- f"http://api.{EXAMPLE_HVCS_DOMAIN}",
188
+ f"http://{EXAMPLE_HVCS_DOMAIN}/api/v3",
140
189
  True,
141
190
  ),
142
191
  ],