Skip to content

Commit 63f19b5

Browse files
committed
Explicitly require Python 3.10+ for vendoring task
1 parent 44857c6 commit 63f19b5

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

noxfile.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,12 @@ def lint(session: nox.Session) -> None:
184184
# git reset --hard origin/main
185185
@nox.session
186186
def vendoring(session: nox.Session) -> None:
187+
# Ensure that the session Python is running 3.10+
188+
# so that truststore can be installed correctly.
189+
session.run(
190+
"python", "-c", "import sys; sys.exit(1 if sys.version_info < (3, 10) else 0)"
191+
)
192+
187193
session.install("vendoring~=1.2.0")
188194

189195
parser = argparse.ArgumentParser(prog="nox -s vendoring")

src/pip/_internal/cli/req_command.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,7 @@ def _create_truststore_ssl_context() -> Optional["SSLContext"]:
6060
try:
6161
from pip._vendor import truststore
6262
except ImportError as e:
63-
raise CommandError(
64-
f"The truststore feature is unavailable: {e}"
65-
)
63+
raise CommandError(f"The truststore feature is unavailable: {e}")
6664

6765
return truststore.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
6866

0 commit comments

Comments
 (0)