Skip to content

Commit

Permalink
Add official support for Python 3.12 / Pip 23.2. (#2176)
Browse files Browse the repository at this point in the history
Pip 23.2 is both the latest release and the only release that supports
Python 3.12.

The Pip 23.2 release notes are here:
  https://pip.pypa.io/en/stable/news/#v23-2

Fixes #2173
  • Loading branch information
jsirois authored Jul 20, 2023
1 parent 0e48174 commit 62829bd
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 10 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ jobs:
pip-version: 23_1_2
tox-env-python: python
- os: macos-12
python-version: [ 3, 12, "0-beta.3" ]
python-version: [ 3, 12, "0-beta.4" ]
pip-version: 23_2
tox-env-python: python3.11
- os: ubuntu-22.04
python-version: [ 3, 12, "0-beta.3" ]
python-version: [ 3, 12, "0-beta.4" ]
pip-version: 23_2
tox-env-python: python3.11
steps:
Expand Down Expand Up @@ -219,11 +219,11 @@ jobs:
pip-version: 23_1_2
tox-env-python: python
- os: macos-12
python-version: [ 3, 12, "0-beta.3" ]
python-version: [ 3, 12, "0-beta.4" ]
pip-version: 23_2
tox-env-python: python3.11
- os: ubuntu-22.04
python-version: [ 3, 12, "0-beta.3" ]
python-version: [ 3, 12, "0-beta.4" ]
pip-version: 23_2
tox-env-python: python3.11
steps:
Expand Down
4 changes: 1 addition & 3 deletions pex/pip/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,10 @@ def values(cls):
)

v23_2 = PipVersionValue(
version="23.2.dev0+ea727e4d",
requirement="pip @ git+https://github.com/pypa/pip@ea727e4d6ab598f34f97c50a22350febc1214a97",
version="23.2",
setuptools_version="68.0.0",
wheel_version="0.40.0",
requires_python=">=3.7",
hidden=True,
)

VENDORED = v20_3_4_patched
Expand Down
16 changes: 15 additions & 1 deletion tests/integration/test_issue_1316.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

import os
import subprocess
import sys

import pytest

from pex.testing import run_pex_command
from pex.typing import TYPE_CHECKING
Expand All @@ -11,8 +14,19 @@
from typing import Any


@pytest.mark.skipif(sys.version_info[:2] < (3, 6), reason="PyYAML 6.0.1 requires Python >= 3.6")
def test_resolve_cyclic_dependency_graph(tmpdir):
# type: (Any) -> None
naked_pex = os.path.join(str(tmpdir), "naked.pex")
run_pex_command(args=["Naked==0.1.31", "-o", naked_pex]).assert_success()

# N.B.: Naked 0.1.31 requires PyYAML unbounded and old versions of PyYAML that work with Python
# 2.7 have been broken by the Cython 3.0.0 release. As such we exclude older versions of Python
# from this test and pin PyYAML to a newer version that works with Cython>=3.
constraints = os.path.join(str(tmpdir), "constraints.txt")
with open(constraints, "w") as fp:
fp.write("PyYAML==6.0.1")

run_pex_command(
args=["Naked==0.1.31", "--constraints", constraints, "-o", naked_pex]
).assert_success()
subprocess.check_call(args=[naked_pex, "-c", "import Naked"])
6 changes: 5 additions & 1 deletion tests/integration/test_issue_1817.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

import os
import shutil
import sys

import pytest

from pex.cli.testing import run_pex3
from pex.testing import run_pex_command
Expand Down Expand Up @@ -60,6 +63,7 @@ def test_sdist_for_project_with_native_extensions(tmpdir):
assert_create_and_use_sdist_lock(tmpdir, "psutil==5.9.1", "import psutil")


@pytest.mark.skipif(sys.version_info[:2] < (3, 6), reason="PyYAML 6.0.1 requires Python >= 3.6")
def test_sdist_for_project_with_pep517_build(tmpdir):
# type: (Any) -> None
assert_create_and_use_sdist_lock(tmpdir, "PyYAML==5.4.1", "import yaml")
assert_create_and_use_sdist_lock(tmpdir, "PyYAML==6.0.1", "import yaml")
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ setenv =
pip23_1: _PEX_PIP_VERSION=23.1
pip23_1_1: _PEX_PIP_VERSION=23.1.1
pip23_1_2: _PEX_PIP_VERSION=23.1.2
pip23_2: _PEX_PIP_VERSION=23.2.dev0+ea727e4d
pip23_2: _PEX_PIP_VERSION=23.2
# Python 3 (until a fix here in 3.9: https://bugs.python.org/issue13601) switched from stderr
# being unbuffered to stderr being buffered by default. This can lead to tests checking stderr
# failing to see what they expect if the stderr buffer block has not been flushed. Force stderr
Expand Down

0 comments on commit 62829bd

Please sign in to comment.