remarkable-annotations 0.1.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 (147) hide show
  1. remarkable_annotations-0.1.0/.github/workflows/release-npm.yml +67 -0
  2. remarkable_annotations-0.1.0/.github/workflows/release.yml +126 -0
  3. remarkable_annotations-0.1.0/.github/workflows/test.yml +92 -0
  4. remarkable_annotations-0.1.0/.gitignore +12 -0
  5. remarkable_annotations-0.1.0/.pre-commit-config.yaml +47 -0
  6. remarkable_annotations-0.1.0/Cargo.lock +528 -0
  7. remarkable_annotations-0.1.0/Cargo.toml +46 -0
  8. remarkable_annotations-0.1.0/LICENSE-APACHE +201 -0
  9. remarkable_annotations-0.1.0/LICENSE-MIT +21 -0
  10. remarkable_annotations-0.1.0/NOTICE +16 -0
  11. remarkable_annotations-0.1.0/PKG-INFO +200 -0
  12. remarkable_annotations-0.1.0/README.md +185 -0
  13. remarkable_annotations-0.1.0/cliff.toml +66 -0
  14. remarkable_annotations-0.1.0/pyproject.toml +38 -0
  15. remarkable_annotations-0.1.0/python/test_cloud.py +127 -0
  16. remarkable_annotations-0.1.0/python/test_scene.py +29 -0
  17. remarkable_annotations-0.1.0/rust-toolchain.toml +5 -0
  18. remarkable_annotations-0.1.0/src/cloud/client.rs +1351 -0
  19. remarkable_annotations-0.1.0/src/cloud/doc.rs +144 -0
  20. remarkable_annotations-0.1.0/src/cloud/error.rs +55 -0
  21. remarkable_annotations-0.1.0/src/cloud/exec.rs +444 -0
  22. remarkable_annotations-0.1.0/src/cloud/js.rs +406 -0
  23. remarkable_annotations-0.1.0/src/cloud/mod.rs +32 -0
  24. remarkable_annotations-0.1.0/src/cloud/schema.rs +394 -0
  25. remarkable_annotations-0.1.0/src/geometry.rs +163 -0
  26. remarkable_annotations-0.1.0/src/js.rs +30 -0
  27. remarkable_annotations-0.1.0/src/lib.rs +23 -0
  28. remarkable_annotations-0.1.0/src/page.rs +594 -0
  29. remarkable_annotations-0.1.0/src/pdf.rs +455 -0
  30. remarkable_annotations-0.1.0/src/py/cloud.rs +323 -0
  31. remarkable_annotations-0.1.0/src/py/mod.rs +43 -0
  32. remarkable_annotations-0.1.0/src/scene/io.rs +363 -0
  33. remarkable_annotations-0.1.0/src/scene/mod.rs +432 -0
  34. remarkable_annotations-0.1.0/src/scene/parse.rs +366 -0
  35. remarkable_annotations-0.1.0/src/scene/view.rs +245 -0
  36. remarkable_annotations-0.1.0/src/scene/write.rs +251 -0
  37. remarkable_annotations-0.1.0/src/shapes.rs +109 -0
  38. remarkable_annotations-0.1.0/tests/cloud.rs +427 -0
  39. remarkable_annotations-0.1.0/tests/common/mod.rs +63 -0
  40. remarkable_annotations-0.1.0/tests/fixtures/geometry.json +1 -0
  41. remarkable_annotations-0.1.0/tests/fixtures/page/blank_3.rm +0 -0
  42. remarkable_annotations-0.1.0/tests/fixtures/page/blank_authors.ids.json +1 -0
  43. remarkable_annotations-0.1.0/tests/fixtures/page/blank_authors.rm +0 -0
  44. remarkable_annotations-0.1.0/tests/fixtures/page/blank_items.ids.json +1 -0
  45. remarkable_annotations-0.1.0/tests/fixtures/page/blank_items.rm +0 -0
  46. remarkable_annotations-0.1.0/tests/fixtures/page/colors_append.ids.json +1 -0
  47. remarkable_annotations-0.1.0/tests/fixtures/page/colors_append.rm +0 -0
  48. remarkable_annotations-0.1.0/tests/fixtures/page/highlight_replace.ids.json +1 -0
  49. remarkable_annotations-0.1.0/tests/fixtures/page/highlight_replace.rm +0 -0
  50. remarkable_annotations-0.1.0/tests/fixtures/page/lines_append.ids.json +1 -0
  51. remarkable_annotations-0.1.0/tests/fixtures/page/lines_append.rm +0 -0
  52. remarkable_annotations-0.1.0/tests/fixtures/page/lines_remove_first.ids.json +1 -0
  53. remarkable_annotations-0.1.0/tests/fixtures/page/lines_remove_first.rm +0 -0
  54. remarkable_annotations-0.1.0/tests/fixtures/page/scenarios.json +57 -0
  55. remarkable_annotations-0.1.0/tests/fixtures/page/split_Bold_Heading_Bullet_Normal.rm +0 -0
  56. remarkable_annotations-0.1.0/tests/fixtures/page/split_Normal_A_stroke_2_layers.rm +0 -0
  57. remarkable_annotations-0.1.0/tests/fixtures/page/text_page_append.ids.json +1 -0
  58. remarkable_annotations-0.1.0/tests/fixtures/page/text_page_append.rm +0 -0
  59. remarkable_annotations-0.1.0/tests/fixtures/pdf/corrupt_stream.pdf +0 -0
  60. remarkable_annotations-0.1.0/tests/fixtures/pdf/incremental.pdf +125 -0
  61. remarkable_annotations-0.1.0/tests/fixtures/pdf/indirect_box.pdf +43 -0
  62. remarkable_annotations-0.1.0/tests/fixtures/pdf/many_pages.pdf +0 -0
  63. remarkable_annotations-0.1.0/tests/fixtures/pdf/mixed_disable.pdf +61 -0
  64. remarkable_annotations-0.1.0/tests/fixtures/pdf/mixed_disable_uncompressed.pdf +61 -0
  65. remarkable_annotations-0.1.0/tests/fixtures/pdf/mixed_generate.pdf +0 -0
  66. remarkable_annotations-0.1.0/tests/fixtures/pdf/mixed_generate_uncompressed.pdf +0 -0
  67. remarkable_annotations-0.1.0/tests/fixtures/pdf/not_a_pdf.pdf +1 -0
  68. remarkable_annotations-0.1.0/tests/fixtures/pdf/objstm_handmade.pdf +0 -0
  69. remarkable_annotations-0.1.0/tests/fixtures/pdf/scan_only.pdf +2 -0
  70. remarkable_annotations-0.1.0/tests/fixtures/pdf/truncated_half.pdf +18 -0
  71. remarkable_annotations-0.1.0/tests/fixtures/rm/generated/Normal_A_stroke_2_layers_appended.page.json +1 -0
  72. remarkable_annotations-0.1.0/tests/fixtures/rm/generated/Normal_A_stroke_2_layers_appended.rm +0 -0
  73. remarkable_annotations-0.1.0/tests/fixtures/rm/generated/Normal_A_stroke_2_layers_appended.rmapi.json +1 -0
  74. remarkable_annotations-0.1.0/tests/fixtures/rm/generated/Normal_A_stroke_2_layers_removed.page.json +1 -0
  75. remarkable_annotations-0.1.0/tests/fixtures/rm/generated/Normal_A_stroke_2_layers_removed.rm +0 -0
  76. remarkable_annotations-0.1.0/tests/fixtures/rm/generated/Normal_A_stroke_2_layers_removed.rmapi.json +1 -0
  77. remarkable_annotations-0.1.0/tests/fixtures/rm/generated/Normal_A_stroke_2_layers_split.page.json +1 -0
  78. remarkable_annotations-0.1.0/tests/fixtures/rm/generated/Normal_A_stroke_2_layers_split.rm +0 -0
  79. remarkable_annotations-0.1.0/tests/fixtures/rm/generated/Normal_A_stroke_2_layers_split.rmapi.json +1 -0
  80. remarkable_annotations-0.1.0/tests/fixtures/rm/generated/Wikipedia_highlighted_p1_appended.page.json +1 -0
  81. remarkable_annotations-0.1.0/tests/fixtures/rm/generated/Wikipedia_highlighted_p1_appended.rm +0 -0
  82. remarkable_annotations-0.1.0/tests/fixtures/rm/generated/Wikipedia_highlighted_p1_appended.rmapi.json +1 -0
  83. remarkable_annotations-0.1.0/tests/fixtures/rm/generated/Wikipedia_highlighted_p1_removed.page.json +1 -0
  84. remarkable_annotations-0.1.0/tests/fixtures/rm/generated/Wikipedia_highlighted_p1_removed.rm +0 -0
  85. remarkable_annotations-0.1.0/tests/fixtures/rm/generated/Wikipedia_highlighted_p1_removed.rmapi.json +1 -0
  86. remarkable_annotations-0.1.0/tests/fixtures/rm/generated/Wikipedia_highlighted_p1_split.page.json +1 -0
  87. remarkable_annotations-0.1.0/tests/fixtures/rm/generated/Wikipedia_highlighted_p1_split.rm +0 -0
  88. remarkable_annotations-0.1.0/tests/fixtures/rm/generated/Wikipedia_highlighted_p1_split.rmapi.json +1 -0
  89. remarkable_annotations-0.1.0/tests/fixtures/rm/generated/blank_registered_authors.page.json +1 -0
  90. remarkable_annotations-0.1.0/tests/fixtures/rm/generated/blank_registered_authors.rm +0 -0
  91. remarkable_annotations-0.1.0/tests/fixtures/rm/generated/blank_registered_authors.rmapi.json +1 -0
  92. remarkable_annotations-0.1.0/tests/fixtures/rm/generated/blank_strokes_highlights.page.json +1 -0
  93. remarkable_annotations-0.1.0/tests/fixtures/rm/generated/blank_strokes_highlights.rm +0 -0
  94. remarkable_annotations-0.1.0/tests/fixtures/rm/generated/blank_strokes_highlights.rmapi.json +1 -0
  95. remarkable_annotations-0.1.0/tests/fixtures/rm/rmscene/Bold_Heading_Bullet_Normal.page.json +1 -0
  96. remarkable_annotations-0.1.0/tests/fixtures/rm/rmscene/Bold_Heading_Bullet_Normal.rm +0 -0
  97. remarkable_annotations-0.1.0/tests/fixtures/rm/rmscene/Bold_Heading_Bullet_Normal.rmapi.json +1 -0
  98. remarkable_annotations-0.1.0/tests/fixtures/rm/rmscene/Color_and_tool_v3.14.4.page.json +1 -0
  99. remarkable_annotations-0.1.0/tests/fixtures/rm/rmscene/Color_and_tool_v3.14.4.rm +0 -0
  100. remarkable_annotations-0.1.0/tests/fixtures/rm/rmscene/Color_and_tool_v3.14.4.rmapi.json +1 -0
  101. remarkable_annotations-0.1.0/tests/fixtures/rm/rmscene/LICENSE +21 -0
  102. remarkable_annotations-0.1.0/tests/fixtures/rm/rmscene/Lines_v2.page.json +1 -0
  103. remarkable_annotations-0.1.0/tests/fixtures/rm/rmscene/Lines_v2.rm +0 -0
  104. remarkable_annotations-0.1.0/tests/fixtures/rm/rmscene/Lines_v2.rmapi.json +1 -0
  105. remarkable_annotations-0.1.0/tests/fixtures/rm/rmscene/Lines_v2_updated.page.json +1 -0
  106. remarkable_annotations-0.1.0/tests/fixtures/rm/rmscene/Lines_v2_updated.rm +0 -0
  107. remarkable_annotations-0.1.0/tests/fixtures/rm/rmscene/Lines_v2_updated.rmapi.json +1 -0
  108. remarkable_annotations-0.1.0/tests/fixtures/rm/rmscene/More_color_highlight_shader_v3.15.4.2.page.json +1 -0
  109. remarkable_annotations-0.1.0/tests/fixtures/rm/rmscene/More_color_highlight_shader_v3.15.4.2.rm +0 -0
  110. remarkable_annotations-0.1.0/tests/fixtures/rm/rmscene/More_color_highlight_shader_v3.15.4.2.rmapi.json +1 -0
  111. remarkable_annotations-0.1.0/tests/fixtures/rm/rmscene/Normal_AB.page.json +1 -0
  112. remarkable_annotations-0.1.0/tests/fixtures/rm/rmscene/Normal_AB.rm +0 -0
  113. remarkable_annotations-0.1.0/tests/fixtures/rm/rmscene/Normal_AB.rmapi.json +1 -0
  114. remarkable_annotations-0.1.0/tests/fixtures/rm/rmscene/Normal_A_stroke_2_layers.page.json +1 -0
  115. remarkable_annotations-0.1.0/tests/fixtures/rm/rmscene/Normal_A_stroke_2_layers.rm +0 -0
  116. remarkable_annotations-0.1.0/tests/fixtures/rm/rmscene/Normal_A_stroke_2_layers.rmapi.json +1 -0
  117. remarkable_annotations-0.1.0/tests/fixtures/rm/rmscene/Normal_A_stroke_2_layers_v3.2.2.page.json +1 -0
  118. remarkable_annotations-0.1.0/tests/fixtures/rm/rmscene/Normal_A_stroke_2_layers_v3.2.2.rm +0 -0
  119. remarkable_annotations-0.1.0/tests/fixtures/rm/rmscene/Normal_A_stroke_2_layers_v3.2.2.rmapi.json +1 -0
  120. remarkable_annotations-0.1.0/tests/fixtures/rm/rmscene/Normal_A_stroke_2_layers_v3.3.2.page.json +1 -0
  121. remarkable_annotations-0.1.0/tests/fixtures/rm/rmscene/Normal_A_stroke_2_layers_v3.3.2.rm +0 -0
  122. remarkable_annotations-0.1.0/tests/fixtures/rm/rmscene/Normal_A_stroke_2_layers_v3.3.2.rmapi.json +1 -0
  123. remarkable_annotations-0.1.0/tests/fixtures/rm/rmscene/Wikipedia_highlighted_p1.page.json +1 -0
  124. remarkable_annotations-0.1.0/tests/fixtures/rm/rmscene/Wikipedia_highlighted_p1.rm +0 -0
  125. remarkable_annotations-0.1.0/tests/fixtures/rm/rmscene/Wikipedia_highlighted_p1.rmapi.json +1 -0
  126. remarkable_annotations-0.1.0/tests/fixtures/rm/rmscene/Wikipedia_highlighted_p2.page.json +1 -0
  127. remarkable_annotations-0.1.0/tests/fixtures/rm/rmscene/Wikipedia_highlighted_p2.rm +0 -0
  128. remarkable_annotations-0.1.0/tests/fixtures/rm/rmscene/Wikipedia_highlighted_p2.rmapi.json +1 -0
  129. remarkable_annotations-0.1.0/tests/fixtures/rm/rmscene/With_SceneInfo_Block.page.json +1 -0
  130. remarkable_annotations-0.1.0/tests/fixtures/rm/rmscene/With_SceneInfo_Block.rm +0 -0
  131. remarkable_annotations-0.1.0/tests/fixtures/rm/rmscene/With_SceneInfo_Block.rmapi.json +1 -0
  132. remarkable_annotations-0.1.0/tests/fixtures/rm/rmscene/test-crdt-ordering.page.json +1 -0
  133. remarkable_annotations-0.1.0/tests/fixtures/rm/rmscene/test-crdt-ordering.rm +0 -0
  134. remarkable_annotations-0.1.0/tests/fixtures/rm/rmscene/test-crdt-ordering.rmapi.json +1 -0
  135. remarkable_annotations-0.1.0/tests/geometry.rs +119 -0
  136. remarkable_annotations-0.1.0/tests/page.rs +153 -0
  137. remarkable_annotations-0.1.0/tests/reference/cloud-check.mjs +487 -0
  138. remarkable_annotations-0.1.0/tests/reference/dump.mjs +35 -0
  139. remarkable_annotations-0.1.0/tests/reference/fakecloud.mjs +223 -0
  140. remarkable_annotations-0.1.0/tests/reference/gen-fixtures.mjs +51 -0
  141. remarkable_annotations-0.1.0/tests/reference/gen-pdfs.py +105 -0
  142. remarkable_annotations-0.1.0/tests/reference/geometry-dump.mjs +78 -0
  143. remarkable_annotations-0.1.0/tests/reference/package-lock.json +194 -0
  144. remarkable_annotations-0.1.0/tests/reference/package.json +15 -0
  145. remarkable_annotations-0.1.0/tests/reference/page-dump.mjs +72 -0
  146. remarkable_annotations-0.1.0/tests/reference/plugin-helpers.mjs +118 -0
  147. remarkable_annotations-0.1.0/tests/scene.rs +106 -0
