Unverified Commit c499eba3 authored by Kelvin Rodriguez's avatar Kelvin Rodriguez Committed by GitHub
Browse files

Merging 1.0 changes into main (#22)



* Update version

* Comment out pipeline for now

* Add cspice cmake file

* Builds with cspice

* Add cereal cmake

* Update files for conda build

* Update meta.yaml

* Rename FindCSpice.cmake

* fixed issue with FMT constevals causing compile errors with C++20

* typos

* yaml linting fail

* ci fix

* unpinned python

* ci fix

* ci fix

* ci fix

* tweaking cmakelists

* ci fix

* ci fix

* ci fix

* ci fix

* ci fix

* ci fix

* updating submodukles

* debugging things

* changed print to log

* changed debug level

* disabled conf test

* removed rm -rf

* updated schema verification

* changed install dir

* changed install dir

* changed install dir

* changed install dir

* changed install dir

* changed install dir

* changed install dir

* changed install dir

* removed 3.8

---------

Co-authored-by: default avatarChristine Kim <chkim@usgs.gov>
parent c35c9d82
Loading
Loading
Loading
Loading
+69 −70
Original line number Diff line number Diff line
@@ -8,17 +8,17 @@ env:

jobs:
  build-library:

    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest]
        python-version: ["3.8", "3.9", "3.10", "3.11"]
        python-version: ["3.9", "3.10", "3.11"]
    defaults:
      run:
        shell: bash -l {0}
    env:
      SSPICE_DEBUG: y
      SPICEQL_LOG_LEVEL: DEBUG
    steps:
      - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
        with:
@@ -28,7 +28,7 @@ jobs:
          miniforge-version: latest
          use-mamba: true
          channels: conda-forge
          activate-environment: ale
          activate-environment: spiceql
          environment-file: environment.yml
          auto-activate-base: false
          auto-update-conda: true
@@ -37,19 +37,18 @@ jobs:
        run: |
          conda list
      - name: Configure CMake
        working-directory: ${{github.workspace}}/build
        run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSPICEQL_BUILD_DOCS=OFF -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install
      - name: Build
        working-directory: ${{github.workspace}}/build
        # Execute the build.  You can specify a specific target with "--target <NAME>"
        run: |
          cmake --build . --config $BUILD_TYPE
          mkdir -p build
          cd build
          cmake -DCMAKE_BUILD_TYPE=RELEASE -DSPICEQL_BUILD_DOCS=OFF -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX ..
          cmake --build .
      
      - name: Test
        working-directory: ${{github.workspace}}/build
        # Execute tests defined by the CMake configuration.
        # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
        run: ctest -VV -C $BUILD_TYPE
        run: | 
          ctest -VV  
  
      - name: Install
        working-directory: ${{github.workspace}}/build
@@ -58,26 +57,25 @@ jobs:
          cmake --install . --config $BUILD_TYPE
  
      - name: Check install
        working-directory: ${{github.workspace}}/install
        working-directory: ${{github.workspace}}
        # Check that the library installed properly
        run: |
            if [ "$RUNNER_OS" == "macOS" ]; then
              test -e lib/libSpiceQL.dylib
              test -e $CONDA_PREFIX/lib/libSpiceQL.dylib
            elif [ "$RUNNER_OS" == "Linux" ]; then
              test -e lib/libSpiceQL.so
              test -e $CONDA_PREFIX/lib/libSpiceQL.so
            fi
            test -e include/SpiceQL/spiceql.h
            rm -rf ${{github.workspace}}/build
            python -c "import pyspiceql"
            test -e $CONDA_PREFIX/include/SpiceQL/spiceql.h
            $CONDA_PREFIX/bin/python -c "import pyspiceql"
  
      # compair all json files against the schema 
      - name: check json files
        working-directory: ${{github.workspace}}/SpiceQL/db/schema
        working-directory: ${{github.workspace}}/SpiceQL/db/
        run: |
          for file in *.json;
              do
              pwd
              jsonschema --instance "$file" spiceMissionSchmea.schema.json 
              check-jsonschema $file --schemafile schema/spiceMissionSchmea.schema.json 
          done;
  
  build-docs:
@@ -91,6 +89,7 @@ jobs:
        with:
            miniconda-version: "latest"
            activate-environment: spiceql
            channels: conda-forge
            environment-file: environment.yml
            auto-activate-base: false
            auto-update-conda: true
+2 −0
Original line number Diff line number Diff line
@@ -42,3 +42,5 @@ release.
### Fixed

### Changed
- SpiceQL source code
- Required administrative files
+9 −11
Original line number Diff line number Diff line
include(CMakeDependentOption)
cmake_minimum_required(VERSION 3.10)
project(SpiceQL VERSION 0.0.1 DESCRIPTION "Syntax Sugar for cspice")
project(SpiceQL VERSION 1.0.0 DESCRIPTION "Syntax Sugar for cspice")

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

