Skip to content
This repository was archived by the owner on Jul 14, 2025. It is now read-only.

Commit 057c560

Browse files
author
Evert
committed
Parity with v1.3.0
0 parents  commit 057c560

File tree

479 files changed

+70024
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

479 files changed

+70024
-0
lines changed

.clang-format

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
BasedOnStyle: LLVM
3+
SortIncludes: false
4+
TabWidth: 4
5+
IndentWidth: 4
6+
ColumnLimit: 120
7+
AllowShortFunctionsOnASingleLine: false
8+
---
9+
UseTab: ForIndentation
10+
DerivePointerAlignment: false
11+
PointerAlignment: Right
12+
AlignConsecutiveMacros: true
13+
AlignTrailingComments: true
14+
AllowAllArgumentsOnNextLine: true
15+
AllowAllConstructorInitializersOnNextLine: true
16+
AllowAllParametersOfDeclarationOnNextLine: true
17+
AlignAfterOpenBracket: Align
18+
SpaceBeforeCpp11BracedList: true
19+
SpaceBeforeCtorInitializerColon: true
20+
SpaceBeforeInheritanceColon: true
21+
SpacesInAngles: false
22+
SpacesInCStyleCastParentheses: false
23+
SpacesInConditionalStatement: false
24+
AllowShortLambdasOnASingleLine: Inline
25+
AllowShortLoopsOnASingleLine: false
26+
AlwaysBreakTemplateDeclarations: Yes
27+
IncludeBlocks: Regroup
28+
Language: Cpp
29+
AccessModifierOffset: -4
30+
---
31+
Language: Java
32+
SpaceAfterCStyleCast: true
33+
---

.clang-tidy

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
Checks: '-*,clang-diagnostic-*,bugprone-*,performance-*,google-explicit-constructor,google-build-using-namespace,google-runtime-int,misc-definitions-in-headers,modernize-use-nullptr,modernize-use-override,-bugprone-macro-parentheses,readability-braces-around-statements,-bugprone-branch-clone,readability-identifier-naming,hicpp-exception-baseclass,misc-throw-by-value-catch-by-reference,-bugprone-signed-char-misuse,-bugprone-misplaced-widening-cast,-bugprone-sizeof-expression,-bugprone-easily-swappable-parameters,google-global-names-in-headers,llvm-header-guard,misc-definitions-in-headers,modernize-use-emplace,modernize-use-bool-literals,-performance-inefficient-string-concatenation,-performance-no-int-to-ptr,readability-container-size-empty,cppcoreguidelines-pro-type-cstyle-cast,-llvm-header-guard,-performance-enum-size,cppcoreguidelines-pro-type-const-cast,cppcoreguidelines-avoid-non-const-global-variables,cppcoreguidelines-interfaces-global-init,cppcoreguidelines-slicing,cppcoreguidelines-rvalue-reference-param-not-moved,cppcoreguidelines-virtual-class-destructor,-readability-identifier-naming,-bugprone-exception-escape,-bugprone-unused-local-non-trivial-variable,-bugprone-empty-catch'
2+
WarningsAsErrors: '*'
3+
HeaderFilterRegex: 'src/include/duckdb/.*'
4+
FormatStyle: none
5+
CheckOptions:
6+
- key: readability-identifier-naming.ClassCase
7+
value: CamelCase
8+
- key: readability-identifier-naming.EnumCase
9+
value: CamelCase
10+
- key: readability-identifier-naming.TypedefCase
11+
value: lower_case
12+
- key: readability-identifier-naming.TypedefSuffix
13+
value: _t
14+
- key: readability-identifier-naming.FunctionCase
15+
value: CamelCase
16+
- key: readability-identifier-naming.MemberCase
17+
value: lower_case
18+
- key: readability-identifier-naming.ParameterCase
19+
value: lower_case
20+
- key: readability-identifier-naming.ConstantCase
21+
value: aNy_CasE
22+
- key: readability-identifier-naming.ConstantParameterCase
23+
value: lower_case
24+
- key: readability-identifier-naming.NamespaceCase
25+
value: lower_case
26+
- key: readability-identifier-naming.MacroDefinitionCase
27+
value: UPPER_CASE
28+
- key: readability-identifier-naming.StaticConstantCase
29+
value: UPPER_CASE
30+
- key: readability-identifier-naming.ConstantMemberCase
31+
value: aNy_CasE
32+
- key: readability-identifier-naming.StaticVariableCase
33+
value: UPPER_CASE
34+
- key: readability-identifier-naming.ClassConstantCase
35+
value: UPPER_CASE
36+
- key: readability-identifier-naming.EnumConstantCase
37+
value: UPPER_CASE
38+
- key: readability-identifier-naming.ConstexprVariableCase
39+
value: aNy_CasE
40+
- key: readability-identifier-naming.StaticConstantCase
41+
value: UPPER_CASE
42+
- key: readability-identifier-naming.TemplateTemplateParameterCase
43+
value: UPPER_CASE
44+
- key: readability-identifier-naming.TypeTemplateParameterCase
45+
value: UPPER_CASE
46+
- key: readability-identifier-naming.VariableCase
47+
value: lower_case
48+
- key: modernize-use-emplace.SmartPointers
49+
value: '::duckdb::shared_ptr;::duckdb::unique_ptr;::std::auto_ptr;::duckdb::weak_ptr'
50+
- key: cppcoreguidelines-rvalue-reference-param-not-moved.IgnoreUnnamedParams
51+
value: true
52+

