mkdocstrings-github 0.4.0__tar.gz → 0.4.2__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 (104) hide show
  1. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/.github/workflows/docs.yaml +4 -8
  2. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/.github/workflows/qualify.yaml +1 -4
  3. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/.github/workflows/release.yaml +2 -46
  4. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/PKG-INFO +2 -1
  5. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/docs/usage/signatures.md +0 -1
  6. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/mkdocs.yml +1 -0
  7. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/pyproject.toml +2 -1
  8. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/src/mkdocstrings_handlers/github/handler.py +60 -22
  9. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/uv.lock +3 -1
  10. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/.github/CODEOWNERS +0 -0
  11. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/.github/CONTRIBUTING.md +0 -0
  12. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/.github/FUNDING.yml +0 -0
  13. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/.github/renovate.json5 +0 -0
  14. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/.github/workflows/example_workflow.yml +0 -0
  15. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/.gitignore +0 -0
  16. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/.gitmodules +0 -0
  17. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/.pre-commit-config.yaml +0 -0
  18. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/LICENSE +0 -0
  19. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/README.md +0 -0
  20. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/action.yaml +0 -0
  21. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/docs/changelog.md +0 -0
  22. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/docs/contributing.md +0 -0
  23. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/docs/credits.md +0 -0
  24. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/docs/favicon.png +0 -0
  25. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/docs/index.md +0 -0
  26. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/docs/license-page.md +0 -0
  27. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/docs/logo.png +0 -0
  28. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/docs/overrides/main.html +0 -0
  29. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/docs/overrides/partials/toc-item.html +0 -0
  30. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/docs/stylesheets/extra.css +0 -0
  31. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/docs/usage/general.md +0 -0
  32. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/docs/usage/headings.md +0 -0
  33. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/docs/usage/index.md +0 -0
  34. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/docs/usage/parameters.md +0 -0
  35. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/logo.png +0 -0
  36. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/src/mkdocstrings_handlers/github/__init__.py +0 -0
  37. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/src/mkdocstrings_handlers/github/config.py +0 -0
  38. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/src/mkdocstrings_handlers/github/objects.py +0 -0
  39. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/src/mkdocstrings_handlers/github/py.typed +0 -0
  40. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/src/mkdocstrings_handlers/github/rendering.py +0 -0
  41. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/src/mkdocstrings_handlers/github/templates/material/action.html.jinja +0 -0
  42. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/src/mkdocstrings_handlers/github/templates/material/heading.html.jinja +0 -0
  43. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/src/mkdocstrings_handlers/github/templates/material/inputs.html.jinja +0 -0
  44. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/src/mkdocstrings_handlers/github/templates/material/outputs.html.jinja +0 -0
  45. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/src/mkdocstrings_handlers/github/templates/material/secrets.html.jinja +0 -0
  46. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/src/mkdocstrings_handlers/github/templates/material/style.css +0 -0
  47. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/src/mkdocstrings_handlers/github/templates/material/workflow.html.jinja +0 -0
  48. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/__init__.py +0 -0
  49. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/conftest.py +0 -0
  50. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/docs/.gitkeep +0 -0
  51. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/helpers.py +0 -0
  52. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/__init__.py +77 -77
  53. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/.gitignore +0 -0
  54. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/0a37a4286738a72a224871dbd1bcd3c662e768f800a8e2b92c410d672c1d19fc.html +0 -0
  55. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/0c67cdd8572de4a97d061f099552f428affde9f418d962c119559531a92f57aa.html +0 -0
  56. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/0ef4f0725dafdff18802cd0dd8839c35562755c90458f0dd3ef7743e87efdd89.html +0 -0
  57. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/1322d6390dbc167e4d2734b6ff7ac30265a52feb242ece864fd08dd36a88214a.html +0 -0
  58. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/1bb484ae2f4d2bfc6473c265761d6ba4f76c5be5dbd3a9059758e67589f4b320.html +0 -0
  59. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/22929d6c2b70b481583d7b07fd7bff72dba985a465d42ad4ee5a7f557429102f.html +0 -0
  60. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/24dfcb59a486346316de8203f742d4f3dd9129f9a57252c37741ad27d0eaddd7.html +0 -0
  61. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/2500c66e16468b20050dd9b8b152a48644d008c0316e444f47afc7bc5117e004.html +0 -0
  62. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/27b0437dc257c9970044eb25da334453829a4ae0450e98cf7a965aff5ad7fcba.html +0 -0
  63. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/28df0ab9fe5662687b72cbb8b2c8e2e18b98beb5a114a505ad845c91b8955a2e.html +0 -0
  64. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/293f8ca976970a4fb9549b1bd3b6f6be8a13bd86d9c34bb98813def62a5777aa.html +0 -0
  65. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/2eb63f18b2d0aaf8000ffcc081c80067937fc7cacea496c2871198aa3bc12a14.html +0 -0
  66. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/36d5597971381260ce0cd98b6ba1c3973134add32288bf34f47290fdbe55b0ec.html +0 -0
  67. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/37c546e4aceaf4af0a681bdaa444b8be901c78713e762fd96d2237b8a78811c5.html +0 -0
  68. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/3cb099624d882a4cde3ef6fdbea56c9aced9331dca1e19c7bc311c2611782e0d.html +0 -0
  69. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/459e6df9404add89f3e159d2b0fdfc81e7f0545da8efaa690de8c06aebd1d2bf.html +0 -0
  70. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/50af1499553795c8cd859a1c9aa5ba162ef1c3dd9fa466668fc2da5bb002a61c.html +0 -0
  71. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/572198cee6d40e3c875970ee6b4c654b3edae54c5a00ee4792df2b0d5a161796.html +0 -0
  72. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/5a2f11e94bc00c7a5122364dcffcdc9bd5c514a773fbf4d1b04fa7e96ba2cfa5.html +0 -0
  73. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/5a75c7bf0d0c9f0d6e193263fe59288ec69ef2d93ec6f8bab8e240b2b58b3dd3.html +0 -0
  74. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/5f0693318b13614e630f852af6ad9165a3793e2e011d4de786b84e178eb411bc.html +0 -0
  75. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/757b79d7975f29e7b7eeda8c910578cb858a867dc4c647c4b5bc9a4c45dbf62e.html +0 -0
  76. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/78f74a133e98bd757a1bd1c4667dc3a5d7cc40cc78daf596187999cb083ec6c4.html +0 -0
  77. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/78feb92e4171bf067dd1615523e5c9cac0de998bb7102ee70da2e145d1262339.html +0 -0
  78. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/84f918940f7b729b21a97d971a27bf994b2deb8ee5d9909481d98f702dfec96a.html +0 -0
  79. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/856a4ff20ee15b09367d852d57cdb6a3376b799760365dbf7677c216156a7b4d.html +0 -0
  80. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/8df27f9a94e16efe5686ebeded8a93bd5b071f4d39fe47224ce218a6b1e58b90.html +0 -0
  81. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/93bf082d40ca4b6730a503aa4d265901a8cfed7ed1a6e9bb6e584c2c3ebd18af.html +0 -0
  82. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/98e4b6474a6f67576ae40a75e152e6bd8c3e743259ad7f1d08890def2ff858d1.html +0 -0
  83. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/98ed5c777c164326632ca657e3cb87ae3f9b75bf9793ab2db4ab90ee7874621c.html +0 -0
  84. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/ac47b3b933709154de762d06903d78925cea9f1ec93865386d669680cf17e4a8.html +0 -0
  85. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/b972a05ffc5672d471d5b1e84b01470a3363a25f9d9adbc8d82f4b9fd21a94a1.html +0 -0
  86. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/bbea0ecf08aec9444ed75cbffd5424aa19e285ac64a53d1bb50f6130230b3c97.html +0 -0
  87. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/c2181f9e06dd6b7437f14e815c4fd32ec304e4474c93e86c02b43f41367a79ff.html +0 -0
  88. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/c3d75cc820623b26630624895fbc53ff7ea764ede141a2751387fca0bddb0c42.html +0 -0
  89. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/c50b7f91aafff5caf0fe0ff96a922b499617966705cde0d3622191f51f523b38.html +0 -0
  90. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/c8c895c400f0532aa3afe641f79ed14bc399b504169242c0a9f77572c185def2.html +0 -0
  91. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/cdad9a8909ec6448ff4392f523d4c7d41dcba61fc635e7e744026f901df04913.html +0 -0
  92. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/cdf58c1c57a805ff06487f8361728c09ddf37f7ef3235ad26effab9f1f07f5a4.html +0 -0
  93. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/d0d656ae32436d7b190665f98f3fe2d7a6250ee7ff4e1fb1bcd9a1364d3da2cb.html +0 -0
  94. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/d2e25cb02f371db9bd247a36766f7887ef1d2adad97ba1102ab1d98cf3128dc3.html +0 -0
  95. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/dbb6b804e35c3cf48b6ea556486a82cf6f34af4d7cc455bfc02995969f45d09f.html +0 -0
  96. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/de1ce14a6155d8b1e4185e0eed7490872ef3af13b459ce5430ee5fc070f549d5.html +0 -0
  97. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/df4a79ccbc4e4aa4c1a3135f1b42ce67cbebdf65acec195630d961605206c078.html +0 -0
  98. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/f0d6c0adbfcc02896663bc47e38910252279cabfe89c8c196c23f02b7d65d77d.html +0 -0
  99. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/f575eacc0b72560cfc4e759f838f4ba8fc6ad1ee88d56fa707a1a840baf3e679.html +0 -0
  100. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/f64c666c9ace98f632d96aea732c4da55112d9c496baef00eb997c68c2c09264.html +0 -0
  101. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/snapshots/external/f90542b4e3cbaf7e9820cdad6bbe707e3210983c911f11584cfae580e5cf6a04.html +0 -0
  102. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/test_handler.py +0 -0
  103. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/test_render_action.py +0 -0
  104. {mkdocstrings_github-0.4.0 → mkdocstrings_github-0.4.2}/test/test_render_workflow.py +0 -0
