Skip to content

Commit 42de4f8

Browse files
Fixes for devexp and ci
Small fixes
2 parents 3b817e1 + 8dc7126 commit 42de4f8

File tree

8 files changed

+64
-55
lines changed

8 files changed

+64
-55
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,5 @@ jobs:
5353
DUCKDB_SHA="${{ inputs.duckdb-sha }}"
5454
aws s3 cp \
5555
artifacts \
56-
s3://duckdb-staging/${DUCKDB_SHA:0:7}/${{ github.repository }}/ \
56+
s3://duckdb-staging/${DUCKDB_SHA:0:10}/${{ github.repository }}/ \
5757
--recursive

.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)