nonebot-plugin-htmlrender 0.6.8__tar.gz → 0.7.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 (197) hide show
  1. nonebot_plugin_htmlrender-0.7.0/.github/workflows/auto-tag.yml +89 -0
  2. nonebot_plugin_htmlrender-0.7.0/.github/workflows/ci.yml +245 -0
  3. nonebot_plugin_htmlrender-0.7.0/.github/workflows/coverage.yml +113 -0
  4. nonebot_plugin_htmlrender-0.7.0/.github/workflows/docs-pr-preview.yml +60 -0
  5. nonebot_plugin_htmlrender-0.7.0/.github/workflows/docs.yml +105 -0
  6. nonebot_plugin_htmlrender-0.7.0/.github/workflows/prek.yml +28 -0
  7. nonebot_plugin_htmlrender-0.7.0/.github/workflows/publish-test.yml +78 -0
  8. nonebot_plugin_htmlrender-0.7.0/.github/workflows/publish.yml +129 -0
  9. {nonebot_plugin_htmlrender-0.6.8 → nonebot_plugin_htmlrender-0.7.0}/.gitignore +5 -1
  10. nonebot_plugin_htmlrender-0.7.0/.markdownlint.json +10 -0
  11. nonebot_plugin_htmlrender-0.7.0/.pre-commit-config.yaml +140 -0
  12. nonebot_plugin_htmlrender-0.7.0/CODE_OF_CONDUCT.md +39 -0
  13. nonebot_plugin_htmlrender-0.7.0/CODING_STANDARDS.md +6 -0
  14. nonebot_plugin_htmlrender-0.7.0/COMMIT_MESSAGE.md +11 -0
  15. nonebot_plugin_htmlrender-0.7.0/CONTRIBUTING.md +87 -0
  16. nonebot_plugin_htmlrender-0.7.0/Makefile +137 -0
  17. nonebot_plugin_htmlrender-0.7.0/PKG-INFO +205 -0
  18. nonebot_plugin_htmlrender-0.7.0/README.md +154 -0
  19. nonebot_plugin_htmlrender-0.7.0/SECURITY.md +26 -0
  20. nonebot_plugin_htmlrender-0.7.0/docker-compose.dev.yaml +37 -0
  21. nonebot_plugin_htmlrender-0.7.0/docs/assets/logo.png +0 -0
  22. nonebot_plugin_htmlrender-0.7.0/docs/assets/nonebot_plugin.svg +1 -0
  23. nonebot_plugin_htmlrender-0.7.0/docs/index.md +137 -0
  24. nonebot_plugin_htmlrender-0.7.0/docs/maintainers/architecture/architecture.md +148 -0
  25. nonebot_plugin_htmlrender-0.7.0/docs/maintainers/architecture/custom-backends.md +124 -0
  26. nonebot_plugin_htmlrender-0.7.0/docs/maintainers/architecture/filehost-resource-resolution.md +356 -0
  27. nonebot_plugin_htmlrender-0.7.0/docs/maintainers/architecture/render-backend-development.md +427 -0
  28. nonebot_plugin_htmlrender-0.7.0/docs/maintainers/contributing/coding-standards.md +82 -0
  29. nonebot_plugin_htmlrender-0.7.0/docs/maintainers/contributing/commit-message.md +100 -0
  30. nonebot_plugin_htmlrender-0.7.0/docs/maintainers/contributing/contributing.md +76 -0
  31. nonebot_plugin_htmlrender-0.7.0/docs/maintainers/contributing/engineering-guide.md +186 -0
  32. nonebot_plugin_htmlrender-0.7.0/docs/maintainers/index.md +105 -0
  33. nonebot_plugin_htmlrender-0.7.0/docs/maintainers/quality/ci-actions.md +173 -0
  34. nonebot_plugin_htmlrender-0.7.0/docs/maintainers/quality/testing-matrix.md +71 -0
  35. nonebot_plugin_htmlrender-0.7.0/docs/maintainers/quality/versioning.md +73 -0
  36. nonebot_plugin_htmlrender-0.7.0/docs/overrides/main.html +8 -0
  37. nonebot_plugin_htmlrender-0.7.0/docs/stylesheets/extra.css +124 -0
  38. nonebot_plugin_htmlrender-0.7.0/docs/users/api.md +424 -0
  39. nonebot_plugin_htmlrender-0.7.0/docs/users/best-practices.md +128 -0
  40. nonebot_plugin_htmlrender-0.7.0/docs/users/config/core.md +99 -0
  41. nonebot_plugin_htmlrender-0.7.0/docs/users/config/index.md +19 -0
  42. nonebot_plugin_htmlrender-0.7.0/docs/users/config/integrations.md +138 -0
  43. nonebot_plugin_htmlrender-0.7.0/docs/users/config/playwright.md +205 -0
  44. nonebot_plugin_htmlrender-0.7.0/docs/users/examples.md +222 -0
  45. nonebot_plugin_htmlrender-0.7.0/docs/users/faq.md +187 -0
  46. nonebot_plugin_htmlrender-0.7.0/docs/users/index.md +81 -0
  47. nonebot_plugin_htmlrender-0.7.0/docs/users/migration.md +114 -0
  48. nonebot_plugin_htmlrender-0.7.0/docs/users/quickstart.md +132 -0
  49. nonebot_plugin_htmlrender-0.7.0/docs/users/remote-playwright.md +172 -0
  50. nonebot_plugin_htmlrender-0.7.0/docs/users/security.md +182 -0
  51. nonebot_plugin_htmlrender-0.7.0/docs/users/troubleshooting.md +251 -0
  52. nonebot_plugin_htmlrender-0.7.0/examples/remote_browser/.env.prod +14 -0
  53. nonebot_plugin_htmlrender-0.7.0/examples/remote_browser/README.md +49 -0
  54. nonebot_plugin_htmlrender-0.7.0/examples/remote_browser/docker-compose.yml +8 -0
  55. nonebot_plugin_htmlrender-0.7.0/examples/remote_browser/plugins/remote_render/__init__.py +50 -0
  56. nonebot_plugin_htmlrender-0.7.0/examples/remote_browser/pyproject.toml +18 -0
  57. nonebot_plugin_htmlrender-0.7.0/examples/screenshot/README.md +26 -0
  58. nonebot_plugin_htmlrender-0.7.0/examples/screenshot/plugins/screenshot/__init__.py +42 -0
  59. nonebot_plugin_htmlrender-0.7.0/examples/screenshot/pyproject.toml +18 -0
  60. nonebot_plugin_htmlrender-0.7.0/examples/template_render/README.md +38 -0
  61. nonebot_plugin_htmlrender-0.7.0/examples/template_render/plugins/template_render/__init__.py +47 -0
  62. nonebot_plugin_htmlrender-0.7.0/examples/template_render/plugins/template_render/templates/profile.html +30 -0
  63. nonebot_plugin_htmlrender-0.7.0/examples/template_render/plugins/template_render/templates/style.css +83 -0
  64. nonebot_plugin_htmlrender-0.7.0/examples/template_render/pyproject.toml +18 -0
  65. nonebot_plugin_htmlrender-0.7.0/mkdocs.yml +188 -0
  66. nonebot_plugin_htmlrender-0.7.0/nonebot_plugin_htmlrender/__init__.py +180 -0
  67. nonebot_plugin_htmlrender-0.7.0/nonebot_plugin_htmlrender/_bootstrap.py +81 -0
  68. nonebot_plugin_htmlrender-0.7.0/nonebot_plugin_htmlrender/_compat.py +286 -0
  69. nonebot_plugin_htmlrender-0.7.0/nonebot_plugin_htmlrender/backend/__init__.py +42 -0
  70. nonebot_plugin_htmlrender-0.7.0/nonebot_plugin_htmlrender/backend/base.py +217 -0
  71. nonebot_plugin_htmlrender-0.7.0/nonebot_plugin_htmlrender/backend/factory.py +194 -0
  72. nonebot_plugin_htmlrender-0.7.0/nonebot_plugin_htmlrender/backend/playwright/__init__.py +98 -0
  73. nonebot_plugin_htmlrender-0.7.0/nonebot_plugin_htmlrender/backend/playwright/_page.py +258 -0
  74. nonebot_plugin_htmlrender-0.7.0/nonebot_plugin_htmlrender/backend/playwright/config.py +244 -0
  75. nonebot_plugin_htmlrender-0.7.0/nonebot_plugin_htmlrender/backend/playwright/data_source.py +90 -0
  76. nonebot_plugin_htmlrender-0.7.0/nonebot_plugin_htmlrender/backend/playwright/install.py +161 -0
  77. nonebot_plugin_htmlrender-0.7.0/nonebot_plugin_htmlrender/backend/playwright/models.py +432 -0
  78. nonebot_plugin_htmlrender-0.7.0/nonebot_plugin_htmlrender/backend/playwright/operations.py +671 -0
  79. nonebot_plugin_htmlrender-0.7.0/nonebot_plugin_htmlrender/backend/playwright/render.py +764 -0
  80. nonebot_plugin_htmlrender-0.7.0/nonebot_plugin_htmlrender/backend/playwright/runtime.py +441 -0
  81. nonebot_plugin_htmlrender-0.7.0/nonebot_plugin_htmlrender/backend/playwright/telemetry.py +240 -0
  82. nonebot_plugin_htmlrender-0.7.0/nonebot_plugin_htmlrender/backend/playwright/types.py +280 -0
  83. nonebot_plugin_htmlrender-0.7.0/nonebot_plugin_htmlrender/browser.py +36 -0
  84. nonebot_plugin_htmlrender-0.7.0/nonebot_plugin_htmlrender/config.py +58 -0
  85. nonebot_plugin_htmlrender-0.7.0/nonebot_plugin_htmlrender/consts.py +124 -0
  86. nonebot_plugin_htmlrender-0.7.0/nonebot_plugin_htmlrender/data_source.py +40 -0
  87. nonebot_plugin_htmlrender-0.7.0/nonebot_plugin_htmlrender/render.py +712 -0
  88. nonebot_plugin_htmlrender-0.7.0/nonebot_plugin_htmlrender/resources/__init__.py +34 -0
  89. nonebot_plugin_htmlrender-0.7.0/nonebot_plugin_htmlrender/resources/config.py +66 -0
  90. nonebot_plugin_htmlrender-0.7.0/nonebot_plugin_htmlrender/resources/filehost/__init__.py +162 -0
  91. nonebot_plugin_htmlrender-0.7.0/nonebot_plugin_htmlrender/resources/filehost/cache.py +258 -0
  92. nonebot_plugin_htmlrender-0.7.0/nonebot_plugin_htmlrender/resources/filehost/guard.py +159 -0
  93. nonebot_plugin_htmlrender-0.7.0/nonebot_plugin_htmlrender/resources/filehost/warmup.py +251 -0
  94. nonebot_plugin_htmlrender-0.7.0/nonebot_plugin_htmlrender/resources/resolve.py +338 -0
  95. nonebot_plugin_htmlrender-0.7.0/nonebot_plugin_htmlrender/resources/template.py +313 -0
  96. nonebot_plugin_htmlrender-0.7.0/nonebot_plugin_htmlrender/utils/__init__.py +48 -0
  97. nonebot_plugin_htmlrender-0.7.0/nonebot_plugin_htmlrender/utils/install.py +172 -0
  98. nonebot_plugin_htmlrender-0.7.0/nonebot_plugin_htmlrender/utils/process.py +292 -0
  99. nonebot_plugin_htmlrender-0.7.0/nonebot_plugin_htmlrender/utils/signal.py +165 -0
  100. nonebot_plugin_htmlrender-0.7.0/nonebot_plugin_htmlrender/utils/telemetry/__init__.py +91 -0
  101. nonebot_plugin_htmlrender-0.7.0/nonebot_plugin_htmlrender/utils/telemetry/common.py +160 -0
  102. nonebot_plugin_htmlrender-0.7.0/nonebot_plugin_htmlrender/utils/telemetry/prometheus.py +199 -0
  103. nonebot_plugin_htmlrender-0.7.0/nonebot_plugin_htmlrender/utils/telemetry/sentry.py +228 -0
  104. nonebot_plugin_htmlrender-0.7.0/pyproject.toml +272 -0
  105. nonebot_plugin_htmlrender-0.7.0/tests/__init__.py +0 -0
  106. nonebot_plugin_htmlrender-0.7.0/tests/backend/playwright/test_backend.py +983 -0
  107. nonebot_plugin_htmlrender-0.7.0/tests/backend/playwright/test_config.py +146 -0
  108. nonebot_plugin_htmlrender-0.7.0/tests/backend/playwright/test_install.py +192 -0
  109. nonebot_plugin_htmlrender-0.7.0/tests/backend/playwright/test_operations.py +1058 -0
  110. nonebot_plugin_htmlrender-0.7.0/tests/backend/playwright/test_runtime_extra.py +332 -0
  111. nonebot_plugin_htmlrender-0.7.0/tests/backend/playwright/test_telemetry.py +268 -0
  112. nonebot_plugin_htmlrender-0.7.0/tests/backend/test_factory.py +219 -0
  113. nonebot_plugin_htmlrender-0.7.0/tests/conftest.py +128 -0
  114. nonebot_plugin_htmlrender-0.7.0/tests/core/test_config_compat.py +46 -0
  115. nonebot_plugin_htmlrender-0.7.0/tests/core/test_data_source_wrappers.py +111 -0
  116. nonebot_plugin_htmlrender-0.7.0/tests/core/test_install_more.py +135 -0
  117. nonebot_plugin_htmlrender-0.7.0/tests/core/test_plugin_install.py +126 -0
  118. nonebot_plugin_htmlrender-0.7.0/tests/core/test_plugin_module.py +298 -0
  119. {nonebot_plugin_htmlrender-0.6.8/tests → nonebot_plugin_htmlrender-0.7.0/tests/core}/test_process.py +48 -69
  120. nonebot_plugin_htmlrender-0.7.0/tests/core/test_reexports.py +60 -0
  121. nonebot_plugin_htmlrender-0.7.0/tests/core/test_telemetry_common.py +154 -0
  122. nonebot_plugin_htmlrender-0.7.0/tests/core/test_telemetry_prometheus.py +187 -0
  123. nonebot_plugin_htmlrender-0.7.0/tests/core/test_telemetry_sentry.py +169 -0
  124. nonebot_plugin_htmlrender-0.7.0/tests/core/test_telemetry_track_render.py +85 -0
  125. nonebot_plugin_htmlrender-0.7.0/tests/core/test_utils_runtime.py +320 -0
  126. nonebot_plugin_htmlrender-0.7.0/tests/infra/docker-compose.remote-test.yaml +39 -0
  127. nonebot_plugin_htmlrender-0.7.0/tests/infra/dockerfile.playwright-server +39 -0
  128. nonebot_plugin_htmlrender-0.7.0/tests/infra/dockerfile.remote-test +23 -0
  129. nonebot_plugin_htmlrender-0.7.0/tests/infra/playwright-server.mjs +12 -0
  130. nonebot_plugin_htmlrender-0.7.0/tests/remote_smoke.py +155 -0
  131. nonebot_plugin_htmlrender-0.7.0/tests/render/test_browser_compat.py +325 -0
  132. nonebot_plugin_htmlrender-0.7.0/tests/render/test_render_api.py +353 -0
  133. nonebot_plugin_htmlrender-0.7.0/tests/render/test_render_concurrency.py +247 -0
  134. nonebot_plugin_htmlrender-0.7.0/tests/render/test_render_unit.py +241 -0
  135. nonebot_plugin_htmlrender-0.7.0/tests/resources/test_filehost_extra.py +374 -0
  136. nonebot_plugin_htmlrender-0.7.0/tests/resources/test_resources.py +774 -0
  137. nonebot_plugin_htmlrender-0.7.0/tests/resources/test_resources_extra.py +250 -0
  138. {nonebot_plugin_htmlrender-0.6.8/example/plugins/render → nonebot_plugin_htmlrender-0.7.0/tests}/templates/markdown.css +1 -1
  139. {nonebot_plugin_htmlrender-0.6.8/example/plugins/render → nonebot_plugin_htmlrender-0.7.0/tests}/templates/mystyle.css +1 -1
  140. {nonebot_plugin_htmlrender-0.6.8 → nonebot_plugin_htmlrender-0.7.0}/tests/templates/progress.html.jinja2 +1 -1
  141. nonebot_plugin_htmlrender-0.7.0/tests/templates/remote_filehost.html.jinja2 +26 -0
  142. nonebot_plugin_htmlrender-0.7.0/uv.lock +2950 -0
  143. nonebot_plugin_htmlrender-0.6.8/.dockerignore +0 -10
  144. nonebot_plugin_htmlrender-0.6.8/.github/workflows/codecov.yml +0 -43
  145. nonebot_plugin_htmlrender-0.6.8/.github/workflows/docker_image.yml +0 -53
  146. nonebot_plugin_htmlrender-0.6.8/.github/workflows/publish.yml +0 -60
  147. nonebot_plugin_htmlrender-0.6.8/.pre-commit-config.yaml +0 -16
  148. nonebot_plugin_htmlrender-0.6.8/PKG-INFO +0 -221
  149. nonebot_plugin_htmlrender-0.6.8/README.md +0 -180
  150. nonebot_plugin_htmlrender-0.6.8/docker-compose.yaml +0 -37
  151. nonebot_plugin_htmlrender-0.6.8/dockerfile +0 -39
  152. nonebot_plugin_htmlrender-0.6.8/docs/example.md +0 -119
  153. nonebot_plugin_htmlrender-0.6.8/entrypoint.sh +0 -71
  154. nonebot_plugin_htmlrender-0.6.8/example/docker-compose.yaml +0 -1
  155. nonebot_plugin_htmlrender-0.6.8/example/entrypoint.sh +0 -1
  156. nonebot_plugin_htmlrender-0.6.8/example/plugins/render/__init__.py +0 -146
  157. nonebot_plugin_htmlrender-0.6.8/example/plugins/render/html2pic.html +0 -31
  158. nonebot_plugin_htmlrender-0.6.8/example/plugins/render/templates/progress.html.jinja2 +0 -27
  159. nonebot_plugin_htmlrender-0.6.8/example/plugins/render/utils.py +0 -13
  160. nonebot_plugin_htmlrender-0.6.8/example/pyproject.toml +0 -24
  161. nonebot_plugin_htmlrender-0.6.8/nonebot_plugin_htmlrender/__init__.py +0 -64
  162. nonebot_plugin_htmlrender-0.6.8/nonebot_plugin_htmlrender/browser.py +0 -231
  163. nonebot_plugin_htmlrender-0.6.8/nonebot_plugin_htmlrender/config.py +0 -95
  164. nonebot_plugin_htmlrender-0.6.8/nonebot_plugin_htmlrender/consts.py +0 -38
  165. nonebot_plugin_htmlrender-0.6.8/nonebot_plugin_htmlrender/data_source.py +0 -316
  166. nonebot_plugin_htmlrender-0.6.8/nonebot_plugin_htmlrender/install.py +0 -248
  167. nonebot_plugin_htmlrender-0.6.8/nonebot_plugin_htmlrender/process.py +0 -193
  168. nonebot_plugin_htmlrender-0.6.8/nonebot_plugin_htmlrender/signal.py +0 -138
  169. nonebot_plugin_htmlrender-0.6.8/nonebot_plugin_htmlrender/utils.py +0 -222
  170. nonebot_plugin_htmlrender-0.6.8/pyproject.toml +0 -106
  171. nonebot_plugin_htmlrender-0.6.8/tests/conftest.py +0 -15
  172. nonebot_plugin_htmlrender-0.6.8/tests/templates/markdown.css +0 -112
  173. nonebot_plugin_htmlrender-0.6.8/tests/templates/mystyle.css +0 -7
  174. nonebot_plugin_htmlrender-0.6.8/tests/templates/text.html +0 -24
  175. nonebot_plugin_htmlrender-0.6.8/tests/test_browser.py +0 -331
  176. nonebot_plugin_htmlrender-0.6.8/tests/test_deprecated_decorator.py +0 -61
  177. nonebot_plugin_htmlrender-0.6.8/tests/test_htmlrender.py +0 -212
  178. nonebot_plugin_htmlrender-0.6.8/tests/test_install.py +0 -131
  179. nonebot_plugin_htmlrender-0.6.8/uv.lock +0 -1952
  180. {nonebot_plugin_htmlrender-0.6.8 → nonebot_plugin_htmlrender-0.7.0}/.python-version +0 -0
  181. {nonebot_plugin_htmlrender-0.6.8 → nonebot_plugin_htmlrender-0.7.0}/LICENSE +0 -0
  182. {nonebot_plugin_htmlrender-0.6.8 → nonebot_plugin_htmlrender-0.7.0}/docs/html2pic.png +0 -0
  183. {nonebot_plugin_htmlrender-0.6.8 → nonebot_plugin_htmlrender-0.7.0}/docs/md2pic.png +0 -0
  184. {nonebot_plugin_htmlrender-0.6.8 → nonebot_plugin_htmlrender-0.7.0}/docs/template2pic.png +0 -0
  185. {nonebot_plugin_htmlrender-0.6.8 → nonebot_plugin_htmlrender-0.7.0}/docs/text2pic.png +0 -0
  186. /nonebot_plugin_htmlrender-0.6.8/tests/__init__.py → /nonebot_plugin_htmlrender-0.7.0/nonebot_plugin_htmlrender/py.typed +0 -0
  187. {nonebot_plugin_htmlrender-0.6.8/nonebot_plugin_htmlrender/templates → nonebot_plugin_htmlrender-0.7.0/nonebot_plugin_htmlrender/templates/markdown}/github-markdown-light.css +0 -0
  188. {nonebot_plugin_htmlrender-0.6.8/nonebot_plugin_htmlrender/templates → nonebot_plugin_htmlrender-0.7.0/nonebot_plugin_htmlrender/templates/markdown}/katex/katex.min.b64_fonts.css +0 -0
  189. {nonebot_plugin_htmlrender-0.6.8/nonebot_plugin_htmlrender/templates → nonebot_plugin_htmlrender-0.7.0/nonebot_plugin_htmlrender/templates/markdown}/katex/katex.min.js +0 -0
  190. {nonebot_plugin_htmlrender-0.6.8/nonebot_plugin_htmlrender/templates → nonebot_plugin_htmlrender-0.7.0/nonebot_plugin_htmlrender/templates/markdown}/katex/mathtex-script-type.min.js +0 -0
  191. {nonebot_plugin_htmlrender-0.6.8/nonebot_plugin_htmlrender/templates → nonebot_plugin_htmlrender-0.7.0/nonebot_plugin_htmlrender/templates/markdown}/katex/mhchem.min.js +0 -0
  192. {nonebot_plugin_htmlrender-0.6.8/nonebot_plugin_htmlrender/templates → nonebot_plugin_htmlrender-0.7.0/nonebot_plugin_htmlrender/templates/markdown}/markdown.html +0 -0
  193. {nonebot_plugin_htmlrender-0.6.8/nonebot_plugin_htmlrender/templates → nonebot_plugin_htmlrender-0.7.0/nonebot_plugin_htmlrender/templates/markdown}/pygments-default.css +0 -0
  194. {nonebot_plugin_htmlrender-0.6.8/nonebot_plugin_htmlrender/templates → nonebot_plugin_htmlrender-0.7.0/nonebot_plugin_htmlrender/templates/text}/text.css +0 -0
  195. {nonebot_plugin_htmlrender-0.6.8/nonebot_plugin_htmlrender/templates → nonebot_plugin_htmlrender-0.7.0/nonebot_plugin_htmlrender/templates/text}/text.html +0 -0
  196. {nonebot_plugin_htmlrender-0.6.8 → nonebot_plugin_htmlrender-0.7.0}/tests/resources/test_template_filter.png +0 -0
  197. {nonebot_plugin_htmlrender-0.6.8/example/plugins/render → nonebot_plugin_htmlrender-0.7.0/tests}/templates/text.html +0 -0
