Skip to content

Commit 9e9426a

Browse files
author
Evert
committed
Merge remote-tracking branch 'upstream/v1.3-ossivalis'
2 parents e671e8e + 42de4f8 commit 9e9426a

File tree

9 files changed

+97
-57
lines changed

9 files changed

+97
-57
lines changed

.githooks/post-checkout

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
if [ "$3" = "1" ]; then
3+
echo "Updating submodules..."
4+
git submodule update --init --recursive
5+
fi
6+

.github/workflows/on_external_dispatch.yml

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ on:
1010
type: string
1111
description: Force version (vX.Y.Z-((rc|post)N))
1212
required: false
13-
publish_to_pypi:
13+
publish_packages:
1414
type: boolean
15-
description: Publish packages to PyPI?
15+
description: Publish packages on S3 and PyPI?
1616
required: true
1717
default: false
1818

@@ -26,3 +26,32 @@ jobs:
2626
git_ref: ${{ github.ref }}
2727
duckdb_git_ref: ${{ inputs.duckdb-sha }}
2828
force_version: ${{ inputs.force_version }}
29+
30+
upload_to_staging:
31+
name: Upload Artifacts to staging
32+
runs-on: ubuntu-latest
33+
needs: [ externally_triggered_build ]
34+
if: ${{ github.repository_owner == 'duckdb' && inputs.publish_packages }}
35+
steps:
36+
- name: Fetch artifacts
37+
uses: actions/download-artifact@v4
38+
with:
39+
pattern: '{sdist,wheel}*'
40+
path: artifacts/
41+
merge-multiple: true
42+
43+
- name: Authenticate with AWS
44+
uses: aws-actions/configure-aws-credentials@v4
45+
with:
46+
aws-region: 'us-east-2'
47+
aws-access-key-id: ${{ secrets.S3_DUCKDB_STAGING_ID }}
48+
aws-secret-access-key: ${{ secrets.S3_DUCKDB_STAGING_KEY }}
49+
50+
- name: Upload artifacts to S3 bucket
51+
shell: bash
52+
run: |
53+
DUCKDB_SHA="${{ inputs.duckdb-sha }}"
54+
aws s3 cp \
55+
artifacts \
56+
s3://duckdb-staging/${DUCKDB_SHA:0:10}/${{ github.repository }}/ \
57+
--recursive

