diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index d815e8a7..0f59ae70 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -13,7 +13,7 @@ env: BASE_IMAGE_USER: ghcr.io/driplineorg BASE_IMAGE_REPO: dripline-cpp DEV_SUFFIX: '-dev' - BASE_IMAGE_TAG: 'v2.10.9' + BASE_IMAGE_TAG: 'v2.10.10' # BASE_IMAGE_TAG: 'dlcpp-hf2.10.8' # DEV_SUFFIX: '' diff --git a/CMakeLists.txt b/CMakeLists.txt index 8012bd79..ef8ed7e4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.5) # <3.5 is deprecated by CMake -project( DriplinePy VERSION 5.1.2 ) +project( DriplinePy VERSION 5.1.3 ) cmake_policy( SET CMP0074 NEW ) diff --git a/Dockerfile b/Dockerfile index 43b18bc6..85dd7c9f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ ARG img_user=ghcr.io/driplineorg ARG img_repo=dripline-cpp #ARG img_tag=dlcpp-hf2.10.8 -ARG img_tag=v2.10.9 +ARG img_tag=v2.10.10 FROM ${img_user}/${img_repo}:${img_tag} AS deps diff --git a/bin/dl-serve b/bin/dl-serve index 19376b42..797fd392 100755 --- a/bin/dl-serve +++ b/bin/dl-serve @@ -66,7 +66,7 @@ class Serve(dripline.core.ObjectCreator): self.handler.setLevel(verbosity) logger.setLevel(verbosity) - sig_handler = scarab.SignalHandler() + sig_handler = scarab.SignalHandler(True) # Prior to v4.8.0, service configuration information was nested within the `runtime-config` block # This deprecates that usage and moves everything within `runtime-config` to the top level of the configuration diff --git a/changelog.md b/changelog.md index 5112f4aa..ed94612a 100644 --- a/changelog.md +++ b/changelog.md @@ -5,19 +5,32 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +Types of changes: Added, Changed, Deprecated, Removed, Fixed, Security + ## [Unreleased] +## [5.1.3] - 2026-01-22 + +### Changed + +- Updated dl-cpp version to v2.10.10 + +### Fixed + +- Receiver class binding switched to use smart holder; all other bindings switched to smart holder too, except where that doesn't work + + ## [5.1.2] - 2025-12-03 -## Changed +### Changed - Updated dl-cpp version to v2.10.9 ## [5.1.1] - 2025-11-05 -## Changed +### Changed - Updated dl-cpp version to v2.10.8 diff --git a/chart/Chart.yaml b/chart/Chart.yaml index cbb96c0b..8a97a812 100644 --- a/chart/Chart.yaml +++ b/chart/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 ## the appVersion is used as the container image tag for the main container in the pod from the deployment ## it can be overridden by a values.yaml file in image.tag -appVersion: "v5.1.2" +appVersion: "v5.1.3" description: Deploy a dripline-python microservice name: dripline-python version: 1.1.2 diff --git a/module_bindings/dripline_core/core_pybind.hh b/module_bindings/dripline_core/core_pybind.hh index 792c1954..280df256 100644 --- a/module_bindings/dripline_core/core_pybind.hh +++ b/module_bindings/dripline_core/core_pybind.hh @@ -19,9 +19,7 @@ namespace dripline_pybind std::list< std::string > all_items; all_items.push_back( "SentMessagePackage" ); - pybind11::class_< dripline::sent_msg_pkg, - std::shared_ptr< dripline::sent_msg_pkg > - >( mod, "SentMessagePackage", "Data structure for sent messages" ) + pybind11::classh< dripline::sent_msg_pkg >( mod, "SentMessagePackage", "Data structure for sent messages" ) .def_property_readonly( "successful_send", [](const dripline::sent_msg_pkg& an_obj){ return an_obj.f_successful_send; } ) .def_property_readonly( "send_error_message", [](const dripline::sent_msg_pkg& an_obj){ return an_obj.f_send_error_message; } ) ; diff --git a/module_bindings/dripline_core/dripline_config_pybind.hh b/module_bindings/dripline_core/dripline_config_pybind.hh index d3c35414..a71a1bc9 100644 --- a/module_bindings/dripline_core/dripline_config_pybind.hh +++ b/module_bindings/dripline_core/dripline_config_pybind.hh @@ -14,6 +14,7 @@ namespace dripline_pybind std::list< std::string > all_members; all_members.push_back( "DriplineConfig" ); + // scarab::param_node uses class_, so we don't use classh here pybind11::class_< dripline::dripline_config, scarab::param_node >( mod, "DriplineConfig" ) .def( pybind11::init<>(), DL_BIND_CALL_GUARD_STREAMS ) ; diff --git a/module_bindings/dripline_core/message_pybind.hh b/module_bindings/dripline_core/message_pybind.hh index c4fe5723..69a0f463 100644 --- a/module_bindings/dripline_core/message_pybind.hh +++ b/module_bindings/dripline_core/message_pybind.hh @@ -8,8 +8,6 @@ #include "uuid.hh" -#include "logger.hh" - #include "pybind11/pybind11.h" #include "pybind11/iostream.h" #include "pybind11/eval.h" @@ -17,7 +15,6 @@ #include #include -LOGGER( dlog_mph, "message_pybind.hh" ) namespace dripline_pybind { diff --git a/module_bindings/dripline_core/receiver_pybind.hh b/module_bindings/dripline_core/receiver_pybind.hh index 56326692..f078c12d 100644 --- a/module_bindings/dripline_core/receiver_pybind.hh +++ b/module_bindings/dripline_core/receiver_pybind.hh @@ -14,7 +14,7 @@ namespace dripline_pybind std::list< std::string > all_members; all_members.push_back( "Receiver" ); - pybind11::class_< dripline::receiver, scarab::cancelable, std::shared_ptr >( mod, "Receiver", "Collect and combine message chunks into a full message object") + pybind11::classh< dripline::receiver, scarab::cancelable >( mod, "Receiver", "Collect and combine message chunks into a full message object") .def( pybind11::init<>() ) .def_property( "single_message_wait_ms", diff --git a/module_bindings/dripline_core/return_code_trampoline.hh b/module_bindings/dripline_core/return_code_trampoline.hh index f664307c..e615d0b0 100644 --- a/module_bindings/dripline_core/return_code_trampoline.hh +++ b/module_bindings/dripline_core/return_code_trampoline.hh @@ -8,7 +8,7 @@ namespace dripline_pybind { - class return_code_trampoline : public dripline::return_code + class return_code_trampoline : public dripline::return_code, public pybind11::trampoline_self_life_support { public: using dripline::return_code::return_code; diff --git a/module_bindings/dripline_core/return_codes_pybind.hh b/module_bindings/dripline_core/return_codes_pybind.hh index 97d9f95b..c77dd6af 100644 --- a/module_bindings/dripline_core/return_codes_pybind.hh +++ b/module_bindings/dripline_core/return_codes_pybind.hh @@ -11,11 +11,10 @@ namespace dripline_pybind { - LOGGER( dl_pybind_retcode, "return_codes_pybind" ); // Macro for binding dripline-cpp return codes; note, it uses local variables defined and scoped in this header #define ADD_DRIPLINE_RET_CODE( cpp_name, py_name ) \ all_items.push_back( "DL_" #py_name ); \ - pybind11::class_< dripline::dl_##cpp_name, dripline::return_code >( mod, "DL_" #py_name, "" ) \ + pybind11::classh< dripline::dl_##cpp_name, dripline::return_code >( mod, "DL_" #py_name, "" ) \ .def( pybind11::init<>() ) \ .def_property_readonly( "value", &dripline::dl_##cpp_name::rc_value ) \ .def_property_readonly( "name", &dripline::dl_##cpp_name::rc_name ) \ @@ -28,7 +27,7 @@ namespace dripline_pybind std::list< std::string > all_items; all_items.push_back( "ReturnCode" ); - pybind11::class_< dripline::return_code, return_code_trampoline >( mod, "ReturnCode", "base class for return codes" ) + pybind11::classh< dripline::return_code, return_code_trampoline >( mod, "ReturnCode", "base class for return codes" ) .def( pybind11::init<>() ) .def_property_readonly( "value", &dripline::return_code::rc_value, "return code value" ) .def_property_readonly( "name", &dripline::return_code::rc_name, "return code name" ) diff --git a/module_bindings/dripline_core/run_simple_service_pybind.hh b/module_bindings/dripline_core/run_simple_service_pybind.hh index c523259a..d6397d0c 100644 --- a/module_bindings/dripline_core/run_simple_service_pybind.hh +++ b/module_bindings/dripline_core/run_simple_service_pybind.hh @@ -13,7 +13,7 @@ namespace dripline_pybind { std::list< std::string > all_items; all_items.push_back( "simple_service" ); - pybind11::class_< dripline::simple_service, std::shared_ptr< dripline::simple_service > >( mod, "simple_service", "Minimal example of a dripline service" ) + pybind11::classh< dripline::simple_service >( mod, "simple_service", "Minimal example of a dripline service" ) .def( pybind11::init< const scarab::param_node& >() ) .def( "execute", &dripline::simple_service::execute, DL_BIND_CALL_GUARD_STREAMS_AND_GIL ) ; diff --git a/module_bindings/dripline_core/service_config_pybind.hh b/module_bindings/dripline_core/service_config_pybind.hh index 653fab49..150d0527 100644 --- a/module_bindings/dripline_core/service_config_pybind.hh +++ b/module_bindings/dripline_core/service_config_pybind.hh @@ -14,6 +14,7 @@ namespace dripline_pybind std::list< std::string > all_members; all_members.push_back( "ServiceConfig" ); + // scarab::param_node uses class_, so we don't use classh here pybind11::class_< dripline::service_config, scarab::param_node >( mod, "ServiceConfig" ) .def( pybind11::init< const std::string& >(), DL_BIND_CALL_GUARD_STREAMS, diff --git a/module_bindings/dripline_core/specifier_pybind.hh b/module_bindings/dripline_core/specifier_pybind.hh index 78dbb138..b37737cf 100644 --- a/module_bindings/dripline_core/specifier_pybind.hh +++ b/module_bindings/dripline_core/specifier_pybind.hh @@ -10,8 +10,7 @@ namespace dripline_pybind { std::list< std::string > all_items; all_items.push_back( "Specifier" ); - pybind11::class_< dripline::specifier, std::shared_ptr< dripline::specifier > - >( mod, "Specifier", "All routing key content after the first '.' delimiter" ) + pybind11::classh< dripline::specifier >( mod, "Specifier", "All routing key content after the first '.' delimiter" ) .def( pybind11::init< const std::string& >(), pybind11::arg( "unparsed" ) = "") .def( "parse", &dripline::specifier::parse, "parses the specifier and populates internal attributes", DL_BIND_CALL_GUARD_STREAMS ) diff --git a/setup.py b/setup.py index efd4adee..6582c7a0 100644 --- a/setup.py +++ b/setup.py @@ -40,7 +40,7 @@ def build_extension(self, ext): ] #cfg = 'Debug' if self.debug else 'Release' - cfg = 'DEBUG' + cfg = 'Release' build_args = ['--config', cfg] if platform.system() == "Windows": diff --git a/tests/test_service.py b/tests/test_service.py index 7b56b394..836d54de 100644 --- a/tests/test_service.py +++ b/tests/test_service.py @@ -7,6 +7,14 @@ def test_service_creation(): a_service = dripline.core.Service(a_name, make_connection=False) assert(a_service.name == a_name) +def test_cancelation(): + a_service = dripline.core.Service("a_service", make_connection=False) + assert(not a_service.is_canceled()) + a_sighand = scarab.SignalHandler(False) + a_sighand.add_cancelable(a_service) + a_sighand.cancel_all(0) + assert(a_service.is_canceled()) + def test_submit_request_message(): a_name = "a_service" a_service = dripline.core.Service(a_name, make_connection=False)