Skip to content

Commit 646a1cd

Browse files
authored
Merge pull request #1 from Alex-PLACET/add_initiale_code
Add sparrow pycapsule
2 parents 064a572 + 089896d commit 646a1cd

20 files changed

+1908
-0
lines changed

.clang-format

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
BasedOnStyle: Mozilla
2+
3+
AccessModifierOffset: '-4'
4+
AlignAfterOpenBracket: BlockIndent
5+
AlignEscapedNewlines: Left
6+
AllowAllArgumentsOnNextLine: false
7+
AllowAllParametersOfDeclarationOnNextLine: false
8+
AllowShortBlocksOnASingleLine: false
9+
AllowShortCaseLabelsOnASingleLine: false
10+
AllowShortFunctionsOnASingleLine: false
11+
AllowShortIfStatementsOnASingleLine: false
12+
# Forbid one line lambdas because clang-format makes a weird split when
13+
# single instructions lambdas are too long.
14+
AllowShortLambdasOnASingleLine: Empty
15+
AllowShortLoopsOnASingleLine: false
16+
AlwaysBreakAfterDefinitionReturnType: None
17+
AlwaysBreakAfterReturnType: None
18+
AlwaysBreakTemplateDeclarations: Yes
19+
BinPackArguments: false
20+
BinPackParameters: false
21+
BreakBeforeBinaryOperators: NonAssignment
22+
BreakBeforeBraces: Allman
23+
BreakBeforeTernaryOperators: true
24+
BreakConstructorInitializers: BeforeComma
25+
BreakInheritanceList: AfterComma
26+
BreakStringLiterals: false
27+
ColumnLimit: '110'
28+
ConstructorInitializerIndentWidth: '4'
29+
ContinuationIndentWidth: '4'
30+
Cpp11BracedListStyle: true
31+
DerivePointerAlignment: false
32+
DisableFormat: false
33+
EmptyLineAfterAccessModifier: Always
34+
EmptyLineBeforeAccessModifier: Always
35+
ExperimentalAutoDetectBinPacking: true
36+
IncludeBlocks: Regroup
37+
IncludeCategories:
38+
- Regex: <[^.]+>
39+
Priority: 1
40+
- Regex: <sparrow/.+>
41+
Priority: 3
42+
- Regex: <.+>
43+
Priority: 2
44+
- Regex: '"sparrow/.+"'
45+
Priority: 4
46+
- Regex: '".+"'
47+
Priority: 5
48+
IndentCaseLabels: true
49+
IndentPPDirectives: AfterHash
50+
IndentWidth: '4'
51+
IndentWrappedFunctionNames: false
52+
InsertBraces: true
53+
InsertTrailingCommas: Wrapped
54+
KeepEmptyLinesAtTheStartOfBlocks: false
55+
LambdaBodyIndentation: Signature
56+
Language: Cpp
57+
MaxEmptyLinesToKeep: '2'
58+
NamespaceIndentation: All
59+
ObjCBlockIndentWidth: '4'
60+
ObjCSpaceAfterProperty: false
61+
ObjCSpaceBeforeProtocolList: false
62+
PackConstructorInitializers: Never
63+
PenaltyBreakAssignment: 100000
64+
PenaltyBreakBeforeFirstCallParameter: 0
65+
PenaltyBreakComment: 10
66+
PenaltyBreakOpenParenthesis: 0
67+
PenaltyBreakTemplateDeclaration: 0
68+
PenaltyExcessCharacter: 10
69+
PenaltyIndentedWhitespace: 0
70+
PenaltyReturnTypeOnItsOwnLine: 10
71+
PointerAlignment: Left
72+
QualifierAlignment: Custom # Experimental
73+
QualifierOrder: [inline, static, constexpr, const, volatile, type]
74+
ReflowComments: true
75+
SeparateDefinitionBlocks: Always
76+
SortIncludes: CaseInsensitive
77+
SortUsingDeclarations: true
78+
SpaceAfterCStyleCast: true
79+
SpaceAfterTemplateKeyword: true
80+
SpaceBeforeAssignmentOperators: true
81+
SpaceBeforeParens: ControlStatements
82+
SpaceInEmptyParentheses: false
83+
SpacesBeforeTrailingComments: '2'
84+
SpacesInAngles: false
85+
SpacesInCStyleCastParentheses: false
86+
SpacesInContainerLiterals: false
87+
SpacesInParentheses: false
88+
SpacesInSquareBrackets: false
89+
Standard: c++20
90+
TabWidth: '4'
91+
UseTab: Never

