From 294af3dc2e1908c17585a76bd26ee62d1da64285 Mon Sep 17 00:00:00 2001 From: William Ayd Date: Thu, 25 May 2023 09:27:44 -0700 Subject: [PATCH] Improved documentation for extension development (#53380) --- .gitignore | 2 ++ .../development/debugging_extensions.rst | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/.gitignore b/.gitignore index 183c97dac1806..cd22c2bb8cb5b 100644 --- a/.gitignore +++ b/.gitignore @@ -38,6 +38,8 @@ .build_cache_dir .mesonpy-native-file.ini MANIFEST +compile_commands.json +debug # Python files # ################ diff --git a/doc/source/development/debugging_extensions.rst b/doc/source/development/debugging_extensions.rst index 8fa9c94ae96c9..9ac4cf4083475 100644 --- a/doc/source/development/debugging_extensions.rst +++ b/doc/source/development/debugging_extensions.rst @@ -13,3 +13,21 @@ For Python developers with limited or no C/C++ experience this can seem a daunti 1. `Fundamental Python Debugging Part 1 - Python `_ 2. `Fundamental Python Debugging Part 2 - Python Extensions `_ 3. `Fundamental Python Debugging Part 3 - Cython Extensions `_ + +Generating debug builds +----------------------- + +By default building pandas from source will generate a release build. To generate a development build you can type:: + + pip install -ve . --no-build-isolation --config-settings=builddir="debug" --config-settings=setup-args="-Dbuildtype=debug" + +By specifying ``builddir="debug"`` all of the targets will be built and placed in the debug directory relative to the project root. This helps to keep your debug and release artifacts separate; you are of course able to choose a different directory name or omit altogether if you do not care to separate build types. + +Editor support +-------------- + +The meson build system generates a `compilation database `_ automatically and places it in the build directory. Many language servers and IDEs can use this information to provide code-completion, go-to-defintion and error checking support as you type. + +How each language server / IDE chooses to look for the compilation database may vary. When in doubt you may want to create a symlink at the root of the project that points to the compilation database in your build directory. Assuming you used *debug* as your directory name, you can run:: + + ln -s debug/compile_commands.json .