File tree Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change @@ -242,3 +242,50 @@ rustflags = [
242
242
" split-debuginfo=packed" ,
243
243
]
244
244
```
245
+
246
+ ### Python build variables (macOS or linux)
247
+
248
+ When building the python package you can greatly speed up your rebuilding
249
+ by defining a ` PYO3_CONFIG_FILE ` environment variable pointing to a file
250
+ that contains your build environment. You will need to update this file if
251
+ there are major changes to your build, including when there are version
252
+ changes in the [ PyO3] ( https://pyo3.rs/ ) dependencies.
253
+
254
+ To set this variable, first run the following command:
255
+
256
+ ``` shell
257
+ PYO3_PRINT_CONFIG=1 cargo build
258
+ ```
259
+
260
+ It should include an output similar to the following:
261
+
262
+ ```
263
+ implementation=CPython
264
+ version=3.9
265
+ shared=true
266
+ abi3=true
267
+ lib_name=python3.12
268
+ lib_dir=/opt/homebrew/opt/[email protected] /Frameworks/Python.framework/Versions/3.12/lib
269
+ executable=/Users/myusername/src/datafusion-python/.venv/bin/python
270
+ pointer_width=64
271
+ build_flags=
272
+ suppress_build_script_link_lines=false
273
+ ```
274
+
275
+ Copy the output in your terminal into a file and set this environment variable.
276
+
277
+ ``` shell
278
+ export PYO3_CONFIG_FILE=" /Users/myusername/some/path/pyo3_build.config"
279
+ ```
280
+
281
+ If you are using VS Code for your IDE you may need to set these variables in
282
+ your settings:
283
+
284
+ ``` json
285
+ "rust-analyzer.cargo.extraEnv" : {
286
+ "PYO3_CONFIG_FILE" : " /Users/myusername/some/path/pyo3_build.config"
287
+ },
288
+ "rust-analyzer.runnables.extraEnv" : {
289
+ "PYO3_CONFIG_FILE" : " /Users/myusername/some/path/pyo3_build.config"
290
+ }
291
+ ```
You can’t perform that action at this time.
0 commit comments