From bbb2a50ff7adfc3c0f1a25cb7e294b0d9f69d825 Mon Sep 17 00:00:00 2001 From: PureSaber Date: Fri, 9 Oct 2026 23:13:59 +0800 Subject: [PATCH 1/3] Lock and document reproducible Windows Python 3.12 environment --- ENVIRONMENT.md | 11 +++++++++++ pyproject.toml | 2 +- requirements.lock | 17 +++++++++++++++++ tools/Install-Locked.ps1 | 18 ++++++++++++++++++ 4 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 ENVIRONMENT.md create mode 100644 requirements.lock create mode 100644 tools/Install-Locked.ps1 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 } From dc494d2e2bb70a0a1e1ef210b8628307bf549899 Mon Sep 17 00:00:00 2001 From: PureSaber Date: Sat, 10 Oct 2026 15:47:19 +0800 Subject: [PATCH 2/3] ci: verify fresh Windows Python 3.12 locked environments --- .github/workflows/locked-windows.yml | 35 ++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/locked-windows.yml diff --git a/.github/workflows/locked-windows.yml b/.github/workflows/locked-windows.yml new file mode 100644 index 0000000..57dc8b7 --- /dev/null +++ b/.github/workflows/locked-windows.yml @@ -0,0 +1,35 @@ +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' } + From 2f4b6991b6838571a8ba5024e5522624a55ed211 Mon Sep 17 00:00:00 2001 From: PureSaber Date: Sat, 10 Oct 2026 15:51:00 +0800 Subject: [PATCH 3/3] style: remove trailing workflow blank line --- .github/workflows/locked-windows.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/locked-windows.yml b/.github/workflows/locked-windows.yml index 57dc8b7..56771de 100644 --- a/.github/workflows/locked-windows.yml +++ b/.github/workflows/locked-windows.yml @@ -32,4 +32,3 @@ jobs: if ($LASTEXITCODE) { throw 'Lint failed' } & $runtime -m pytest -q if ($LASTEXITCODE) { throw 'Tests failed' } -