Skip to content

Commit 82aaa13

Browse files
authored
Merge pull request #2043 from EliahKagan/static-package-selection
Express conditional `setuptools` requirement statically
2 parents e337e99 + 727f4e9 commit 82aaa13

File tree

4 files changed

+16
-10
lines changed

4 files changed

+16
-10
lines changed

.github/workflows/alpine-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ jobs:
5555
run: |
5656
# Get the latest pip, wheel, and prior to Python 3.12, setuptools.
5757
. .venv/bin/activate
58-
python -m pip install -U pip $(pip freeze --all | grep -ow ^setuptools) wheel
58+
python -m pip install -U pip 'setuptools; python_version<"3.12"' wheel
5959
6060
- name: Install project and test dependencies
6161
run: |
6262
. .venv/bin/activate
63-
pip install ".[test]"
63+
pip install '.[test]'
6464
6565
- name: Show version and platform information
6666
run: |

.github/workflows/cygwin-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ jobs:
7979
- name: Update PyPA packages
8080
run: |
8181
# Get the latest pip, wheel, and prior to Python 3.12, setuptools.
82-
python -m pip install -U pip $(pip freeze --all | grep -ow ^setuptools) wheel
82+
python -m pip install -U pip 'setuptools; python_version<"3.12"' wheel
8383
8484
- name: Install project and test dependencies
8585
run: |
86-
pip install ".[test]"
86+
pip install '.[test]'
8787
8888
- name: Show version and platform information
8989
run: |

.github/workflows/pythonpackage.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ jobs:
7272
- name: Update PyPA packages
7373
run: |
7474
# Get the latest pip, wheel, and prior to Python 3.12, setuptools.
75-
python -m pip install -U pip $(pip freeze --all | grep -ow ^setuptools) wheel
75+
python -m pip install -U pip 'setuptools; python_version<"3.12"' wheel
7676
7777
- name: Install project and test dependencies
7878
run: |
79-
pip install ".[test]"
79+
pip install '.[test]'
8080
8181
- name: Show version and platform information
8282
run: |
@@ -114,5 +114,5 @@ jobs:
114114
- name: Documentation
115115
if: matrix.python-version != '3.7'
116116
run: |
117-
pip install ".[doc]"
117+
pip install '.[doc]'
118118
make -C doc html

test/lib/helper.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -415,9 +415,15 @@ def __init__(self, env_dir, *, with_pip):
415415

416416
if with_pip:
417417
# The upgrade_deps parameter to venv.create is 3.9+ only, so do it this way.
418-
command = [self.python, "-m", "pip", "install", "--upgrade", "pip"]
419-
if sys.version_info < (3, 12):
420-
command.append("setuptools")
418+
command = [
419+
self.python,
420+
"-m",
421+
"pip",
422+
"install",
423+
"--upgrade",
424+
"pip",
425+
'setuptools; python_version<"3.12"',
426+
]
421427
subprocess.check_output(command)
422428

423429
@property

0 commit comments

Comments
 (0)