mkdocstrings-github 0.2.3__tar.gz → 0.2.4__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 (106) hide show
  1. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/.github/workflows/qualify.yaml +2 -3
  2. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/.github/workflows/release.yaml +1 -0
  3. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/PKG-INFO +1 -1
  4. mkdocstrings_github-0.2.4/docs/changelog.md +1 -0
  5. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/docs/usage/index.md +3 -2
  6. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/docs/usage/signatures.md +2 -3
  7. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/pyproject.toml +4 -1
  8. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/src/mkdocstrings_handlers/github/config.py +5 -0
  9. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/src/mkdocstrings_handlers/github/handler.py +34 -7
  10. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/uv.lock +1 -1
  11. mkdocstrings_github-0.2.3/CHANGELOG.md +0 -1
  12. mkdocstrings_github-0.2.3/docs/changelog.md +0 -1
  13. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/.github/CODEOWNERS +0 -0
  14. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/.github/CONTRIBUTING.md +0 -0
  15. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/.github/FUNDING.yml +0 -0
  16. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/.github/renovate.json5 +0 -0
  17. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/.github/workflows/docs.yaml +0 -0
  18. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/.github/workflows/example_workflow.yml +0 -0
  19. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/.gitignore +0 -0
  20. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/.gitmodules +0 -0
  21. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/.pre-commit-config.yaml +0 -0
  22. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/LICENSE +0 -0
  23. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/README.md +0 -0
  24. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/action.yaml +0 -0
  25. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/docs/contributing.md +0 -0
  26. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/docs/credits.md +0 -0
  27. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/docs/favicon.png +0 -0
  28. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/docs/index.md +0 -0
  29. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/docs/license-page.md +0 -0
  30. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/docs/logo.png +0 -0
  31. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/docs/overrides/main.html +0 -0
  32. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/docs/overrides/partials/toc-item.html +0 -0
  33. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/docs/stylesheets/extra.css +0 -0
  34. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/docs/usage/general.md +0 -0
  35. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/docs/usage/headings.md +0 -0
  36. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/docs/usage/parameters.md +0 -0
  37. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/logo.png +0 -0
  38. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/mkdocs.yml +0 -0
  39. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/src/mkdocstrings_handlers/github/__init__.py +0 -0
  40. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/src/mkdocstrings_handlers/github/objects.py +0 -0
  41. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/src/mkdocstrings_handlers/github/py.typed +0 -0
  42. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/src/mkdocstrings_handlers/github/rendering.py +0 -0
  43. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/src/mkdocstrings_handlers/github/templates/material/action.html.jinja +0 -0
  44. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/src/mkdocstrings_handlers/github/templates/material/heading.html.jinja +0 -0
  45. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/src/mkdocstrings_handlers/github/templates/material/inputs.html.jinja +0 -0
  46. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/src/mkdocstrings_handlers/github/templates/material/outputs.html.jinja +0 -0
  47. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/src/mkdocstrings_handlers/github/templates/material/secrets.html.jinja +0 -0
  48. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/src/mkdocstrings_handlers/github/templates/material/style.css +0 -0
  49. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/src/mkdocstrings_handlers/github/templates/material/workflow.html.jinja +0 -0
  50. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/__init__.py +0 -0
  51. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/conftest.py +0 -0
  52. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/docs/.gitkeep +0 -0
  53. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/helpers.py +0 -0
  54. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/__init__.py +0 -0
  55. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/.gitignore +0 -0
  56. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/0a37a4286738a72a224871dbd1bcd3c662e768f800a8e2b92c410d672c1d19fc.html +0 -0
  57. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/0c67cdd8572de4a97d061f099552f428affde9f418d962c119559531a92f57aa.html +0 -0
  58. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/0ef4f0725dafdff18802cd0dd8839c35562755c90458f0dd3ef7743e87efdd89.html +0 -0
  59. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/1322d6390dbc167e4d2734b6ff7ac30265a52feb242ece864fd08dd36a88214a.html +0 -0
  60. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/1bb484ae2f4d2bfc6473c265761d6ba4f76c5be5dbd3a9059758e67589f4b320.html +0 -0
  61. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/22929d6c2b70b481583d7b07fd7bff72dba985a465d42ad4ee5a7f557429102f.html +0 -0
  62. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/24dfcb59a486346316de8203f742d4f3dd9129f9a57252c37741ad27d0eaddd7.html +0 -0
  63. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/2500c66e16468b20050dd9b8b152a48644d008c0316e444f47afc7bc5117e004.html +0 -0
  64. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/27b0437dc257c9970044eb25da334453829a4ae0450e98cf7a965aff5ad7fcba.html +0 -0
  65. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/28df0ab9fe5662687b72cbb8b2c8e2e18b98beb5a114a505ad845c91b8955a2e.html +0 -0
  66. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/293f8ca976970a4fb9549b1bd3b6f6be8a13bd86d9c34bb98813def62a5777aa.html +0 -0
  67. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/2eb63f18b2d0aaf8000ffcc081c80067937fc7cacea496c2871198aa3bc12a14.html +0 -0
  68. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/36d5597971381260ce0cd98b6ba1c3973134add32288bf34f47290fdbe55b0ec.html +0 -0
  69. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/37c546e4aceaf4af0a681bdaa444b8be901c78713e762fd96d2237b8a78811c5.html +0 -0
  70. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/3cb099624d882a4cde3ef6fdbea56c9aced9331dca1e19c7bc311c2611782e0d.html +0 -0
  71. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/50af1499553795c8cd859a1c9aa5ba162ef1c3dd9fa466668fc2da5bb002a61c.html +0 -0
  72. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/572198cee6d40e3c875970ee6b4c654b3edae54c5a00ee4792df2b0d5a161796.html +0 -0
  73. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/5a2f11e94bc00c7a5122364dcffcdc9bd5c514a773fbf4d1b04fa7e96ba2cfa5.html +0 -0
  74. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/5f0693318b13614e630f852af6ad9165a3793e2e011d4de786b84e178eb411bc.html +0 -0
  75. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/62440ee595f9a66c9c38e2dd31dd0333a03332893c982993b48c6e8e9074b5be.html +0 -0
  76. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/757b79d7975f29e7b7eeda8c910578cb858a867dc4c647c4b5bc9a4c45dbf62e.html +0 -0
  77. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/78f74a133e98bd757a1bd1c4667dc3a5d7cc40cc78daf596187999cb083ec6c4.html +0 -0
  78. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/78feb92e4171bf067dd1615523e5c9cac0de998bb7102ee70da2e145d1262339.html +0 -0
  79. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/84f918940f7b729b21a97d971a27bf994b2deb8ee5d9909481d98f702dfec96a.html +0 -0
  80. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/856a4ff20ee15b09367d852d57cdb6a3376b799760365dbf7677c216156a7b4d.html +0 -0
  81. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/8df27f9a94e16efe5686ebeded8a93bd5b071f4d39fe47224ce218a6b1e58b90.html +0 -0
  82. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/93bf082d40ca4b6730a503aa4d265901a8cfed7ed1a6e9bb6e584c2c3ebd18af.html +0 -0
  83. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/98e4b6474a6f67576ae40a75e152e6bd8c3e743259ad7f1d08890def2ff858d1.html +0 -0
  84. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/98ed5c777c164326632ca657e3cb87ae3f9b75bf9793ab2db4ab90ee7874621c.html +0 -0
  85. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/a5c25b6859cc07004c872762d51e1c17d597a5d9cf4f325f0d876cafc3096d16.html +0 -0
  86. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/ac47b3b933709154de762d06903d78925cea9f1ec93865386d669680cf17e4a8.html +0 -0
  87. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/b3235de10ed47f4d1a0d1d5fec8deb8323199b703201cc3a525950411079672b.html +0 -0
  88. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/b972a05ffc5672d471d5b1e84b01470a3363a25f9d9adbc8d82f4b9fd21a94a1.html +0 -0
  89. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/bbea0ecf08aec9444ed75cbffd5424aa19e285ac64a53d1bb50f6130230b3c97.html +0 -0
  90. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/c2181f9e06dd6b7437f14e815c4fd32ec304e4474c93e86c02b43f41367a79ff.html +0 -0
  91. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/c50b7f91aafff5caf0fe0ff96a922b499617966705cde0d3622191f51f523b38.html +0 -0
  92. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/c8601796046ec0837b1cc98f777d45532e7c2c36606b8682536e0aac3f678554.html +0 -0
  93. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/c8c895c400f0532aa3afe641f79ed14bc399b504169242c0a9f77572c185def2.html +0 -0
  94. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/cdad9a8909ec6448ff4392f523d4c7d41dcba61fc635e7e744026f901df04913.html +0 -0
  95. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/cdf58c1c57a805ff06487f8361728c09ddf37f7ef3235ad26effab9f1f07f5a4.html +0 -0
  96. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/d0d656ae32436d7b190665f98f3fe2d7a6250ee7ff4e1fb1bcd9a1364d3da2cb.html +0 -0
  97. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/d2e25cb02f371db9bd247a36766f7887ef1d2adad97ba1102ab1d98cf3128dc3.html +0 -0
  98. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/dbb6b804e35c3cf48b6ea556486a82cf6f34af4d7cc455bfc02995969f45d09f.html +0 -0
  99. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/e5a8b4ccf8097faf7e34c1a90377932fad0277a6b89675ef7b9e05fa37fae38c.html +0 -0
  100. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/f0d6c0adbfcc02896663bc47e38910252279cabfe89c8c196c23f02b7d65d77d.html +0 -0
  101. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/f575eacc0b72560cfc4e759f838f4ba8fc6ad1ee88d56fa707a1a840baf3e679.html +0 -0
  102. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/f90542b4e3cbaf7e9820cdad6bbe707e3210983c911f11584cfae580e5cf6a04.html +0 -0
  103. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/snapshots/external/fab6f055074f9b57075eb9f63d7a2f6ce6eb7ae6c5289a675cb24e507f3f5fb5.html +0 -0
  104. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/test_handler.py +0 -0
  105. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/test_render_action.py +0 -0
  106. {mkdocstrings_github-0.2.3 → mkdocstrings_github-0.2.4}/test/test_render_workflow.py +0 -0
