Skip to content

Commit d6e333f

Browse files
authored
Add 3.11 to CI (#11550)
1 parent 8f34d86 commit d6e333f

File tree

5 files changed

+50
-102
lines changed

5 files changed

+50
-102
lines changed

.github/workflows/ci.yml

+27-55
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@ jobs:
2626
runs-on: ubuntu-latest
2727

2828
steps:
29-
- uses: actions/checkout@v2
30-
- uses: actions/setup-python@v2
29+
- uses: actions/checkout@v3
30+
- uses: actions/setup-python@v4
31+
with:
32+
python-version: "3.x"
3133
- run: pip install nox
3234
- run: nox -s docs
3335

@@ -60,8 +62,10 @@ jobs:
6062
runs-on: ubuntu-latest
6163

6264
steps:
63-
- uses: actions/checkout@v2
64-
- uses: actions/setup-python@v2
65+
- uses: actions/checkout@v3
66+
- uses: actions/setup-python@v4
67+
with:
68+
python-version: "3.x"
6569
- name: Set up git credentials
6670
run: |
6771
git config --global user.email "[email protected]"
@@ -82,8 +86,10 @@ jobs:
8286
github.event_name != 'pull_request'
8387
8488
steps:
85-
- uses: actions/checkout@v2
86-
- uses: actions/setup-python@v2
89+
- uses: actions/checkout@v3
90+
- uses: actions/setup-python@v4
91+
with:
92+
python-version: "3.x"
8793

8894
- run: pip install nox
8995
- run: nox -s vendoring
@@ -103,14 +109,15 @@ jobs:
103109
matrix:
104110
os: [Ubuntu, MacOS]
105111
python:
106-
- 3.7
107-
- 3.8
108-
- 3.9
112+
- "3.7"
113+
- "3.8"
114+
- "3.9"
109115
- "3.10"
116+
- "3.11"
110117

111118
steps:
112-
- uses: actions/checkout@v2
113-
- uses: actions/setup-python@v2
119+
- uses: actions/checkout@v3
120+
- uses: actions/setup-python@v4
114121
with:
115122
python-version: ${{ matrix.python }}
116123

@@ -151,16 +158,17 @@ jobs:
151158
matrix:
152159
os: [Windows]
153160
python:
154-
- 3.7
161+
- "3.7"
155162
# Commented out, since Windows tests are expensively slow.
156-
# - 3.8
157-
# - 3.9
158-
- "3.10"
163+
# - "3.8"
164+
# - "3.9"
165+
# - "3.10"
166+
- "3.11"
159167
group: [1, 2]
160168

161169
steps:
162-
- uses: actions/checkout@v2
163-
- uses: actions/setup-python@v2
170+
- uses: actions/checkout@v3
171+
- uses: actions/setup-python@v4
164172
with:
165173
python-version: ${{ matrix.python }}
166174

@@ -221,8 +229,8 @@ jobs:
221229
github.event_name != 'pull_request'
222230
223231
steps:
224-
- uses: actions/checkout@v2
225-
- uses: actions/setup-python@v2
232+
- uses: actions/checkout@v3
233+
- uses: actions/setup-python@v4
226234
with:
227235
python-version: "3.10"
228236

@@ -240,41 +248,6 @@ jobs:
240248
--durations=5
241249
--use-zipapp
242250
243-
# TODO: Remove this when we add Python 3.11 to CI.
244-
tests-importlib-metadata:
245-
name: tests for importlib.metadata backend
246-
runs-on: ubuntu-latest
247-
env:
248-
_PIP_USE_IMPORTLIB_METADATA: 'true'
249-
250-
needs: [packaging, determine-changes]
251-
if: >-
252-
needs.determine-changes.outputs.tests == 'true' ||
253-
github.event_name != 'pull_request'
254-
255-
steps:
256-
- uses: actions/checkout@v2
257-
- uses: actions/setup-python@v2
258-
with:
259-
python-version: '3.10'
260-
261-
- name: Install Ubuntu dependencies
262-
run: sudo apt-get install bzr
263-
264-
- run: pip install nox
265-
266-
- name: Run unit tests
267-
run: >-
268-
nox -s test-3.10 --
269-
-m unit
270-
--verbose --numprocesses auto --showlocals
271-
- name: Run integration tests
272-
run: >-
273-
nox -s test-3.10 --
274-
-m integration
275-
--verbose --numprocesses auto --showlocals
276-
--durations=5
277-
278251
check: # This job does nothing and is only used for the branch protection
279252
if: always()
280253

@@ -285,7 +258,6 @@ jobs:
285258
- tests-unix
286259
- tests-windows
287260
- tests-zipapp
288-
- tests-importlib-metadata
289261
- vendoring
290262

291263
runs-on: ubuntu-latest

.github/workflows/news-file.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-20.04
1111

1212
steps:
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v3
1414
with:
1515
# `towncrier check` runs `git diff --name-only origin/main...`, which
1616
# needs a non-shallow clone.

noxfile.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def should_update_common_wheels() -> bool:
6666
# -----------------------------------------------------------------------------
6767
# Development Commands
6868
# -----------------------------------------------------------------------------
69-
@nox.session(python=["3.7", "3.8", "3.9", "3.10", "pypy3"])
69+
@nox.session(python=["3.7", "3.8", "3.9", "3.10", "3.11", "pypy3"])
7070
def test(session: nox.Session) -> None:
7171
# Get the common wheels.
7272
if should_update_common_wheels():

tests/functional/test_install_user.py

+21-12
Original file line numberDiff line numberDiff line change
@@ -287,35 +287,44 @@ def test_install_user_conflict_in_globalsite_and_usersite(
287287
assert isdir(dist_info_folder)
288288
assert isdir(initools_folder)
289289

290-
@pytest.mark.network
291290
def test_install_user_in_global_virtualenv_with_conflict_fails(
292291
self, script: PipTestEnvironment
293292
) -> None:
294293
"""
295294
Test user install in --system-site-packages virtualenv with conflict in
296295
site fails.
297296
"""
297+
create_basic_wheel_for_package(script, "pkg", "0.1")
298+
create_basic_wheel_for_package(script, "pkg", "0.2")
298299

299-
script.pip("install", "INITools==0.2")
300+
script.pip(
301+
"install",
302+
"--no-cache-dir",
303+
"--no-index",
304+
"--find-links",
305+
script.scratch_path,
306+
"pkg==0.2",
307+
)
300308

301309
result2 = script.pip(
302310
"install",
311+
"--no-cache-dir",
312+
"--no-index",
313+
"--find-links",
314+
script.scratch_path,
303315
"--user",
304-
"INITools==0.1",
316+
"pkg==0.1",
305317
expect_error=True,
306318
)
307319
resultp = script.run(
308320
"python",
309321
"-c",
310-
"import pkg_resources; print(pkg_resources.get_distribution"
311-
"('initools').location)",
322+
"from pip._internal.metadata import get_default_environment; "
323+
"print(get_default_environment().get_distribution('pkg').location)",
312324
)
313325
dist_location = resultp.stdout.strip()
326+
314327
assert (
315-
"Will not install to the user site because it will lack sys.path "
316-
"precedence to {name} in {location}".format(
317-
name="INITools",
318-
location=dist_location,
319-
)
320-
in result2.stderr
321-
)
328+
f"Will not install to the user site because it will lack sys.path "
329+
f"precedence to pkg in {dist_location}"
330+
) in result2.stderr

tests/functional/test_new_resolver_user.py

-33
Original file line numberDiff line numberDiff line change
@@ -91,39 +91,6 @@ def test_new_resolver_install_user_conflict_in_user_site(
9191
result.did_not_create(base_2_dist_info)
9292

9393

94-
@pytest.mark.usefixtures("enable_user_site")
95-
def test_new_resolver_install_user_in_virtualenv_with_conflict_fails(
96-
script: PipTestEnvironment,
97-
) -> None:
98-
create_basic_wheel_for_package(script, "base", "1.0.0")
99-
create_basic_wheel_for_package(script, "base", "2.0.0")
100-
101-
script.pip(
102-
"install",
103-
"--no-cache-dir",
104-
"--no-index",
105-
"--find-links",
106-
script.scratch_path,
107-
"base==2.0.0",
108-
)
109-
result = script.pip(
110-
"install",
111-
"--no-cache-dir",
112-
"--no-index",
113-
"--find-links",
114-
script.scratch_path,
115-
"--user",
116-
"base==1.0.0",
117-
expect_error=True,
118-
)
119-
120-
error_message = (
121-
"Will not install to the user site because it will lack sys.path "
122-
"precedence to base in {}"
123-
).format(os.path.normcase(script.site_packages_path))
124-
assert error_message in result.stderr
125-
126-
12794
@pytest.fixture()
12895
def patch_dist_in_site_packages(virtualenv: VirtualEnvironment) -> None:
12996
# Since the tests are run from a virtualenv, and to avoid the "Will not

0 commit comments

Comments
 (0)