Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Release Notes

## 2.97.0

This release adds support for using `--scie-pbs-stripped` in combination with
`--scie-pbs-free-threaded`.

* Support PBS free-threaded `install_only(_stripped)`. (#3197)

## 2.96.2

This release fixes `--scie-only` for foreign platforms.
Expand Down
10 changes: 4 additions & 6 deletions pex/scie/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,7 @@ def register_options(
help=(
"Should the Python Standalone Builds CPython distributions be free-threaded. If left "
"unspecified or otherwise turned off, creating a scie from a PEX with free-threaded "
"abi wheels will automatically turn this option on. Note that this option is not "
"compatible with `--scie-pbs-stripped`."
"abi wheels will automatically turn this option on."
),
)
parser.add_argument(
Expand All @@ -388,7 +387,7 @@ def register_options(
"Should the Python Standalone Builds CPython distributions used be stripped of debug "
"symbols or not. For Linux and Windows particularly, the stripped distributions are "
"less than half the size of the distributions that ship with debug symbols. Note that "
"this option is not compatible with `--scie-pbs-free-threaded` or `--scie-pbs-debug`."
"this option is not compatible with `--scie-pbs-debug`."
),
)
parser.add_argument(
Expand Down Expand Up @@ -588,10 +587,9 @@ def extract_options(options):
)
)

if options.scie_pbs_stripped and (options.scie_pbs_free_threaded or options.scie_pbs_debug):
if options.scie_pbs_stripped and options.scie_pbs_debug:
raise ValueError(
"Python Standalone Builds does not release stripped distributions for debug or "
"free-threaded builds."
"Python Standalone Builds does not release stripped distributions for debug builds."
)

science_binary = None # type: Optional[Union[File, Url]]
Expand Down
18 changes: 15 additions & 3 deletions pex/scie/science.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import re
import shutil
import subprocess
import time
from collections import OrderedDict
from subprocess import CalledProcessError

Expand Down Expand Up @@ -69,7 +70,7 @@ def qualified_binary_name(self, binary_name):


SCIENCE_RELEASES_URL = "https://github.com/a-scie/lift/releases"
MIN_SCIENCE_VERSION = Version("0.18.1")
MIN_SCIENCE_VERSION = Version("0.19.0")
SCIENCE_REQUIREMENT = SpecifierSet("~={min_version}".format(min_version=MIN_SCIENCE_VERSION))


Expand Down Expand Up @@ -441,9 +442,20 @@ def configuration_binding(
interpreter_config["base_url"] = "/".join(
(configuration.options.assets_base_url, "providers", str(interpreter.provider))
)
if Provider.PythonBuildStandalone is interpreter.provider and not (
configuration.options.pbs_debug or pbs_free_threaded

install_only_available = Provider.PythonBuildStandalone is interpreter.provider
if install_only_available and configuration.options.pbs_debug:
install_only_available = False
if (
install_only_available
and pbs_free_threaded
and interpreter.release
and time.strptime(interpreter.release, "%Y%m%d") < time.strptime("20260320", "%Y%m%d")
):
# N.B.: Builds for free-threaded gained install_only & install_only_stripped flavors as
# of https://github.com/astral-sh/python-build-standalone/releases/tag/20260320
install_only_available = False
if install_only_available:
interpreter_config.update(
flavor=(
"install_only_stripped"
Expand Down
2 changes: 1 addition & 1 deletion pex/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2015 Pex project contributors.
# Licensed under the Apache License, Version 2.0 (see LICENSE).

__version__ = "2.96.2"
__version__ = "2.97.0"
18 changes: 15 additions & 3 deletions tests/integration/scie/test_pex_scie.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ def test_specified_science_binary(tmpdir):

local_science_binary = os.path.join(str(tmpdir), "science")
with open(local_science_binary, "wb") as write_fp, URLFetcher().get_body_stream(
"https://github.com/a-scie/lift/releases/download/v0.18.1/{binary}".format(
"https://github.com/a-scie/lift/releases/download/v0.19.0/{binary}".format(
binary=SysPlatform.CURRENT.qualified_binary_name("science")
)
) as read_fp:
Expand Down Expand Up @@ -394,7 +394,7 @@ def test_specified_science_binary(tmpdir):
cached_science_binaries
), "Expected the local science binary to be used but not cached."
assert (
"0.18.1"
"0.19.0"
== subprocess.check_output(args=[local_science_binary, "--version"]).decode("utf-8").strip()
)

Expand Down Expand Up @@ -1349,14 +1349,26 @@ def test_free_threaded_scie_auto_detected(tmpdir):
"eager",
"--scie-only",
"--scie-pbs-free-threaded",
# N.B.: Exercise selection of old free-threaded -full builds.
"--scie-pbs-release",
"20260310",
"-o",
free_threaded_python,
]
).assert_success()

scie = tmpdir.join("scie")
run_pex_command(
args=["--scie", "eager", "psutil", "--scie-only", "-o", scie],
args=[
"--scie",
"eager",
"psutil",
"--scie-only",
# N.B.: Exercise selection of newer free-threaded install_only(_stripped) builds.
"--scie-pbs-stripped",
"-o",
scie,
],
python=free_threaded_python,
use_pex_whl_venv=False,
).assert_success()
Expand Down