.clangd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CompileFlags:
2+
CompilationDatabase: build/clangd
3+
Add: -Wno-unqualified-std-cast-call

.codecov.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
comment: false
2+
coverage:
3+
precision: 2
4+
round: down
5+
range: "0...100"
6+
status:
7+
project:
8+
default:
9+
# advanced settings
10+
if_not_found: success
11+
if_ci_failed: failure
12+
informational: true
13+
only_pulls: false
14+
patch:
15+
default:
16+
branches:
17+
- main
18+
if_not_found: success
19+
if_ci_failed: error
20+
informational: true
21+
only_pulls: true
22+
paths:
23+
- "src"

.editorconfig

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Unix-style newlines with a newline ending every file
2+
[*.{c,cpp,h,hpp}]
3+
end_of_line = lf
4+
insert_final_newline = true
5+
indent_style = tab
6+
tab_width = 4
7+
indent_size = tab
8+
trim_trailing_whitespace = true
9+
charset = utf-8
10+
max_line_length = 120
11+
x-soft-wrap-text = true
12+
x-soft-wrap-mode = CharacterWidth
13+
x-soft-wrap-limit = 120
14+
x-show-invisibles = false
15+
x-show-spaces = false
16+
17+
[*.{java}]
18+
end_of_line = lf
19+
insert_final_newline = true
20+
indent_style = tab
21+
tab_width = 4
22+
indent_size = tab
23+
trim_trailing_whitespace = false
24+
charset = utf-8
25+
max_line_length = 120
26+
x-soft-wrap-text = true
27+
x-soft-wrap-mode = CharacterWidth
28+
x-soft-wrap-limit = 120
29+
x-show-invisibles = false
30+
x-show-spaces = false
31+
32+
[*.{test,test_slow,test_coverage,benchmark}]
33+
end_of_line = lf
34+
insert_final_newline = true
35+
indent_style = tab
36+
tab_width = 4
37+
indent_size = tab
38+
trim_trailing_whitespace = false
39+
charset = utf-8
40+
x-soft-wrap-text = false
41+
42+
[Makefile]
43+
end_of_line = lf
44+
insert_final_newline = true
45+
indent_style = tab
46+
tab_width = 4
47+
indent_size = tab
48+
trim_trailing_whitespace = true
49+
charset = utf-8
50+
x-soft-wrap-text = false
51+
52+
[*keywords.list]
53+
insert_final_newline = false

