From b781731e885d89e8c6eaa602bde9822a221452db Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Fri, 4 Jul 2025 22:45:33 -0400 Subject: [PATCH] docs: clarify supported python versions --- README.md | 2 +- scripts/install.ps1 | 21 ++++++++++++++++----- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 147513f..2f469f6 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ SeedPass now uses the `portalocker` library for cross-platform file locking. No ## Prerequisites -- **Python 3.8+**: Ensure you have Python installed on your system. You can download it from [python.org](https://www.python.org/downloads/). +- **Python 3.8+** (3.11 or 3.12 recommended): Ensure you have Python installed on your system. You can download it from [python.org](https://www.python.org/downloads/). Using Python 3.13 is currently discouraged because some dependencies do not ship wheels for it yet, which can cause build failures on Windows unless you install the Visual C++ Build Tools. ## Installation diff --git a/scripts/install.ps1 b/scripts/install.ps1 index f62d493..c448748 100644 --- a/scripts/install.ps1 +++ b/scripts/install.ps1 @@ -65,6 +65,14 @@ if (-not (Get-Command git -ErrorAction SilentlyContinue)) { $pythonExe = Get-Command python -ErrorAction SilentlyContinue if (-not $pythonExe) { Write-Error "Python 3 is not installed or not in your PATH. Please install it from https://www.python.org/" } +# Warn about unsupported Python versions +$pyVersionString = (& python --version) -replace '[^0-9\.]', '' +try { $pyVersion = [version]$pyVersionString } catch { $pyVersion = $null } +if ($pyVersion -and $pyVersion.Major -eq 3 -and $pyVersion.Minor -ge 13) { + Write-Warning "Python $pyVersionString detected. Some dependencies may not have prebuilt wheels yet." + Write-Warning "If installation fails, install Python 3.11 or 3.12 or ensure Microsoft C++ Build Tools are available." +} + # 2. Clone or update the repository if (Test-Path (Join-Path $InstallDir ".git")) { Write-Info "SeedPass directory found. Fetching updates and switching to '$Branch' branch..." @@ -91,12 +99,15 @@ if (-not (Test-Path $VenvDir)) { # 4. Install/Update Python dependencies Write-Info "Installing/updating Python dependencies..." -try { - & "$VenvDir\Scripts\pip.exe" install --upgrade pip - & "$VenvDir\Scripts\pip.exe" install -r "src\requirements.txt" -} catch { +& "$VenvDir\Scripts\pip.exe" install --upgrade pip +if ($LASTEXITCODE -ne 0) { + Write-Error "Failed to upgrade pip" +} + +& "$VenvDir\Scripts\pip.exe" install -r "src\requirements.txt" +if ($LASTEXITCODE -ne 0) { Write-Warning "Failed to install Python dependencies. If errors mention C++, install Microsoft C++ Build Tools: https://visualstudio.microsoft.com/visual-cpp-build-tools/" - Write-Error "Dependency installation failed. Error: $_" + Write-Error "Dependency installation failed." } # 5. Create launcher script