Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 91 additions & 0 deletions .clang-format
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From sparrow

Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
BasedOnStyle: Mozilla

AccessModifierOffset: '-4'
AlignAfterOpenBracket: BlockIndent
AlignEscapedNewlines: Left
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: false
# Forbid one line lambdas because clang-format makes a weird split when
# single instructions lambdas are too long.
AllowShortLambdasOnASingleLine: Empty
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: false
BinPackParameters: false
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeBraces: Allman
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeComma
BreakInheritanceList: AfterComma
BreakStringLiterals: false
ColumnLimit: '110'
ConstructorInitializerIndentWidth: '4'
ContinuationIndentWidth: '4'
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
EmptyLineAfterAccessModifier: Always
EmptyLineBeforeAccessModifier: Always
ExperimentalAutoDetectBinPacking: true
IncludeBlocks: Regroup
IncludeCategories:
- Regex: <[^.]+>
Priority: 1
- Regex: <sparrow/.+>
Priority: 3
- Regex: <.+>
Priority: 2
- Regex: '"sparrow/.+"'
Priority: 4
- Regex: '".+"'
Priority: 5
IndentCaseLabels: true
IndentPPDirectives: AfterHash
IndentWidth: '4'
IndentWrappedFunctionNames: false
InsertBraces: true
InsertTrailingCommas: Wrapped
KeepEmptyLinesAtTheStartOfBlocks: false
LambdaBodyIndentation: Signature
Language: Cpp
MaxEmptyLinesToKeep: '2'
NamespaceIndentation: All
ObjCBlockIndentWidth: '4'
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: false
PackConstructorInitializers: Never
PenaltyBreakAssignment: 100000
PenaltyBreakBeforeFirstCallParameter: 0
PenaltyBreakComment: 10
PenaltyBreakOpenParenthesis: 0
PenaltyBreakTemplateDeclaration: 0
PenaltyExcessCharacter: 10
PenaltyIndentedWhitespace: 0
PenaltyReturnTypeOnItsOwnLine: 10
PointerAlignment: Left
QualifierAlignment: Custom # Experimental
QualifierOrder: [inline, static, constexpr, const, volatile, type]
ReflowComments: true
SeparateDefinitionBlocks: Always
SortIncludes: CaseInsensitive
SortUsingDeclarations: true
SpaceAfterCStyleCast: true
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: '2'
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: c++20
TabWidth: '4'
UseTab: Never
18 changes: 18 additions & 0 deletions .clang-tidy
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From sparrow

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
Checks: 'clang-diagnostic-*,clang-analyzer-*,cppcoreguidelines-*,modernize-*,performance-*,portability-*,-modernize-use-trailing-return-type'
WarningsAsErrors: ''
HeaderFileExtensions:
- ''
- h
- hh
- hpp
- hxx
ImplementationFileExtensions:
- c
- cc
- cpp
- cxx
HeaderFilterRegex: ''
FormatStyle: file
SystemHeaders: false
...
90 changes: 90 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Linux build and test

on:
workflow_dispatch:
pull_request:
push:
branches: [main]

defaults:
run:
shell: bash -l -eo pipefail {0}

jobs:
linux_build_from_conda_forge:
runs-on: ubuntu-latest
strategy:
matrix:
build_type: [Release, Debug]
build_shared: [ON, OFF]
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Create build environment
uses: mamba-org/setup-micromamba@v2
with:
environment-file: ./environment-dev.yml
environment-name: build_env
cache-environment: true

- name: Configure using cmake
run: |
cmake -G Ninja \
-Bbuild \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \
-DCMAKE_PREFIX_PATH=$CONDA_PREFIX \
-DSPARROW_PYCAPSULE_BUILD_SHARED=${{ matrix.build_shared }} \
-DSPARROW_PYCAPSULE_BUILD_TESTS=ON

- name: Build sparrow-pycapsule
working-directory: build
run: cmake --build . --target sparrow-pycapsule

- name: Build tests
working-directory: build
run: cmake --build . --target test_sparrow_pycapsule_lib