@@ -0,0 +1,89 @@
1
+ name: Auto Tag on Release Merge
2
+
3
+ on:
4
+ pull_request:
5
+ types: [closed]
6
+ branches: [master]
7
+
8
+ concurrency:
9
+ group: auto-tag-master
10
+ cancel-in-progress: false
11
+
12
+ jobs:
13
+ tag-and-dispatch:
14
+ name: Tag merged version & dispatch publish
15
+ # Skip fork PRs: GITHUB_TOKEN from forks is read-only and cannot push tags
16
+ # or dispatch workflows. Version-bump PRs must originate from same-repo branches.
17
+ if: >-
18
+ github.event.pull_request.merged == true &&
19
+ github.event.pull_request.head.repo.full_name == github.repository
20
+ runs-on: ubuntu-latest
21
+ timeout-minutes: 10
22
+ permissions:
23
+ contents: write
24
+ actions: write
25
+ steps:
26
+ - name: Checkout master
27
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
28
+ with:
29
+ ref: master
30
+ fetch-depth: 0
31
+ fetch-tags: true
32
+ persist-credentials: false
33
+
34
+ - name: Install the latest version of uv
35
+ uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78
36
+ with:
37
+ enable-cache: true
38
+
39
+ - name: Read version from pyproject
40
+ id: version
41
+ shell: bash
42
+ run: |
43
+ VERSION=$(uv version --short)
44
+ TAG="v${VERSION}"
45
+ echo "version=${VERSION}" >> "${GITHUB_OUTPUT}"
46
+ echo "tag=${TAG}" >> "${GITHUB_OUTPUT}"
47
+ echo "Resolved: ${VERSION} -> tag ${TAG}"
48
+
49
+ - name: Check if tag already exists
50
+ id: check
51
+ shell: bash
52
+ env:
53
+ TAG: ${{ steps.version.outputs.tag }}
54
+ run: |
55
+ if git rev-parse -q --verify "refs/tags/${TAG}" >/dev/null; then
56
+ echo "exists=true" >> "${GITHUB_OUTPUT}"
57
+ echo "Tag ${TAG} already exists; skipping."
58
+ else
59
+ echo "exists=false" >> "${GITHUB_OUTPUT}"
60
+ fi
61
+
62
+ - name: Create and push tag
63
+ if: steps.check.outputs.exists == 'false'
64
+ shell: bash
65
+ env:
66
+ TAG: ${{ steps.version.outputs.tag }}
67
+ PR_NUMBER: ${{ github.event.pull_request.number }}
68
+ PR_TITLE: ${{ github.event.pull_request.title }}
69
+ MERGE_SHA: ${{ github.event.pull_request.merge_commit_sha }}
70
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71
+ run: |
72
+ git config user.name "github-actions[bot]"
73
+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
74
+ git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
75
+ git tag -a "${TAG}" -m "Release ${TAG} (#${PR_NUMBER}: ${PR_TITLE})" -m "Merge commit: ${MERGE_SHA}"
76
+ git push origin "${TAG}"
77
+ echo "Pushed tag: ${TAG}"
78
+
79
+ - name: Dispatch publish workflow
80
+ if: steps.check.outputs.exists == 'false'
81
+ shell: bash
82
+ env:
83
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
84
+ TAG: ${{ steps.version.outputs.tag }}
85
+ run: |
86
+ gh workflow run publish.yml \
87
+ --ref master \
88
+ -f release_tag="${TAG}"
89
+ echo "Dispatched publish.yml with release_tag=${TAG}"
@@ -0,0 +1,245 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ pull_request:
8
+ workflow_dispatch:
9
+ inputs:
10
+ debug_enabled:
11
+ description: Enable extra debug diagnostics
12
+ required: false
13
+ default: false
14
+ type: boolean
15
+
16
+ permissions:
17
+ contents: read
18
+
19
+ concurrency:
20
+ group: ${{ github.workflow }}-${{ github.ref }}
21
+ cancel-in-progress: true
22
+
23
+ jobs:
24
+ ruff:
25
+ name: Ruff
26
+ runs-on: ubuntu-latest
27
+ timeout-minutes: 20
28
+ steps:
29
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
30
+ with:
31
+ persist-credentials: false
32
+
33
+ - name: Set up uv
34
+ uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78
35
+ with:
36
+ python-version: "3.12"
37
+ enable-cache: true
38
+ cache-suffix: lint-type-${{ github.event_name }}
39
+
40
+ - name: Show Runner Context
41
+ run: |
42
+ echo "Runner: $RUNNER_NAME ($RUNNER_OS/$RUNNER_ARCH)"
43
+ python --version
44
+ uv --version
45
+
46
+ - name: Sync deps
47
+ run: uv sync --locked --all-extras --all-groups
48
+
49
+ - name: Ruff
50
+ run: uv run ruff check .
51
+
52
+ ty:
53
+ name: Ty
54
+ runs-on: ubuntu-latest
55
+ timeout-minutes: 20
56
+ steps:
57
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
58
+ with:
59
+ persist-credentials: false
60
+
61
+ - name: Set up uv
62
+ uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78
63
+ with:
64
+ python-version: "3.12"
65
+ enable-cache: true
66
+ cache-suffix: ty-${{ github.event_name }}
67
+
68
+ - name: Sync deps
69
+ run: uv sync --locked --all-extras --all-groups
70
+
71
+ - name: Ty
72
+ run: uv run ty check
73
+
74
+ basedpyright:
75
+ name: Basedpyright
76
+ runs-on: ubuntu-latest
77
+ timeout-minutes: 20
78
+ steps:
79
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
80
+ with:
81
+ persist-credentials: false
82
+
83
+ - name: Set up uv
84
+ uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78
85
+ with:
86
+ python-version: "3.12"
87
+ enable-cache: true
88
+ cache-suffix: basedpyright-${{ github.event_name }}
89
+
90
+ - name: Sync deps
91
+ run: uv sync --locked --all-extras --all-groups
92
+
93
+ - name: Basedpyright
94
+ run: uv run basedpyright .
95
+
96
+ package:
97
+ name: Package Build
98
+ runs-on: ubuntu-latest
99
+ timeout-minutes: 15
100
+ env:
101
+ BUILD_LOG: package-build.log
102
+ steps:
103
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
104
+ with:
105
+ persist-credentials: false
106
+
107
+ - name: Set up uv
108
+ uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78
109
+ with:
110
+ python-version: "3.12"
111
+ enable-cache: true
112
+ cache-suffix: package-${{ github.event_name }}
113
+
114
+ - name: Build distributions
115
+ run: |
116
+ set -o pipefail
117
+ uv build 2>&1 | tee "${BUILD_LOG}"
118
+
119
+ - name: Validate distributions
120
+ run: uv run --no-project --with twine twine check dist/*
121
+
122
+ - name: Show built distributions
123
+ run: |
124
+ ls -la dist
125
+ sha256sum dist/* || true
126
+
127
+ - name: Upload built distributions
128
+ uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
129
+ with:
130
+ name: package-dist
131
+ path: dist/
132
+ if-no-files-found: error
133
+ retention-days: 14
134
+
135
+ - name: Upload build logs
136
+ if: ${{ always() }}
137
+ uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
138
+ with:
139
+ name: package-build-logs
140
+ path: ${{ env.BUILD_LOG }}
141
+ if-no-files-found: warn
142
+ retention-days: 14
143
+
144
+ remote-browser-render:
145
+ name: Remote Browser Render Smoke (Docker)
146
+ runs-on: ubuntu-latest
147
+ timeout-minutes: 30
148
+ env:
149
+ RENDER_IMAGE: htmlrender-remote-test:ci
150
+ PLAYWRIGHT_IMAGE: htmlrender-playwright:ci
151
+ steps:
152
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
153
+ with:
154
+ persist-credentials: false
155
+
156
+ - name: Set up Docker Buildx
157
+ uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435
158
+
159
+ - name: Build remote smoke render image
160
+ uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83
161
+ with:
162
+ context: .
163
+ file: tests/infra/dockerfile.remote-test
164
+ load: true
165
+ tags: ${{ env.RENDER_IMAGE }}
166
+ cache-from: type=gha,scope=remote-smoke
167
+ cache-to: type=gha,scope=remote-smoke,mode=max
168
+ build-args: |
169
+ PYTHON_BASE_IMAGE=python:3.12-bookworm
170
+
171
+ - name: Resolve Playwright version
172
+ id: playwright-version
173
+ shell: bash
174
+ run: |
175
+ PLAYWRIGHT_VERSION=$(python3 - <<'PY'
176
+ from pathlib import Path
177
+
178
+ try:
179
+ import tomllib
180
+ except ModuleNotFoundError:
181
+ tomllib = None
182
+
183
+
184
+ def parse_package_version(text, package_name):
185
+ if tomllib is not None:
186
+ lock = tomllib.loads(text)
187
+ for package in lock["package"]:
188
+ if package["name"] == package_name:
189
+ return package["version"]
190
+ return None
191
+
192
+ current_name = None
193
+ for line in text.splitlines():
194
+ stripped = line.strip()
195
+ if stripped == "[[package]]":
196
+ current_name = None
197
+ continue
198
+ if stripped.startswith("name = "):
199
+ current_name = stripped.split('"', 2)[1]
200
+ continue
201
+ if current_name == package_name and stripped.startswith("version = "):
202
+ return stripped.split('"', 2)[1]
203
+ return None
204
+
205
+
206
+ version = parse_package_version(Path("uv.lock").read_text(), "playwright")
207
+ if version is None:
208
+ raise SystemExit("playwright package not found in uv.lock")
209
+ print(version)
210
+ PY
211
+ )
212
+ echo "version=${PLAYWRIGHT_VERSION}" >> "${GITHUB_OUTPUT}"
213
+ echo "Resolved Playwright version: ${PLAYWRIGHT_VERSION}"
214
+
215
+ - name: Build playwright server image
216
+ uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83
217
+ with:
218
+ context: .
219
+ file: tests/infra/dockerfile.playwright-server
220
+ load: true
221
+ tags: ${{ env.PLAYWRIGHT_IMAGE }}
222
+ cache-from: type=gha,scope=playwright-server
223
+ cache-to: type=gha,scope=playwright-server,mode=max
224
+ build-args: |
225
+ PLAYWRIGHT_VERSION=${{ steps.playwright-version.outputs.version }}
226
+
227
+ - name: Build and run remote smoke
228
+ run: docker compose -f tests/infra/docker-compose.remote-test.yaml up --abort-on-container-exit --exit-code-from render
229
+
230
+ - name: Capture compose logs
231
+ if: ${{ always() }}
232
+ run: docker compose -f tests/infra/docker-compose.remote-test.yaml logs > remote-smoke-compose.log
233
+
234
+ - name: Upload remote smoke logs
235
+ if: ${{ always() }}
236
+ uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
237
+ with:
238
+ name: remote-smoke-compose-logs
239
+ path: remote-smoke-compose.log
240
+ if-no-files-found: warn
241
+ retention-days: 14
242
+
243
+ - name: Teardown compose
244
+ if: always()
245
+ run: docker compose -f tests/infra/docker-compose.remote-test.yaml down -v
@@ -0,0 +1,113 @@
1
+ name: Coverage
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ pull_request:
8
+ workflow_dispatch:
9
+ inputs:
10
+ debug_enabled:
11
+ description: Enable extra debug diagnostics
12
+ required: false
13
+ default: false
14
+ type: boolean
15
+
16
+ permissions:
17
+ contents: read
18
+
19
+ concurrency:
20
+ group: ${{ github.workflow }}-${{ github.ref }}
21
+ cancel-in-progress: true
22
+
23
+ jobs:
24
+ coverage:
25
+ name: Coverage (py${{ matrix.python-version }}-${{ matrix.target.arch }})
26
+ runs-on: ${{ matrix.target.runs-on }}
27
+ timeout-minutes: 45
28
+ strategy:
29
+ fail-fast: false
30
+ matrix:
31
+ python-version: ["3.10", "3.11", "3.12", "3.13"]
32
+ target:
33
+ - runs-on: ubuntu-latest
34
+ arch: x64
35
+ - runs-on: ubuntu-24.04-arm
36
+ arch: arm64
37
+
38
+ env:
39
+ HTMLRENDER_TEST_PROFILE: ci
40
+ ARCH: ${{ matrix.target.arch }}
41
+ PYTHON_VERSION: ${{ matrix.python-version }}
42
+ COVERAGE_XML: coverage-py${{ matrix.python-version }}-${{ matrix.target.arch }}.xml
43
+ PYTEST_LOG: pytest-py${{ matrix.python-version }}-${{ matrix.target.arch }}.log
44
+
45
+ steps:
46
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
47
+ with:
48
+ persist-credentials: false
49
+
50
+ - name: Set up uv
51
+ uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78
52
+ with:
53
+ python-version: ${{ matrix.python-version }}
54
+ enable-cache: true
55
+ cache-suffix: coverage-py${{ matrix.python-version }}-${{ matrix.target.arch }}-${{ github.event_name }}
56
+
57
+ - name: Show Runner Context
58
+ run: |
59
+ echo "Event: ${{ github.event_name }}"
60
+ echo "Runner: $RUNNER_NAME ($RUNNER_OS/$RUNNER_ARCH)"
61
+ echo "Python: $PYTHON_VERSION, ARCH: $ARCH"
62
+ uname -a
63
+ df -h
64
+ python --version
65
+ uv --version
66
+ if command -v lscpu >/dev/null 2>&1; then lscpu; fi
67
+
68
+ - name: Sync deps
69
+ run: uv sync --locked --all-extras --all-groups
70
+
71
+ - name: Show Dependency Snapshot
72
+ if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true' }}
73
+ run: |
74
+ uv pip list
75
+ uv tree
76
+
77
+ - name: Run tests with coverage
78
+ run: |
79
+ set -o pipefail
80
+ uv run pytest tests \
81
+ --cov=nonebot_plugin_htmlrender \
82
+ --cov-report=term-missing \
83
+ --cov-report=xml:${COVERAGE_XML} \
84
+ -ra 2>&1 | tee "${PYTEST_LOG}"
85
+
86
+ - name: Show Failure Diagnostics
87
+ if: ${{ failure() }}
88
+ run: |
89
+ echo "==== Last 200 lines of pytest log ===="
90
+ tail -n 200 "${PYTEST_LOG}" || true
91
+ echo "==== Environment ===="
92
+ env | sort
93
+ echo "==== Workspace files ===="
94
+ ls -la
95
+
96
+ - name: Upload Coverage + Pytest Logs
97
+ if: ${{ always() }}
98
+ uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
99
+ with:
100
+ name: coverage-debug-py${{ matrix.python-version }}-${{ matrix.target.arch }}
101
+ path: |
102
+ ${{ env.COVERAGE_XML }}
103
+ ${{ env.PYTEST_LOG }}
104
+ if-no-files-found: warn
105
+ retention-days: 14
106
+
107
+ - name: Upload coverage to Codecov
108
+ uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de
109
+ with:
110
+ files: ./${{ env.COVERAGE_XML }}
111
+ flags: py${{ matrix.python-version }}-${{ matrix.target.arch }}
112
+ env_vars: ARCH,PYTHON_VERSION
113
+ verbose: true
@@ -0,0 +1,60 @@
1
+ name: Docs PR Preview
2
+
3
+ on:
4
+ pull_request:
5
+ types: [opened, synchronize, reopened, closed]
6
+ paths:
7
+ - docs/**
8
+ - mkdocs.yml
9
+ - README.md
10
+ - .github/workflows/docs-pr-preview.yml
11
+
12
+ concurrency:
13
+ group: docs-pr-preview-${{ github.event.pull_request.number }}
14
+ cancel-in-progress: true
15
+
16
+ jobs:
17
+ preview:
18
+ name: Deploy / cleanup PR docs preview
19
+ # Skip PRs from forks: GITHUB_TOKEN from forks lacks write access to gh-pages.
20
+ if: github.event.pull_request.head.repo.full_name == github.repository
21
+ runs-on: ubuntu-latest
22
+ timeout-minutes: 20
23
+ permissions:
24
+ contents: write
25
+ pull-requests: write
26
+ steps:
27
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
28
+ with:
29
+ persist-credentials: false
30
+
31
+ - name: Set up uv
32
+ if: github.event.action != 'closed'
33
+ uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78
34
+ with:
35
+ python-version: "3.12"
36
+ enable-cache: true
37
+ cache-suffix: docs-${{ github.event_name }}
38
+
39
+ - name: Show Runner Context
40
+ if: github.event.action != 'closed'
41
+ run: |
42
+ echo "Runner: $RUNNER_NAME ($RUNNER_OS/$RUNNER_ARCH)"
43
+ python --version
44
+ uv --version
45
+
46
+ - name: Sync docs deps
47
+ if: github.event.action != 'closed'
48
+ run: uv sync --locked --group docs
49
+
50
+ - name: Build docs
51
+ if: github.event.action != 'closed'
52
+ run: uv run zensical build --strict
53
+
54
+ - name: Deploy / cleanup preview
55
+ uses: rossjrw/pr-preview-action@2fb559e4766555e23d07b73d313fe97c4f8c3cfe
56
+ with:
57
+ source-dir: site/
58
+ preview-branch: gh-pages
59
+ umbrella-dir: pr-preview
60
+ action: auto
@@ -0,0 +1,105 @@
1
+ name: Docs
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ paths:
8
+ - docs/**
9
+ - mkdocs.yml
10
+ - README.md
11
+ - .github/workflows/docs.yml
12
+ workflow_dispatch:
13
+ inputs:
14
+ debug_enabled:
15
+ description: Enable extra debug diagnostics
16
+ required: false
17
+ default: false
18
+ type: boolean
19
+
20
+ permissions:
21
+ contents: write
22
+
23
+ jobs:
24
+ deploy:
25
+ name: Build & Deploy Docs
26
+ runs-on: ubuntu-latest
27
+ timeout-minutes: 20
28
+ env:
29
+ DOCS_LOG: docs-build.log
30
+ steps:
31
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
32
+ with:
33
+ fetch-depth: 0
34
+ persist-credentials: false
35
+
36
+ - name: Set up uv
37
+ uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78
38
+ with:
39
+ python-version: "3.12"
40
+ enable-cache: true
41
+ cache-suffix: docs-${{ github.event_name }}
42
+
43
+ - name: Show Runner Context
44
+ run: |
45
+ echo "Runner: $RUNNER_NAME ($RUNNER_OS/$RUNNER_ARCH)"
46
+ python --version
47
+ uv --version
48
+
49
+ - name: Sync docs deps
50
+ run: uv sync --locked --group docs
51
+
52
+ - name: Debug Dependency Snapshot
53
+ if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true' }}
54
+ run: |
55
+ uv pip list
56
+ uv tree
57
+
58
+ - name: Build docs
59
+ run: |
60
+ set -o pipefail
61
+ uv run zensical build --strict 2>&1 | tee "${DOCS_LOG}"
62
+
63
+ - name: Upload docs build logs
64
+ if: ${{ always() }}
65
+ uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
66
+ with:
67
+ name: docs-build-logs
68
+ path: ${{ env.DOCS_LOG }}
69
+ if-no-files-found: warn
70
+ retention-days: 14
71
+
72
+ - name: Configure git
73
+ run: |
74
+ git config user.name "github-actions[bot]"
75
+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
76
+
77
+ - name: Configure authenticated origin
78
+ env:
79
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80
+ run: |
81
+ git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
82
+
83
+ - name: Get project version
84
+ id: version
85
+ run: |
86
+ VERSION=$(uv version --short)
87
+ echo "version=${VERSION}" >> "${GITHUB_OUTPUT}"
88
+
89
+ - name: Deploy versioned docs
90
+ env:
91
+ VERSION: ${{ steps.version.outputs.version }}
92
+ run: |
93
+ uv run mike deploy --push --update-aliases "${VERSION}" latest
94
+
95
+ - name: Set default version
96
+ run: |
97
+ uv run mike set-default --push latest
98
+
99
+ - name: Show docs url
100
+ env:
101
+ DOCS_OWNER: ${{ github.repository_owner }}
102
+ DOCS_REPO: ${{ github.event.repository.name }}
103
+ VERSION: ${{ steps.version.outputs.version }}
104
+ run: |
105
+ echo "Docs deployed: https://${DOCS_OWNER}.github.io/${DOCS_REPO}/${VERSION}/"
@@ -0,0 +1,28 @@
1
+ name: Prek
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ pull_request:
8
+ workflow_dispatch:
9
+
10
+ permissions:
11
+ contents: read
12
+
13
+ concurrency:
14
+ group: ${{ github.workflow }}-${{ github.ref }}
15
+ cancel-in-progress: true
16
+
17
+ jobs:
18
+ prek:
19
+ name: Prek
20
+ runs-on: ubuntu-latest
21
+ timeout-minutes: 15
22
+ steps:
23
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
24
+ with:
25
+ persist-credentials: false
26
+
27
+ - name: Run pre-commit hooks via prek
28
+ uses: j178/prek-action@6ad80277337ad479fe43bd70701c3f7f8aa74db3