mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
Add 3.11 to CI (#11550)
This commit is contained in:
parent
8f34d86a1e
commit
d6e333fb63
82
.github/workflows/ci.yml
vendored
82
.github/workflows/ci.yml
vendored
|
@ -26,8 +26,10 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-python@v2
|
- uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: "3.x"
|
||||||
- run: pip install nox
|
- run: pip install nox
|
||||||
- run: nox -s docs
|
- run: nox -s docs
|
||||||
|
|
||||||
|
@ -60,8 +62,10 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-python@v2
|
- uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: "3.x"
|
||||||
- name: Set up git credentials
|
- name: Set up git credentials
|
||||||
run: |
|
run: |
|
||||||
git config --global user.email "pypa-dev@googlegroups.com"
|
git config --global user.email "pypa-dev@googlegroups.com"
|
||||||
|
@ -82,8 +86,10 @@ jobs:
|
||||||
github.event_name != 'pull_request'
|
github.event_name != 'pull_request'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-python@v2
|
- uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: "3.x"
|
||||||
|
|
||||||
- run: pip install nox
|
- run: pip install nox
|
||||||
- run: nox -s vendoring
|
- run: nox -s vendoring
|
||||||
|
@ -103,14 +109,15 @@ jobs:
|
||||||
matrix:
|
matrix:
|
||||||
os: [Ubuntu, MacOS]
|
os: [Ubuntu, MacOS]
|
||||||
python:
|
python:
|
||||||
- 3.7
|
- "3.7"
|
||||||
- 3.8
|
- "3.8"
|
||||||
- 3.9
|
- "3.9"
|
||||||
- "3.10"
|
- "3.10"
|
||||||
|
- "3.11"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-python@v2
|
- uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python }}
|
python-version: ${{ matrix.python }}
|
||||||
|
|
||||||
|
@ -151,16 +158,17 @@ jobs:
|
||||||
matrix:
|
matrix:
|
||||||
os: [Windows]
|
os: [Windows]
|
||||||
python:
|
python:
|
||||||
- 3.7
|
- "3.7"
|
||||||
# Commented out, since Windows tests are expensively slow.
|
# Commented out, since Windows tests are expensively slow.
|
||||||
# - 3.8
|
# - "3.8"
|
||||||
# - 3.9
|
# - "3.9"
|
||||||
- "3.10"
|
# - "3.10"
|
||||||
|
- "3.11"
|
||||||
group: [1, 2]
|
group: [1, 2]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-python@v2
|
- uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python }}
|
python-version: ${{ matrix.python }}
|
||||||
|
|
||||||
|
@ -221,8 +229,8 @@ jobs:
|
||||||
github.event_name != 'pull_request'
|
github.event_name != 'pull_request'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-python@v2
|
- uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: "3.10"
|
python-version: "3.10"
|
||||||
|
|
||||||
|
@ -240,41 +248,6 @@ jobs:
|
||||||
--durations=5
|
--durations=5
|
||||||
--use-zipapp
|
--use-zipapp
|
||||||
|
|
||||||
# TODO: Remove this when we add Python 3.11 to CI.
|
|
||||||
tests-importlib-metadata:
|
|
||||||
name: tests for importlib.metadata backend
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
env:
|
|
||||||
_PIP_USE_IMPORTLIB_METADATA: 'true'
|
|
||||||
|
|
||||||
needs: [packaging, determine-changes]
|
|
||||||
if: >-
|
|
||||||
needs.determine-changes.outputs.tests == 'true' ||
|
|
||||||
github.event_name != 'pull_request'
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
python-version: '3.10'
|
|
||||||
|
|
||||||
- name: Install Ubuntu dependencies
|
|
||||||
run: sudo apt-get install bzr
|
|
||||||
|
|
||||||
- run: pip install nox
|
|
||||||
|
|
||||||
- name: Run unit tests
|
|
||||||
run: >-
|
|
||||||
nox -s test-3.10 --
|
|
||||||
-m unit
|
|
||||||
--verbose --numprocesses auto --showlocals
|
|
||||||
- name: Run integration tests
|
|
||||||
run: >-
|
|
||||||
nox -s test-3.10 --
|
|
||||||
-m integration
|
|
||||||
--verbose --numprocesses auto --showlocals
|
|
||||||
--durations=5
|
|
||||||
|
|
||||||
check: # This job does nothing and is only used for the branch protection
|
check: # This job does nothing and is only used for the branch protection
|
||||||
if: always()
|
if: always()
|
||||||
|
|
||||||
|
@ -285,7 +258,6 @@ jobs:
|
||||||
- tests-unix
|
- tests-unix
|
||||||
- tests-windows
|
- tests-windows
|
||||||
- tests-zipapp
|
- tests-zipapp
|
||||||
- tests-importlib-metadata
|
|
||||||
- vendoring
|
- vendoring
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
2
.github/workflows/news-file.yml
vendored
2
.github/workflows/news-file.yml
vendored
|
@ -10,7 +10,7 @@ jobs:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
# `towncrier check` runs `git diff --name-only origin/main...`, which
|
# `towncrier check` runs `git diff --name-only origin/main...`, which
|
||||||
# needs a non-shallow clone.
|
# needs a non-shallow clone.
|
||||||
|
|
|
@ -66,7 +66,7 @@ def should_update_common_wheels() -> bool:
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
# Development Commands
|
# Development Commands
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
@nox.session(python=["3.7", "3.8", "3.9", "3.10", "pypy3"])
|
@nox.session(python=["3.7", "3.8", "3.9", "3.10", "3.11", "pypy3"])
|
||||||
def test(session: nox.Session) -> None:
|
def test(session: nox.Session) -> None:
|
||||||
# Get the common wheels.
|
# Get the common wheels.
|
||||||
if should_update_common_wheels():
|
if should_update_common_wheels():
|
||||||
|
|
|
@ -287,7 +287,6 @@ class Tests_UserSite:
|
||||||
assert isdir(dist_info_folder)
|
assert isdir(dist_info_folder)
|
||||||
assert isdir(initools_folder)
|
assert isdir(initools_folder)
|
||||||
|
|
||||||
@pytest.mark.network
|
|
||||||
def test_install_user_in_global_virtualenv_with_conflict_fails(
|
def test_install_user_in_global_virtualenv_with_conflict_fails(
|
||||||
self, script: PipTestEnvironment
|
self, script: PipTestEnvironment
|
||||||
) -> None:
|
) -> None:
|
||||||
|
@ -295,27 +294,37 @@ class Tests_UserSite:
|
||||||
Test user install in --system-site-packages virtualenv with conflict in
|
Test user install in --system-site-packages virtualenv with conflict in
|
||||||
site fails.
|
site fails.
|
||||||
"""
|
"""
|
||||||
|
create_basic_wheel_for_package(script, "pkg", "0.1")
|
||||||
|
create_basic_wheel_for_package(script, "pkg", "0.2")
|
||||||
|
|
||||||
script.pip("install", "INITools==0.2")
|
script.pip(
|
||||||
|
"install",
|
||||||
|
"--no-cache-dir",
|
||||||
|
"--no-index",
|
||||||
|
"--find-links",
|
||||||
|
script.scratch_path,
|
||||||
|
"pkg==0.2",
|
||||||
|
)
|
||||||
|
|
||||||
result2 = script.pip(
|
result2 = script.pip(
|
||||||
"install",
|
"install",
|
||||||
|
"--no-cache-dir",
|
||||||
|
"--no-index",
|
||||||
|
"--find-links",
|
||||||
|
script.scratch_path,
|
||||||
"--user",
|
"--user",
|
||||||
"INITools==0.1",
|
"pkg==0.1",
|
||||||
expect_error=True,
|
expect_error=True,
|
||||||
)
|
)
|
||||||
resultp = script.run(
|
resultp = script.run(
|
||||||
"python",
|
"python",
|
||||||
"-c",
|
"-c",
|
||||||
"import pkg_resources; print(pkg_resources.get_distribution"
|
"from pip._internal.metadata import get_default_environment; "
|
||||||
"('initools').location)",
|
"print(get_default_environment().get_distribution('pkg').location)",
|
||||||
)
|
)
|
||||||
dist_location = resultp.stdout.strip()
|
dist_location = resultp.stdout.strip()
|
||||||
|
|
||||||
assert (
|
assert (
|
||||||
"Will not install to the user site because it will lack sys.path "
|
f"Will not install to the user site because it will lack sys.path "
|
||||||
"precedence to {name} in {location}".format(
|
f"precedence to pkg in {dist_location}"
|
||||||
name="INITools",
|
) in result2.stderr
|
||||||
location=dist_location,
|
|
||||||
)
|
|
||||||
in result2.stderr
|
|
||||||
)
|
|
||||||
|
|
|
@ -91,39 +91,6 @@ def test_new_resolver_install_user_conflict_in_user_site(
|
||||||
result.did_not_create(base_2_dist_info)
|
result.did_not_create(base_2_dist_info)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.usefixtures("enable_user_site")
|
|
||||||
def test_new_resolver_install_user_in_virtualenv_with_conflict_fails(
|
|
||||||
script: PipTestEnvironment,
|
|
||||||
) -> None:
|
|
||||||
create_basic_wheel_for_package(script, "base", "1.0.0")
|
|
||||||
create_basic_wheel_for_package(script, "base", "2.0.0")
|
|
||||||
|
|
||||||
script.pip(
|
|
||||||
"install",
|
|
||||||
"--no-cache-dir",
|
|
||||||
"--no-index",
|
|
||||||
"--find-links",
|
|
||||||
script.scratch_path,
|
|
||||||
"base==2.0.0",
|
|
||||||
)
|
|
||||||
result = script.pip(
|
|
||||||
"install",
|
|
||||||
"--no-cache-dir",
|
|
||||||
"--no-index",
|
|
||||||
"--find-links",
|
|
||||||
script.scratch_path,
|
|
||||||
"--user",
|
|
||||||
"base==1.0.0",
|
|
||||||
expect_error=True,
|
|
||||||
)
|
|
||||||
|
|
||||||
error_message = (
|
|
||||||
"Will not install to the user site because it will lack sys.path "
|
|
||||||
"precedence to base in {}"
|
|
||||||
).format(os.path.normcase(script.site_packages_path))
|
|
||||||
assert error_message in result.stderr
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture()
|
@pytest.fixture()
|
||||||
def patch_dist_in_site_packages(virtualenv: VirtualEnvironment) -> None:
|
def patch_dist_in_site_packages(virtualenv: VirtualEnvironment) -> None:
|
||||||
# Since the tests are run from a virtualenv, and to avoid the "Will not
|
# Since the tests are run from a virtualenv, and to avoid the "Will not
|
||||||
|
|
Loading…
Reference in a new issue