@@ -0,0 +1,67 @@
1
+ name: Upload npm package
2
+
3
+ # Publishes the WebAssembly build (wasm/) to npm as `remarkable-annotations`,
4
+ # from the same GitHub release as the Python packages (release.yml) but
5
+ # independently. Both use the version in [workspace.package] of Cargo.toml.
6
+ #
7
+ # npm trusted publishing (OIDC, no token, provenance generated) with staged
8
+ # publishing: the version goes live once a maintainer approves it on
9
+ # npmjs.com (2FA). On npmjs.com, package `remarkable-annotations` > Settings >
10
+ # Trusted Publisher: GitHub Actions, repository
11
+ # `bpiwowar/remarkable-annotations`, workflow `release-npm.yml`, environment
12
+ # `npm`. A first version must be published by hand before a trusted
13
+ # publisher can be set.
14
+ #
15
+ # workflow_dispatch: dry run (build and pack, nothing is published).
16
+ # "[skip npm]" in the release notes skips this workflow.
17
+
18
+ on:
19
+ release:
20
+ types: [created]
21
+ workflow_dispatch:
22
+
23
+ permissions:
24
+ contents: read
25
+
26
+ jobs:
27
+ npm:
28
+ if: ${{ github.event_name != 'release' || !contains(github.event.release.body, '[skip npm]') }}
29
+ runs-on: ubuntu-latest
30
+ environment: npm
31
+ permissions:
32
+ contents: read
33
+ id-token: write
34
+ steps:
35
+ - uses: actions/checkout@v5
36
+ - name: Check tag matches the workspace version
37
+ if: github.event_name == 'release'
38
+ run: |
39
+ tag="${GITHUB_REF_NAME#v}"
40
+ version=$(python3 -c 'import tomllib; print(tomllib.load(open("Cargo.toml", "rb"))["workspace"]["package"]["version"])')
41
+ if [ "$tag" != "$version" ]; then
42
+ echo "::error file=Cargo.toml::Release tag $GITHUB_REF_NAME does not match Cargo.toml version $version."
43
+ exit 1
44
+ fi
45
+ - uses: Swatinem/rust-cache@v2
46
+ with:
47
+ shared-key: wasm
48
+ save-if: false
49
+ # No registry-url: setup-node would then set a placeholder
50
+ # NODE_AUTH_TOKEN, which breaks OIDC publishing
51
+ - uses: actions/setup-node@v5
52
+ with:
53
+ node-version: '24'
54
+ - name: npm >= 11.15.0 (staged publishing)
55
+ run: npm install -g 'npm@^11.15.0' && npm --version
56
+ - uses: taiki-e/install-action@v2
57
+ with:
58
+ tool: wasm-pack@0.15.1
59
+ - name: Build the package
60
+ run: wasm/build-npm.sh "$GITHUB_WORKSPACE/wasm/pkg"
61
+ - name: Check the package
62
+ working-directory: wasm/pkg
63
+ run: npm publish --dry-run
64
+ - name: Stage for publication (approve on npmjs.com)
65
+ if: github.event_name == 'release'
66
+ working-directory: wasm/pkg
67
+ run: npm stage publish
@@ -0,0 +1,126 @@
1
+ name: Upload python packages
2
+
3
+ # The npm package (wasm/) is published by release-npm.yml from the same
4
+ # release, independently: a failure in one does not block the other.
5
+ #
6
+ # "[skip pypi]" in the release notes when the release is created skips
7
+ # building and publishing the Python packages (release notes are still
8
+ # generated), e.g. `gh release create v0.1.1 --notes "[skip pypi]"`.
9
+ #
10
+ # PyPI uses trusted publishing: on pypi.org, project remarkable-annotations >
11
+ # Publishing: GitHub, repository bpiwowar/remarkable-annotations, workflow
12
+ # release.yml, environment pypi.
13
+
14
+ on:
15
+ release:
16
+ types: [created]
17
+
18
+ jobs:
19
+ check-version:
20
+ runs-on: ubuntu-latest
21
+ steps:
22
+ - uses: actions/checkout@v5
23
+ - name: Check tag matches Cargo.toml version
24
+ run: |
25
+ tag="${GITHUB_REF_NAME#v}"
26
+ version=$(python3 -c 'import tomllib; print(tomllib.load(open("Cargo.toml", "rb"))["workspace"]["package"]["version"])')
27
+ if [ "$tag" != "$version" ]; then
28
+ echo "::error file=Cargo.toml::Release tag $GITHUB_REF_NAME does not match Cargo.toml version $version. Bump [workspace.package] version in Cargo.toml (and Cargo.lock), then recreate the release."
29
+ exit 1
30
+ fi
31
+ echo "Version $version matches tag $GITHUB_REF_NAME"
32
+
33
+ # abi3 wheels: one per platform, for every Python >= 3.10
34
+ wheels:
35
+ needs: check-version
36
+ if: ${{ !contains(github.event.release.body, '[skip pypi]') }}
37
+ runs-on: ${{ matrix.platform.runner }}
38
+ strategy:
39
+ matrix:
40
+ platform:
41
+ - { runner: ubuntu-latest, target: x86_64, name: linux-x86_64 }
42
+ - { runner: ubuntu-24.04-arm, target: aarch64, name: linux-aarch64 }
43
+ - { runner: windows-latest, target: x64, name: windows-x64 }
44
+ - { runner: macos-latest, target: x86_64-apple-darwin, name: macos-x86_64 }
45
+ - { runner: macos-latest, target: aarch64-apple-darwin, name: macos-aarch64 }
46
+ steps:
47
+ - uses: actions/checkout@v5
48
+ - uses: actions/setup-python@v6
49
+ with:
50
+ python-version: '3.12'
51
+ - name: Build wheel
52
+ uses: PyO3/maturin-action@v1
53
+ with:
54
+ target: ${{ matrix.platform.target }}
55
+ args: --release --out dist
56
+ sccache: 'true'
57
+ manylinux: auto
58
+ - uses: actions/upload-artifact@v6
59
+ with:
60
+ name: wheels-${{ matrix.platform.name }}
61
+ path: dist
62
+
63
+ sdist:
64
+ needs: check-version
65
+ if: ${{ !contains(github.event.release.body, '[skip pypi]') }}
66
+ runs-on: ubuntu-latest
67
+ steps:
68
+ - uses: actions/checkout@v5
69
+ - name: Build sdist
70
+ uses: PyO3/maturin-action@v1
71
+ with:
72
+ command: sdist
73
+ args: --out dist
74
+ - uses: actions/upload-artifact@v6
75
+ with:
76
+ name: wheels-sdist
77
+ path: dist
78
+
79
+ release:
80
+ name: Release
81
+ runs-on: ubuntu-latest
82
+ # Also runs (for the release notes) when the builds were skipped
83
+ if: ${{ !cancelled() && !failure() && startsWith(github.ref, 'refs/tags/') }}
84
+ needs: [wheels, sdist]
85
+ environment: pypi
86
+ permissions:
87
+ contents: write
88
+ id-token: write
89
+ steps:
90
+ - uses: actions/checkout@v5
91
+ with:
92
+ fetch-depth: 0
93
+ - name: Generate changelog for this release
94
+ uses: orhun/git-cliff-action@v4
95
+ with:
96
+ config: cliff.toml
97
+ args: --latest --strip header
98
+ env:
99
+ OUTPUT: release-notes.md
100
+ - name: List the registries in the release notes
101
+ env:
102
+ SKIP_PYPI: ${{ contains(github.event.release.body, '[skip pypi]') }}
103
+ SKIP_NPM: ${{ contains(github.event.release.body, '[skip npm]') }}
104
+ run: |
105
+ version=${GITHUB_REF_NAME#v}
106
+ registries=""
107
+ [ "$SKIP_PYPI" = true ] || registries="[PyPI](https://pypi.org/project/remarkable-annotations/$version/)"
108
+ [ "$SKIP_NPM" = true ] || registries="${registries:+$registries, }[npm](https://www.npmjs.com/package/remarkable-annotations/v/$version)"
109
+ {
110
+ echo "**Published to:** ${registries:-none}"
111
+ echo
112
+ cat release-notes.md
113
+ } > release-notes.tmp && mv release-notes.tmp release-notes.md
114
+ - name: Update release notes
115
+ uses: softprops/action-gh-release@v2
116
+ with:
117
+ body_path: release-notes.md
118
+ - uses: actions/download-artifact@v7
119
+ if: ${{ !contains(github.event.release.body, '[skip pypi]') }}
120
+ with:
121
+ path: dist
122
+ pattern: wheels-*
123
+ merge-multiple: true
124
+ - name: Publish to PyPI
125
+ if: ${{ !contains(github.event.release.body, '[skip pypi]') }}
126
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,92 @@
1
+ name: CI test
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ # A new push to the same branch/PR supersedes any run still in progress.
10
+ concurrency:
11
+ group: ${{ github.workflow }}-${{ github.ref }}
12
+ cancel-in-progress: true
13
+
14
+ jobs:
15
+ rust:
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: actions/checkout@v5
19
+ - uses: Swatinem/rust-cache@v2
20
+ with:
21
+ save-if: ${{ github.ref == 'refs/heads/main' }}
22
+ - run: cargo fmt --all --check
23
+ - run: cargo clippy --all-targets --features python -- -D warnings
24
+ - run: cargo test
25
+
26
+ wasm:
27
+ runs-on: ubuntu-latest
28
+ steps:
29
+ - uses: actions/checkout@v5
30
+ - uses: Swatinem/rust-cache@v2
31
+ with:
32
+ # also restored by release-npm.yml
33
+ shared-key: wasm
34
+ save-if: ${{ github.ref == 'refs/heads/main' }}
35
+ - uses: actions/setup-node@v5
36
+ with:
37
+ node-version: '22'
38
+ - uses: taiki-e/install-action@v2
39
+ with:
40
+ tool: wasm-pack@0.15.1
41
+ - name: WebAssembly build against the fixtures
42
+ run: wasm/tests/check.sh
43
+
44
+ python:
45
+ runs-on: ubuntu-latest
46
+ steps:
47
+ - uses: actions/checkout@v5
48
+ - uses: Swatinem/rust-cache@v2
49
+ with:
50
+ save-if: ${{ github.ref == 'refs/heads/main' }}
51
+ - uses: astral-sh/setup-uv@v6
52
+ - name: Build and test
53
+ run: |
54
+ uv venv --python 3.12
55
+ uv pip install maturin pytest
56
+ uv run --no-project maturin develop --uv --release
57
+ uv run --no-project pytest python -v
58
+
59
+ reference:
60
+ # The rmapi-js reference files are up to date with the fixtures
61
+ runs-on: ubuntu-latest
62
+ steps:
63
+ - uses: actions/checkout@v5
64
+ # rmapi-js uses Uint8Array.prototype.toHex (Node >= 25): on older Node it
65
+ # leaves author tables unparsed
66
+ - uses: actions/setup-node@v5
67
+ with:
68
+ node-version: '26'
69
+ - working-directory: tests/reference
70
+ run: npm ci && npm run dump
71
+ - run: git diff --exit-code tests/fixtures
72
+
73
+ cloud:
74
+ # The cloud client against rmapi-js, on fake clouds
75
+ runs-on: ubuntu-latest
76
+ steps:
77
+ - uses: actions/checkout@v5
78
+ - uses: Swatinem/rust-cache@v2
79
+ with:
80
+ shared-key: wasm
81
+ save-if: false
82
+ # rmapi-js needs Uint8Array.prototype.toHex (Node >= 25)
83
+ - uses: actions/setup-node@v5
84
+ with:
85
+ node-version: '26'
86
+ - uses: taiki-e/install-action@v2
87
+ with:
88
+ tool: wasm-pack@0.15.1
89
+ - name: Build the WebAssembly bindings for Node
90
+ run: wasm-pack build --dev --target nodejs --out-dir "$RUNNER_TEMP/pkg" wasm
91
+ - working-directory: tests/reference
92
+ run: npm ci && node cloud-check.mjs "$RUNNER_TEMP/pkg"
@@ -0,0 +1,12 @@
1
+ /target
2
+ __pycache__/
3
+ .pytest_cache/
4
+ *.py[cod]
5
+ *.so
6
+ .venv/
7
+ dist/
8
+ .DS_Store
9
+ node_modules/
10
+
11
+ # npm package built by wasm/build-npm.sh
12
+ /wasm/pkg/
@@ -0,0 +1,47 @@
1
+ default_install_hook_types:
2
+ - pre-commit
3
+ - commit-msg
4
+
5
+ # fixtures are byte-exact files: never rewrite them
6
+ exclude: ^tests/fixtures/
7
+
8
+ repos:
9
+ - repo: https://github.com/pre-commit/pre-commit-hooks
10
+ rev: v6.0.0
11
+ hooks:
12
+ - id: check-yaml
13
+ - id: end-of-file-fixer
14
+ - id: trailing-whitespace
15
+ - repo: https://github.com/pre-commit/pygrep-hooks
16
+ rev: v1.10.0
17
+ hooks:
18
+ - id: python-check-blanket-noqa
19
+ - id: python-no-eval
20
+ - repo: local
21
+ hooks:
22
+ - id: no-todo
23
+ name: no TODO/FIXME markers
24
+ entry: '(TODO|FIXME):'
25
+ language: pygrep
26
+ types: [text]
27
+ - id: rustfmt
28
+ name: rustfmt
29
+ entry: rustfmt --edition 2021
30
+ language: system
31
+ types: [rust]
32
+ - repo: https://github.com/doublify/pre-commit-rust
33
+ rev: v1.0
34
+ hooks:
35
+ - id: cargo-check
36
+ - repo: https://github.com/astral-sh/ruff-pre-commit
37
+ rev: v0.11.4
38
+ hooks:
39
+ - id: ruff
40
+ args: [--fix]
41
+ - id: ruff-format
42
+ - repo: https://github.com/compilerla/conventional-pre-commit
43
+ rev: v4.3.0
44
+ hooks:
45
+ - id: conventional-pre-commit
46
+ stages:
47
+ - commit-msg