- name: Run tests
working-directory: build
run: cmake --build . --target run_tests_with_junit_report
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The target run_tests_with_junit_report is referenced in the workflow but is never defined in the test CMakeLists.txt. The actual test target defined is run_pycapsule_tests (line 47 in test/CMakeLists.txt). This will cause the workflow to fail when trying to run tests.

Copilot uses AI. Check for mistakes.

- name: Install
working-directory: build
run: cmake --install .

linux_build_fetch_from_source:
runs-on: ubuntu-latest
strategy:
matrix:
build_type: [Release, Debug]
build_shared: [ON, OFF]
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Configure using cmake
run: |
cmake -G Ninja \
-Bbuild \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DSPARROW_PYCAPSULE_BUILD_SHARED=${{ matrix.build_shared }} \
-DSPARROW_PYCAPSULE_BUILD_TESTS=ON \
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CMake variable name inconsistency: The project uses BUILD_TESTS option, but this workflow references SPARROW_PYCAPSULE_BUILD_TESTS. This mismatch will cause the tests not to be built when using the workflow commands.

Copilot uses AI. Check for mistakes.
-DFETCH_DEPENDENCIES_WITH_CMAKE=MISSING

- name: Build sparrow-pycapsule
working-directory: build
run: cmake --build . --target sparrow-pycapsule

- name: Build tests
working-directory: build
run: cmake --build . --target test_sparrow_pycapsule_lib

- name: Run tests
working-directory: build
run: cmake --build . --target run_tests_with_junit_report
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The target run_tests_with_junit_report is referenced in the workflow but is never defined in the test CMakeLists.txt. The actual test target defined is run_pycapsule_tests (line 47 in test/CMakeLists.txt). This will cause the workflow to fail when trying to run tests.

Copilot uses AI. Check for mistakes.

- name: Install
working-directory: build
run: sudo cmake --install .
100 changes: 100 additions & 0 deletions .github/workflows/osx.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: OSX build and test

on:
workflow_dispatch:
pull_request:
push:
branches: [main]

defaults:
run:
shell: bash -l -eo pipefail {0}

jobs:
osx_build_from_conda_forge:
runs-on: macos-latest
strategy:
matrix:
build_type: [Release, Debug]
build_shared: [ON, OFF]
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Select XCode version
run: |
sudo xcode-select --switch /Applications/Xcode_16.4.app/Contents/Developer
xcodebuild -version

- name: Create build environment
uses: mamba-org/setup-micromamba@v2
with:
environment-file: ./environment-dev.yml
environment-name: build_env
cache-environment: true

- name: Configure using cmake
run: |
cmake -G Ninja \
-Bbuild \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \
-DCMAKE_PREFIX_PATH=$CONDA_PREFIX \
-DSPARROW_PYCAPSULE_BUILD_SHARED=${{ matrix.build_shared }} \
-DSPARROW_PYCAPSULE_BUILD_TESTS=ON

- name: Build sparrow-pycapsule
working-directory: build
run: cmake --build . --target sparrow-pycapsule

- name: Build tests
working-directory: build
run: cmake --build . --target test_sparrow_pycapsule_lib

- name: Run tests
working-directory: build
run: cmake --build . --target run_tests_with_junit_report
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The target run_tests_with_junit_report is referenced in the workflow but is never defined in the test CMakeLists.txt. The actual test target defined is run_pycapsule_tests (line 47 in test/CMakeLists.txt). This will cause the workflow to fail when trying to run tests.

Copilot uses AI. Check for mistakes.

- name: Install
working-directory: build
run: cmake --install .

osx_build_fetch_from_source:
runs-on: macos-latest
strategy:
matrix:
build_type: [Release, Debug]
build_shared: [ON, OFF]
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Select XCode version
run: |
sudo xcode-select --switch /Applications/Xcode_16.4.app/Contents/Developer
xcodebuild -version

- name: Configure using cmake
run: |
cmake -G Ninja \
-Bbuild \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DSPARROW_PYCAPSULE_BUILD_SHARED=${{ matrix.build_shared }} \
-DSPARROW_PYCAPSULE_BUILD_TESTS=ON \
-DFETCH_DEPENDENCIES_WITH_CMAKE=MISSING

