Skip to content

Commit f2b3dd1

Browse files
committed
Use *-wheel packages as a better fix for gitpython-developers#2004
This installs the `python-pip-wheel`, `python-setuptools-wheel`, and `python-wheel-wheel` packages on Cygwini CI, which provide `.whl` files for `pip`, `setuptools`, and `wheel`. By making those wheels available, this fixes gitpython-developers#2004 better than the previous workaround, allowing `ensurepip` to run without the error: Traceback (most recent call last): File "/usr/lib/python3.9/runpy.py", line 188, in _run_module_as_main mod_name, mod_spec, code = _get_module_details(mod_name, _Error) File "/usr/lib/python3.9/runpy.py", line 147, in _get_module_details return _get_module_details(pkg_main_name, error) File "/usr/lib/python3.9/runpy.py", line 111, in _get_module_details __import__(pkg_name) File "/usr/lib/python3.9/ensurepip/__init__.py", line [30](https://github.com/EliahKagan/GitPython/actions/runs/13454947366/job/37596811693#step:10:31), in <module> _SETUPTOOLS_VERSION = _get_most_recent_wheel_version("setuptools") File "/usr/lib/python3.9/ensurepip/__init__.py", line 27, in _get_most_recent_wheel_version return str(max(_wheels[pkg], key=distutils.version.LooseVersion)) ValueError: max() arg is an empty sequence This change takes the place of the main changes in gitpython-developers#2007 and gitpython-developers#2009. In particular, it should allow `test_installation` to pass again. This also delists non-wheel Cygwin packages such as `python39-pip`, which are not needed (or at least no longer needed).
1 parent 66955cc commit f2b3dd1

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

.github/workflows/cygwin-test.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
- name: Install Cygwin
4242
uses: cygwin/cygwin-install-action@v5
4343
with:
44-
packages: python39 python39-pip python39-virtualenv git wget
44+
packages: git python39 python39-pip-wheel python39-setuptools-wheel python39-wheel-wheel
4545
add-to-path: false # No need to change $PATH outside the Cygwin environment.
4646

4747
- name: Arrange for verbose output
@@ -69,13 +69,9 @@ jobs:
6969
7070
- name: Set up virtual environment
7171
run: |
72-
python3.9 -m venv --without-pip .venv
72+
python3.9 -m venv .venv
7373
echo 'BASH_ENV=.venv/bin/activate' >>"$GITHUB_ENV"
7474
75-
- name: Bootstrap pip in virtualenv
76-
run: |
77-
wget -qO- https://bootstrap.pypa.io/get-pip.py | python
78-
7975
- name: Update PyPA packages
8076
run: |
8177
python -m pip install -U pip 'setuptools; python_version<"3.12"' wheel

test/test_installation.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,11 @@
44
import ast
55
import os
66
import subprocess
7-
import sys
8-
9-
import pytest
107

118
from test.lib import TestBase, VirtualEnvironment, with_rw_directory
129

1310

1411
class TestInstallation(TestBase):
15-
@pytest.mark.xfail(
16-
sys.platform == "cygwin" and "CI" in os.environ,
17-
reason="Trouble with pip on Cygwin CI, see issue #2004",
18-
raises=subprocess.CalledProcessError,
19-
)
2012
@with_rw_directory
2113
def test_installation(self, rw_dir):
2214
venv = self._set_up_venv(rw_dir)

0 commit comments

Comments
 (0)