Download deployment/project_python.ps1 from Wizzas/DefectRAG: direct link, hf CLI and curl.
- Browser
- Download file 976 Bytes
-
https://huggingface.co/Wizzas/DefectRAG/resolve/ecb2a3f4a67e1aec2e445efe43c0f241176875ff/deployment/project_python.ps1
- Command line
-
hf download hf://Wizzas/DefectRAG@ecb2a3f4a67e1aec2e445efe43c0f241176875ff/deployment/project_python.ps1
-
curl -L -o project_python.ps1 https://huggingface.co/Wizzas/DefectRAG/resolve/ecb2a3f4a67e1aec2e445efe43c0f241176875ff/deployment/project_python.ps1
976 Bytes
| # Finds the Python interpreter for this project. No side effects when dot-sourced. | |
| # Order: DEFECTRAG_PYTHON, the project .venv, the active conda env named | |
| # "defectrag", then the default Anaconda location of that env. | |
| function Get-ProjectPython{ | |
| $root=Split-Path $PSScriptRoot -Parent | |
| $candidates=@() | |
| if($env:DEFECTRAG_PYTHON){$candidates+=$env:DEFECTRAG_PYTHON} | |
| $candidates+=(Join-Path $root '.venv\Scripts\python.exe') | |
| if($env:CONDA_PREFIX -and (Split-Path $env:CONDA_PREFIX -Leaf) -eq 'defectrag'){$candidates+=(Join-Path $env:CONDA_PREFIX 'python.exe')} | |
| foreach($base in @('anaconda3','miniconda3')){$candidates+=(Join-Path $env:USERPROFILE "$base\envs\defectrag\python.exe")} | |
| foreach($candidate in $candidates){if($candidate -and (Test-Path -LiteralPath $candidate)){return $candidate}} | |
| throw 'No project Python found. Run: conda activate defectrag (see README, "Development machine (conda)"), or set DEFECTRAG_PYTHON to a python.exe.' | |
| } | |