Skip to content

Commit

Permalink
Upgrade Python 3.13 to alpha 6. (#2398)
Browse files Browse the repository at this point in the history
Also upgrade all other pythons to latest point releases.
  • Loading branch information
jsirois committed Apr 20, 2024
1 parent fa0995b commit 41ad944
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 25 deletions.
12 changes: 6 additions & 6 deletions docker/base/install_pythons.sh
Expand Up @@ -8,16 +8,16 @@ export PYENV_ROOT=/pyenv
# N.B.: The 1st listed version will supply the default `python` on the PATH; otherwise order does
# not matter.
PYENV_VERSIONS=(
3.11.8
3.11.9
2.7.18
3.5.10
3.6.15
3.7.17
3.8.18
3.9.18
3.10.13
3.12.2
3.13.0a5
3.8.19
3.9.19
3.10.14
3.12.3
3.13.0a6
pypy2.7-7.3.15
pypy3.5-7.0.0
pypy3.6-7.3.3
Expand Down
10 changes: 5 additions & 5 deletions pex/interpreter_constraints.py
Expand Up @@ -317,11 +317,11 @@ def iter_compatible_versions(
PythonVersion(Lifecycle.EOL, 3, 5, 10),
PythonVersion(Lifecycle.EOL, 3, 6, 15),
PythonVersion(Lifecycle.EOL, 3, 7, 17),
PythonVersion(Lifecycle.STABLE, 3, 8, 18),
PythonVersion(Lifecycle.STABLE, 3, 9, 18),
PythonVersion(Lifecycle.STABLE, 3, 10, 13),
PythonVersion(Lifecycle.STABLE, 3, 11, 8),
PythonVersion(Lifecycle.STABLE, 3, 12, 2),
PythonVersion(Lifecycle.STABLE, 3, 8, 19),
PythonVersion(Lifecycle.STABLE, 3, 9, 19),
PythonVersion(Lifecycle.STABLE, 3, 10, 14),
PythonVersion(Lifecycle.STABLE, 3, 11, 9),
PythonVersion(Lifecycle.STABLE, 3, 12, 3),
PythonVersion(Lifecycle.DEV, 3, 13, 0),
)

Expand Down
8 changes: 3 additions & 5 deletions tests/integration/test_lock_resolver.py
Expand Up @@ -344,7 +344,7 @@ def test_issue_1413_portable_find_links(tmpdir):
)
)

repository_pex = os.path.join(str(tmpdir), "my-app-not-on-pypi.pex")
repository_pex = os.path.join(str(tmpdir), "myappnotonpypi.pex")
run_pex_command(
args=["-D", src, "ansicolors==1.1.8", "-m", "app", "--include-tools", "-o", repository_pex]
).assert_success()
Expand All @@ -362,16 +362,14 @@ def test_issue_1413_portable_find_links(tmpdir):
# We should have only the sdist of the src/app.py source code available in the find-links repo.
os.unlink(os.path.join(original_find_links, "ansicolors-1.1.8-py2.py3-none-any.whl"))
assert 1 == len(os.listdir(original_find_links))
assert 1 == len(
glob.glob(os.path.join(original_find_links, "my-app-not-on-pypi-0.0.0*.tar.gz"))
)
assert 1 == len(glob.glob(os.path.join(original_find_links, "myappnotonpypi-0.0.0*.tar.gz")))

lock = os.path.join(str(tmpdir), "lock")
run_pex3(
"lock",
"create",
"ansicolors==1.1.8",
"my-app-not-on-pypi",
"myappnotonpypi",
"-f",
original_find_links,
"--path-mapping",
Expand Down
32 changes: 23 additions & 9 deletions tests/test_pex_builder.py
Expand Up @@ -490,6 +490,13 @@ def size(pex):
assert size(compressed_pex) < size(uncompressed_pex)


@pytest.mark.skipif(
sys.version_info == (3, 13, 0, "alpha", 6),
reason=(
"The 3.13.0a6 release has a bug in its zipimporter ZIP64 handling, see: "
"https://github.com/python/cpython/issues/118107"
),
)
@pytest.mark.skipif(
subprocess.call(args=["cat", os.devnull]) != 0,
reason="The cat binary is required for this test.",
Expand All @@ -506,16 +513,23 @@ def assert_perform_check_zip64_handling(
assert Check.ERROR.perform_check(Layout.PACKED, zipapp) is None
assert Check.ERROR.perform_check(Layout.LOOSE, zipapp) is None

expected_error_message_re = r"The PEX zip at {path} is not a valid zipapp: ".format(
path=re.escape(zipapp)
)
with pytest.warns(PEXWarning, match=expected_error_message_re):
assert Check.WARN.perform_check(Layout.ZIPAPP, zipapp) is False
with pytest.raises(InvalidZipAppError, match=expected_error_message_re):
Check.ERROR.perform_check(Layout.ZIPAPP, zipapp)
# Python 3.13 newly supports ZIP64 in `zipimport.zipimporter`.
if sys.version_info >= (3, 13):
assert Check.WARN.perform_check(Layout.ZIPAPP, zipapp) is True
assert Check.ERROR.perform_check(Layout.ZIPAPP, zipapp) is True
if test_run:
subprocess.check_call(args=[sys.executable, zipapp])
else:
expected_error_message_re = r"The PEX zip at {path} is not a valid zipapp: ".format(
path=re.escape(zipapp)
)
with pytest.warns(PEXWarning, match=expected_error_message_re):
assert Check.WARN.perform_check(Layout.ZIPAPP, zipapp) is False
with pytest.raises(InvalidZipAppError, match=expected_error_message_re):
Check.ERROR.perform_check(Layout.ZIPAPP, zipapp)

if test_run:
assert subprocess.call(args=[sys.executable, zipapp]) != 0
if test_run:
assert subprocess.call(args=[sys.executable, zipapp]) != 0

@contextmanager
def write_zipapp(path):
Expand Down

0 comments on commit 41ad944

Please sign in to comment.