From 89fc5022489d01352f154bfc5581367d3ce3377d Mon Sep 17 00:00:00 2001 From: Andrew Annex Date: Thu, 4 Sep 2025 09:12:04 -0700 Subject: [PATCH] trying to make editable installs work --- .gitignore | 14 +++++++++++++- CMakeLists.txt | 13 +++++++++---- pyproject.toml | 4 ++++ src/spiceypy/utils/libspicehelper.py | 9 ++++++--- 4 files changed, 32 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 07e68f0f..a2555f8d 100644 --- a/.gitignore +++ b/.gitignore @@ -78,4 +78,16 @@ spiceypy/utils/cmake/cspice/*.cmake *.dylib *.so -wheelhouse/ \ No newline at end of file +# cibuildwheel +wheelhouse/ + +# CMake +_deps/ +CMakeCache.txt +CMakeFiles/ +Makefile +cmake_install.cmake +install_manifest.txt +CTestTestfile.cmake +_CPack_Packages/ +.skbuild-info.json \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index e497cc9b..d53ebcc9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,10 +37,10 @@ else() ) FetchContent_MakeAvailable(cspice) - # disable versioned/ + # disable versioned install set_target_properties(cspice PROPERTIES - VERSION "" # no libmyclibrary.so.X.Y.Z - SOVERSION "" # no libmyclibrary.so.X + VERSION "" # no so.X.Y.Z + SOVERSION "" # no so.X NO_SONAME ON # don't encode a soname ) # The target name depends on your cspice CMake setup @@ -94,4 +94,9 @@ elseif(UNIX) endif() # install cyice -install(TARGETS cyice DESTINATION spiceypy/cyice/) \ No newline at end of file +install( + TARGETS + cyice + DESTINATION + spiceypy/cyice/ +) \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 71c5c425..7a4e7c6f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -97,6 +97,10 @@ doc = [ [tool.scikit-build] logging.level = "INFO" cmake.build-type = "Release" +build-dir = "build" +editable.mode = "redirect" +editable.rebuild = false +editable.verbose = true # TODO probably will want to consider excluding tests due to changing standards sdist.include = [ diff --git a/src/spiceypy/utils/libspicehelper.py b/src/spiceypy/utils/libspicehelper.py index c87512af..f4516115 100644 --- a/src/spiceypy/utils/libspicehelper.py +++ b/src/spiceypy/utils/libspicehelper.py @@ -32,7 +32,8 @@ import logging if os.environ.get("SPICEYPY_LOGLEVEL"): - logging.basicConfig(level=os.environ["SPICEYPY_LOGLEVEL"].upper()) + print('Logging was set') + logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) @@ -105,8 +106,10 @@ def load_cspice() -> tuple[CDLL, str]: shared_name = "libcspice.wasm" case _: shared_name = "libcspice.so" - - relpath = Path(__file__).resolve().parent / shared_name + parent = Path(__file__).resolve().parent + logger.info(f'SpiceyPy parent: {parent}') + relpath = parent / shared_name + logger.info(f'SpiceyPy relpath: {relpath}') if relpath.exists(): libspice_path = str(relpath) logger.info(f"Using fallback library next to module: {libspice_path}")