Skip to content

Commit

Permalink
Merge branch 'main' into automation/release/2.24.0.dev0
Browse files Browse the repository at this point in the history
  • Loading branch information
huonw authored Sep 16, 2024
2 parents d79d9d1 + 1abe7fe commit e97e079
Show file tree
Hide file tree
Showing 10 changed files with 172 additions and 222 deletions.
7 changes: 7 additions & 0 deletions 3rdparty/python/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ typing-extensions~=4.12
mypy-typing-asserts==0.1.1
node-semver==0.9.0

# In src/python/pants/backend/url_handlers/s3/register.py we advise adding
# `botocore` to `[GLOBAL].plugins`, but `botocore` is particular about the
# version of urllib3 used. To make the s3 handler easier to use, constrain
# urlib3 here. Per the voluminous thread at
# https://github.com/boto/botocore/issues/2926 this can likely be relaxed when
# Pants itself is on a newer version of Python
urllib3<2

# These dependencies are only for debugging Pants itself (in VSCode/PyCharm respectively),
# and should never be imported.
Expand Down
295 changes: 154 additions & 141 deletions 3rdparty/python/user_reqs.lock

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions docs/notes/2.24.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,12 @@ Deprecations:

As a consequence of the lockfile generation, newer versions of many tools are now included in the default lockfiles.

