From b139313879a9f80c7fe4a2a1d7ee57a8c87673d5 Mon Sep 17 00:00:00 2001 From: ccummingsNV Date: Thu, 11 Jul 2024 14:38:29 +0100 Subject: [PATCH] SGL env setup (#34) * SGL env setup * Remove language version from pre-commit * Remove auto-install of prerequisits from setup Fix clang path Add note to docs about python build requirements * Fix launch.json --- .pre-commit-config.yaml | 1 - .vscode-default/launch.json | 87 +++++--------------------- .vscode-default/settings.json | 9 ++- docs/src/developer_guide/compiling.rst | 3 + examples/requirements.txt | 1 + tools/buildrequirements.txt | 3 + 6 files changed, 31 insertions(+), 73 deletions(-) create mode 100644 examples/requirements.txt create mode 100644 tools/buildrequirements.txt diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1f35ae08..9afc5678 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,7 +20,6 @@ repos: rev: 24.4.2 hooks: - id: black - language_version: python3.9 exclude: | (?x)^( .*\.ipynb| diff --git a/.vscode-default/launch.json b/.vscode-default/launch.json index 922b57c1..1dacf2c0 100644 --- a/.vscode-default/launch.json +++ b/.vscode-default/launch.json @@ -1,89 +1,36 @@ { - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - // - // Note: These launch configurations rely on the ms-vscode.cmake-tools extension - // to provide ${command:cmake.launchTargetPath} and ${command:cmake.launchTargetDirectory}. - // "version": "0.2.0", "configurations": [ + { - // Launch configuration for currently selected target. - "name": "Selected CMake Target", - "type": "cppvsdbg", + "name": "Python C++ Debugger Windows", + "type": "pythoncpp", "request": "launch", - "program": "${command:cmake.launchTargetPath}", - "args": [], - "stopAtEntry": false, - "cwd": "${command:cmake.launchTargetDirectory}", - "environment": [ - { - "name": "FALCOR_DEVMODE", - "value": "1" - } - ], - "visualizerFile": "${workspaceFolder}/Source/Falcor/Falcor.natvis" + "pythonConfig": "default", + "cppConfig": "default (win) Attach" }, { - // Launch configuration for Mogwai. - "name": "Mogwai", - "type": "cppvsdbg", + "name": "Python C++ Debugger GDB", + "type": "pythoncpp", "request": "launch", - "windows": { - "program": "${command:cmake.launchTargetDirectory}/Mogwai.exe" - }, - "args": [], - "stopAtEntry": false, - "cwd": "${command:cmake.launchTargetDirectory}", - "environment": [ - { - "name": "FALCOR_DEVMODE", - "value": "1" - } - ], - "visualizerFile": "${workspaceFolder}/Source/Falcor/Falcor.natvis" + "pythonConfig": "default", + "cppConfig": "default (gdb) Attach" }, { - // Launch configuration for FalcorTest. - "name": "FalcorTest", - "type": "cppvsdbg", + "name": "Python Debugger: Current File", + "type": "debugpy", "request": "launch", - "windows": { - "program": "${command:cmake.launchTargetDirectory}/FalcorTest.exe" - }, - "args": [], - "stopAtEntry": false, - "cwd": "${command:cmake.launchTargetDirectory}", - "environment": [ - { - "name": "FALCOR_DEVMODE", - "value": "1" - } - ], - "visualizerFile": "${workspaceFolder}/Source/Falcor/Falcor.natvis" + "program": "${file}", + "console": "integratedTerminal" }, { - // Launch configuration for Python example. - "name": "Python Example", + "name": "Selected CMake Target", "type": "cppvsdbg", "request": "launch", - "windows": { - "program": "${config:python.defaultInterpreterPath}" - }, - "args": [ - "${workspaceFolder}/scripts/internal/python/simple.py" - ], + "program": "${command:cmake.launchTargetPath}", + "args": [], "stopAtEntry": false, - "cwd": "${command:cmake.launchTargetDirectory}", - "environment": [ - { - "name": "FALCOR_DEVMODE", - "value": "1" - } - ], - "internalConsoleOptions": "openOnSessionStart", - "visualizerFile": "${workspaceFolder}/Source/Falcor/Falcor.natvis" + "cwd": "${command:cmake.launchTargetDirectory}" } ] } diff --git a/.vscode-default/settings.json b/.vscode-default/settings.json index 6eab4c15..8aa3257d 100644 --- a/.vscode-default/settings.json +++ b/.vscode-default/settings.json @@ -4,6 +4,11 @@ }, "cmake.configureOnEdit": false, "cmake.options.statusBarVisibility": "visible", - "C_Cpp.clang_format_path": "${workspaceFolder}/tools/.packman/clang-format/clang-format", - "slang.format.clangFormatLocation": "${workspaceFolder}/tools/.packman/clang-format/clang-format" + "C_Cpp.clang_format_path": "${workspaceFolder}/tools/host/clang-format/clang-format", + "slang.format.clangFormatLocation": "${workspaceFolder}/tools/host/clang-format/clang-format", + "cmake.configureOnOpen": false, + "python.testing.pytestEnabled": true, + "python.testing.pytestArgs": [ + "./src/sgl" + ] } diff --git a/docs/src/developer_guide/compiling.rst b/docs/src/developer_guide/compiling.rst index 7716a92c..ab38b96b 100644 --- a/docs/src/developer_guide/compiling.rst +++ b/docs/src/developer_guide/compiling.rst @@ -29,6 +29,9 @@ To make it easy to build ``sgl`` reliably, an additional setup step is required: .. code-block:: bash + # Install Python build prerequisites + pip install -r tools/buildrequirements.txt + # On Windows setup.bat diff --git a/examples/requirements.txt b/examples/requirements.txt new file mode 100644 index 00000000..24ce15ab --- /dev/null +++ b/examples/requirements.txt @@ -0,0 +1 @@ +numpy diff --git a/tools/buildrequirements.txt b/tools/buildrequirements.txt new file mode 100644 index 00000000..4ec702ac --- /dev/null +++ b/tools/buildrequirements.txt @@ -0,0 +1,3 @@ +typing_extensions +pre-commit +pytest