.github/workflows/coverage.yml

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
name: Test coverage
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
git_ref:
6+
type: string
7+
description: Git ref of the DuckDB python package
8+
default: refs/heads/main
9+
required: true
10+
duckdb_git_ref:
11+
type: string
12+
description: Git ref of DuckDB
13+
testsuite:
14+
type: choice
15+
description: Testsuite to run ('all' or 'fast')
16+
default: all
17+
required: true
18+
options:
19+
- all
20+
- fast
21+
workflow_call:
22+
inputs:
23+
git_ref:
24+
type: string
25+
description: Git ref of the DuckDB python package
26+
required: true
27+
duckdb_git_ref:
28+
type: string
29+
testsuite:
30+
type: string
31+
description: Testsuite to run ('all' or 'fast')
32+
required: true
33+
default: all
34+
35+
concurrency:
36+
group: coverage-${{ github.workflow }}-${{ github.ref }}
37+
cancel-in-progress: true
38+
39+
jobs:
40+
generate_coverage_reports:
41+
name: Generate code coverage reports for both Python and C++ code
42+
runs-on: ubuntu-24.04
43+
env: { COVERAGE: 1 }
44+
outputs:
45+
summary_py: ${{ steps.py_coverage.outputs.summary }}
46+
summary_cpp: ${{ steps.cpp_coverage.outputs.summary }}
47+
steps:
48+
49+
- uses: actions/checkout@v4
50+
with:
51+
ref: ${{ inputs.git_ref }}
52+
fetch-depth: 0
53+
submodules: true
54+
55+
- name: Checkout DuckDB to provided ref
56+
if: ${{ inputs.duckdb_git_ref != '' }}
57+
shell: bash
58+
run: |
59+
cd external/duckdb
60+
git fetch origin
61+
git checkout ${{ inputs.duckdb_git_ref }}
62+
63+
- name: Install Ccache
64+
shell: bash
65+
run: |
66+
sudo apt-get update
67+
sudo apt-get -y install ccache
68+
69+
- name: Install Astral UV and enable the cache
70+
uses: astral-sh/setup-uv@v6
71+
with:
72+
version: "0.7.14"
73+
python-version: 3.9
74+
enable-cache: true
75+
cache-suffix: -${{ github.workflow }}
76+
77+
- name: Run tests with coverage
78+
shell: bash
79+
run: |
80+
if [[ "${{ inputs.testsuite }}" == "all" ]]; then
81+
uv run coverage run -m pytest ./tests --ignore=./tests/stubs
82+
elif [[ "${{ inputs.testsuite }}" == "fast" ]]; then
83+
uv run coverage run -m pytest ./tests/fast
84+
else
85+
echo "Invalid testsuite!"
86+
exit 1
87+
fi
88+
89+
- name: Get Python coverage data
90+
id: py_coverage
91+
shell: bash
92+
run: |
93+
# save HTML report in coverage-python
94+
uv run coverage html -d coverage-python
95+
# save markdown summary in step output
96+
echo "summary<<EOF" >> $GITHUB_OUTPUT
97+
uv run coverage report --format=markdown >> $GITHUB_OUTPUT
98+
echo "EOF" >> $GITHUB_OUTPUT
99+
100+
- name: Upload Python coverage report
101+
uses: actions/upload-artifact@v4
102+
with:
103+
name: coverage-report-python
104+
path: coverage-python
105+
106+
- name: Get C++ coverage data
107+
id: cpp_coverage
108+
shell: bash
109+
run: |
110+
mkdir coverage-cpp
111+
uv run gcovr \
112+
--gcov-ignore-errors all \
113+
--root "$PWD" \
114+
--filter "${PWD}/src/duckdb_py" \
115+
--exclude '.*/\.cache/.*' \
116+
--gcov-exclude '.*/\.cache/.*' \
117+
--gcov-exclude '.*/external/.*' \
118+
--gcov-exclude '.*/site-packages/.*' \
119+
--exclude-unreachable-branches \
120+
--exclude-throw-branches \
121+
--html --html-details -o coverage-cpp/index.html \
122+
build/coverage/src/duckdb_py \
123+
--print-summary > cpp_summary.txt
124+
# save the summary in the output
125+
echo "summary<<EOF" >> $GITHUB_OUTPUT
126+
cat cpp_summary.txt >> $GITHUB_OUTPUT
127+
echo "EOF" >> $GITHUB_OUTPUT
128+
129+
- name: Upload C++ coverage report
130+
uses: actions/upload-artifact@v4
131+
with:
132+
name: coverage-report-cpp
133+
path: coverage-cpp
134+
135+
summary:
136+
name: Coverage Summary
137+
runs-on: ubuntu-24.04
138+
needs: [generate_coverage_reports]
139+
env:
140+
SUMMARY_PY: ${{ needs.generate_coverage_reports.outputs.summary_py }}
141+
SUMMARY_CPP: ${{ needs.generate_coverage_reports.outputs.summary_cpp }}
142+
if: always()
143+
steps:
144+
- name: Summarize
145+
shell: bash
146+
run: |
147+
echo "## Coverage Summary" >> $GITHUB_STEP_SUMMARY
148+
echo "### Python Coverage Summary" >> $GITHUB_STEP_SUMMARY
149+
echo "$SUMMARY_PY" >> $GITHUB_STEP_SUMMARY
150+
echo "### C++ Coverage Summary" >> $GITHUB_STEP_SUMMARY
151+
echo '```' >> $GITHUB_STEP_SUMMARY
152+
echo "$SUMMARY_CPP" >> $GITHUB_STEP_SUMMARY
153+
echo '```' >> $GITHUB_STEP_SUMMARY

