From f0f465de73ebd55f515b8d78aacf61eb372c6cf3 Mon Sep 17 00:00:00 2001 From: Hanspeter Schaub Date: Fri, 10 Jul 2026 14:11:14 -0600 Subject: [PATCH 1/5] [#19] rename plugins to extensions The BSK-SDK wheel products are really modular extensions of BSK. We plan to use the name plugin for more flexible components down the road. --- .github/workflows/ci.yml | 18 ++++----- .github/workflows/nightly.yml | 8 ++-- AGENTS.md | 38 +++++++++---------- README.md | 18 ++++----- cmake/bsk-sdkConfig.cmake.in | 6 +-- cmake/bsk_add_swig_module.cmake | 14 +++---- cmake/bsk_generate_messages.cmake | 8 ++-- .../CMakeLists.txt | 22 +++++------ .../README.md | 16 ++++---- .../customExponentialAtmosphere/README.md | 2 +- .../test_customExponentialAtmosphere.py | 32 ++++++++-------- .../customExponentialAtmosphere.cpp | 6 +-- .../customExponentialAtmosphere.h | 6 +-- .../customExponentialAtmosphere.i | 4 +- .../custom_atm/README.md | 2 +- .../custom_atm/__init__.py | 2 +- .../messages/CustomAtmStatusMsgPayload.h | 0 .../messages/README.md | 2 +- .../planetStateProbe/planetStateProbe.c | 0 .../planetStateProbe/planetStateProbe.h | 2 +- .../pyproject.toml | 2 +- pyproject.toml | 8 ++-- src/bsk_sdk/__init__.py | 8 ++-- tests/test_smoke.py | 2 +- tools/sync_c_msg_interfaces.py | 2 +- tools/sync_headers.py | 2 +- tools/sync_sources.py | 4 +- tools/sync_swig.py | 2 +- 28 files changed, 118 insertions(+), 118 deletions(-) rename examples/{custom-atm-plugin => custom-atm-extension}/CMakeLists.txt (78%) rename examples/{custom-atm-plugin => custom-atm-extension}/README.md (74%) rename examples/{custom-atm-plugin => custom-atm-extension}/customExponentialAtmosphere/README.md (92%) rename examples/{custom-atm-plugin => custom-atm-extension}/customExponentialAtmosphere/_UnitTest/test_customExponentialAtmosphere.py (86%) rename examples/{custom-atm-plugin => custom-atm-extension}/customExponentialAtmosphere/customExponentialAtmosphere.cpp (93%) rename examples/{custom-atm-plugin => custom-atm-extension}/customExponentialAtmosphere/customExponentialAtmosphere.h (91%) rename examples/{custom-atm-plugin => custom-atm-extension}/customExponentialAtmosphere/customExponentialAtmosphere.i (95%) rename examples/{custom-atm-plugin => custom-atm-extension}/custom_atm/README.md (87%) rename examples/{custom-atm-plugin => custom-atm-extension}/custom_atm/__init__.py (95%) rename examples/{custom-atm-plugin => custom-atm-extension}/messages/CustomAtmStatusMsgPayload.h (100%) rename examples/{custom-atm-plugin => custom-atm-extension}/messages/README.md (87%) rename examples/{custom-atm-plugin => custom-atm-extension}/planetStateProbe/planetStateProbe.c (100%) rename examples/{custom-atm-plugin => custom-atm-extension}/planetStateProbe/planetStateProbe.h (93%) rename examples/{custom-atm-plugin => custom-atm-extension}/pyproject.toml (86%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5a14daf..26ee6cc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -132,7 +132,7 @@ jobs: run: pytest tests/test_smoke.py -v examples: - name: Build example plugin (${{ matrix.os }}, ${{ matrix.python_label }}) + name: Build example extension (${{ matrix.os }}, ${{ matrix.python_label }}) needs: build runs-on: ${{ matrix.os }} strategy: @@ -179,23 +179,23 @@ jobs: shell: bash run: pip show bsk swig | grep -E "^(Name|Version):" && python -c "import bsk_sdk; print('bsk-sdk:', bsk_sdk.__version__, '| synced from BSK:', bsk_sdk.bsk_version())" - - name: Build example plugin wheel + - name: Build example extension wheel # --no-isolation so the build inherits the locally installed bsk-sdk wheel, # guaranteeing CI always tests the current branch rather than a stale PyPI version. shell: bash run: | pip install build scikit-build-core - python -m build --wheel --no-isolation -o plugin-dist examples/custom-atm-plugin + python -m build --wheel --no-isolation -o extension-dist examples/custom-atm-extension - uses: actions/upload-artifact@v6 with: - name: plugin-wheel-${{ matrix.os }}-py${{ matrix.python }} - path: plugin-dist/*.whl + name: extension-wheel-${{ matrix.os }}-py${{ matrix.python }} + path: extension-dist/*.whl retention-days: 7 - - name: Install plugin wheel and test dependencies + - name: Install extension wheel and test dependencies shell: bash - run: pip install plugin-dist/*.whl pytest + run: pip install extension-dist/*.whl pytest - - name: Run example plugin tests - run: pytest examples/custom-atm-plugin/customExponentialAtmosphere/_UnitTest/test_customExponentialAtmosphere.py -v + - name: Run example extension tests + run: pytest examples/custom-atm-extension/customExponentialAtmosphere/_UnitTest/test_customExponentialAtmosphere.py -v diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index ed41d31..17ef9d3 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -61,12 +61,12 @@ jobs: pip install pytest pytest tests/test_smoke.py -v - - name: Build and test example plugin + - name: Build and test example extension run: | pip install scikit-build-core - python -m build --wheel --no-isolation -o plugin-dist examples/custom-atm-plugin - pip install plugin-dist/*.whl - pytest examples/custom-atm-plugin/customExponentialAtmosphere/_UnitTest/test_customExponentialAtmosphere.py -v + python -m build --wheel --no-isolation -o extension-dist examples/custom-atm-extension + pip install extension-dist/*.whl + pytest examples/custom-atm-extension/customExponentialAtmosphere/_UnitTest/test_customExponentialAtmosphere.py -v - name: Notify on failure if: failure() diff --git a/AGENTS.md b/AGENTS.md index 2166cf3..5989f67 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -6,19 +6,19 @@ entire `bsk-sdk` repo. ## Repository Purpose `bsk-sdk` is a Python wheel that lets external projects build -Basilisk-compatible SWIG plugins without vendoring the full Basilisk source +Basilisk-compatible SWIG extensions without vendoring the full Basilisk source tree. The public contract is the installed wheel layout plus the CMake helpers -that downstream plugin authors call: +that downstream extension authors call: - Python package: `src/bsk_sdk` - CMake package: `cmake/bsk-sdkConfig.cmake.in` -- Plugin helper: `cmake/bsk_add_swig_module.cmake` +- Extension helper: `cmake/bsk_add_swig_module.cmake` - Message helper: `cmake/bsk_generate_messages.cmake` -- Consumer example: `examples/custom-atm-plugin` +- Consumer example: `examples/custom-atm-extension` - Basilisk source input: `external/basilisk` submodule - Sync tooling: `tools/sync_all.py` and sibling `tools/sync_*.py` scripts -Prefer changes that preserve the downstream plugin experience: +Prefer changes that preserve the downstream extension experience: ```cmake find_package(bsk-sdk CONFIG REQUIRED) @@ -38,11 +38,11 @@ bsk_generate_messages(...) - Keep PRs draft until the relevant build/test commands below have been run or the skipped checks are clearly documented. - PR descriptions should call out: - - The affected surface: packaging, CMake/SWIG, sync tooling, example plugin, + - The affected surface: packaging, CMake/SWIG, sync tooling, example extension, CI, or docs. - The Basilisk version or submodule commit, if it changed. - The local verification commands and any skipped checks. - - Any downstream compatibility impact for plugin authors. + - Any downstream compatibility impact for extension authors. ## Generated And Vendored Boundaries @@ -94,7 +94,7 @@ python -m pip install dist/*.whl pytest --force-reinstall pytest tests/test_smoke.py -v ``` -Downstream plugin path: +Downstream extension path: ```bash python -m pip install dist/*.whl --force-reinstall @@ -103,9 +103,9 @@ subprocess.run([sys.executable, '-m', 'pip', 'install', \ f'bsk[all]=={bsk_sdk.bsk_version()}'], check=True)" python -c "import Basilisk; print(Basilisk.__file__)" python -m pip install build scikit-build-core -python -m build --wheel --no-isolation -o plugin-dist examples/custom-atm-plugin -python -m pip install plugin-dist/*.whl pytest --force-reinstall -pytest examples/custom-atm-plugin/customExponentialAtmosphere/_UnitTest/test_customExponentialAtmosphere.py -v +python -m build --wheel --no-isolation -o extension-dist examples/custom-atm-extension +python -m pip install extension-dist/*.whl pytest --force-reinstall +pytest examples/custom-atm-extension/customExponentialAtmosphere/_UnitTest/test_customExponentialAtmosphere.py -v ``` Sync path: @@ -118,12 +118,12 @@ Notes: - A local wheel build may need network access if CMake must fetch Eigen3 and it is not already available. -- The example plugin build intentionally uses `--no-isolation` so it tests the +- The example extension build intentionally uses `--no-isolation` so it tests the just-built SDK wheel instead of accidentally pulling a stale PyPI package. - Install the exact `bsk[all]` version reported by `bsk_sdk.bsk_version()` and - confirm that `Basilisk` imports before running the example plugin test. The + confirm that `Basilisk` imports before running the example extension test. The test uses `pytest.importorskip`, so a missing BSK installation can otherwise - produce a successful pytest exit without exercising the plugin. + produce a successful pytest exit without exercising the extension. - CI runs Linux, macOS, and Windows against the minimum and maximum supported Python versions. Review local-only changes with that matrix in mind. @@ -140,7 +140,7 @@ Notes: - Keep `pyproject.toml`, `CMakeLists.txt`, installed package paths, and smoke tests in sync. If a file must ship in the wheel or sdist, update the install rules and `tool.scikit-build.sdist.include`/`exclude` as needed. -- Avoid adding plugin-author requirements that contradict the core promise: +- Avoid adding extension-author requirements that contradict the core promise: SDK sources, runtime-minimal sources, and built-in C message interface sources should be handled by `bsk_add_swig_module`, not manually wired by consumers. @@ -171,8 +171,8 @@ contract and the consumer build, not just whether the repository build passes. mismatches should warn when that is the intended compatibility policy. - Adding or moving installed files requires three-way review: CMake install rules, Python path helper APIs, and `tests/test_smoke.py` assertions. -- Example plugin failures are usually the most realistic signal for downstream - users. Treat `examples/custom-atm-plugin` as a compatibility test, not just +- Example extension failures are usually the most realistic signal for downstream + users. Treat `examples/custom-atm-extension` as a compatibility test, not just sample code. ## Review Checklist @@ -181,11 +181,11 @@ For every PR, answer these before approving: - Does the wheel still expose the expected package root, include directories, CMake config files, SWIG directory, tools directory, and SDK source dirs? -- If the CMake helpers changed, does the example plugin still build and import +- If the CMake helpers changed, does the example extension still build and import on a clean install? - If sync tooling changed, does `python3 tools/sync_all.py` still stamp the BSK version and recreate all required artifact directories/files? -- If dependencies changed, are `pyproject.toml`, CI, example plugin metadata, +- If dependencies changed, are `pyproject.toml`, CI, example extension metadata, and CMake diagnostics consistent? - If `external/basilisk` changed, is the submodule pointer intentional and is the corresponding version impact documented? diff --git a/README.md b/README.md index f5b42d1..e8a180a 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Basilisk SDK (`bsk-sdk`) A self-contained Python wheel that gives external projects everything they need -to build [Basilisk](https://github.com/AVSLab/basilisk) compatible SWIG plugins +to build [Basilisk](https://github.com/AVSLab/basilisk) compatible SWIG extensions without vendoring the full simulation codebase. ## Quick start @@ -10,21 +10,21 @@ without vendoring the full simulation codebase. pip install bsk-sdk ``` -Then in your plugin's `CMakeLists.txt`: +Then in your extension's `CMakeLists.txt`: ```cmake find_package(bsk-sdk CONFIG REQUIRED) bsk_add_swig_module( - TARGET myPlugin - INTERFACE swig/myPlugin.i - SOURCES myPlugin.cpp + TARGET myExtension + INTERFACE swig/myExtension.i + SOURCES myExtension.cpp ) ``` `bsk_add_swig_module` automatically compiles the vendored Basilisk SDK sources (arch_min, arch_utilities, runtime_min, and built-in C message interfaces) -directly into your plugin, so no separate link targets are needed. Basilisk +directly into your extension, so no separate link targets are needed. Basilisk utility headers are available at their standard paths, for example: ```cpp @@ -38,10 +38,10 @@ Basilisk modules: #include "cMsgCInterface/SpicePlanetStateMsg_C.h" ``` -If your plugin needs additional link targets, pass them via `LINK_LIBS` and +If your extension needs additional link targets, pass them via `LINK_LIBS` and they will be appended after the SDK defaults. -See [`examples/custom-atm-plugin/`](examples/custom-atm-plugin/) for a +See [`examples/custom-atm-extension/`](examples/custom-atm-extension/) for a complete working example. ## Syncing from Basilisk @@ -77,5 +77,5 @@ The `bsk-sdk` package version tracks the Basilisk version it was synced from At CMake configure time, the SDK checks that the installed Basilisk version matches and errors out on a mismatch. This prevents silent ABI -incompatibilities where plugins are compiled against headers from one Basilisk +incompatibilities where extensions are compiled against headers from one Basilisk version but linked against a different runtime. diff --git a/cmake/bsk-sdkConfig.cmake.in b/cmake/bsk-sdkConfig.cmake.in index 204ad36..023a1ac 100644 --- a/cmake/bsk-sdkConfig.cmake.in +++ b/cmake/bsk-sdkConfig.cmake.in @@ -15,7 +15,7 @@ set(BSK_SDK_RUNTIME_MIN_DIR "${BSK_SDK_PKG_DIR}/runtime_min" CACHE PATH " set(BSK_SDK_SWIG_DIR "${BSK_SDK_PKG_DIR}/swig" CACHE PATH "bsk-sdk swig dir") set(BSK_SDK_TOOLS_DIR "${BSK_SDK_PKG_DIR}/tools" CACHE PATH "bsk-sdk tools dir") -# Provide Eigen3::Eigen from bundled headers so plugins are self-contained. +# Provide Eigen3::Eigen from bundled headers so extensions are self-contained. if(NOT TARGET Eigen3::Eigen) add_library(Eigen3::Eigen IMPORTED INTERFACE GLOBAL) set_target_properties(Eigen3::Eigen PROPERTIES @@ -23,7 +23,7 @@ if(NOT TARGET Eigen3::Eigen) ) endif() -# Header-only SDK target — SDK sources are compiled directly into each plugin. +# Header-only SDK target — SDK sources are compiled directly into each extension. if(NOT TARGET bsk::sdk_headers) add_library(bsk::sdk_headers IMPORTED INTERFACE GLOBAL) set_target_properties(bsk::sdk_headers PROPERTIES @@ -73,7 +73,7 @@ function(_bsk_sdk_check_basilisk_version) "Basilisk version mismatch!\n" " bsk-sdk was synced from Basilisk ${BSK_SDK_BSK_VERSION}\n" " Installed Basilisk is ${_bsk_installed_version}\n\n" - "Plugins compiled against mismatched headers will have ABI incompatibilities.\n" + "Extensions compiled against mismatched headers will have ABI incompatibilities.\n" "Either install the matching Basilisk version or re-sync the SDK:\n" " pip install \"bsk[all]==${BSK_SDK_BSK_VERSION}\"\n" " # or: cd external/basilisk && git checkout v${_bsk_installed_version} && cd ../.. && python3 tools/sync_all.py" diff --git a/cmake/bsk_add_swig_module.cmake b/cmake/bsk_add_swig_module.cmake index b6dab04..8a90c01 100644 --- a/cmake/bsk_add_swig_module.cmake +++ b/cmake/bsk_add_swig_module.cmake @@ -124,7 +124,7 @@ macro(_bsk_find_build_deps) endif() endmacro() -# Collect SDK implementation sources to compile directly into the plugin. +# Collect SDK implementation sources to compile directly into the extension. # Falls back to the installed Basilisk runtime libs when sources are absent. function(_bsk_resolve_sdk_sources out_sources out_link_libs) if(DEFINED BSK_SDK_ARCH_MIN_DIR AND EXISTS "${BSK_SDK_ARCH_MIN_DIR}" @@ -266,10 +266,10 @@ print(f'{exe_path};{lib_path}', end='')" # Validate SWIG runtime version matches Basilisk's. file(STRINGS "${_pip_swig_lib}/swigrun.swg" _swigrun_lines REGEX "SWIG_RUNTIME_VERSION") - set(_plugin_rt "") + set(_extension_rt "") foreach(_line IN LISTS _swigrun_lines) if(_line MATCHES "#define SWIG_RUNTIME_VERSION \"([0-9]+)\"") - set(_plugin_rt "${CMAKE_MATCH_1}") + set(_extension_rt "${CMAKE_MATCH_1}") endif() endforeach() @@ -287,14 +287,14 @@ except ImportError:\n\ OUTPUT_STRIP_TRAILING_WHITESPACE ) - if(_plugin_rt AND _bsk_rt AND NOT _plugin_rt STREQUAL _bsk_rt) + if(_extension_rt AND _bsk_rt AND NOT _extension_rt STREQUAL _bsk_rt) message(FATAL_ERROR "SWIG runtime version mismatch!\n" " bsk was compiled with SWIG_RUNTIME_VERSION \"${_bsk_rt}\" " "(capsule: swig_runtime_data${_bsk_rt})\n" - " pip swig ${_pip_swig_exe} uses SWIG_RUNTIME_VERSION \"${_plugin_rt}\" " - "(capsule: swig_runtime_data${_plugin_rt})\n\n" - "Plugins compiled with this SWIG version cannot exchange objects with " + " pip swig ${_pip_swig_exe} uses SWIG_RUNTIME_VERSION \"${_extension_rt}\" " + "(capsule: swig_runtime_data${_extension_rt})\n\n" + "Extensions compiled with this SWIG version cannot exchange objects with " "Basilisk across module boundaries.\n" "Install a SWIG version whose runtime epoch matches bsk (epoch ${_bsk_rt}):\n" " SWIG runtime epoch 5 -> SWIG 4.4.1 (pip install \"swig==4.4.1\")\n" diff --git a/cmake/bsk_generate_messages.cmake b/cmake/bsk_generate_messages.cmake index 41417c7..a3d24de 100644 --- a/cmake/bsk_generate_messages.cmake +++ b/cmake/bsk_generate_messages.cmake @@ -138,8 +138,8 @@ function(bsk_generate_messages) # Generate the per-payload equality traits header included by the SWIG # template. Basilisk's generator includes payload headers below # "architecture/${_eq_payload_search_dir}", so create a forwarding include - # tree in autoSource that points back to the plugin's real payload header. - set(_eq_payload_search_dir "bskSdkPluginPayloads") + # tree in autoSource that points back to the extension's real payload header. + set(_eq_payload_search_dir "bskSdkExtensionPayloads") file(TO_CMAKE_PATH "${_hdr_abs}" _hdr_include) set(_eq_forward_dir "${_auto_root}/architecture/${_eq_payload_search_dir}") set(_eq_forward_hdr "${_eq_forward_dir}/${_payload_name}.h") @@ -267,12 +267,12 @@ function(bsk_generate_messages) # Generate __init__.py that re-exports all message payloads. Importing this # package also registers the SWIG proxy classes for the generated Message - # and Recorder specializations, so plugin package __init__.py files should + # and Recorder specializations, so extension package __init__.py files should # import their generated messaging package before importing module wrappers. file(MAKE_DIRECTORY "${BSK_OUTPUT_DIR}") set(_init_file "${BSK_OUTPUT_DIR}/__init__.py") file(WRITE "${_init_file}" - "\"\"\"Generated Basilisk message bindings for this plugin.\n\n" + "\"\"\"Generated Basilisk message bindings for this extension.\n\n" "Importing this package registers custom Message and Recorder SWIG\n" "proxy classes, including the recorder() methods on custom messages.\n" "\"\"\"\n\n" diff --git a/examples/custom-atm-plugin/CMakeLists.txt b/examples/custom-atm-extension/CMakeLists.txt similarity index 78% rename from examples/custom-atm-plugin/CMakeLists.txt rename to examples/custom-atm-extension/CMakeLists.txt index 575967f..9b4a2a8 100644 --- a/examples/custom-atm-plugin/CMakeLists.txt +++ b/examples/custom-atm-extension/CMakeLists.txt @@ -2,7 +2,7 @@ # Boilerplate: Copy and Paste this section as is, and modify the section below. # ============================================================================= cmake_minimum_required(VERSION 3.26) -project(bsk_plugin_exponential_atmosphere LANGUAGES C CXX) +project(bsk_extension_exponential_atmosphere LANGUAGES C CXX) find_package(Python3 REQUIRED COMPONENTS Interpreter Development.Module NumPy) @@ -22,20 +22,20 @@ set(bsk-sdk_DIR "${bsk_sdk_dir}") find_package(bsk-sdk CONFIG REQUIRED) # Where scikit-build-core places wheel outputs -set(PLUGIN_PKG_DIR "${SKBUILD_PLATLIB_DIR}/custom_atm") +set(EXTENSION_PKG_DIR "${SKBUILD_PLATLIB_DIR}/custom_atm") # ============================================================================= -# Plugin-specific configuration +# Extension-specific configuration # ============================================================================= -# Gather your plugin sources -file(GLOB PLUGIN_SOURCES CONFIGURE_DEPENDS +# Gather your extension sources +file(GLOB EXTENSION_SOURCES CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/customExponentialAtmosphere/*.cpp" ) # Note: do NOT add SDK sources (arch_min, arch_utilities, runtime_min, or # built-in cMsgCInterface definitions) here. -# bsk_add_swig_module compiles them automatically into the plugin target. -list(APPEND PLUGIN_SOURCES +# bsk_add_swig_module compiles them automatically into the extension target. +list(APPEND EXTENSION_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/planetStateProbe/planetStateProbe.c" ) @@ -44,17 +44,17 @@ list(APPEND PLUGIN_SOURCES bsk_add_swig_module( TARGET customExponentialAtmosphere INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/customExponentialAtmosphere/customExponentialAtmosphere.i" - SOURCES ${PLUGIN_SOURCES} + SOURCES ${EXTENSION_SOURCES} INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/customExponentialAtmosphere" "${CMAKE_CURRENT_SOURCE_DIR}/messages" "${CMAKE_CURRENT_SOURCE_DIR}/planetStateProbe" - OUTPUT_DIR "${PLUGIN_PKG_DIR}" + OUTPUT_DIR "${EXTENSION_PKG_DIR}" ) -# Generate Python bindings for plugin-defined messages +# Generate Python bindings for extension-defined messages bsk_generate_messages( - OUTPUT_DIR "${PLUGIN_PKG_DIR}/messaging" + OUTPUT_DIR "${EXTENSION_PKG_DIR}/messaging" MSG_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/messages/CustomAtmStatusMsgPayload.h" ) diff --git a/examples/custom-atm-plugin/README.md b/examples/custom-atm-extension/README.md similarity index 74% rename from examples/custom-atm-plugin/README.md rename to examples/custom-atm-extension/README.md index b597ed2..4cc8b1f 100644 --- a/examples/custom-atm-plugin/README.md +++ b/examples/custom-atm-extension/README.md @@ -1,8 +1,8 @@ -# custom-atm-plugin +# custom-atm-extension -Example Basilisk plugin built entirely out-of-tree using `bsk-sdk`. +Example Basilisk extension built entirely out-of-tree using `bsk-sdk`. -This plugin implements a simple exponential atmosphere model +This extension implements a simple exponential atmosphere model (`CustomExponentialAtmosphere`) that extends Basilisk's `AtmosphereBase`. ## Directory structure @@ -10,10 +10,10 @@ This plugin implements a simple exponential atmosphere model The layout follows the standard Basilisk module conventions: ``` -custom-atm-plugin/ +custom-atm-extension/ customExponentialAtmosphere/ # Module source, header, SWIG interface _UnitTest/ # Tests (pytest) - messages/ # Plugin-defined message payload headers + messages/ # Extension-defined message payload headers planetStateProbe/ # Small C module using built-in BSK messages custom_atm/ # Python package (wheel output) CMakeLists.txt # Build configuration @@ -37,8 +37,8 @@ pytest customExponentialAtmosphere/_UnitTest/ -v ## Custom message recorders -If a plugin defines custom messages with `bsk_generate_messages()`, import the -generated message package from the plugin's top-level `__init__.py` before +If an extension defines custom messages with `bsk_generate_messages()`, import the +generated message package from the extension's top-level `__init__.py` before importing module wrappers: ```python @@ -60,5 +60,5 @@ same include path as in Basilisk itself: ``` The SDK ships and compiles these built-in definitions automatically through -`bsk_add_swig_module()`, so the plugin `CMakeLists.txt` only lists the module's +`bsk_add_swig_module()`, so the extension `CMakeLists.txt` only lists the module's own C source. diff --git a/examples/custom-atm-plugin/customExponentialAtmosphere/README.md b/examples/custom-atm-extension/customExponentialAtmosphere/README.md similarity index 92% rename from examples/custom-atm-plugin/customExponentialAtmosphere/README.md rename to examples/custom-atm-extension/customExponentialAtmosphere/README.md index 8d9e186..705b46f 100644 --- a/examples/custom-atm-plugin/customExponentialAtmosphere/README.md +++ b/examples/custom-atm-extension/customExponentialAtmosphere/README.md @@ -14,7 +14,7 @@ customExponentialAtmosphere/ The module implements a simple exponential atmosphere model that extends Basilisk's `AtmosphereBase`. It demonstrates how to: -- Subclass a Basilisk base class from an out-of-tree plugin +- Subclass a Basilisk base class from an out-of-tree extension - Define and wire custom input messages - Use built-in Basilisk C message interfaces from a C module - Use `bsk_add_swig_module()` for SWIG wrapping diff --git a/examples/custom-atm-plugin/customExponentialAtmosphere/_UnitTest/test_customExponentialAtmosphere.py b/examples/custom-atm-extension/customExponentialAtmosphere/_UnitTest/test_customExponentialAtmosphere.py similarity index 86% rename from examples/custom-atm-plugin/customExponentialAtmosphere/_UnitTest/test_customExponentialAtmosphere.py rename to examples/custom-atm-extension/customExponentialAtmosphere/_UnitTest/test_customExponentialAtmosphere.py index 06cd1e3..abd1838 100644 --- a/examples/custom-atm-plugin/customExponentialAtmosphere/_UnitTest/test_customExponentialAtmosphere.py +++ b/examples/custom-atm-extension/customExponentialAtmosphere/_UnitTest/test_customExponentialAtmosphere.py @@ -1,9 +1,9 @@ """ -Integration test for the custom-atm-plugin example. +Integration test for the custom-atm-extension example. Requires: - bsk-sdk installed (provides the CMake helpers and SDK headers) - - custom_atm wheel built and installed (see example-plugins/custom-atm-plugin) + - custom_atm wheel built and installed (see examples/custom-atm-extension) - Basilisk installed (provides SimulationBaseClass, messaging, etc.) Skip gracefully if either optional dependency is absent so the smoke test @@ -17,7 +17,7 @@ import pytest basilisk = pytest.importorskip("Basilisk", reason="Basilisk not installed") -custom_atm = pytest.importorskip("custom_atm", reason="custom_atm plugin not installed") +custom_atm = pytest.importorskip("custom_atm", reason="custom_atm extension not installed") from Basilisk.architecture import messaging, bskLogging # noqa: E402 from Basilisk.utilities import SimulationBaseClass, macros # noqa: E402 @@ -30,7 +30,7 @@ def _window_density(log) -> float: return float(max(vals)) -def _plugin_messaging(): +def _extension_messaging(): assert hasattr(custom_atm, "messaging"), ( "custom_atm.__init__ must import generated messaging before module wrappers" ) @@ -39,7 +39,7 @@ def _plugin_messaging(): @pytest.fixture() def sim_env(): - """Set up a minimal Basilisk sim with the custom atmosphere plugin.""" + """Set up a minimal Basilisk sim with the custom atmosphere extension.""" sim = SimulationBaseClass.SimBaseClass() sim.bskLogger.setLogLevel(bskLogging.BSK_WARNING) @@ -78,13 +78,13 @@ def sim_env(): return sim, atmosphere, log, dt -def test_plugin_instantiates(): +def test_extension_instantiates(): atm = customExponentialAtmosphere.CustomExponentialAtmosphere() assert atm is not None -def test_plugin_links_architecture_utilities(): - """Verify the sample plugin can call a compiled Basilisk architecture utility.""" +def test_extension_links_architecture_utilities(): + """Verify the sample extension can call a compiled Basilisk architecture utility.""" atm = customExponentialAtmosphere.CustomExponentialAtmosphere() earth_mu = 3.986004418e14 # [m^3/s^2] semi_major_axis = 7_000_000.0 # [m] @@ -105,8 +105,8 @@ def test_c_message_interface_round_trips(): def test_package_import_exposes_generated_messaging(): """Package import exposes generated message bindings and recorders.""" - plugin_messaging = _plugin_messaging() - msg = plugin_messaging.CustomAtmStatusMsg() + extension_messaging = _extension_messaging() + msg = extension_messaging.CustomAtmStatusMsg() rec = msg.recorder() assert rec is not None @@ -134,12 +134,12 @@ def test_density_positive(sim_env): def test_status_message_updates_density(sim_env): sim, atmosphere, log, dt = sim_env - plugin_messaging = _plugin_messaging() - status_pl = plugin_messaging.CustomAtmStatusMsgPayload() + extension_messaging = _extension_messaging() + status_pl = extension_messaging.CustomAtmStatusMsgPayload() status_pl.density = 2.0 status_pl.scaleHeight = 8_500.0 status_pl.modelValid = 1 - status_msg = plugin_messaging.CustomAtmStatusMsg().write(status_pl) + status_msg = extension_messaging.CustomAtmStatusMsg().write(status_pl) atmosphere.connectAtmStatus(status_msg) sim.ConfigureStopTime(dt) @@ -155,12 +155,12 @@ def test_invalid_status_message_ignored(sim_env): sim, atmosphere, log, dt = sim_env # modelValid=0 — should be ignored, density stays at default baseDensity - plugin_messaging = _plugin_messaging() - status_pl = plugin_messaging.CustomAtmStatusMsgPayload() + extension_messaging = _extension_messaging() + status_pl = extension_messaging.CustomAtmStatusMsgPayload() status_pl.density = 999.0 status_pl.scaleHeight = 1.0 status_pl.modelValid = 0 - status_msg = plugin_messaging.CustomAtmStatusMsg().write(status_pl) + status_msg = extension_messaging.CustomAtmStatusMsg().write(status_pl) atmosphere.connectAtmStatus(status_msg) sim.ConfigureStopTime(dt) diff --git a/examples/custom-atm-plugin/customExponentialAtmosphere/customExponentialAtmosphere.cpp b/examples/custom-atm-extension/customExponentialAtmosphere/customExponentialAtmosphere.cpp similarity index 93% rename from examples/custom-atm-plugin/customExponentialAtmosphere/customExponentialAtmosphere.cpp rename to examples/custom-atm-extension/customExponentialAtmosphere/customExponentialAtmosphere.cpp index 078edbd..9e053b8 100644 --- a/examples/custom-atm-plugin/customExponentialAtmosphere/customExponentialAtmosphere.cpp +++ b/examples/custom-atm-extension/customExponentialAtmosphere/customExponentialAtmosphere.cpp @@ -58,7 +58,7 @@ void CustomExponentialAtmosphere::evaluateAtmosphereModel(AtmoPropsMsgPayload* m static bool firstCall = true; if (firstCall) { this->bskLogger.bskLog(BSK_INFORMATION, - "ExponentialAtmosphere (plugin): model active; using AtmosphereBase altitude."); + "ExponentialAtmosphere (extension): model active; using AtmosphereBase altitude."); firstCall = false; } @@ -71,7 +71,7 @@ void CustomExponentialAtmosphere::evaluateAtmosphereModel(AtmoPropsMsgPayload* m statusApplied = true; } else { this->bskLogger.bskLog(BSK_WARNING, - "ExponentialAtmosphere (plugin): CustomAtmStatusMsgPayload invalid; ignoring."); + "ExponentialAtmosphere (extension): CustomAtmStatusMsgPayload invalid; ignoring."); } } @@ -81,7 +81,7 @@ void CustomExponentialAtmosphere::evaluateAtmosphereModel(AtmoPropsMsgPayload* m if (statusApplied) { this->bskLogger.bskLog(BSK_INFORMATION, - "ExponentialAtmosphere (plugin): applied status msg; alt=%.3g m rho=%.3g", + "ExponentialAtmosphere (extension): applied status msg; alt=%.3g m rho=%.3g", this->orbitAltitude, msg->neutralDensity); } } diff --git a/examples/custom-atm-plugin/customExponentialAtmosphere/customExponentialAtmosphere.h b/examples/custom-atm-extension/customExponentialAtmosphere/customExponentialAtmosphere.h similarity index 91% rename from examples/custom-atm-plugin/customExponentialAtmosphere/customExponentialAtmosphere.h rename to examples/custom-atm-extension/customExponentialAtmosphere/customExponentialAtmosphere.h index d6f4f5a..a8f5a57 100644 --- a/examples/custom-atm-plugin/customExponentialAtmosphere/customExponentialAtmosphere.h +++ b/examples/custom-atm-extension/customExponentialAtmosphere/customExponentialAtmosphere.h @@ -24,20 +24,20 @@ #include "architecture/messaging/messaging.h" // ReadFunctor / Message #include "CustomAtmStatusMsgPayload.h" -/*! @brief exponential atmosphere model (plugin example) */ +/*! @brief exponential atmosphere model (extension example) */ class CustomExponentialAtmosphere : public AtmosphereBase { public: CustomExponentialAtmosphere(); ~CustomExponentialAtmosphere(); - // Plugin-defined input message wiring (idiomatic Basilisk pattern) + // Extension-defined input message wiring (idiomatic Basilisk pattern) void connectAtmStatus(Message* msg); /*! @brief Compute the orbital radius for a circular orbit using Basilisk's orbitalMotion utility. * * This helper exists to exercise a Basilisk architecture utility from the - * plugin example. It proves that plugin modules can include + * extension example. It proves that extension modules can include * architecture/utilities/orbitalMotion.h and link against the corresponding * SDK-provided utility implementation. * diff --git a/examples/custom-atm-plugin/customExponentialAtmosphere/customExponentialAtmosphere.i b/examples/custom-atm-extension/customExponentialAtmosphere/customExponentialAtmosphere.i similarity index 95% rename from examples/custom-atm-plugin/customExponentialAtmosphere/customExponentialAtmosphere.i rename to examples/custom-atm-extension/customExponentialAtmosphere/customExponentialAtmosphere.i index fd37644..7d3992c 100644 --- a/examples/custom-atm-plugin/customExponentialAtmosphere/customExponentialAtmosphere.i +++ b/examples/custom-atm-extension/customExponentialAtmosphere/customExponentialAtmosphere.i @@ -38,7 +38,7 @@ from Basilisk.architecture.swig_common_model import * // IMPORTANT: use %import (not %include) for Basilisk base-class modules. // // %import tells SWIG "these types live in an existing Python module — do not -// re-wrap them here." The generated Python class for this plugin will then +// re-wrap them here." The generated Python class for this extension will then // inherit from Basilisk's cSysModel.SysModel, which is what Basilisk's // simulation task manager expects when you call AddModelToTask(). // @@ -60,7 +60,7 @@ struct SCStatesMsg_C; %include "architecture/msgPayloadDefC/AtmoPropsMsgPayload.h" struct AtmoPropsMsg_C; -// Plugin-defined message +// Extension-defined message %include "CustomAtmStatusMsgPayload.h" struct CustomAtmStatusMsg_C; diff --git a/examples/custom-atm-plugin/custom_atm/README.md b/examples/custom-atm-extension/custom_atm/README.md similarity index 87% rename from examples/custom-atm-plugin/custom_atm/README.md rename to examples/custom-atm-extension/custom_atm/README.md index f6079b3..7635452 100644 --- a/examples/custom-atm-plugin/custom_atm/README.md +++ b/examples/custom-atm-extension/custom_atm/README.md @@ -9,5 +9,5 @@ binaries and message bindings here. The generated `messaging` package must be imported before module wrappers that expose custom message fields. That import registers the SWIG proxy classes for -the plugin's `Message` and `Recorder` specializations, which makes calls +the extension's `Message` and `Recorder` specializations, which makes calls such as `module.customOutMsg.recorder()` work without an extra user import. diff --git a/examples/custom-atm-plugin/custom_atm/__init__.py b/examples/custom-atm-extension/custom_atm/__init__.py similarity index 95% rename from examples/custom-atm-plugin/custom_atm/__init__.py rename to examples/custom-atm-extension/custom_atm/__init__.py index 16198b6..47c8b18 100644 --- a/examples/custom-atm-plugin/custom_atm/__init__.py +++ b/examples/custom-atm-extension/custom_atm/__init__.py @@ -26,7 +26,7 @@ sys.modules.setdefault("cSysModel", _cSysModel) # Import generated custom message bindings before SWIG module wrappers. This -# registers the plugin's Message and Recorder proxy classes so custom +# registers the extension's Message and Recorder proxy classes so custom # message fields exposed by modules have their Python methods, including # recorder(), without requiring users to import custom_atm.messaging manually. from . import messaging diff --git a/examples/custom-atm-plugin/messages/CustomAtmStatusMsgPayload.h b/examples/custom-atm-extension/messages/CustomAtmStatusMsgPayload.h similarity index 100% rename from examples/custom-atm-plugin/messages/CustomAtmStatusMsgPayload.h rename to examples/custom-atm-extension/messages/CustomAtmStatusMsgPayload.h diff --git a/examples/custom-atm-plugin/messages/README.md b/examples/custom-atm-extension/messages/README.md similarity index 87% rename from examples/custom-atm-plugin/messages/README.md rename to examples/custom-atm-extension/messages/README.md index e7e7085..fd020ff 100644 --- a/examples/custom-atm-plugin/messages/README.md +++ b/examples/custom-atm-extension/messages/README.md @@ -1,6 +1,6 @@ # messages -Plugin-defined message payload headers live here. +Extension-defined message payload headers live here. Each header defines a C struct following the Basilisk naming convention `MsgPayload`. At build time, `bsk_generate_messages()` in diff --git a/examples/custom-atm-plugin/planetStateProbe/planetStateProbe.c b/examples/custom-atm-extension/planetStateProbe/planetStateProbe.c similarity index 100% rename from examples/custom-atm-plugin/planetStateProbe/planetStateProbe.c rename to examples/custom-atm-extension/planetStateProbe/planetStateProbe.c diff --git a/examples/custom-atm-plugin/planetStateProbe/planetStateProbe.h b/examples/custom-atm-extension/planetStateProbe/planetStateProbe.h similarity index 93% rename from examples/custom-atm-plugin/planetStateProbe/planetStateProbe.h rename to examples/custom-atm-extension/planetStateProbe/planetStateProbe.h index 9d8fe27..f380597 100644 --- a/examples/custom-atm-plugin/planetStateProbe/planetStateProbe.h +++ b/examples/custom-atm-extension/planetStateProbe/planetStateProbe.h @@ -18,7 +18,7 @@ */ /* - * Minimal C module that uses the plugin's built-in planet-state input message + * Minimal C module that uses the extension's built-in planet-state input message * through the C interface shipped by bsk-sdk. */ #ifndef PLANET_STATE_PROBE_H diff --git a/examples/custom-atm-plugin/pyproject.toml b/examples/custom-atm-extension/pyproject.toml similarity index 86% rename from examples/custom-atm-plugin/pyproject.toml rename to examples/custom-atm-extension/pyproject.toml index 388f17c..80f6d8b 100644 --- a/examples/custom-atm-plugin/pyproject.toml +++ b/examples/custom-atm-extension/pyproject.toml @@ -3,7 +3,7 @@ requires = ["scikit-build-core>=0.9.3", "numpy>=1.24", "bsk-sdk", "bsk", "swig== build-backend = "scikit_build_core.build" [project] -name = "bsk-plugin-exponential-atmosphere" +name = "bsk-extension-exponential-atmosphere" version = "0.1.0" [tool.scikit-build] diff --git a/pyproject.toml b/pyproject.toml index 24b9819..111ce97 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,12 +6,12 @@ backend-path = ["."] [project] name = "bsk-sdk" version = "2.11.0" -description = "Vendored Basilisk SDK headers, runtime, and CMake integration for plugin authors" +description = "Vendored Basilisk SDK headers, runtime, and CMake integration for extension authors" readme = "README.md" license = { text = "ISC" } requires-python = ">=3.9" dependencies = [ - # Plugin authors compile SWIG extensions against bsk. The pip swig package + # Extension authors compile SWIG modules against bsk. The pip swig package # provides a self-contained binary on all platforms and is detected # automatically by bsk_add_swig_module.cmake via the Python interpreter. # @@ -20,7 +20,7 @@ dependencies = [ # The cmake check in bsk_add_swig_module enforces the match at build time. "swig==4.4.1", # Required by generatePayloadMetaJson.py, which parses *Payload.h structs at - # plugin build time to produce the JSON metadata consumed by generateSWIGModules.py. + # extension build time to produce the JSON metadata consumed by generateSWIGModules.py. "libclang>=15.0.6.1,<=18.1.1", ] @@ -29,7 +29,7 @@ bsk-sdk = "bsk_sdk" [tool.scikit-build] wheel.packages = ["bsk_sdk"] -# SDK sources and headers are compiled into each plugin at plugin build time, +# SDK sources and headers are compiled into each extension at extension build time, # so this wheel carries no native artifacts and is genuinely platform-neutral. wheel.py-api = "py3" wheel.platlib = false diff --git a/src/bsk_sdk/__init__.py b/src/bsk_sdk/__init__.py index 94900d0..3532057 100644 --- a/src/bsk_sdk/__init__.py +++ b/src/bsk_sdk/__init__.py @@ -17,21 +17,21 @@ # """ -Basilisk SDK (``bsk-sdk``) -- build Basilisk-compatible SWIG plugins out-of-tree. +Basilisk SDK (``bsk-sdk``) -- build Basilisk-compatible SWIG extensions out-of-tree. This package ships curated Basilisk headers, minimal runtime sources, SWIG interface files, and CMake helpers so that external projects can -compile and link Basilisk plugins without vendoring the full simulation +compile and link Basilisk extensions without vendoring the full simulation codebase. Quick start:: pip install bsk-sdk -Then in your plugin's ``CMakeLists.txt``:: +Then in your extension's ``CMakeLists.txt``:: find_package(bsk-sdk CONFIG REQUIRED) - bsk_add_swig_module(TARGET myPlugin INTERFACE swig/myPlugin.i ...) + bsk_add_swig_module(TARGET myExtension INTERFACE swig/myExtension.i ...) Convenience functions below expose installed paths for headers, SWIG support files, CMake config, and tools. diff --git a/tests/test_smoke.py b/tests/test_smoke.py index e38d896..b1e4610 100644 --- a/tests/test_smoke.py +++ b/tests/test_smoke.py @@ -68,7 +68,7 @@ def test_sdk_source_dirs_exist() -> None: def test_builtin_c_msg_interfaces_present() -> None: - """Built-in C message wrappers ship pre-generated for C plugin modules.""" + """Built-in C message wrappers ship pre-generated for C extension modules.""" cmsg = Path(bsk_sdk.c_msg_interface_dir()) assert cmsg.is_dir(), f"c_msg_interface_dir() does not exist: {cmsg}" for name in ("SpicePlanetStateMsg_C.h", "SpicePlanetStateMsg_C.cpp"): diff --git a/tools/sync_c_msg_interfaces.py b/tools/sync_c_msg_interfaces.py index ecc1057..472685f 100644 --- a/tools/sync_c_msg_interfaces.py +++ b/tools/sync_c_msg_interfaces.py @@ -24,7 +24,7 @@ #include "cMsgCInterface/SomeMsg_C.h" -The SDK ships these generated headers and definitions so external plugin C +The SDK ships these generated headers and definitions so external extension C modules can use the same include paths without adding message-specific CMake. """ diff --git a/tools/sync_headers.py b/tools/sync_headers.py index 7b62049..e8395b3 100755 --- a/tools/sync_headers.py +++ b/tools/sync_headers.py @@ -26,7 +26,7 @@ sdk/src/bsk_sdk/include/Basilisk/ -Only the headers that plugin authors need to compile against are included. +Only the headers that extension authors need to compile against are included. """ from __future__ import annotations diff --git a/tools/sync_sources.py b/tools/sync_sources.py index 6f5a4fd..ef4815c 100644 --- a/tools/sync_sources.py +++ b/tools/sync_sources.py @@ -33,8 +33,8 @@ - sync_sources.py vendors architecture utility sources into: sdk/src/bsk_sdk/arch_utilities/... -These files are compiled by the bsk-sdk CMake project so plugin authors do not -have to compile them in every plugin. +These files are compiled by the bsk-sdk CMake project so extension authors do not +have to compile them in every extension. """ from __future__ import annotations diff --git a/tools/sync_swig.py b/tools/sync_swig.py index 873b075..34efed6 100644 --- a/tools/sync_swig.py +++ b/tools/sync_swig.py @@ -30,7 +30,7 @@ sdk/tools/msgAutoSource/ -So plugin builds can depend solely on the installed `bsk-sdk` package. +So extension builds can depend solely on the installed `bsk-sdk` package. """ from __future__ import annotations From 6804f917c0766ebf3c58f5ec55d6fa3e0cd634d3 Mon Sep 17 00:00:00 2001 From: Hanspeter Schaub Date: Fri, 10 Jul 2026 14:17:50 -0600 Subject: [PATCH 2/5] [#19] Teach the BSK setup CI action to recognize b0 and a0 PEP 440 alpha/beta versions such as 2.12.0a1 and 2.12.0b0 should lead to beta-cycle PR CI testing against BSK develop and nightly wheels. --- .github/actions/setup-bsk/action.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/actions/setup-bsk/action.yml b/.github/actions/setup-bsk/action.yml index 4aecf69..fb7edcb 100644 --- a/.github/actions/setup-bsk/action.yml +++ b/.github/actions/setup-bsk/action.yml @@ -1,14 +1,14 @@ name: Set up Basilisk description: > Clones the Basilisk source tree and installs the BSK Python package set, - beta/alpha => develop branch clone + nightly wheel index + beta/alpha/aN/bN => develop branch clone + nightly wheel index rc => release tag clone + TestPyPI release => release tag clone + PyPI inputs: version: description: > - BSK version string (e.g. 2.11.0beta, 2.10.2rc1, 2.11.0). + BSK version string (e.g. 2.12.0b0, 2.10.2rc1, 2.11.0). Drives both the git ref to clone and the pip index to install from. required: true clone-source: @@ -26,7 +26,7 @@ runs: shell: bash run: | BSK="${{ inputs.version }}" - if [[ "$BSK" =~ beta|alpha ]]; then + if [[ "$BSK" =~ beta|alpha|[0-9]+(a|b)[0-9]+ ]]; then REF=develop else REF="v${BSK}" @@ -39,7 +39,7 @@ runs: shell: bash run: | BSK="${{ inputs.version }}" - if [[ "$BSK" =~ beta|alpha ]]; then + if [[ "$BSK" =~ beta|alpha|[0-9]+(a|b)[0-9]+ ]]; then pip install --pre \ --index-url https://avslab.github.io/basilisk/nightly/ \ --extra-index-url https://pypi.org/simple/ \ From 6d41480155901d46efba6f4651002ad98e5636a1 Mon Sep 17 00:00:00 2001 From: Hanspeter Schaub Date: Fri, 10 Jul 2026 15:09:28 -0600 Subject: [PATCH 3/5] [#19] update version number for the current BSK beta cycle --- pyproject.toml | 2 +- src/bsk_sdk/_bsk_version.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 111ce97..3e389ce 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ backend-path = ["."] [project] name = "bsk-sdk" -version = "2.11.0" +version = "2.12.0b0" description = "Vendored Basilisk SDK headers, runtime, and CMake integration for extension authors" readme = "README.md" license = { text = "ISC" } diff --git a/src/bsk_sdk/_bsk_version.txt b/src/bsk_sdk/_bsk_version.txt index 46b81d8..ea62c06 100644 --- a/src/bsk_sdk/_bsk_version.txt +++ b/src/bsk_sdk/_bsk_version.txt @@ -1 +1 @@ -2.11.0 +2.12.0b0 From 9be85b741143ed5741b650d9154798a2c6796e30 Mon Sep 17 00:00:00 2001 From: Hanspeter Schaub Date: Fri, 10 Jul 2026 15:10:49 -0600 Subject: [PATCH 4/5] [#19] make the sync process also sync the version numbers --- tests/test_sync_all.py | 77 ++++++++++++++++++++++++++++++++++++++++++ tools/sync_all.py | 28 ++++++++++++++- 2 files changed, 104 insertions(+), 1 deletion(-) create mode 100644 tests/test_sync_all.py diff --git a/tests/test_sync_all.py b/tests/test_sync_all.py new file mode 100644 index 0000000..45e50ce --- /dev/null +++ b/tests/test_sync_all.py @@ -0,0 +1,77 @@ +# +# ISC License +# +# Copyright (c) 2026, Autonomous Vehicle Systems Lab, University of Colorado at Boulder +# +# Permission to use, copy, modify, and/or distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +# + +from __future__ import annotations + +import sys +from pathlib import Path + +import pytest + +sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "tools")) +from sync_all import update_pyproject_version # noqa: E402 + + +def test_update_pyproject_version_updates_project_table_only(tmp_path: Path) -> None: + pyproject = tmp_path / "pyproject.toml" + pyproject.write_text( + "\n".join( + [ + "[project]", + 'name = "bsk-sdk"', + 'version = "2.11.0"', + "", + "[tool.scikit-build.cmake]", + 'version = ">=3.26"', + "", + ] + ) + ) + + update_pyproject_version(pyproject, "2.12.0b0") + + assert pyproject.read_text() == "\n".join( + [ + "[project]", + 'name = "bsk-sdk"', + 'version = "2.12.0b0"', + "", + "[tool.scikit-build.cmake]", + 'version = ">=3.26"', + "", + ] + ) + + +def test_update_pyproject_version_requires_project_version(tmp_path: Path) -> None: + pyproject = tmp_path / "pyproject.toml" + pyproject.write_text( + "\n".join( + [ + "[project]", + 'name = "bsk-sdk"', + "", + "[tool.scikit-build.cmake]", + 'version = ">=3.26"', + "", + ] + ) + ) + + with pytest.raises(RuntimeError, match=r"\[project\]\.version"): + update_pyproject_version(pyproject, "2.12.0b0") diff --git a/tools/sync_all.py b/tools/sync_all.py index 03ba5c5..f0c5e5b 100644 --- a/tools/sync_all.py +++ b/tools/sync_all.py @@ -22,6 +22,7 @@ from __future__ import annotations import argparse +import re import subprocess import sys from pathlib import Path @@ -36,10 +37,34 @@ def run(cmd: list[str], cwd: Path) -> None: BSK_VERSION_FILE = "docs/source/bskVersion.txt" +PROJECT_VERSION_RE = re.compile(r"^(\s*)version\s*=.*?(\r?\n?)$") + + +def update_pyproject_version(pyproject_path: Path, version: str) -> None: + """Set ``[project].version`` in pyproject.toml to the synced BSK version.""" + lines = pyproject_path.read_text().splitlines(keepends=True) + in_project = False + + for index, line in enumerate(lines): + stripped = line.strip() + if stripped.startswith("[") and stripped.endswith("]"): + in_project = stripped == "[project]" + continue + + if in_project: + match = PROJECT_VERSION_RE.match(line) + if match: + indent, newline = match.groups() + lines[index] = f'{indent}version = "{version}"{newline}' + pyproject_path.write_text("".join(lines)) + print(f"[bsk-sdk] Updated package version: {version} -> {pyproject_path}") + return + + raise RuntimeError(f"Could not find [project].version in {pyproject_path}") def stamp_bsk_version(bsk_root: Path, repo_root: Path) -> None: - """Read bskVersion.txt from Basilisk and write it into the SDK package.""" + """Read bskVersion.txt from Basilisk and write it into SDK metadata.""" version_file = bsk_root / BSK_VERSION_FILE if not version_file.exists(): raise FileNotFoundError( @@ -50,6 +75,7 @@ def stamp_bsk_version(bsk_root: Path, repo_root: Path) -> None: dst = repo_root / "src" / "bsk_sdk" / "_bsk_version.txt" dst.write_text(bsk_version + "\n") print(f"\n[bsk-sdk] Stamped BSK version: {bsk_version} -> {dst}") + update_pyproject_version(repo_root / "pyproject.toml", bsk_version) def sync_basilisk_submodule(repo_root: Path) -> None: From 35c27433de3cf3b9a1261003b4a6718050a29d01 Mon Sep 17 00:00:00 2001 From: Hanspeter Schaub Date: Fri, 10 Jul 2026 16:00:27 -0600 Subject: [PATCH 5/5] [#19] discuss how to use an existing local BSK folder --- AGENTS.md | 9 +++++++++ README.md | 25 +++++++++++++++++++++++-- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 5989f67..676b2d1 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -61,10 +61,19 @@ directories are ignored by git and should normally be recreated locally: Use the sync scripts rather than hand-editing generated Basilisk copies: ```bash +# Only needed once in a fresh clone: git submodule update --init --recursive + python3 tools/sync_all.py ``` +If you already have a local Basilisk checkout, point the sync scripts at it +instead of moving the submodule: + +```bash +python3 tools/sync_all.py --basilisk-root ~/Repos/basilisk +``` + For an intentional Basilisk update: ```bash diff --git a/README.md b/README.md index e8a180a..280c40e 100644 --- a/README.md +++ b/README.md @@ -46,15 +46,28 @@ complete working example. ## Syncing from Basilisk -The SDK vendors a curated subset of Basilisk headers and sources. These are -synced from a pinned Basilisk commit via a Git submodule. +The SDK vendors a curated subset of Basilisk headers and sources. By default, +these are synced from the `external/basilisk` Git submodule. For a fresh clone, +initialize the submodule once before running the default sync: ```bash +# Only needed once in a fresh clone: git submodule update --init --recursive + python3 tools/sync_all.py pip install -e . ``` +If you already have a local Basilisk checkout, point the sync script at it +directly instead of moving the submodule checkout: + +```bash +git -C ~/Repos/basilisk fetch --tags +git -C ~/Repos/basilisk checkout +python3 tools/sync_all.py --basilisk-root ~/Repos/basilisk +pip install -e . +``` + Or opt into auto-sync during build: ```bash @@ -70,6 +83,14 @@ cd ../.. python3 tools/sync_all.py ``` +Or sync from an existing Basilisk checkout without moving the submodule: + +```bash +git -C ~/Repos/basilisk fetch --tags +git -C ~/Repos/basilisk checkout +python3 tools/sync_all.py --basilisk-root ~/Repos/basilisk +``` + ## Versioning The `bsk-sdk` package version tracks the Basilisk version it was synced from