diff --git a/.github/update_stub.sh b/.github/update_stub.sh index 5e6875ff..3f72bc3c 100755 --- a/.github/update_stub.sh +++ b/.github/update_stub.sh @@ -13,6 +13,14 @@ set -eu -o pipefail # we are in the source directory, .github/ this_dir=$(cd $(dirname $0) && pwd) -pybind11-stubgen --exit-code --enum-class-locations="GrowthStrategy:amrex.space1d" -o ${this_dir}/../src/ amrex.space1d -pybind11-stubgen --exit-code --enum-class-locations="GrowthStrategy:amrex.space2d" -o ${this_dir}/../src/ amrex.space2d -pybind11-stubgen --exit-code --enum-class-locations="GrowthStrategy:amrex.space3d" -o ${this_dir}/../src/ amrex.space3d +pybind11-stubgen --sort-by=definition --exit-code --enum-class-locations="GrowthStrategy:amrex.space1d" -o ${this_dir}/../src/ amrex.space1d +pybind11-stubgen --sort-by=definition --exit-code --enum-class-locations="GrowthStrategy:amrex.space2d" -o ${this_dir}/../src/ amrex.space2d +pybind11-stubgen --sort-by=definition --exit-code --enum-class-locations="GrowthStrategy:amrex.space3d" -o ${this_dir}/../src/ amrex.space3d + +sed -i 's/amrex.space1d.GrowthStrategy/GrowthStrategy/g' src/amrex/space1d/amrex_1d_pybind/__init__.pyi +sed -i 's/amrex.space2d.GrowthStrategy/GrowthStrategy/g' src/amrex/space2d/amrex_2d_pybind/__init__.pyi +sed -i 's/amrex.space3d.GrowthStrategy/GrowthStrategy/g' src/amrex/space3d/amrex_3d_pybind/__init__.pyi + +sed -i 's/= GrowthStrategy.Poisson/= "GrowthStrategy.Poisson"/g' src/amrex/space1d/amrex_1d_pybind/__init__.pyi +sed -i 's/= GrowthStrategy.Poisson/= "GrowthStrategy.Poisson"/g' src/amrex/space2d/amrex_2d_pybind/__init__.pyi +sed -i 's/= GrowthStrategy.Poisson/= "GrowthStrategy.Poisson"/g' src/amrex/space3d/amrex_3d_pybind/__init__.pyi diff --git a/.github/workflows/stubs.yml b/.github/workflows/stubs.yml index df0cb83a..3080e2b8 100644 --- a/.github/workflows/stubs.yml +++ b/.github/workflows/stubs.yml @@ -62,7 +62,8 @@ jobs: ccache -z python3 -m pip install -U pip setuptools[core] wheel - python3 -m pip install -U mpi4py pytest pybind11-stubgen pre-commit + python3 -m pip install -U mpi4py pytest pre-commit + python3 -m pip install -U "pybind11-stubgen @ git+https://github.com/ax3l/pybind11-stubgen.git@fix-class-sorting" cmake -S . -B build -DAMReX_SPACEDIM="1;2;3" -DAMReX_EB=ON -DpyAMReX_IPO=OFF cmake --build build -j 4 --target pip_install diff --git a/docs/requirements.txt b/docs/requirements.txt index b545f286..9f98e688 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -7,7 +7,7 @@ breathe docutils>=0.17.1 numpy # in public APIs -pybind11-stubgen # type hints in pyi files +pybind11-stubgen @ git+https://github.com/ax3l/pybind11-stubgen.git@fix-class-sorting # type hints in pyi files pygments recommonmark # Attention: we need to track the resolution of