.github/workflows/on_pr.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Tests and builds on PR
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
- v*.*-*
7+
types: [opened, reopened, ready_for_review, converted_to_draft]
8+
paths-ignore:
9+
- '**.md'
10+
- 'LICENSE'
11+
- '.editorconfig'
12+
- 'scripts/**'
13+
- '.github//**'
14+
- '!.github/workflows/on_push.yml'
15+
- '!.github/workflows/coverage.yml'
16+
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.ref }}
19+
cancel-in-progress: true
20+
21+
jobs:
22+
packaging_test:
23+
name: Build a minimal set of packages and run all tests on them
24+
# Skip packaging tests for draft PRs
25+
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
26+
uses: ./.github/workflows/pypi_packaging.yml
27+
with:
28+
minimal: true
29+
testsuite: all
30+
git_ref: ${{ github.ref }}
31+
duckdb_git_ref: ${{ github.ref_name }}
32+
33+
coverage_test:
34+
name: Run coverage tests
35+
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
36+
uses: ./.github/workflows/coverage.yml
37+
with:
38+
git_ref: ${{ github.ref }}
39+
testsuite: all

.github/workflows/on_push.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Tests and coverage on push
2+
on:
3+
push:
4+
branches-ignore:
5+
- main
6+
- v*.*-*
7+
paths-ignore:
8+
- '**.md'
9+
- 'LICENSE'
10+
- '.editorconfig'
11+
- 'scripts/**'
12+
- '.github//**'
13+
- '!.github/workflows/on_push.yml'
14+
- '!.github/workflows/coverage.yml'
15+
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.ref }}
18+
cancel-in-progress: true
19+
20+
jobs:
21+
test:
22+
name: Run coverage tests
23+
uses: ./.github/workflows/coverage.yml
24+
with:
25+
git_ref: ${{ github.ref }}
26+
testsuite: fast

0 commit comments

Comments
 (0)