- name: Build sparrow-pycapsule
working-directory: build
run: cmake --build . --target sparrow-pycapsule

- name: Build tests
working-directory: build
run: cmake --build . --target test_sparrow_pycapsule_lib

- name: Run tests
working-directory: build
run: cmake --build . --target run_tests_with_junit_report
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The target run_tests_with_junit_report is referenced in the workflow but is never defined in the test CMakeLists.txt. The actual test target defined is run_pycapsule_tests (line 47 in test/CMakeLists.txt). This will cause the workflow to fail when trying to run tests.

Copilot uses AI. Check for mistakes.

- name: Install
working-directory: build
run: sudo cmake --install .
94 changes: 94 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Windows build and test

on:
workflow_dispatch:
pull_request:
push:
branches: [main]

defaults:
run:
shell: bash -e -l {0}

jobs:
windows_build_from_conda_forge:
runs-on: windows-latest
strategy:
matrix:
build_type: [Release, Debug]
build_shared: [ON, OFF]
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Create build environment
uses: mamba-org/setup-micromamba@v2
with:
environment-file: ./environment-dev.yml
environment-name: build_env
init-shell: bash
cache-environment: true

- name: Configure using cmake
run: |
if [ "${{ matrix.build_type }}" == "Release" ]; then
GLOB_PREFIX_PATH="$CONDA_PREFIX"
elif [ "${{ matrix.build_type }}" == "Debug" ]; then
GLOB_PREFIX_PATH="$CONDA_PREFIX/Library/debug;$CONDA_PREFIX"
fi
cmake -S ./ -B ./build \
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \
-DCMAKE_PREFIX_PATH=$GLOB_PREFIX_PATH \
-DSPARROW_PYCAPSULE_BUILD_SHARED=${{ matrix.build_shared }} \
-DSPARROW_PYCAPSULE_BUILD_TESTS=ON

- name: Build sparrow-pycapsule
working-directory: build
run: cmake --build . --config ${{ matrix.build_type }} --target sparrow-pycapsule

- name: Build tests
working-directory: build
run: cmake --build . --config ${{ matrix.build_type }} --target test_sparrow_pycapsule_lib

- name: Run tests
working-directory: build
run: |
cmake --build . --config ${{ matrix.build_type }} --target run_tests_with_junit_report
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The target run_tests_with_junit_report is referenced in the workflow but is never defined in the test CMakeLists.txt. The actual test target defined is run_pycapsule_tests (line 47 in test/CMakeLists.txt). This will cause the workflow to fail when trying to run tests.

Copilot uses AI. Check for mistakes.

- name: Install
working-directory: build
run: cmake --install . --config ${{ matrix.build_type }}

windows_build_fetch_from_source:
runs-on: windows-latest
strategy:
matrix:
build_type: [Release, Debug]
build_shared: [ON, OFF]
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Configure using cmake
run: |
cmake -S ./ -B ./build \
-DSPARROW_PYCAPSULE_BUILD_SHARED=${{ matrix.build_shared }} \
-DSPARROW_PYCAPSULE_BUILD_TESTS=ON \
-DFETCH_DEPENDENCIES_WITH_CMAKE=MISSING

- name: Build sparrow-pycapsule
working-directory: build
run: cmake --build . --config ${{ matrix.build_type }} --target sparrow-pycapsule

- name: Build tests
working-directory: build
run: cmake --build . --config ${{ matrix.build_type }} --target test_sparrow_pycapsule_lib

- name: Run tests
working-directory: build
run: cmake --build . --config ${{ matrix.build_type }} --target run_tests_with_junit_report
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The target run_tests_with_junit_report is referenced in the workflow but is never defined in the test CMakeLists.txt. The actual test target defined is run_pycapsule_tests (line 47 in test/CMakeLists.txt). This will cause the workflow to fail when trying to run tests.

Copilot uses AI. Check for mistakes.

- name: Install
working-directory: build
run: cmake --install . --config ${{ matrix.build_type }}

Loading