Skip to content
Snippets Groups Projects
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
Branches
Tags
No related merge requests found
Showing
with 273 additions and 115 deletions
......@@ -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
......
......@@ -42,3 +42,5 @@ release.
### Fixed
### Changed
- SpiceQL source code
- Required administrative files
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})
......
......@@ -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,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;
};
......
......@@ -7,7 +7,12 @@ else()
set(CMAKE_CXX_STANDARD 17)
endif()
find_package(CSpice REQUIRED)
get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
foreach(dir ${dirs})
message(STATUS "dir='${dir}'")
endforeach()
set(SPICEQL_TEST_DIRECTORY ${CMAKE_SOURCE_DIR}/SpiceQL/tests/)
# collect all of the test sources
......@@ -30,7 +35,7 @@ target_link_libraries(runSpiceQLTests
PRIVATE
SpiceQL
redis++
CSpice::cspice
cspice
gtest
gmock
Threads::Threads
......
......@@ -143,13 +143,17 @@ TEST_F(TestConfig, FunctionalTestsConfigKeySearch) {
}
}
// TODO: Re-enable after confs are refactored.
TEST_F(TestConfig, FunctionalTestsConfigGetRecursive) {
GTEST_SKIP() << "Disabled until config refactor";
MockRepository mocks;
mocks.OnCallFunc(ls).Return(paths);
json resJson = testConfig.getRecursive("sclk");
EXPECT_EQ(resJson.size(), 58);
SPDLOG_DEBUG(resJson.dump(2));
EXPECT_EQ(resJson.size(), 61);
for (auto &[key, val] : resJson.items()) {
EXPECT_TRUE(val.contains("sclk"));
}
......
......@@ -8,7 +8,7 @@
#include "spice_types.h"
#include "query.h"
#include "SpiceUsr.h"
#include <SpiceUsr.h>
#include "spdlog/spdlog.h"
......
......@@ -4,7 +4,7 @@
#include <spdlog/spdlog.h>
int main(int argc, char **argv) {
spdlog::set_level(spdlog::level::trace);
spdlog::set_level(spdlog::level::debug);
spdlog::set_pattern("SpiceQL-TESTS [%H:%M:%S %z] [%l] [%s@%# %!] %v");
testing::Environment* const spiceql_env = testing::AddGlobalTestEnvironment(new TempTestingFiles);
......
......@@ -11,7 +11,7 @@ using namespace std::chrono;
#include "Fixtures.h"
#include "spice_types.h"
#include "config.h"
#include "SpiceUsr.h"
#include <SpiceUsr.h>
#include "memo.h"
#include "query.h"
......
......@@ -44,5 +44,4 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/__init__.py
COPYONLY)
# Setup to run setup tools on install
install(CODE "execute_process(COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/setup.py install --single-version-externally-managed --record=record.txt
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})")
\ No newline at end of file
install(CODE "execute_process(COMMAND python -m pip install -e . WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})")
\ No newline at end of file
# CMake module for find_package(CSPICE)
# Finds include directory and all applicable libraries
#
# Sets the following:
# CSPICE_INCLUDE_DIR
# CSPICE_LIBRARY
find_path(CSPICE_INCLUDE_DIR
NAME SpiceUsr.h
PATH_SUFFIXES naif cspice
)
find_library(CSPICE_LIBRARY
NAMES cspice
)
link_directories($ENV{CONDA_PREFIX}/lib)
include_directories(${CSPICE_INCLUDE_DIR})
message(STATUS "CSPICE INCLUDE: " ${CSPICE_INCLUDE_DIR} )
message(STATUS "CSPICE LIB: " ${CSPICE_LIBRARY} )
# CMake module for find_package(CEREAL)
# Finds include directory and all applicable libraries
# This sets the following variables:
# CEREAL_FOUND - True if Cereal was found.
# CEREAL_INCLUDE_DIRS - Directories containing the Cereal include files.
# CEREAL_DEFINITIONS - Compiler flags for Cereal.
find_path(CEREAL_INCLUDE_DIR cereal
HINTS "${CEREAL_ROOT}/include" "$ENV{CEREAL_ROOT}/include" "/usr/include" "$ENV{PROGRAMFILES}/cereal/include" "cereal/include")
set(CEREAL_INCLUDE_DIRS ${CEREAL_INCLUDE_DIR})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(cereal DEFAULT_MSG CEREAL_INCLUDE_DIR)
mark_as_advanced(CEREAL_INCLUDE_DIR)
if(CEREAL_FOUND)
message(STATUS "Cereal found (include: ${CEREAL_INCLUDE_DIRS})")
endif(CEREAL_FOUND)
......@@ -44,5 +44,51 @@
"date": {
"metadataLastUpdated": "2023-09-13"
}
},
{
"name": "SpiceQL",
"organization": "U.S. Geological Survey",
"description": "GitLab repository for library that interacts with NAIF's SPICE kernels",
"version": "1.0.0",
"status": "Development",
"permissions": {
"usageType": "openSource",
"licenses": [
{
"name": "Public Domain, CC0-1.0",
"URL": "https://code.usgs.gov/astrogeology/spiceql/-/raw/main/LICENSE.md"
}
]
},
"homepageURL": "https://code.usgs.gov/astrogeology/spiceql/",
"downloadURL": "https://code.usgs.gov/astrogeology/spiceql/-/archive/1.0.0/spiceql-1.0.0.zip",
"disclaimerURL": "https://code.usgs.gov/astrogeology/spiceql/-/raw/1.0.0/DISCLAIMER.md",
"repositoryURL": "https://code.usgs.gov/astrogeology/spiceql.git",
"vcs": "git",
"laborHours": 520,
"tags": [
"Planetary",
"Remote Sensing",
"Data Processing",
"Ephemerides",
"Kernels"
],
"languages": [
"C++"
],
"contact": {
"name": "Kelvin Rodriguez",
"email": "krodriguez@usgs.gov"
},
"date": {
"metadataLastUpdated": "2023-09-20"
}
}
]
\ No newline at end of file
......@@ -41,7 +41,7 @@ copyright = '2021, USGS'
author = 'USGS Astrogeology'
# The full version, including alpha/beta/rc tags
release = '0.1'
release = '1.0.0'
# -- General configuration ---------------------------------------------------
......
......@@ -2,19 +2,19 @@ channels:
- defaults
- conda-forge
- usgs-astrogeology
- tudat-team
dependencies:
- cmake
- cspice-cmake
- cspice
- cpp-filesystem
- cspice
- doxygen
- fmt
- fmt==9.1.0
- libhiredis
- ninja
- pip
- pytest
- python>=3.9,<3.10
- python
- swig
- jsonschema
- cereal
......@@ -24,5 +24,5 @@ dependencies:
- sphinx-material
- m2r2
- sphinxcontrib.gist
- jsonschema
- check-jsonschema
{% set name = "spiceql" %}
{% set version = "1.0.0rc1" %}
package:
name: spiceql
version: 0.0.1 # {{ environ.get("GIT_DESCRIBE_TAG", "") }}
name: {{ name|lower }}
version: {{ version }}
source:
git_url: https://github.com/DOI-USGS/SpiceQL.git
- folder: .
url: https://code.usgs.gov/astrogeology/spiceql/-/archive/{{ version }}/spiceql-{{ version }}.tar.gz
sha256: f2aa3c290b6f0fe4a5de001844b1ef075eb2f4c8d571bab87b439e492e216b27
# submodules
- folder: submodules/gularkfilesystem
url: https://github.com/gulrak/filesystem/archive/fcea331ebb8273581cef3e91a131e3d7877f7dfd.zip
sha256: c2775dccc5d8f6d8654bd4b1ef2302b26b8cb75f140640dc2328a58d643f3818
- folder: submodules/googletest
url: https://github.com/google/googletest/archive/e47544ad31cb3ceecd04cc13e8fe556f8df9fe0b.zip
sha256: d87a66523023173ea842e5ec6eb969a54d20be2b56cd939dd6d808fda57626fa
- folder: submodules/json
url: https://github.com/nlohmann/json/archive/fac07e22c5d7dd0423ccf31c02db5603d27e6556.zip
sha256: 191543fd27175d57bd6d2f56cb4f63e424cb56379acb6f367bad3ce34a2bb9c3
- folder: submodules/hippomocks
url: https://github.com/dascandy/hippomocks/archive/10960d027b398444ec3ec6ce2487de3db0283ff8.zip
sha256: a4efc07eacdc35107039bd3b7b491b9fc5f95d4dabb37de83a2b0642c7231fe8
- folder: submodules/redis-plus-plus
url: https://github.com/sewenew/redis-plus-plus/archive/48e178c09a2fbd10d3b991e54b8a71b70791b933.zip
sha256: 352d6d98e738429a35d0b5f4ef89b42ff4f97167dce97a0067aefa97fb73e243
build:
string: {{ environ.get("GIT_DESCRIBE_HASH", "dev") }}
number: 0
skip: true # [win]
requirements:
build:
- {{ compiler('cxx') }} # [linux]
- libgcc-ng # [linux]
- libstdcxx-ng # [linux]
- cmake >=3.14
- pip
- make
- swig
- fmt <8
- fmt ==9.1.0
- cpp-filesystem
run:
- python>=3
- cspice-cmake
- cspice
- cereal
- spdlog
- libhiredis
host:
- python >=3
- cspice-cmake
- libgcc-ng # [linux]
- libstdcxx-ng # [linux]
- fmt ==9.1.0 # [osx]
- libcxx # [osx]
- python
- pip
- cspice
- cereal
- spdlog
- libhiredis
run:
- libgcc-ng # [linux]
- libstdcxx-ng # [linux]
- fmt ==9.1.0 # [osx]
- libcxx # [osx]
- python
- cspice
- cereal
- spdlog
- libhiredis
test:
imports:
......@@ -32,7 +78,14 @@ test:
- if not exist %LIBRARY_LIB%\SpiceQL.lib exit 1 # [win]
about:
home: https://sugar-spice.readthedocs.io/en/latest/#docs
license: None
home: https://code.usgs.gov/astrogeology/spiceql
summary: "This Library provides a C++ interface querying, reading and writing Naif SPICE kernels."
license: CC0-1.0
license: LICENSE.txt
doc_url: https://sugar-spice.readthedocs.io/en/latest/#docs
dev_url: https://code.usgs.gov/astrogeology/spiceql
extra:
recipe-maintainers:
- Kelvinrr
- chkim-usgs
Subproject commit e47544ad31cb3ceecd04cc13e8fe556f8df9fe0b
Subproject commit 16f637fbf4ffc3f7a01fa4eceb7906634565242f
Subproject commit fcea331ebb8273581cef3e91a131e3d7877f7dfd
Subproject commit b15977a05aa10fff396ffb93b539fff33dd9187e
Subproject commit fac07e22c5d7dd0423ccf31c02db5603d27e6556
Subproject commit 7126d88803eeb9d28cc10621f01a58813d50d078
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment