Skip to content

Commit 14ef5ee

Browse files
author
Evert
committed
Better IDE integration
1 parent b5fb053 commit 14ef5ee

File tree

3 files changed

+36
-20
lines changed

3 files changed

+36
-20
lines changed

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: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -65,19 +65,6 @@ git config --local core.hooksPath .githooks/
6565
```
6666

6767

68-
### Building wheels and sdists
69-
70-
To build a wheel and sdist for your system and the default Python version:
71-
```bash
72-
uv build
73-
````
74-
75-
To build a wheel for a different Python version:
76-
```bash
77-
# E.g. for Python 3.9
78-
uv build -p 3.9
79-
```
80-
8168
### Editable installs (general)
8269

8370
It's good to be aware of the following when creating an editable install:
@@ -93,7 +80,7 @@ uv build -p 3.9
9380
# install all dev dependencies without building the project (needed once)
9481
uv sync -p 3.9 --no-install-project
9582
# build and install without build isolation
96-
uv sync --no-build-isolation
83+
uv sync --no-build-isolation
9784
```
9885

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

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+
106115
### Running tests
107116

108117
Run all pytests:

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)