.clang-tidy

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
Checks: 'clang-diagnostic-*,clang-analyzer-*,cppcoreguidelines-*,modernize-*,performance-*,portability-*,-modernize-use-trailing-return-type'
3+
WarningsAsErrors: ''
4+
HeaderFileExtensions:
5+
- ''
6+
- h
7+
- hh
8+
- hpp
9+
- hxx
10+
ImplementationFileExtensions:
11+
- c
12+
- cc
13+
- cpp
14+
- cxx
15+
HeaderFilterRegex: ''
16+
FormatStyle: file
17+
SystemHeaders: false
18+
...

.github/workflows/linux.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: Linux build and test
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
push:
7+
branches: [main]
8+
9+
defaults:
10+
run:
11+
shell: bash -l -eo pipefail {0}
12+
13+
jobs:
14+
linux_build_from_conda_forge:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
build_type: [Release, Debug]
19+
build_shared: [ON, OFF]
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
24+
- name: Create build environment
25+
uses: mamba-org/setup-micromamba@v2
26+
with:
27+
environment-file: ./environment-dev.yml
28+
environment-name: build_env
29+
cache-environment: true
30+
31+
- name: Configure using cmake
32+
run: |
33+
cmake -G Ninja \
34+
-Bbuild \
35+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
36+
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \
37+
-DCMAKE_PREFIX_PATH=$CONDA_PREFIX \
38+
-DSPARROW_PYCAPSULE_BUILD_SHARED=${{ matrix.build_shared }} \
39+
-DSPARROW_PYCAPSULE_BUILD_TESTS=ON
40+
41+
- name: Build sparrow-pycapsule
42+
working-directory: build
43+
run: cmake --build . --target sparrow-pycapsule
44+
45+
- name: Build tests
46+
working-directory: build
47+
run: cmake --build . --target test_sparrow_pycapsule_lib
48+
49+
- name: Run tests
50+
working-directory: build
51+
run: cmake --build . --target run_tests_with_junit_report
52+
53+
- name: Install
54+
working-directory: build
55+
run: cmake --install .
56+
57+
linux_build_fetch_from_source:
58+
runs-on: ubuntu-latest
59+
strategy:
60+
matrix:
61+
build_type: [Release, Debug]
62+
build_shared: [ON, OFF]
63+
steps:
64+
- name: Checkout repository
65+
uses: actions/checkout@v4
66+
67+
- name: Configure using cmake
68+
run: |
69+
cmake -G Ninja \
70+
-Bbuild \
71+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
72+
-DSPARROW_PYCAPSULE_BUILD_SHARED=${{ matrix.build_shared }} \
73+
-DSPARROW_PYCAPSULE_BUILD_TESTS=ON \
74+
-DFETCH_DEPENDENCIES_WITH_CMAKE=MISSING
75+
76+
- name: Build sparrow-pycapsule
77+
working-directory: build
78+
run: cmake --build . --target sparrow-pycapsule
79+
80+
- name: Build tests
81+
working-directory: build
82+
run: cmake --build . --target test_sparrow_pycapsule_lib
83+
84+
- name: Run tests
85+
working-directory: build
86+
run: cmake --build . --target run_tests_with_junit_report
87+
88+
- name: Install
89+
working-directory: build
90+
run: sudo cmake --install .

.github/workflows/osx.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: OSX build and test
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
push:
7+
branches: [main]
8+
9+
defaults:
10+
run:
11+
shell: bash -l -eo pipefail {0}
12+
13+
jobs:
14+
osx_build_from_conda_forge:
15+
runs-on: macos-latest
16+
strategy:
17+
matrix:
18+
build_type: [Release, Debug]
19+
build_shared: [ON, OFF]
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
24+
- name: Select XCode version
25+
run: |
26+
sudo xcode-select --switch /Applications/Xcode_16.4.app/Contents/Developer
27+
xcodebuild -version
28+
29+
- name: Create build environment
30+
uses: mamba-org/setup-micromamba@v2
31+
with:
32+
environment-file: ./environment-dev.yml
33+
environment-name: build_env
34+
cache-environment: true
35+
36+
- name: Configure using cmake
37+
run: |
38+
cmake -G Ninja \
39+
-Bbuild \
40+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
41+
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \
42+
-DCMAKE_PREFIX_PATH=$CONDA_PREFIX \
43+
-DSPARROW_PYCAPSULE_BUILD_SHARED=${{ matrix.build_shared }} \
44+
-DSPARROW_PYCAPSULE_BUILD_TESTS=ON
45+
46+
- name: Build sparrow-pycapsule
47+
working-directory: build
48+
run: cmake --build . --target sparrow-pycapsule
49+
50+
- name: Build tests
51+
working-directory: build
52+
run: cmake --build . --target test_sparrow_pycapsule_lib
53+
54+
- name: Run tests
55+
working-directory: build
56+
run: cmake --build . --target run_tests_with_junit_report
57+
58+
- name: Install
59+
working-directory: build
60+
run: cmake --install .
61+
62+
osx_build_fetch_from_source:
63+
runs-on: macos-latest
64+
strategy:
65+
matrix:
66+
build_type: [Release, Debug]
67+
build_shared: [ON, OFF]
68+
steps:
69+
- name: Checkout repository
70+
uses: actions/checkout@v4
71+
72+
- name: Select XCode version
73+
run: |
74+
sudo xcode-select --switch /Applications/Xcode_16.4.app/Contents/Developer
75+
xcodebuild -version
76+
77+
- name: Configure using cmake
78+
run: |
79+
cmake -G Ninja \
80+
-Bbuild \
81+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
82+
-DSPARROW_PYCAPSULE_BUILD_SHARED=${{ matrix.build_shared }} \
83+
-DSPARROW_PYCAPSULE_BUILD_TESTS=ON \
84+
-DFETCH_DEPENDENCIES_WITH_CMAKE=MISSING
85+
86+
- name: Build sparrow-pycapsule
87+
working-directory: build
88+
run: cmake --build . --target sparrow-pycapsule
89+
90+
- name: Build tests
91+
working-directory: build
92+
run: cmake --build . --target test_sparrow_pycapsule_lib
93+
94+
- name: Run tests
95+
working-directory: build
96+
run: cmake --build . --target run_tests_with_junit_report
97+
98+
- name: Install
99+
working-directory: build
100+
run: sudo cmake --install .