@@ -21,7 +21,6 @@ concurrency:
21
21
 
22
22
  jobs:
23
23
  docs:
24
- if: contains(github.event.pull_request.labels.*.name, 'documentation')
25
24
  name: Test deploy documentation
26
25
  uses: ./.github/workflows/docs.yaml
27
26
  concurrency:
@@ -32,9 +31,9 @@ jobs:
32
31
  secrets: inherit
33
32
  with:
34
33
  version: ${{ format('pr-{0}', github.head_ref) || 'test' }}
35
- alias: ""
34
+ alias: "test"
36
35
  set-default: false
37
- push: true
36
+ push: ${{ contains(github.event.pull_request.labels.*.name, 'documentation') }}
38
37
 
39
38
  setup:
40
39
  runs-on: ubuntu-latest
@@ -180,6 +180,7 @@ jobs:
180
180
  continue-on-error: true
181
181
  env:
182
182
  VERSION: ${{ format('pr-{0}', github.head_ref) || 'test' }}
183
+ GH_TOKEN: ${{ github.token }}
183
184
  run: >
184
185
  uv run mike delete
185
186
  --push --ignore-remote-status
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mkdocstrings-github
3
- Version: 0.2.3
3
+ Version: 0.2.4
4
4
  Summary: A GitHub Action handler for mkdocstrings
