From ff78cf731c4f2d5ddc8c5ccc7561db9af85cfe83 Mon Sep 17 00:00:00 2001 From: Jakob van Santen Date: Tue, 19 Sep 2023 16:33:09 +0200 Subject: [PATCH] install stubs as stub package There doesn't seem to be another way to make mypy find these. --- .github/workflows/ci.yml | 2 +- CMakeLists.txt | 2 +- typings/{photospline.pyi => photospline-stubs/__init__.pyi} | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename typings/{photospline.pyi => photospline-stubs/__init__.pyi} (100%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 545d7dd..42194d4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: python-version: "3.11" - run: pip install numpy mypy - run: sudo apt-get install libsuitesparse-dev libbtbb-dev liblapack-dev libcfitsio-dev libmetis-dev libgsl-dev - - run: cmake -DPython_EXECUTABLE=$(which python) . && make && sudo make install + - run: cmake -DPython_EXECUTABLE=$(which python) . && make pyphotospline && sudo make install - run: mypy test/*.py linux: runs-on: ubuntu-latest diff --git a/CMakeLists.txt b/CMakeLists.txt index a85739d..fa36333 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -203,7 +203,7 @@ print(pl.relative_to(d))" INSTALL(TARGETS pyphotospline LIBRARY DESTINATION ${PYTHON_MODULE_DIR}) IF(${Python_VERSION} VERSION_GREATER_EQUAL "3.9") MESSAGE("-- + typing stubs") - INSTALL(FILES typings/photospline.pyi DESTINATION ${PYTHON_MODULE_DIR}) + INSTALL(FILES typings/photospline-stubs/__init__.pyi DESTINATION ${PYTHON_MODULE_DIR}/photospline-stubs) ENDIF() ELSEIF(NOT PYTHON_FOUND) MESSAGE("-- Python not found, skipping build of python module") diff --git a/typings/photospline.pyi b/typings/photospline-stubs/__init__.pyi similarity index 100% rename from typings/photospline.pyi rename to typings/photospline-stubs/__init__.pyi