From f4345a91a16d4074bc515496a57c79cb466bb113 Mon Sep 17 00:00:00 2001 From: froejdh_e Date: Fri, 13 Jun 2025 16:13:17 +0200 Subject: [PATCH 1/2] added workflow for python wheels --- .github/workflows/build_wheel.yml | 64 +++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 .github/workflows/build_wheel.yml diff --git a/.github/workflows/build_wheel.yml b/.github/workflows/build_wheel.yml new file mode 100644 index 000000000..f131e7775 --- /dev/null +++ b/.github/workflows/build_wheel.yml @@ -0,0 +1,64 @@ +name: Build wheel + +on: + workflow_dispatch: + pull_request: + push: + branches: + - main + release: + types: + - published + + +jobs: + build_wheels: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest,] + + steps: + - uses: actions/checkout@v4 + + - name: Build wheels + run: pipx run cibuildwheel==2.23.0 + + - uses: actions/upload-artifact@v4 + with: + name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} + path: ./wheelhouse/*.whl + + build_sdist: + name: Build source distribution + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Build sdist + run: pipx run build --sdist + + - uses: actions/upload-artifact@v4 + with: + name: cibw-sdist + path: dist/*.tar.gz + + upload_pypi: + needs: [build_wheels, build_sdist] + runs-on: ubuntu-latest + environment: pypi + permissions: + id-token: write + if: github.event_name == 'release' && github.event.action == 'published' + # or, alternatively, upload to PyPI on every tag starting with 'v' (remove on: release above to use this) + # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') + steps: + - uses: actions/download-artifact@v4 + with: + # unpacks all CIBW artifacts into dist/ + pattern: cibw-* + path: dist + merge-multiple: true + + - uses: pypa/gh-action-pypi-publish@release/v1 From 925176b6618368a2a291f1b2bdf7b3d81ff6b13d Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Mon, 16 Jun 2025 22:10:44 +0200 Subject: [PATCH 2/2] formatting --- slsSupportLib/include/sls/StaticVector.h | 8 +++++--- slsSupportLib/include/sls/versionAPI.h | 1 - slsSupportLib/src/ToString.cpp | 7 +------ slsSupportLib/tests/test-StaticVector.cpp | 4 ---- slsSupportLib/tests/test-ToString.cpp | 1 - 5 files changed, 6 insertions(+), 15 deletions(-) diff --git a/slsSupportLib/include/sls/StaticVector.h b/slsSupportLib/include/sls/StaticVector.h index cf72aa05d..931ea17fa 100644 --- a/slsSupportLib/include/sls/StaticVector.h +++ b/slsSupportLib/include/sls/StaticVector.h @@ -113,10 +113,12 @@ template class StaticVector { // auto begin() noexcept -> decltype(data_.begin()) { return data_.begin(); // } const_iterator begin() const noexcept { return data_.begin(); } - iterator end() noexcept { return data_.begin()+current_size; } - const_iterator end() const noexcept { return data_.begin()+current_size; } + iterator end() noexcept { return data_.begin() + current_size; } + const_iterator end() const noexcept { return data_.begin() + current_size; } const_iterator cbegin() const noexcept { return data_.cbegin(); } - const_iterator cend() const noexcept { return data_.cbegin()+current_size; } + const_iterator cend() const noexcept { + return data_.cbegin() + current_size; + } void size_check(size_type s) const { if (s > Capacity) { diff --git a/slsSupportLib/include/sls/versionAPI.h b/slsSupportLib/include/sls/versionAPI.h index 0453a3846..d88a71ba8 100644 --- a/slsSupportLib/include/sls/versionAPI.h +++ b/slsSupportLib/include/sls/versionAPI.h @@ -10,4 +10,3 @@ #define APIXILINXCTB "0.0.0 0x250523" #define APIJUNGFRAU "0.0.0 0x250523" #define APIMYTHEN3 "0.0.0 0x250523" - diff --git a/slsSupportLib/src/ToString.cpp b/slsSupportLib/src/ToString.cpp index 1e109d9b1..212514f6f 100644 --- a/slsSupportLib/src/ToString.cpp +++ b/slsSupportLib/src/ToString.cpp @@ -5,12 +5,7 @@ namespace sls { - -std::string ToString(bool value) { - return value ? "1" : "0"; -} - - +std::string ToString(bool value) { return value ? "1" : "0"; } std::string ToString(const slsDetectorDefs::xy &coord) { std::ostringstream oss; diff --git a/slsSupportLib/tests/test-StaticVector.cpp b/slsSupportLib/tests/test-StaticVector.cpp index 2ff548fce..fc40f1a0f 100644 --- a/slsSupportLib/tests/test-StaticVector.cpp +++ b/slsSupportLib/tests/test-StaticVector.cpp @@ -8,15 +8,12 @@ #include #include - using sls::StaticVector; TEST_CASE("StaticVector is a container") { REQUIRE(sls::is_container>::value == true); } - - TEST_CASE("Comparing StaticVector containers") { StaticVector a{0, 1, 2}; StaticVector b{0, 1, 2}; @@ -344,4 +341,3 @@ TEST_CASE("StaticVector stream") { oss << vec; REQUIRE(oss.str() == "[33, 85667, 2]"); } - diff --git a/slsSupportLib/tests/test-ToString.cpp b/slsSupportLib/tests/test-ToString.cpp index 4232169eb..76ee87245 100644 --- a/slsSupportLib/tests/test-ToString.cpp +++ b/slsSupportLib/tests/test-ToString.cpp @@ -26,7 +26,6 @@ TEST_CASE("Convert string to bool", "[support]") { REQUIRE(StringTo("0") == false); } - TEST_CASE("Integer conversions", "[support]") { REQUIRE(ToString(0) == "0"); REQUIRE(ToString(1) == "1");