5
5
  Author-email: Mark Hu <watermarkhu@gmail.com>
6
6
  License: MIT
@@ -0,0 +1 @@
1
+ # changelog
@@ -100,6 +100,9 @@ plugins:
100
100
 
101
101
  Some options are **global only, and go directly under the handler's name.
102
102
 
103
+ ::: mkdocstrings_handlers.github.config.GitHubConfig.hostname
104
+ handler: python
105
+
103
106
  ::: mkdocstrings_handlers.github.config.GitHubConfig.repo
104
107
  handler: python
105
108
 
@@ -121,7 +124,6 @@ plugins:
121
124
 
122
125
  ...and locally, overriding the global configuration:
123
126
 
124
-
125
127
  ```markdown title="docs/some_page.md"
126
128
  ::: .github/workflows/reusable-workflow.yml
127
129
  handler: github
@@ -136,7 +138,6 @@ These options affect how the documentation is collected from sources and rendere
136
138
  - [Signature options](./signatures.md): options related to the shown call signature.
137
139
  - [Parameters options](./parameters.md): options related to the input (and output) parameters of the action or workflow.
138
140
 
139
-
140
141
  ::: mkdocstrings_handlers.github.config.GitHubOptions
141
142
  handler: python
142
143
  options:
@@ -14,7 +14,6 @@
14
14
  --8<-- ".github/workflows/example_workflow.yml"
15
15
  ```
16
16
 
17
-
18
17
  ::: mkdocstrings_handlers.github.config.GitHubOptions.show_signature
19
18
  handler: python
20
19
 
@@ -84,9 +83,9 @@
84
83
  mkdocs build
