Skip to content

Commit 58349c6

Browse files
codexByron
authored andcommitted
ci: make the Cygwin pip pin durable
Review feedback: Pin against a persistent package source. Ordinary Cygwin mirrors retain only a rolling set of package versions, so the exact setup package selection would eventually disappear. Create the virtual environment without ensurepip, download pip 26.0.1 from its immutable PyPI file URL, verify its SHA-256 digest, and bootstrap that wheel directly. Avoid upgrading pip afterward so the broken 26.2.1 release is not reintroduced. Validated with git diff --check, Ruby YAML parsing, and a local no-pip virtual-environment bootstrap using the pinned wheel.
1 parent c249ec4 commit 58349c6

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

.github/workflows/cygwin-test.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
- name: Install Cygwin
4646
uses: cygwin/cygwin-install-action@v6
4747
with:
48-
packages: git python312 python-pip-wheel=26.0.1-1 python-setuptools-wheel python-wheel-wheel
48+
packages: curl git python312
4949
add-to-path: false # No need to change $PATH outside the Cygwin environment.
5050

5151
- name: Arrange for verbose output
@@ -73,12 +73,16 @@ jobs:
7373
7474
- name: Set up virtual environment
7575
run: |
76-
python3.12 -m venv .venv
76+
pip_wheel=/tmp/pip-26.0.1-py3-none-any.whl
77+
python3.12 -m venv --without-pip .venv
78+
curl -fsSLo "$pip_wheel" https://files.pythonhosted.org/packages/de/f0/c81e05b613866b76d2d1066490adf1a3dbc4ee9d9c839961c3fc8a6997af/pip-26.0.1-py3-none-any.whl
79+
python3.12 -c 'import hashlib, pathlib, sys; assert hashlib.sha256(pathlib.Path(sys.argv[1]).read_bytes()).hexdigest() == sys.argv[2]' "$pip_wheel" bdb1b08f4274833d62c1aa29e20907365a2ceb950410df15fc9521bad440122b
80+
PYTHONPATH="$pip_wheel" .venv/bin/python -m pip install "$pip_wheel"
7781
echo 'BASH_ENV=.venv/bin/activate' >>"$GITHUB_ENV"
7882
7983
- name: Update PyPA packages
8084
run: |
81-
python -m pip install -U pip 'setuptools; python_version<"3.12"' wheel
85+
python -m pip install -U 'setuptools; python_version<"3.12"' wheel
8286
8387
- name: Install project and test dependencies
8488
run: |

0 commit comments

Comments
 (0)