@@ -60,6 +60,7 @@ if(SPICEQL_BUILD_LIB)
  find_package(fmt REQUIRED)
  find_package(cereal REQUIRED)
  find_package(spdlog REQUIRED)
  find_package(hiredis REQUIRED)

  set(SPICEQL_INSTALL_INCLUDE_DIR "include/SpiceQL")
  set(SPICEQL_SRC_FILES   ${CMAKE_CURRENT_SOURCE_DIR}/SpiceQL/src/spiceql.cpp 
@@ -80,7 +81,8 @@ if(SPICEQL_BUILD_LIB)

  set(SPICEQL_PRIVATE_HEADER_FILES ${SPICEQL_BUILD_INCLUDE_DIR}/memo.h)

  set(SPICEQL_CONFIG_FILES ${CMAKE_CURRENT_SOURCE_DIR}/SpiceQL/db/apollo16.json
  set(SPICEQL_CONFIG_FILES ${CMAKE_CURRENT_SOURCE_DIR}/SpiceQL/db/apollo15.json 
                           ${CMAKE_CURRENT_SOURCE_DIR}/SpiceQL/db/apollo16.json
                           ${CMAKE_CURRENT_SOURCE_DIR}/SpiceQL/db/apollo17.json
                           ${CMAKE_CURRENT_SOURCE_DIR}/SpiceQL/db/base.json
                           ${CMAKE_CURRENT_SOURCE_DIR}/SpiceQL/db/cassini.json
@@ -100,7 +102,6 @@ if(SPICEQL_BUILD_LIB)
                           ${CMAKE_CURRENT_SOURCE_DIR}/SpiceQL/db/viking1.json
                           ${CMAKE_CURRENT_SOURCE_DIR}/SpiceQL/db/viking2.json)

  
  set(SPICEQL_KERNELS ${CMAKE_CURRENT_SOURCE_DIR}/SpiceQL/db/kernels/naif0011.tls)

  add_library(SpiceQL SHARED ${SPICEQL_SRC_FILES})
@@ -109,11 +110,10 @@ if(SPICEQL_BUILD_LIB)
                                  VERSION ${PROJECT_VERSION}
                                  SOVERSION 0)


  target_compile_definitions(SpiceQL PRIVATE SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_TRACE 
                                     PUBLIC -D_SOURCE_PREFIX="${CMAKE_CURRENT_SOURCE_DIR}")
  
  message(STATUS "redis++ inc: "  ${hiredis_INCLUDE_DIRS})
  message(STATUS "redis++ inc: "  ${HIREDIS_INCLUDE_DIRS})
  target_include_directories(SpiceQL
                            PUBLIC
                            $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/SpiceQL/include>
@@ -125,12 +125,11 @@ if(SPICEQL_BUILD_LIB)

  target_link_libraries(SpiceQL
                        PUBLIC
                        ghc_filesystem
                        fmt::fmt-header-only
                        nlohmann_json::nlohmann_json
                        PRIVATE
                        redis++ 
                        CSpice::cspice
                        cspice
                        spdlog::spdlog_header_only
                        )
   
@@ -155,9 +154,8 @@ if(SPICEQL_BUILD_LIB)
  # Install the shipped kernels
  install(FILES ${SPICEQL_KERNELS} DESTINATION "etc/SpiceQL/db/kernels")


  # Install the library
  install(TARGETS SpiceQL nlohmann_json
  install(TARGETS SpiceQL nlohmann_json ghc_filesystem
          EXPORT spiceQLTargets
          LIBRARY  DESTINATION ${CMAKE_INSTALL_LIBDIR}
          INCLUDES DESTINATION ${SPICEQL_INSTALL_INCLUDE_DIR})
+10 −0
Original line number Diff line number Diff line
@@ -95,3 +95,13 @@ int result2 = func_memoed(3);

assert(result1 == result2);
```

## How to Pull a Release
1. Create a branch with the new version name (e.g., `1.0`)
2. Update the version info in following files:
  - `code.json` - Append to the metadata with the updated version info
  - `CMakeLists.txt` - Update the project `VERSION` value
  - `CHANGELOG.md` - Create a new section with the version number, date, and changes made in the upcoming release
  - `docs/conf.py` - Update the version
  - `recipe/meta.yaml` - Update the package version
3. Tag a release candidate from the version branch
+3 −3
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@

#include <fmt/format.h>

#include "SpiceUsr.h"
#include <SpiceUsr.h>

#include "io.h"
#include "utils.h"
@@ -238,9 +238,9 @@ namespace SpiceQL {
      string formatString = (isComment) ? "{}\n" : "( '{}' // )";

      for(int i = 0; i < s.size()/maxLen; i++) {
        newString.append(fmt::format(formatString, s.substr(i*maxLen, maxLen)) + "\n");
        newString.append(fmt::format(fmt::runtime(formatString), s.substr(i*maxLen, maxLen)) + "\n");
      }
      newString.append(fmt::format(formatString, s.substr(s.size()-(s.size()%maxLen), s.size()%maxLen)));
      newString.append(fmt::format(fmt::runtime(formatString), s.substr(s.size()-(s.size()%maxLen), s.size()%maxLen)));

      return newString;
    };
Loading