Skip to content

Commit efa952a

Browse files
committed
Adjusted project generator for python setting removal
Signed-off-by: paulober <[email protected]>
1 parent 90548a9 commit efa952a

File tree

3 files changed

+3
-13
lines changed

3 files changed

+3
-13
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ This command installs all of the necessary tools, including but not limited to:
6666
This extension provides the following settings:
6767

6868
* `raspberry-pi-pico.cmakePath`: Specify a custom path for CMake.
69-
* `raspberry-pi-pico.python3Path`: Specify a custom path for Python 3.
69+
* `raspberry-pi-pico.python3Path`: Specify a custom path for Python 3 _(machine scoped)_.
7070
* `raspberry-pi-pico.ninjaPath`: Specify a custom path for Ninja.
7171
* `raspberry-pi-pico.gitPath`: Specify a custom path for Git.
7272
* `raspberry-pi-pico.cmakeAutoConfigure`: Provide a GitHub personal access token (classic) with the `public_repo` scope. This token is used to check for available versions of the Pico SDK and other tools. Without it, the extension uses the unauthenticated GitHub API, which has a lower rate limit and may lead to restricted functionality if the limit is exceeded. The unauthenticated rate limit is per public IP address, so a token is more necessary if your IP is shared with many users.

scripts/pico_project.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,6 @@ def ParseCommandLine():
480480
parser.add_argument("-picotoolVersion", "--picotoolVersion", help="Picotool version to use (required)")
481481
parser.add_argument("-np", "--ninjaPath", help="Ninja path")
482482
parser.add_argument("-cmp", "--cmakePath", help="CMake path")
483-
parser.add_argument("-cupy", "--customPython", action='store_true', help="Custom python path used to execute the script.")
484483
parser.add_argument("-openOCDVersion", "--openOCDVersion", help="OpenOCD version to use - defaults to 0", default=0)
485484
parser.add_argument("-examLibs", "--exampleLibs", action='append', help="Include an examples library in the folder")
486485
parser.add_argument("-ucmt", "--useCmakeTools", action='store_true', help="Enable CMake Tools extension integration")
@@ -766,7 +765,7 @@ def GenerateCMake(folder, params):
766765

767766

768767
# Generates the requested project files, if any
769-
def generateProjectFiles(projectPath, projectName, sdkPath, projects, debugger, sdkVersion, toolchainVersion, picotoolVersion, ninjaPath, cmakePath, customPython, openOCDVersion, useCmakeTools):
768+
def generateProjectFiles(projectPath, projectName, sdkPath, projects, debugger, sdkVersion, toolchainVersion, picotoolVersion, ninjaPath, cmakePath, openOCDVersion, useCmakeTools):
770769

771770
oldCWD = os.getcwd()
772771

@@ -896,8 +895,6 @@ def generateProjectFiles(projectPath, projectName, sdkPath, projects, debugger,
896895
}}
897896
'''
898897

899-
pythonExe = sys.executable.replace("\\", "/").replace(user_home, "${HOME}") if use_home_var else sys.executable
900-
901898
# kits
902899
kits = f'''[
903900
{{
@@ -970,10 +967,6 @@ def generateProjectFiles(projectPath, projectName, sdkPath, projects, debugger,
970967
"raspberry-pi-pico.useCmakeTools": {"true" if useCmakeTools else "false"},
971968
"raspberry-pi-pico.cmakePath": "{cmakePath.replace(user_home, "${HOME}") if use_home_var else cmakePath}",
972969
"raspberry-pi-pico.ninjaPath": "{ninjaPath.replace(user_home, "${HOME}") if use_home_var else ninjaPath}"'''
973-
974-
if customPython:
975-
settings += f''',
976-
"raspberry-pi-pico.python3Path": "{pythonExe}"'''
977970

978971
settings += '\n}\n'
979972

@@ -1236,7 +1229,6 @@ def DoEverything(parent, params):
12361229
params["picotoolVersion"],
12371230
params["ninjaPath"],
12381231
params["cmakePath"],
1239-
params["customPython"],
12401232
params["openOCDVersion"],
12411233
params['useCmakeTools'])
12421234

@@ -1360,7 +1352,6 @@ def DoEverything(parent, params):
13601352
'picotoolVersion': args.picotoolVersion,
13611353
'ninjaPath' : args.ninjaPath,
13621354
'cmakePath' : args.cmakePath,
1363-
'customPython' : args.customPython,
13641355
'openOCDVersion': args.openOCDVersion,
13651356
'exampleLibs' : args.exampleLibs if args.exampleLibs is not None else [],
13661357
'useCmakeTools' : args.useCmakeTools

src/webview/newProjectPanel.mts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2277,6 +2277,7 @@ export class NewProjectPanel {
22772277
);
22782278

22792279
const command: string = [
2280+
// TODO: maybe use includes powershell instead of .exe and ===
22802281
`${process.env.ComSpec === "powershell.exe" ? "&" : ""}"${pythonExe}"`,
22812282
`"${joinPosix(getScriptsRoot(), "pico_project.py")}"`,
22822283
...basicNewProjectOptions,
@@ -2311,8 +2312,6 @@ export class NewProjectPanel {
23112312
`"${options.cmakeExecutable}"`,
23122313
options.useCmakeTools ? "-ucmt" : "",
23132314

2314-
// set custom python executable path used flag if python executable is not in PATH
2315-
pythonExe.includes("/") ? "-cupy" : "",
23162315
`"${projectName}"`,
23172316
].join(" ");
23182317

0 commit comments

Comments
 (0)