diff --git a/.github/workflows/locked-windows.yml b/.github/workflows/locked-windows.yml new file mode 100644 index 0000000..56771de --- /dev/null +++ b/.github/workflows/locked-windows.yml @@ -0,0 +1,34 @@ +name: Locked Windows environment +on: + pull_request: + push: + branches: [main] +permissions: + contents: read +jobs: + locked-windows: + name: Locked Windows Python 3.12 + runs-on: windows-latest + timeout-minutes: 15 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 + with: + persist-credentials: false + - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 + with: + python-version: "3.12" + - name: Build a fresh environment from the lock + shell: pwsh + run: | + ./tools/Install-Locked.ps1 -Python python -Environment .venv-locked + - name: Verify locked dependencies and exercise the research code + shell: pwsh + run: | + $ErrorActionPreference = 'Stop' + $runtime = '.venv-locked/Scripts/python.exe' + & $runtime -m pip check + if ($LASTEXITCODE) { throw 'Dependency consistency check failed' } + & $runtime -m ruff check src tests + if ($LASTEXITCODE) { throw 'Lint failed' } + & $runtime -m pytest -q + if ($LASTEXITCODE) { throw 'Tests failed' } diff --git a/ENVIRONMENT.md b/ENVIRONMENT.md new file mode 100644 index 0000000..82feff1 --- /dev/null +++ b/ENVIRONMENT.md @@ -0,0 +1,11 @@ +# Reproducible Windows research environment + +The checked-in lock targets CPython 3.12 on Windows. Other Python/platform combinations need their own resolved and tested lock. The Git dependency, where present, is pinned to an immutable commit. The project itself must also be checked out at the desired recorded commit. + +```powershell +powershell -File tools/Install-Locked.ps1 -Python C:/path/to/python.exe -Environment D:/new-environment +D:/new-environment/Scripts/python.exe -m pytest -q +D:/new-environment/Scripts/python.exe -m ruff check src tests +``` + +Install into a new directory; do not overlay an existing research environment. Update this lock only in a dedicated environment, rebuild from the proposed lock, run pip check and the complete tests, and commit the lock with its validation record. Do not copy editable local paths into the dependency lock. diff --git a/pyproject.toml b/pyproject.toml index 3a3cf23..e84ff59 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=68"] +requires = ["setuptools==84.0.0"] build-backend = "setuptools.build_meta" [project] diff --git a/requirements.lock b/requirements.lock new file mode 100644 index 0000000..ea103b2 --- /dev/null +++ b/requirements.lock @@ -0,0 +1,17 @@ +# Verified Windows / CPython 3.12 environment; runtime + dev + build requirements. +# Source versions: engineering acceptance 2026-10-09, rebuilt in a clean venv. +# Install with --no-deps; then install this repository --no-deps --no-build-isolation. +colorama==0.4.6 +iniconfig==2.3.1 +numpy==2.5.3 +packaging==26.3 +pandas==3.0.6 +pluggy==1.6.0 +Pygments==2.21.0 +pytest==9.1.1 +python-dateutil==2.9.0.post0 +PyYAML==6.0.3 +ruff==0.16.10 +setuptools==84.0.0 +six==1.17.0 +tzdata==2026.5 diff --git a/tools/Install-Locked.ps1 b/tools/Install-Locked.ps1 new file mode 100644 index 0000000..7e870c7 --- /dev/null +++ b/tools/Install-Locked.ps1 @@ -0,0 +1,18 @@ +param([string]$Python = 'python', [string]$Environment = '.venv-locked') +$ErrorActionPreference = 'Stop' +$Repo = Split-Path $PSScriptRoot -Parent +Push-Location $Repo +try { + & $Python -c "import sys; assert sys.version_info[:2] == (3, 12), 'Use Python 3.12'" + if ($LASTEXITCODE) { throw 'Python 3.12 is required' } + if (Test-Path -LiteralPath $Environment) { throw 'Choose a new environment directory' } + & $Python -m venv $Environment + if ($LASTEXITCODE) { throw 'venv failed' } + $Runtime = Join-Path $Environment 'Scripts/python.exe' + & $Runtime -m pip install --no-deps -r requirements.lock + if ($LASTEXITCODE) { throw 'Locked dependency installation failed' } + & $Runtime -m pip install --no-deps --no-build-isolation -e . + if ($LASTEXITCODE) { throw 'Project installation failed' } + & $Runtime -m pip check + if ($LASTEXITCODE) { throw 'Dependency consistency check failed' } +} finally { Pop-Location }