85
84
  ```
86
85
 
87
- !!! info
86
+ !!! info
88
87
 
89
- For GitHub Enterprise instances, you need to additionally set the `GH_HOST` environment variable to your GitHub hostname.
88
+ For GitHub Enterprise instances, you can set either the [`hostname`][mkdocstrings_handlers.github.config.GitHubConfig.hostname] configuration option or the `GH_HOST` environment variable to your GitHub hostname.
90
89
 
91
90
  ??? preview
92
91
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "mkdocstrings-github"
3
- version = "0.2.3"
3
+ version = "0.2.4"
4
4
  description = "A GitHub Action handler for mkdocstrings"
5
5
  authors = [
6
6
  { name = "Mark Hu", email = "watermarkhu@gmail.com" }
@@ -120,6 +120,9 @@ prerelease = false
120
120
  [tool.semantic_release.commit_parser_options]
121
121
  patch_tags = ["fix", "perf", "chore"]
122
122
 
123
+ [tool.semantic_release.changelog]
124
+ changelog_file = "docs/changelog.md"
125
+
123
126
  [tool.pytest.ini_options]
124
127
  pythonpath = [
125
128
  "test"
@@ -171,6 +171,11 @@ class GitHubOptions(BaseModel):
171
171
  class GitHubConfig(BaseModel):
172
172
  """Configuration options for the GitHub handler."""
173
173
 
174
+ hostname: str = Field(
175
+ default="github.com",
176
+ description="The hostname of the GitHub instance to use.",
177
+ )
178
+
174
179
  repo: str = Field(
175
180
  default="",
176
181
  description="""The GitHub repository in the format *owner/repo*.
@@ -80,20 +80,47 @@ class GitHubHandler(BaseHandler):
80
80
  ) and "pytest" not in sys.modules:
81
81
  # Use PyGitHub to find last GitHub releases with tags matching vX.X.X and vX
82
82
 
83
- GH_HOST = os.environ.get("GH_HOST", "https://api.github.com")
83
+ gh_host = os.environ.get("GH_HOST", config.hostname)
84
+ # Construct base_url for GitHub API.
85
+ #
86
+ # Expected formats for GH_HOST/config.hostname:
87
+ # - Full API URL (e.g., 'https://github.company.com/api/v3') [RECOMMENDED for GitHub Enterprise]
88
+ # - Hostname (e.g., 'github.com' or 'github.company.com')
89
+ # - API subdomain (e.g., 'api.github.com')
90
+ #
91
+ # If a full URL is provided, it is used as-is.
92
+ # If the value contains '/api/', it is assumed to be a full API endpoint and used as-is (with protocol if missing).
93
+ # Otherwise, the code falls back to public GitHub conventions.
94
+ if gh_host.startswith(("http://", "https://")):
95
+ base_url = gh_host
96
+ elif "/api/" in gh_host:
97
+ # If protocol is missing, default to https
98
+ base_url = f"https://{gh_host}"
99
+ elif gh_host.startswith("api."):
100
+ base_url = f"https://{gh_host}"
101
+ else:
102
+ # Warn user about possible misconfiguration for GitHub Enterprise
103
+ _logger.warning(
104
+ "The GH_HOST/config.hostname value '%s' does not appear to be a full API endpoint. "
105
+ "For GitHub Enterprise, you may need to specify the full API URL (e.g., 'https://github.company.com/api/v3').",
106
+ gh_host,
107
+ )
108
+ base_url = f"https://api.{gh_host}"
84
109
 
85
110
  if (token_key := "GH_TOKEN") in os.environ:
86
- gh = Github(base_url=GH_HOST, auth=Auth.Token(os.environ[token_key]))
111
+ gh = Github(base_url=base_url, auth=Auth.Token(os.environ[token_key]))
87
112
  elif (token_key := "GITHUB_TOKEN") in os.environ:
88
- gh = Github(base_url=GH_HOST, auth=Auth.Token(os.environ[token_key]))
113
+ gh = Github(base_url=base_url, auth=Auth.Token(os.environ[token_key]))
89
114
  else:
90
115
  try:
91
- gh = Github(base_url=GH_HOST, auth=Auth.NetrcAuth())
116
+ gh = Github(base_url=base_url, auth=Auth.NetrcAuth())
92
117
  except RuntimeError:
93
118
  try:
94
- token = subprocess.check_output(["gh", "auth", "token"], text=True).strip()
119
+ token = subprocess.check_output(
120
+ ["gh", "auth", "token"], text=True, env=os.environ
121
+ ).strip()
95
122
  if token:
96
- gh = Github(base_url=GH_HOST, auth=Auth.Token(token))
123
+ gh = Github(base_url=base_url, auth=Auth.Token(token))
97
124
  else:
98
125
  raise RuntimeError("No token from gh auth token")
99
126
  except Exception:
@@ -102,7 +129,7 @@ class GitHubHandler(BaseHandler):
102
129
  "Consider setting .netrc, environment variable GH_TOKEN, "
103
130
  "or using GitHub CLI (`gh auth login`) to get GitHub releases.",
104
131
  )
105
- gh = Github(base_url=GH_HOST)
132
+ gh = Github(base_url=base_url)
106
133
 
107
134
  owner, repo_name = self.config.repo.split("/", 1)
108
135
  gh_repo = gh.get_repo(f"{owner}/{repo_name}")
@@ -788,7 +788,7 @@ wheels = [
788
788
 
789
789
  [[package]]
790
790
  name = "mkdocstrings-github"
791
- version = "0.2.3"
791
+ version = "0.2.4"
792
792
  source = { editable = "." }
793
793
  dependencies = [
794
794
  { name = "gitpython" },
@@ -1 +0,0 @@
1
- # CHANGELOG
@@ -1 +0,0 @@
1
- --8<-- "CHANGELOG.md"