flat-zoo-31952
01/31/2024, 9:22 PMproud-dentist-22844
01/31/2024, 10:03 PMproud-dentist-22844
01/31/2024, 10:04 PMproud-dentist-22844
01/31/2024, 10:04 PMlittle-pilot-11155
01/31/2024, 11:37 PMpython.analysis.extraPaths. That will give you code completion and go to the definition. Example:
"python.analysis.extraPaths": [
"./dist/codegen/src"
]dazzling-plastic-2448
02/03/2024, 7:28 PMexport-codegen goal as it turns out, been around since 2.16 at least.dazzling-plastic-2448
02/03/2024, 7:29 PMproud-dentist-22844
02/03/2024, 7:30 PMexport-codegen is that it will only export under a subfolder like dist/ , so it does not help for files you want to generate and store WITH the rest of your sources.dazzling-plastic-2448
02/03/2024, 7:31 PMproud-dentist-22844
02/03/2024, 7:32 PMgo-generate is another goal that provides a way for codegen to end up with the sources, as versioning generated files is standard practice with go development. Unlike standard pants codegen, you actually have to run go-generate to get the codegen to run.proud-dentist-22844
02/03/2024, 7:38 PMpersist-codegen goal similar to export-codegen, but it “persists” the generated files in the workspace (not under dist). For that to work well, I think the targets that trigger the codegen would probably need a persist parameter target_abcd(…, persist=True) so that they can opt into a persisted mode instead of the standard ephemeral mode.proud-dentist-22844
02/03/2024, 7:39 PMdazzling-plastic-2448
02/03/2024, 7:43 PMpersist-codegen command would have made a change, but can't because the target hasn't opted in, spit out a warning/info/whatever is appropriate indicating that the persist=True option is required? Otherwise you might get a bunch of people saying "hey, I used persist-codegen, why isn't it showing up in my workspace?"dazzling-plastic-2448
02/03/2024, 7:44 PMlittle-pilot-11155
02/07/2024, 1:23 PMpants export-codegen :: && cd dist/codegen && cp --parents **/*.{py,pyi} <path_to_your_repo>
I am using that in VSCode Tasks with <path_to_your_repo> set to ${workspaceFolder}.flat-zoo-31952
02/07/2024, 2:06 PM