Skip to content

Commit 399eb7d

Browse files
committed
Bootstrap pip in Cygwin Python 3.12 venv in a separate step
This works around a problem in Python 3.12 on Cygwin where `pip` fails to intall in a venv via `ensurepip` (both implicitly when the venv is created normally, and explicitly when `python -m ensurepip` is attempted), by creating the venv with `--without-pip` and then, once the venv is set up, bootstrapping `pip` in it by running the https://bootstrap.pypa.io/get-pip.py script. Eventually, when `pip` is working automatically in a venv in Python 3.12 on Cygwin (the problem is specific to that combination, and the Cygwin `python312*` packages are still marked "test"), this special-casing can be removed.
1 parent 93f29c2 commit 399eb7d

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

.github/workflows/cygwin-test.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212
include:
1313
- python-version: "3.9"
1414
python-cygwin: python39
15-
python-command: python3.9
15+
venv-args: ''
1616
- python-version: "3.12"
1717
python-cygwin: python312
18-
python-command: python3.12
18+
venv-args: --without-pip
1919

2020
fail-fast: false
2121

@@ -40,7 +40,7 @@ jobs:
4040
- name: Set up Cygwin
4141
uses: egor-tensin/setup-cygwin@v4
4242
with:
43-
packages: ${{ matrix.python-cygwin }} ${{ matrix.python-cygwin }}-pip ${{ matrix.python-cygwin }}-virtualenv git
43+
packages: ${{ matrix.python-cygwin }} ${{ matrix.python-cygwin }}-pip ${{ matrix.python-cygwin }}-virtualenv git wget
4444

4545
- name: Arrange for verbose output
4646
run: |
@@ -67,9 +67,14 @@ jobs:
6767
6868
- name: Set up virtualenv
6969
run: |
70-
${{ matrix.python-command }} -m venv .venv
70+
python${{ matrix.python-version }} -m venv ${{ matrix.venv-args }} .venv
7171
echo 'BASH_ENV=.venv/bin/activate' >>"$GITHUB_ENV"
7272
73+
- name: Bootstrap pip in virtualenv
74+
if: contains(matrix.venv-args, '--without-pip')
75+
run: |
76+
wget -qO- https://bootstrap.pypa.io/get-pip.py | python
77+
7378
- name: Update PyPA packages
7479
run: |
7580
# Get the latest pip, wheel, and prior to Python 3.12, setuptools.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy