Skip to content

Commit

Permalink
Explicitly require Python 3.10+ for vendoring task
Browse files Browse the repository at this point in the history
  • Loading branch information
sethmlarson committed Aug 19, 2023
1 parent 0d9b32a commit f16b7c2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 6 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,12 @@ def lint(session: nox.Session) -> None:
# git reset --hard origin/main
@nox.session
def vendoring(session: nox.Session) -> None:
# Ensure that the session Python is running 3.10+
# so that truststore can be installed correctly.
session.run(
"python", "-c", "import sys; sys.exit(1 if sys.version_info < (3, 10) else 0)"
)

session.install("vendoring~=1.2.0")

parser = argparse.ArgumentParser(prog="nox -s vendoring")
Expand Down
4 changes: 1 addition & 3 deletions src/pip/_internal/cli/req_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@ def _create_truststore_ssl_context() -> Optional["SSLContext"]:
try:
from pip._vendor import truststore
except ImportError as e:
raise CommandError(
f"The truststore feature is unavailable: {e}"
)
raise CommandError(f"The truststore feature is unavailable: {e}")

return truststore.SSLContext(ssl.PROTOCOL_TLS_CLIENT)

Expand Down

0 comments on commit f16b7c2

Please sign in to comment.