-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Copyright 2021-2023 The AMReX Community | ||
# | ||
# This script updates the .pyi stub files for documentation and interactive use. | ||
# To run this script, pyAMReX needs to be installed (all dimensions) and importable. | ||
# | ||
# Authors: Axel Huebl | ||
# License: BSD-3-Clause-LBNL | ||
# | ||
|
||
# we are in the source directory, .github/ | ||
this_dir=$(cd $(dirname $0) && pwd) | ||
|
||
pybind11-stubgen --ignore-all-errors -o ${this_dir}/../src/amrex/ amrex.space1d | ||
pybind11-stubgen --ignore-all-errors -o ${this_dir}/../src/amrex/ amrex.space2d | ||
pybind11-stubgen --ignore-all-errors -o ${this_dir}/../src/amrex/ amrex.space3d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: 🔄 Update Stub Files | ||
|
||
# This workflow updates the .pyi stub files for documentation and interactive use. | ||
|
||
on: [push, pull_request] | ||
|
||
concurrency: | ||
group: ${{ github.ref }}-${{ github.head_ref }}-stubs | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
# Build and install libamrex as AMReX CMake project | ||
stubs: | ||
name: Stubs | ||
runs-on: ubuntu-22.04 | ||
env: | ||
CC: gcc | ||
CXX: g++ | ||
CXXFLAGS: "-O1" | ||
if: github.event.pull_request.draft == false | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
name: Install Python | ||
with: | ||
python-version: '3.9' | ||
- name: Dependencies | ||
run: .github/workflows/dependencies/gcc10.sh | ||
- name: Build & Install | ||
run: | | ||
python3 -m pip install -U pip setuptools wheel pytest pybind11-stubgen | ||
cmake -S . -B build -DAMReX_SPACEDIM="1;2;3" | ||
cmake --build build -j 2 --target pip_install | ||
- name: Update Stubs | ||
run: | | ||
.github/update_stub.sh | ||
- name: Update Install | ||
run: | | ||
cmake --build build -j 2 --target pip_install | ||
- name: Unit tests | ||
run: | | ||
mpiexec -np 1 python3 -m pytest tests/ | ||
- uses: stefanzweifel/git-auto-commit-action@v4 | ||
name: Commit Updated Stub Files | ||
with: | ||
commit_message: Updat Stub Files |