The default version of pip is now [24.2](https://pip.pypa.io/en/stable/news/#v24-2) bringing performance improvements to dependency resolution and support or the upcoming Python 3.13 release.

The versions of `setuptools` and `wheel` used in Pants have been upgraded to `74.1.2` and `0.44.0` to address a remote code execution vulnerability in versions before setuptools `70.0`. This forces the minimum Python version to 3.8, in line with the changes mentioned above.

The deprecation of `resolve_local_platforms` (both a field of `pex_binary`, and a option of `[pex-binary-defaults]`) has expired and thus they have been removed.

#### S3

The `pants.backend.url_handlers.s3` backend now correctly passes along query parameters such as `versionId` for `s3://` urls.
Expand Down
4 changes: 4 additions & 0 deletions pants.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ unmatched_build_file_globs = "error"
# https://github.com/pantsbuild/pants/issues/16096.
cache_content_behavior = "fetch"

# Our current macOS 10.15 and 11 infrastructure is working okay, so for now (i.e. 2.24 dev
# releases), we'll just keep building on them:
allow_deprecated_macos_before_12 = true

[DEFAULT]
# Tell `scie-pants` to use our `./pants` bootstrap script.
delegate_bootstrap = true
Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/backend/python/goals/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class ExportPluginOptions:
"""
),
advanced=True,
removal_version="2.24.0.dev0",
removal_version="2.26.0.dev0",
removal_hint=softwrap(
"""
Use `--export-py-non-hermetic-scripts-in-resolve` instead.
Expand Down
4 changes: 0 additions & 4 deletions src/python/pants/backend/python/goals/package_pex_binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
PexInheritPathField,
PexLayout,
PexLayoutField,
PexResolveLocalPlatformsField,
PexScriptField,
PexShBootField,
PexShebangField,
Expand Down Expand Up @@ -72,7 +71,6 @@ class PexBinaryFieldSet(PackageFieldSet, RunFieldSet):
shebang: PexShebangField
strip_env: PexStripEnvField
complete_platforms: PexCompletePlatformsField
resolve_local_platforms: PexResolveLocalPlatformsField
layout: PexLayoutField
execution_mode: PexExecutionModeField
include_requirements: PexIncludeRequirementsField
Expand All @@ -94,8 +92,6 @@ def generate_additional_args(self, pex_binary_defaults: PexBinaryDefaults) -> Tu
args.append("--no-emit-warnings")
elif self.emit_warnings.value_or_global_default(pex_binary_defaults) is True:
args.append("--emit-warnings")
if self.resolve_local_platforms.value_or_global_default(pex_binary_defaults) is True:
args.append("--resolve-local-platforms")
if self.ignore_errors.value is True:
args.append("--ignore-errors")
if self.inherit_path.value is not None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,44 +252,6 @@ def pex_executable(rule_runner: PythonRuleRunner) -> str:
return os.path.join(rule_runner.build_root, expected_pex_relpath)


def test_resolve_local_platforms(pex_executable: str, rule_runner: PythonRuleRunner) -> None:
complete_current_platform = subprocess.run(
args=[pex_executable, "interpreter", "inspect", "-mt"],
env=dict(PEX_MODULE="pex.cli", **os.environ),
stdout=subprocess.PIPE,
).stdout

# N.B.: ansicolors 1.0.2 is available sdist-only on PyPI, so resolving it requires using a
# local interpreter.
rule_runner.write_files(
{
"src/py/project/app.py": "import colors",
"src/py/project/platform.json": complete_current_platform,
"src/py/project/BUILD": dedent(
"""\
python_requirement(name="ansicolors", requirements=["ansicolors==1.0.2"])
file(name="platform", source="platform.json")
pex_binary(
dependencies=[":ansicolors"],
complete_platforms=[":platform"],
resolve_local_platforms=True,
)
"""
),
}
)
tgt = rule_runner.get_target(Address("src/py/project"))
field_set = PexBinaryFieldSet.create(tgt)
result = rule_runner.request(BuiltPackage, [field_set])
assert len(result.artifacts) == 1
expected_pex_relpath = "src.py.project/project.pex"
assert expected_pex_relpath == result.artifacts[0].relpath

rule_runner.write_digest(result.digest)
executable = os.path.join(rule_runner.build_root, expected_pex_relpath)
subprocess.run([executable], check=True)


@skip_unless_python38_present
@pytest.mark.parametrize("target_type", ["files", "resources"])
def test_complete_platforms(rule_runner: PythonRuleRunner, target_type: str) -> None:
Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/backend/python/subsystems/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def interpreter_constraints(self) -> tuple[str, ...]:
),
)
pip_version = StrOption(
default="24.0",
default="24.2",
help=softwrap(
f"""
Use this version of Pip for resolving requirements and generating lockfiles.
Expand Down
36 changes: 0 additions & 36 deletions src/python/pants/backend/python/target_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,26 +605,6 @@ def value_or_global_default(self, pex_binary_defaults: PexBinaryDefaults) -> boo
return self.value


class PexResolveLocalPlatformsField(TriBoolField):
alias = "resolve_local_platforms"
removal_version = "2.24.0.dev0"
removal_hint = softwrap(
f"""\
This {alias} field is no longer used now that the `platforms` field has been removed. Remove it.
"""
)
help = help_text(
"""
Now unused.
"""
)

def value_or_global_default(self, pex_binary_defaults: PexBinaryDefaults) -> bool:
if self.value is None:
return pex_binary_defaults.resolve_local_platforms
return self.value


class PexExecutionMode(Enum):
ZIPAPP = "zipapp"
VENV = "venv"
Expand Down Expand Up @@ -756,7 +736,6 @@ class PexVenvHermeticScripts(BoolField):
PexBinaryDependenciesField,
PexCheckField,
PexCompletePlatformsField,
PexResolveLocalPlatformsField,
PexInheritPathField,
PexStripEnvField,
PexIgnoreErrorsField,
Expand Down Expand Up @@ -903,21 +882,6 @@ class PexBinaryDefaults(Subsystem):
),
advanced=True,
)
resolve_local_platforms = BoolOption(
default=False,
help=softwrap(
"""
Now unused.
"""
),
removal_version="2.24.0.dev0",
removal_hint=softwrap(
"""\
This `resolve_local_platforms` option is no longer used now that the `platforms` field has been removed. You can safely delete this setting.
"""
),
advanced=True,
)


# -----------------------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/backend/python/util_rules/pex_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class PexCli(TemplatedExternalTool):

default_version = "v2.16.2"
default_url_template = "https://github.com/pex-tool/pex/releases/download/{version}/pex"
version_constraints = ">=2.3.0,<3.0"
version_constraints = ">=2.13.0,<3.0"

# extra args to be passed to the pex tool; note that they
# are going to apply to all invocations of the pex tool.
Expand Down

0 comments on commit e97e079

Please sign in to comment.