.github/workflows/pypi_packaging.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,9 @@ jobs:
114114
115115
- uses: actions/upload-artifact@v4
116116
with:
117-
name: sdist-main
117+
name: sdist
118118
path: dist/*.tar.gz
119+
compression-level: 0
119120

120121
build_wheels:
121122
name: 'Wheel: ${{ matrix.python }}-${{ matrix.platform.cibw_system }}_${{ matrix.platform.arch }}'
@@ -186,3 +187,4 @@ jobs:
186187
with:
187188
name: wheel-${{ matrix.python }}-${{ matrix.platform.cibw_system }}_${{ matrix.platform.arch }}
188189
path: wheelhouse/*.whl
190+
compression-level: 0

.gitmodules

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
path = external/duckdb
33
url = https://github.com/duckdb/duckdb.git
44
branch = main
5+
[submodule]
6+
recurse = true

CMakeLists.txt

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@ setup_compiler_launcher_if_available()
1717
# ────────────────────────────────────────────
1818
# Create compile_commands.json for IntelliSense and clang-tidy
1919
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
20-
# If we're not building through scikit-build-core then we have to set a different dest dir
21-
include(GNUInstallDirs)
22-
set(_DUCKDB_PY_INSTALL_DIR "${SKBUILD_PLATLIB_DIR}")
23-
if(NOT _DUCKDB_PY_INSTALL_DIR)
24-
set(_DUCKDB_PY_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}")
25-
endif()
2620

2721
# ────────────────────────────────────────────
2822
# Policy hygiene
@@ -87,4 +81,16 @@ target_link_libraries(_duckdb PRIVATE _duckdb_dependencies)
8781
# ────────────────────────────────────────────
8882
# Put the object file in the correct place
8983
# ────────────────────────────────────────────
84+
85+
# If we're not building through scikit-build-core then we have to set a different dest dir
86+
include(GNUInstallDirs)
87+
if(DEFINED SKBUILD_PLATLIB_DIR)
88+
set(_DUCKDB_PY_INSTALL_DIR "${SKBUILD_PLATLIB_DIR}")
89+
elseif(DEFINED Python_SITEARCH)
90+
set(_DUCKDB_PY_INSTALL_DIR "${Python_SITEARCH}")
91+
else()
92+
message(WARNING "Could not determine Python install dir. Falling back to CMAKE_INSTALL_LIBDIR.")
93+
set(_DUCKDB_PY_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}")
94+
endif()
95+
9096
install(TARGETS _duckdb LIBRARY DESTINATION "${_DUCKDB_PY_INSTALL_DIR}")

README.md

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,27 @@ pip install 'duckdb[all]'
4444

4545
## Development
4646

47-
### Building wheels and sdists
47+
### Cloning
4848

49-
To build a wheel and sdist for your system and the default Python version:
50-
```bash
51-
uv build
52-
````
49+
When you clone the repo or your fork, make sure you initialize the duckdb submodule:
50+
```shell
51+
git clone --recurse-submodules <repo>
52+
```
5353

54-
To build a wheel for a different Python version:
55-
```bash
56-
# E.g. for Python 3.9
57-
uv build -p 3.9
54+
... or, if you already have the repo locally:
55+
```shell
56+
git clone <your-repo>
57+
cd <your-repo>
58+
git submodule update --init --recursive
59+
```
60+
61+
If you'll be switching between branches that are have the submodule set to different refs, then make your life
62+
easier and add the git hooks in the .githooks directory to your local config:
63+
```shell
64+
git config --local core.hooksPath .githooks/
5865
```
5966

67+
6068
### Editable installs (general)
6169

6270
It's good to be aware of the following when creating an editable install:
@@ -72,7 +80,7 @@ uv build -p 3.9
7280
# install all dev dependencies without building the project (needed once)
7381
uv sync -p 3.9 --no-install-project
7482
# build and install without build isolation
75-
uv sync --no-build-isolation
83+
uv sync --no-build-isolation
7684
```
7785

7886
### Editable installs (IDEs)
@@ -82,6 +90,28 @@ uv sync --no-build-isolation
8290
compilation and editable rebuilds. This will skip scikit-build-core's build backend and all of uv's dependency
8391
management, so for "real" builds you better revert to the CLI. However, this should work fine for coding and debugging.
8492

93+
94+
### Cleaning
95+
96+
```shell
97+
uv cache clean
98+
rm -rf build .venv uv.lock
99+
```
100+
101+
102+
### Building wheels and sdists
103+
104+
To build a wheel and sdist for your system and the default Python version:
105+
```bash
106+
uv build
107+
````
108+
109+
To build a wheel for a different Python version:
110+
```bash
111+
# E.g. for Python 3.9
112+
uv build -p 3.9
113+
```
114+
85115
### Running tests
86116

87117
Run all pytests:

duckdb_packaging/setuptools_scm_version.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
# Import from our own versioning module to avoid duplication
1313
from ._versioning import parse_version, format_version
1414

15-
# MAIN_BRANCH_VERSIONING default should be 'True' for main branch and feature branches
16-
MAIN_BRANCH_VERSIONING = True
15+
# MAIN_BRANCH_VERSIONING should be 'True' on main branch only
16+
MAIN_BRANCH_VERSIONING = False
1717

1818
SCM_PRETEND_ENV_VAR = "SETUPTOOLS_SCM_PRETEND_VERSION_FOR_DUCKDB"
1919
SCM_GLOBAL_PRETEND_ENV_VAR = "SETUPTOOLS_SCM_PRETEND_VERSION"

external/README_GIT_SUBMODULE.md

Lines changed: 0 additions & 36 deletions
This file was deleted.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ if.state = "editable"
112112
if.env.COVERAGE = false
113113
build-dir = "build/debug/"
114114
editable.rebuild = true
115+
editable.mode = "redirect"
115116
cmake.build-type = "Debug"
116117

117118
# Separate override because we have to append to cmake.define with `inherit` in order not to overwrite other defines.

0 commit comments

Comments
 (0)