@@ -59,24 +59,20 @@ jobs:
59
59
 
60
60
  - name: Build documentation with mike
61
61
  shell: bash
62
- env:
63
- PUSH_DEPLOY: ${{ fromJson(inputs.push) && '--push' || '' }}
64
- VERSION: ${{ inputs.version }}
65
62
  run: |
66
63
  if [[ $VERSION =~ ^v([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then
67
64
  VERSION="v${BASH_REMATCH[1]}.${BASH_REMATCH[2]}.*"
68
65
  echo "Patching version "${{ inputs.version}}" to $VERSION"
69
66
  fi
70
- uv run mike deploy ${PUSH_DEPLOY} \
67
+ uv run mike deploy ${{ fromJson(inputs.push) && '--push' || '' }} \
71
68
  --update-aliases \
72
69
  --branch gh-pages \
73
70
  --alias-type symlink \
74
- "$VERSION" "${{ inputs.alias }}"
71
+ "${{ inputs.version }}" "${{ inputs.alias }}"
75
72
 
76
73
  - name: Set default alias for mike
77
74
  if: ${{ fromJson(inputs.set-default) }}
78
75
  run: >
79
- uv run mike set-default
80
- --branch gh-pages
81
- --push
76
+ uv run mike set-default ${{ fromJson(inputs.push) && '--push' || '' }}
77
+ --branch gh-pages
82
78
  ${{ inputs.alias }}
@@ -23,9 +23,6 @@ jobs:
23
23
  docs:
24
24
  name: Test deploy documentation
25
25
  uses: ./.github/workflows/docs.yaml
26
- concurrency:
27
- group: gh-pages
28
- cancel-in-progress: false
29
26
  permissions:
30
27
  contents: write
31
28
  secrets: inherit
@@ -33,7 +30,7 @@ jobs:
33
30
  version: ${{ format('pr-{0}', github.head_ref) || 'test' }}
34
31
  alias: "test"
35
32
  set-default: false
36
- push: ${{ contains(github.event.pull_request.labels.*.name, 'documentation') }}
33
+ push: false
37
34
 
38
35
  setup:
39
36
  runs-on: ubuntu-latest
@@ -19,6 +19,7 @@ jobs:
19
19
  outputs:
20
20
  released: ${{ steps.get-version.outputs.released == 'true' }}
21
21
  next-tag: ${{ steps.get-version.outputs.next-tag }}
22
+ last-tag: ${{ steps.get-version.outputs.last-tag }}
22
23
 
23
24
  steps:
24
25
  - uses: actions/create-github-app-token@v2
@@ -146,61 +147,16 @@ jobs:
146
147
  dist/*.whl
147
148
  dist/*.tar.gz
148
149
 
149
- delete-test-document:
150
- name: Delete test documentation
151
- runs-on: ubuntu-latest
152
- if: contains(github.event.pull_request.labels.*.name, 'documentation') && (github.event.action == 'closed')
153
- concurrency:
154
- group: gh-pages
155
- cancel-in-progress: false
156
- permissions:
157
- contents: write
158
- steps:
159
- - name: checkout repository
160
- uses: actions/checkout@v5
161
- with:
162
- fetch-depth: 0 # Required to push to the documentation branch
163
-
164
- - name: Install the latest version of uv
165
- uses: astral-sh/setup-uv@v7
166
- with:
167
- version: "latest"
168
-
169
- - name: Sync dependencies
170
- run: |
171
- uv sync --no-dev --group docs
172
-
173
- - name: Configure Git Credentials
174
- run: |
175
- git config --global user.name github-actions[bot]
176
- git config --global user.email 41898282+github-actions[bot]@users.noreply.github.com
177
- git fetch origin gh-pages:gh-pages
178
-
179
- - name: delete testing documentation
180
- continue-on-error: true
181
- env:
182
- VERSION: ${{ format('pr-{0}', github.head_ref) || 'test' }}
183
- GH_TOKEN: ${{ github.token }}
184
- run: >
185
- uv run mike delete
186
- --push --ignore-remote-status
187
- --config-file mkdocs.yml
188
- --branch gh-pages
189
- $VERSION
190
-
191
150
  document:
192
151
  name: Deploy documentation
193
152
  needs: [release]
194
153
  if: github.event.pull_request.merged
195
154
  uses: ./.github/workflows/docs.yaml
196
- concurrency:
197
- group: gh-pages
198
- cancel-in-progress: false
199
155
  permissions:
200
156
  contents: write
201
157
  secrets: inherit
202
158
  with:
203
- version: ${{ needs.release.outputs.next-tag }}
159
+ version: ${{ needs.release.outputs.next-tag || needs.release.outputs.last-tag }}
204
160
  alias: latest
205
161
  set-default: true
206
162
  ref: ${{ needs.release.outputs.next-tag }}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mkdocstrings-github
3
- Version: 0.4.0
3
+ Version: 0.4.2
4
4
  Summary: A GitHub Action handler for mkdocstrings
5
5
  Author-email: Mark Hu <watermarkhu@gmail.com>
6
6
  License: MIT
@@ -23,6 +23,7 @@ Classifier: Typing :: Typed
23
23
  Requires-Python: <3.15,>=3.10
24
24
  Requires-Dist: gitpython~=3.1.45
25
25
  Requires-Dist: mkdocstrings~=0.29
26
+ Requires-Dist: packaging~=25.0
26
27
  Requires-Dist: typing-extensions>=4.0; python_version < '3.11'
27
28
  Description-Content-Type: text/markdown
28
29
 
@@ -84,7 +84,6 @@
84
84
  - name: build step
85
85
  run: mkdocs build
86
86
  ```
87
- -
88
87
 
89
88
  ??? preview
90
89
 
@@ -120,6 +120,7 @@ plugins:
120
120
  default_handler: github
121
121
  handlers:
122
122
  github:
123
+ repo: owner/repository
123
124
  options:
124
125
  show_toc_entry: false
125
126
  heading_level: 3
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "mkdocstrings-github"
3
- version = "0.4.0"
3
+ version = "0.4.2"
4
4
  description = "A GitHub Action handler for mkdocstrings"
5
5
  authors = [
6
6
  { name = "Mark Hu", email = "watermarkhu@gmail.com" }
@@ -29,6 +29,7 @@ classifiers = [
29
29
  dependencies = [
30
30
  "gitpython~=3.1.45",
31
31
  "mkdocstrings~=0.29",
32
+ "packaging~=25.0",
32
33
  "typing-extensions>=4.0; python_version < '3.11'",
33
34
  ]
34
35
 
@@ -16,6 +16,7 @@ from mkdocstrings import (
16
16
  HandlerOptions,
17
17
  get_logger,
18
18
  )
19
+ from packaging.version import InvalidVersion, Version
19
20
 
20
21
  from mkdocstrings_handlers.github import rendering
21
22
  from mkdocstrings_handlers.github.config import GitHubConfig, GitHubOptions
@@ -72,6 +73,29 @@ class GitHubHandler(BaseHandler):
72
73
  self.major: str = ""
73
74
  self.semver: str = ""
74
75
 
76
+ # Determine owner and repo name
77
+ if not self.config.repo:
78
+ # Try each remote to find a valid GitHub owner/repo
79
+ owner = None
80
+ repo_name = None
81
+ for remote in self.repo.remotes:
82
+ for url in remote.urls:
83
+ match = re.search(
84
+ r"(?P<host>[\w\.-]+)[/:](?P<owner>[^/]+)/(?P<repo>[^/.]+?)(?:\.git)?$",
85
+ url,
86
+ )
87
+ if match:
88
+ owner = match.group("owner")
89
+ repo_name = match.group("repo")
90
+ break
91
+ if owner and repo_name:
92
+ break
93
+ if not (owner and repo_name):
94
+ raise PluginError(
95
+ f"Could not determine GitHub repository owner/name from config.repo='{self.config.repo}' or any git remote URL."
96
+ )
97
+ self.config.repo = f"{owner}/{repo_name}"
98
+
75
99
  # Only run GitHub releases code if required and not in testing
76
100
  not_testing = "pytest" not in sys.modules
77
101
  no_custom_tags = (
@@ -113,29 +137,43 @@ class GitHubHandler(BaseHandler):
113
137
  _logger.warning(f"Could not get git tags from repository: {e}")
114
138
  return
115
139
 
116
- # Find matching tags
140
+ # Separate semver, major, and other tags
141
+ semver_tags = []
142
+ major_tags = []
143
+ other_tags = []
117
144
  for tag in tags:
118
- if not self.semver and SEMVER_PATTERN.match(tag):
119
- _logger.info(f"Using git tag '{tag}' for semver.")
120
- self.semver = tag
121
- if not self.major and MAJOR_PATTERN.match(tag):
122
- _logger.info(f"Using git tag '{tag}' for major.")
123
- self.major = tag
124
- if self.semver and self.major:
125
- break
126
-
127
- if not self.semver or not self.major:
128
- if not self.semver and not self.major:
129
- messages = ("'vX.X.X' and 'vX'", "'semver and major'")
130
- elif not self.semver:
131
- messages = ("'vX.X.X'", "'semver'")
132
- else: # not self.major
133
- messages = ("'vX'", "'major'")
134
- _logger.warning(
135
- f"Could not find suitable git tags in repository. "
136
- f"Make sure there are tags matching {messages[0]}, "
137
- f"if you wish to use option signature_version {messages[1]}.",
138
- )
145
+ if SEMVER_PATTERN.match(tag):
146
+ semver_tags.append(tag)
147
+ elif MAJOR_PATTERN.match(tag):
148
+ major_tags.append(tag)
149
+ else:
150
+ other_tags.append(tag)
151
+
152
+ # Sort tags using packaging.version.Version
153
+ def version_key(tag):
154
+ try:
155
+ return Version(tag.lstrip("v"))
156
+ except InvalidVersion:
157
+ return Version("0.0.0")
158
+
159
+ semver_tags_sorted = sorted(semver_tags, key=version_key, reverse=True)
160
+ major_tags_sorted = sorted(major_tags, key=version_key, reverse=True)
161
+ other_tags_sorted = sorted(other_tags, reverse=True)
162
+
163
+ if semver_tags_sorted:
164
+ self.semver = semver_tags_sorted[0]
165
+ _logger.info(f"Using git tag '{self.semver}' for semver.")
166
+ else:
167
+ _logger.warning("No semver tags found in repository.")
168
+
169
+ if major_tags_sorted:
170
+ self.major = major_tags_sorted[0]
171
+ _logger.info(f"Using git tag '{self.major}' for major.")
172
+ else:
173
+ _logger.warning("No major tags found in repository.")
174
+
175
+ if other_tags_sorted:
176
+ _logger.debug(f"Other git tags found: {', '.join(other_tags_sorted)}")
139
177
 
140
178
  def get_options(self, local_options: Mapping[str, Any]) -> HandlerOptions:
141
179
  """Get combined default, global and local options.
@@ -716,11 +716,12 @@ wheels = [
716
716
 
717
717
  [[package]]
718
718
  name = "mkdocstrings-github"
719
- version = "0.4.0"
719
+ version = "0.4.2"
720
720
  source = { editable = "." }
721
721
  dependencies = [
722
722
  { name = "gitpython" },
723
723
  { name = "mkdocstrings" },
724
+ { name = "packaging" },
724
725
  { name = "typing-extensions", marker = "python_full_version < '3.11'" },
725
726
  ]
726
727
 
@@ -750,6 +751,7 @@ docs = [
750
751
  requires-dist = [
751
752
  { name = "gitpython", specifier = "~=3.1.45" },
752
753
  { name = "mkdocstrings", specifier = "~=0.29" },
754
+ { name = "packaging", specifier = "~=25.0" },
753
755
  { name = "typing-extensions", marker = "python_full_version < '3.11'", specifier = ">=4.0" },
754
756
  ]
755
757
 
@@ -4,6 +4,13 @@ register_format_alias(".html", ".txt")
4
4
 
5
5
  workflow_show = snapshot(
6
6
  {
7
+ (
8
+ ("show_signature", True),
9
+ ("signature_version", "major"),
10
+ ("signature_version_string", ""),
11
+ ("signature_show_secrets", True),
12
+ ("signature_show_permissions", True),
13
+ ): external("hash:d2e25cb02f37*.html"),
7
14
  (("show_description", True), ("description", ""), ("show_source", True)): external(
8
15
  "hash:78f74a133e98*.html"
9
16
  ),
@@ -36,13 +43,6 @@ workflow_show = snapshot(
36
43
  ("show_toc_entry", True),
37
44
  ("toc_label", ""),
38
45
  ): external("hash:1322d6390dbc*.html"),
39
- (
40
- ("show_signature", True),
41
- ("signature_version", "major"),
42
- ("signature_version_string", ""),
43
- ("signature_show_secrets", True),
44
- ("signature_show_permissions", True),
45
- ): external("hash:d2e25cb02f37*.html"),
46
46
  (
47
47
  ("show_signature", True),
48
48
  ("signature_version", "semver"),
@@ -176,6 +176,76 @@ action_show = snapshot(
176
176
  (("show_description", False), ("description", ""), ("show_source", False)): external(
177
177
  "hash:5a2f11e94bc0*.html"
178
178
  ),
179
+ (
180
+ ("show_heading", True),
181
+ ("heading", ""),
182
+ ("heading_level", 1),
183
+ ("show_branding", False),
184
+ ("branding_icon", ""),
185
+ ("branding_icon_color", ""),
186
+ ("show_toc_entry", False),
187
+ ("toc_label", ""),
188
+ ): external("hash:2eb63f18b2d0*.html"),
189
+ (
190
+ ("show_heading", True),
191
+ ("heading", "Custom heading"),
192
+ ("heading_level", 2),
193
+ ("show_branding", False),
194
+ ("branding_icon", ""),
195
+ ("branding_icon_color", ""),
196
+ ("show_toc_entry", False),
197
+ ("toc_label", "Custom toc label"),
198
+ ): external("hash:856a4ff20ee1*.html"),
199
+ (
200
+ ("show_heading", True),
201
+ ("heading", ""),
202
+ ("heading_level", 1),
203
+ ("show_branding", True),
204
+ ("branding_icon", ""),
205
+ ("branding_icon_color", ""),
206
+ ("show_toc_entry", False),
207
+ ("toc_label", ""),
208
+ ): external("hash:0a37a4286738*.html"),
209
+ (
210
+ ("show_heading", True),
211
+ ("heading", ""),
212
+ ("heading_level", 2),
213
+ ("show_branding", True),
214
+ ("branding_icon", "green"),
215
+ ("branding_icon_color", ""),
216
+ ("show_toc_entry", False),
217
+ ("toc_label", ""),
218
+ ): external("hash:3cb099624d88*.html"),
219
+ (
220
+ ("show_heading", True),
221
+ ("heading", ""),
222
+ ("heading_level", 3),
223
+ ("show_branding", True),
224
+ ("branding_icon", ""),
225
+ ("branding_icon_color", "github"),
226
+ ("show_toc_entry", False),
227
+ ("toc_label", ""),
228
+ ): external("hash:c50b7f91aaff*.html"),
229
+ (
230
+ ("show_heading", False),
231
+ ("heading", ""),
232
+ ("heading_level", 1),
233
+ ("show_branding", False),
234
+ ("branding_icon", ""),
235
+ ("branding_icon_color", ""),
236
+ ("show_toc_entry", True),
237
+ ("toc_label", ""),
238
+ ): external("hash:c8c895c400f0*.html"),
239
+ (
240
+ ("show_heading", False),
241
+ ("heading", ""),
242
+ ("heading_level", 1),
243
+ ("show_branding", False),
244
+ ("branding_icon", ""),
245
+ ("branding_icon_color", ""),
246
+ ("show_toc_entry", False),
247
+ ("toc_label", ""),
248
+ ): external("hash:36d559797138*.html"),
179
249
  (
180
250
  ("show_signature", True),
181
251
  ("signature_version", "major"),
@@ -280,75 +350,5 @@ action_show = snapshot(
280
350
  ("parameters_order", "source"),
281
351
  ("parameters_section_style", "list"),
282
352
  ): external("hash:cdad9a8909ec*.html"),
283
- (
284
- ("show_heading", True),
285
- ("heading", ""),
286
- ("heading_level", 1),
287
- ("show_branding", False),
288
- ("branding_icon", ""),
289
- ("branding_icon_color", ""),
290
- ("show_toc_entry", False),
291
- ("toc_label", ""),
292
- ): external("hash:2eb63f18b2d0*.html"),
293
- (
294
- ("show_heading", True),
295
- ("heading", "Custom heading"),
296
- ("heading_level", 2),
297
- ("show_branding", False),
298
- ("branding_icon", ""),
299
- ("branding_icon_color", ""),
300
- ("show_toc_entry", False),
301
- ("toc_label", "Custom toc label"),
302
- ): external("hash:856a4ff20ee1*.html"),
303
- (
304
- ("show_heading", True),
305
- ("heading", ""),
306
- ("heading_level", 1),
307
- ("show_branding", True),
308
- ("branding_icon", ""),
309
- ("branding_icon_color", ""),
310
- ("show_toc_entry", False),
311
- ("toc_label", ""),
312
- ): external("hash:0a37a4286738*.html"),
313
- (
314
- ("show_heading", True),
315
- ("heading", ""),
316
- ("heading_level", 2),
317
- ("show_branding", True),
318
- ("branding_icon", "green"),
319
- ("branding_icon_color", ""),
320
- ("show_toc_entry", False),
321
- ("toc_label", ""),
322
- ): external("hash:3cb099624d88*.html"),
323
- (
324
- ("show_heading", True),
325
- ("heading", ""),
326
- ("heading_level", 3),
327
- ("show_branding", True),
328
- ("branding_icon", ""),
329
- ("branding_icon_color", "github"),
330
- ("show_toc_entry", False),
331
- ("toc_label", ""),
332
- ): external("hash:c50b7f91aaff*.html"),
333
- (
334
- ("show_heading", False),
335
- ("heading", ""),
336
- ("heading_level", 1),
337
- ("show_branding", False),
338
- ("branding_icon", ""),
339
- ("branding_icon_color", ""),
340
- ("show_toc_entry", True),
341
- ("toc_label", ""),
342
- ): external("hash:c8c895c400f0*.html"),
343
- (
344
- ("show_heading", False),
345
- ("heading", ""),
346
- ("heading_level", 1),
347
- ("show_branding", False),
348
- ("branding_icon", ""),
349
- ("branding_icon_color", ""),
350
- ("show_toc_entry", False),
351
- ("toc_label", ""),
352
- ): external("hash:36d559797138*.html"),
353
353
  }
354
354
  )