.github/workflows/windows.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: Windows build and test
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
push:
7+
branches: [main]
8+
9+
defaults:
10+
run:
11+
shell: bash -e -l {0}
12+
13+
jobs:
14+
windows_build_from_conda_forge:
15+
runs-on: windows-latest
16+
strategy:
17+
matrix:
18+
build_type: [Release, Debug]
19+
build_shared: [ON, OFF]
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
24+
- name: Create build environment
25+
uses: mamba-org/setup-micromamba@v2
26+
with:
27+
environment-file: ./environment-dev.yml
28+
environment-name: build_env
29+
init-shell: bash
30+
cache-environment: true
31+
32+
- name: Configure using cmake
33+
run: |
34+
if [ "${{ matrix.build_type }}" == "Release" ]; then
35+
GLOB_PREFIX_PATH="$CONDA_PREFIX"
36+
elif [ "${{ matrix.build_type }}" == "Debug" ]; then
37+
GLOB_PREFIX_PATH="$CONDA_PREFIX/Library/debug;$CONDA_PREFIX"
38+
fi
39+
cmake -S ./ -B ./build \
40+
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \
41+
-DCMAKE_PREFIX_PATH=$GLOB_PREFIX_PATH \
42+
-DSPARROW_PYCAPSULE_BUILD_SHARED=${{ matrix.build_shared }} \
43+
-DSPARROW_PYCAPSULE_BUILD_TESTS=ON
44+
45+
- name: Build sparrow-pycapsule
46+
working-directory: build
47+
run: cmake --build . --config ${{ matrix.build_type }} --target sparrow-pycapsule
48+
49+
- name: Build tests
50+
working-directory: build
51+
run: cmake --build . --config ${{ matrix.build_type }} --target test_sparrow_pycapsule_lib
52+
53+
- name: Run tests
54+
working-directory: build
55+
run: |
56+
cmake --build . --config ${{ matrix.build_type }} --target run_tests_with_junit_report
57+
58+
- name: Install
59+
working-directory: build
60+
run: cmake --install . --config ${{ matrix.build_type }}
61+
62+
windows_build_fetch_from_source:
63+
runs-on: windows-latest
64+
strategy:
65+
matrix:
66+
build_type: [Release, Debug]
67+
build_shared: [ON, OFF]
68+
steps:
69+
- name: Checkout repository
70+
uses: actions/checkout@v4
71+
72+
- name: Configure using cmake
73+
run: |
74+
cmake -S ./ -B ./build \
75+
-DSPARROW_PYCAPSULE_BUILD_SHARED=${{ matrix.build_shared }} \
76+
-DSPARROW_PYCAPSULE_BUILD_TESTS=ON \
77+
-DFETCH_DEPENDENCIES_WITH_CMAKE=MISSING
78+
79+
- name: Build sparrow-pycapsule
80+
working-directory: build
81+
run: cmake --build . --config ${{ matrix.build_type }} --target sparrow-pycapsule
82+
83+
- name: Build tests
84+
working-directory: build
85+
run: cmake --build . --config ${{ matrix.build_type }} --target test_sparrow_pycapsule_lib
86+
87+
- name: Run tests
88+
working-directory: build
89+
run: cmake --build . --config ${{ matrix.build_type }} --target run_tests_with_junit_report
90+
91+
- name: Install
92+
working-directory: build
93+
run: cmake --install . --config ${{ matrix.build_type }}
94+

0 commit comments

Comments
 (0)