Skip to content

Commit 264114d

Browse files
authored
Add xeus cpp jupyter notebook with sparrow examples (#570)
1 parent e5d4d1f commit 264114d

File tree

9 files changed

+515
-59
lines changed

9 files changed

+515
-59
lines changed

.github/workflows/build-docs.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Build Doxygen Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- "*"
10+
workflow_dispatch:
11+
workflow_call:
12+
13+
defaults:
14+
run:
15+
shell: bash -e -l {0}
16+
17+
jobs:
18+
build-docs:
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
25+
- name: Set conda environment
26+
uses: mamba-org/setup-micromamba@main
27+
with:
28+
environment-name: myenv
29+
environment-file: environment-dev.yml
30+
init-shell: bash
31+
cache-downloads: true
32+
33+
- name: Configure using CMake
34+
run: cmake -G Ninja -Bbuild -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DBUILD_DOCS=ON
35+
36+
- name: Build docs target
37+
run: cmake --build build --target docs
38+
39+
- name: Upload docs artifact
40+
uses: actions/upload-artifact@v4
41+
with:
42+
name: doxygen-docs
43+
path: build/docs/html
44+
retention-days: 30
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Build JupyterLite
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
# pull_request:
8+
# branches:
9+
# - "*"
10+
workflow_dispatch:
11+
workflow_call:
12+
13+
jobs:
14+
build-jupyterlite:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Setup Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: "3.12"
24+
25+
- name: Install mamba
26+
uses: mamba-org/setup-micromamba@v2
27+
with:
28+
environment-file: jupyterlite_build_environment.yml
29+
cache-environment: true
30+
31+
- name: Build the JupyterLite site
32+
shell: bash -l {0}
33+
run: |
34+
jupyter lite build --contents notebooks --output-dir dist
35+
36+
- name: Upload JupyterLite artifact
37+
uses: actions/upload-artifact@v4
38+
with:
39+
name: jupyterlite-site
40+
path: ./dist
41+
retention-days: 7
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
# pull_request:
8+
# branches:
9+
# - "*"
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
18+
concurrency:
19+
group: "pages"
20+
cancel-in-progress: false
21+
22+
jobs:
23+
# Call the build workflows
24+
build-docs:
25+
uses: ./.github/workflows/build-docs.yaml
26+
27+
build-jupyterlite:
28+
uses: ./.github/workflows/build-jupyterlite.yaml
29+
30+
# Deploy job that depends on the build workflows
31+
deploy:
32+
needs: [build-docs, build-jupyterlite]
33+
runs-on: ubuntu-latest
34+
35+
environment:
36+
name: github-pages
37+
url: ${{ steps.deployment.outputs.page_url }}
38+
39+
steps:
40+
- name: Checkout
41+
uses: actions/checkout@v4
42+
43+
- name: Download docs artifact from build-docs workflow
44+
uses: actions/download-artifact@v4
45+
with:
46+
name: doxygen-docs
47+
path: ./site
48+
49+
- name: Download JupyterLite artifact from build-jupyterlite workflow
50+
uses: actions/download-artifact@v4
51+
with:
52+
name: jupyterlite-site
53+
path: ./site/jupyterlite
54+
55+
- name: Upload combined site artifact
56+
uses: actions/upload-pages-artifact@v3
57+
with:
58+
path: ./site
59+
60+
- name: Deploy to GitHub Pages
61+
id: deployment
62+
uses: actions/deploy-pages@v4

.github/workflows/docs.yaml

Lines changed: 0 additions & 59 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ C++20 idiomatic APIs for the Apache Arrow Columnar Format
1414
`sparrow` is an implementation of the Apache Arrow Columnar format in C++. It provides array structures
1515
with idiomatic APIs and convenient conversions from and to the [C interface](https://arrow.apache.org/docs/dev/format/CDataInterface.html#structure-definitions).
1616

17+
Try it online without any installation ! [![Try Sparrow in JupyterLite](https://jupyterlite.rtfd.io/en/latest/_static/badge.svg)](https://man-group.github.io/sparrow/jupyterlite)
18+
1719
`sparrow` requires a modern C++ compiler supporting C++20.
1820

1921
## Installation

docs/source/main_page.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Introduction
66

77
Sparrow stands for "Simple Arrow" and is an implementation of the [Apache Arrow Columnar format](https://arrow.apache.org/docs/format/Columnar.html) in C++20. It provides array structures with idiomatic APIs and convenient conversions from and to the [C interface](https://arrow.apache.org/docs/dev/format/CDataInterface.html#structure-definitions).
88

9+
Try it online without any installation ! [![Try Sparrow in JupyterLite](https://jupyterlite.rtfd.io/en/latest/_static/badge.svg)](./jupyterlite/)
10+
911
Sparrow requires a modern C++ compiler supporting C++20:
1012

1113
| Compiler | Version |

environment.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: xeus-kernel
2+
channels:
3+
- https://repo.prefix.dev/emscripten-forge-dev
4+
- https://repo.prefix.dev/conda-forge
5+
dependencies:
6+
- xeus-cpp
7+
- sparrow

jupyterlite_build_environment.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: build-env
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- python
6+
- pip
7+
- jupyter_server
8+
- jupyterlite-core >=0.6
9+
- jupyterlite-xeus >=4

0 commit comments

Comments
 (0)