Skip to content

Commit f76c05e

Browse files
committed
Merge branch 'main' into franknoirot/7222/inlaid-sidebar
2 parents 9ae9116 + 9445feb commit f76c05e

File tree

283 files changed

+9117
-6347
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

283 files changed

+9117
-6347
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Auto-update PyO3 stubs
2+
on:
3+
pull_request:
4+
branches: [main] # PRs _into_ main
5+
paths:
6+
- "rust/kcl-python-bindings/**" # run only when Rust/Python code changes
7+
- ".github/workflows/update-python-stubs.yml"
8+
permissions:
9+
contents: write # allow committing back to the PR branch
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
12+
cancel-in-progress: true
13+
jobs:
14+
build-and-stub:
15+
runs-on: namespace-profile-ubuntu-2-cores
16+
defaults:
17+
run:
18+
shell: bash -eux {0}
19+
steps:
20+
- uses: actions/create-github-app-token@v2
21+
id: app-token
22+
with:
23+
# required
24+
app-id: ${{ secrets.GH_ORG_APP_ID }}
25+
private-key: ${{ secrets.GH_ORG_APP_PRIVATE_KEY }}
26+
owner: ${{ github.repository_owner }}
27+
- name: Checkout the repo
28+
uses: actions/checkout@v4
29+
with:
30+
submodules: recursive
31+
token: ${{ steps.app-token.outputs.token }}
32+
ref: ${{ github.head_ref }}
33+
- name: Install toolchain + maturin
34+
uses: PyO3/maturin-action@v1 # Rust + Python + maturin
35+
with:
36+
working-directory: rust/kcl-python-bindings
37+
- name: Install deps & dev-install the crate
38+
run: |
39+
pip install pyo3-stubgen
40+
pip install --no-cache-dir --editable ./rust/kcl-python-bindings
41+
# ------------------------------------------------------------
42+
# 2. Re-generate the .pyi
43+
# ------------------------------------------------------------
44+
- name: Generate stubs
45+
run: |
46+
mkdir -p rust/kcl-python-bindings/stubs
47+
pyo3-stubgen kcl stubs
48+
ls -la stubs
49+
cp stubs/* rust/kcl-python-bindings/stubs/
50+
# ------------------------------------------------------------
51+
# 3. Commit & push if anything changed
52+
# ------------------------------------------------------------
53+
- name: Check for diff
54+
id: git-status
55+
run: |
56+
git add rust/kcl-python-bindings/stubs/*.pyi
57+
if git diff --cached --quiet; then
58+
echo "changed=false" >> "$GITHUB_OUTPUT"
59+
else
60+
echo "changed=true" >> "$GITHUB_OUTPUT"
61+
fi
62+
- name: Commit & push
63+
if: steps.git-status.outputs.changed == 'true'
64+
run: |
65+
git config --global user.name 'github-actions[bot]'
66+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
67+
git commit -m "chore(stubs): auto-update PyO3 .pyi"
68+
git push --force-with-lease

docs/kcl-lang/settings/project.md

Lines changed: 17 additions & 0 deletions

docs/kcl-std/functions/std-appearance-hexString.md

Lines changed: 52 additions & 4 deletions

docs/kcl-std/functions/std-array-concat.md

Lines changed: 26 additions & 2 deletions

docs/kcl-std/functions/std-array-count.md

Lines changed: 13 additions & 1 deletion

docs/kcl-std/functions/std-array-map.md

Lines changed: 26 additions & 2 deletions

docs/kcl-std/functions/std-array-pop.md

Lines changed: 13 additions & 1 deletion

docs/kcl-std/functions/std-array-push.md

Lines changed: 13 additions & 1 deletion

docs/kcl-std/functions/std-array-reduce.md

Lines changed: 39 additions & 3 deletions

docs/kcl-std/functions/std-assert.md

Lines changed: 1 addition & 0 deletions

0 commit comments

Comments
 (0)