diff --git a/pants.toml b/pants.toml index 68be559b275b..7d15e0b1ab03 100644 --- a/pants.toml +++ b/pants.toml @@ -154,7 +154,6 @@ pytest = "3rdparty/python/pytest.lock" [python-infer] assets = true unowned_dependency_behavior = "error" -use_rust_parser = true [docformatter] args = ["--wrap-summaries=100", "--wrap-descriptions=100"] diff --git a/src/python/pants/backend/go/util_rules/cgo.py b/src/python/pants/backend/go/util_rules/cgo.py index d4b6be10e326..4150131b71d8 100644 --- a/src/python/pants/backend/go/util_rules/cgo.py +++ b/src/python/pants/backend/go/util_rules/cgo.py @@ -22,7 +22,6 @@ from pants.backend.go.util_rules.cgo_security import check_linker_flags from pants.backend.go.util_rules.goroot import GoRoot from pants.backend.go.util_rules.sdk import GoSdkProcess -from pants.base.deprecated import warn_or_error from pants.base.glob_match_error_behavior import GlobMatchErrorBehavior from pants.core.util_rules.system_binaries import BashBinary, BinaryPath, BinaryPathTest from pants.engine.engine_aware import EngineAwareParameter @@ -287,19 +286,6 @@ async def setup_compiler_cmd( return SetupCompilerCmdResult(tuple(args)) -@dataclass(frozen=True) -class CGoCompilerWrapperScriptRequest: - def __post_init__(self) -> None: - warn_or_error( - "2.18.0.dev0", - "using `Get(CGoCompilerWrapperScript, CGoCompilerWrapperScriptRequest)", - ( - "Instead, simply use `Get(CGoCompilerWrapperScript)` or put " - + "`CGoCompilerWrapperScript` in the rule signature" - ), - ) - - @dataclass(frozen=True) class CGoCompilerWrapperScript: digest: Digest @@ -328,13 +314,6 @@ async def make_cgo_compile_wrapper_script() -> CGoCompilerWrapperScript: return CGoCompilerWrapperScript(digest=digest) -@rule -def cgo_wrapper_compile_script_request( - _: CGoCompilerWrapperScriptRequest, script: CGoCompilerWrapperScript -) -> CGoCompilerWrapperScript: - return script - - async def _cc( binary_name: str, input_digest: Digest, diff --git a/src/python/pants/backend/python/dependency_inference/parse_python_dependencies.py b/src/python/pants/backend/python/dependency_inference/parse_python_dependencies.py index 9cc40e5329f7..0d95a4280bff 100644 --- a/src/python/pants/backend/python/dependency_inference/parse_python_dependencies.py +++ b/src/python/pants/backend/python/dependency_inference/parse_python_dependencies.py @@ -183,13 +183,12 @@ async def parse_python_dependencies( # We operate on PythonSourceField, which should be one file. assert len(stripped_sources.snapshot.files) == 1 - if python_infer_subsystem.options.is_default("use_rust_parser"): - # NB: In 2.18, we'll switch the default to `True` and then warn if the value is set (to anything) + if not python_infer_subsystem.options.is_default("use_rust_parser"): # NB: In 2.19, we remove the option altogether and remove the old code. warn_or_error( - removal_version="2.18.0.dev0", - entity="Not explicitly providing [python-infer].use_rust_parser", - hint="Read the help for [python-infer].use_rust_parser, then set the value in pants.toml.", + removal_version="2.19.0.dev0", + entity="Explicitly providing [python-infer].use_rust_parser", + hint="Read the help for [python-infer].use_rust_parser, then stop setting the value in pants.toml.", ) has_custom_dep_inferences = len(union_membership[PythonDependencyVisitorRequest]) > 1 diff --git a/src/python/pants/backend/python/dependency_inference/subsystem.py b/src/python/pants/backend/python/dependency_inference/subsystem.py index 19625b764a55..11fe1905b25a 100644 --- a/src/python/pants/backend/python/dependency_inference/subsystem.py +++ b/src/python/pants/backend/python/dependency_inference/subsystem.py @@ -192,7 +192,7 @@ class PythonInferSubsystem(Subsystem): ) use_rust_parser = BoolOption( - default=False, + default=True, help=softwrap( f""" Use the new Rust-based, multithreaded, in-process dependency parser. @@ -205,16 +205,16 @@ class PythonInferSubsystem(Subsystem): while hot-cache had no difference. Additionally, Pants can now infer dependencies from Python scripts with syntax errors. - However, since this parser is completely different it has the potential of introducing - differences in dependency inference. Although the Pants suite of tests only identified - differences when using the `# pants: no-infer-dep` pragma, and string-based - imports/assets, Out of an abundance of caution, this is behind a feature flag that will - eventually be on-by-default then removed. + After leaving this defaulted to disabled for a a release cycle, Pants 2.18 started + defaulting to enabling this. + + If you think the new behaviour is causing problems, it is recommended that you run + `{bin_name()} peek :: > before.json` and then + `{bin_name()} --python-infer-use-rust-parser=False peek :: > after.json` and compare the + two results. - It is recommended that you run `{bin_name()} peek :: > before.json` and then - `{bin_name()} --python-infer-use-rust-parser peek :: > after.json` and compare the two - results. If all looks good, set `use_rust_parser` in `[python-infer]` in `pants.toml`. - If you think there's a bug please file an issue: https://github.com/pantsbuild/pants/issues/new/choose. + If you think there is a bug and need to disable it, please file an issue: + https://github.com/pantsbuild/pants/issues/new/choose. """ ), ) diff --git a/src/python/pants/backend/python/subsystems/python_tool_base.py b/src/python/pants/backend/python/subsystems/python_tool_base.py index fe251cf9c673..2b90818a51dd 100644 --- a/src/python/pants/backend/python/subsystems/python_tool_base.py +++ b/src/python/pants/backend/python/subsystems/python_tool_base.py @@ -125,7 +125,7 @@ class PythonToolRequirementsBase(Subsystem): _lockfile = StrOption( default=DEFAULT_TOOL_LOCKFILE, advanced=True, - removal_version="2.18.0.dev0", + removal_version="2.18.0.dev1", removal_hint=lambda cls: softwrap( f"""\ Custom tool versions are now installed from named resolves, as @@ -478,7 +478,7 @@ def __new__(cls): return super().__new__( cls, default=True, - removal_version="2.18.0.dev0", + removal_version="2.18.0.dev1", removal_hint="Use the export goal's --resolve option to select tools to export, instead " "of using this option to exempt a tool from export-by-default.", help=( diff --git a/src/python/pants/backend/python/typecheck/mypy/subsystem.py b/src/python/pants/backend/python/typecheck/mypy/subsystem.py index 77286449532b..2fae068d1d65 100644 --- a/src/python/pants/backend/python/typecheck/mypy/subsystem.py +++ b/src/python/pants/backend/python/typecheck/mypy/subsystem.py @@ -151,7 +151,7 @@ class MyPy(PythonToolBase): ) extra_type_stubs = StrListOption( advanced=True, - removal_version="2.18.0dev0", + removal_version="2.18.0.dev1", removal_hint=softwrap( f""" Extra type stubs are now installed from a named resolve, as described @@ -183,7 +183,7 @@ class MyPy(PythonToolBase): advanced=True, # Note that there is no default lockfile, as by default, extra_type_stubs is empty. default=NO_TOOL_LOCKFILE, - removal_version="2.18.0dev0", + removal_version="2.18.0.dev1", removal_hint=softwrap( f""" Extra type stubs are now installed from a named resolve, as described diff --git a/src/python/pants/backend/shell/target_types.py b/src/python/pants/backend/shell/target_types.py index d4e2e186936f..1a0d5d8e51cf 100644 --- a/src/python/pants/backend/shell/target_types.py +++ b/src/python/pants/backend/shell/target_types.py @@ -354,8 +354,6 @@ class SkipShellCommandTestsField(BoolField): class ShellCommandTarget(Target): alias = "shell_command" - deprecated_alias = "experimental_shell_command" - deprecated_alias_removal_version = "2.18.0.dev0" core_fields = ( *COMMON_TARGET_FIELDS, ShellCommandOutputDependenciesField, @@ -400,8 +398,6 @@ class ShellCommandTarget(Target): class ShellCommandRunTarget(Target): alias = "run_shell_command" - deprecated_alias = "experimental_run_shell_command" - deprecated_alias_removal_version = "2.18.0.dev0" core_fields = ( *COMMON_TARGET_FIELDS, ShellCommandExecutionDependenciesField, diff --git a/src/python/pants/core/target_types.py b/src/python/pants/core/target_types.py index 89b2a264c84b..3bf1b9844b66 100644 --- a/src/python/pants/core/target_types.py +++ b/src/python/pants/core/target_types.py @@ -11,7 +11,6 @@ from pathlib import PurePath from typing import Generic, Optional, Sequence, TypeVar, Union, cast -from pants.base.deprecated import warn_or_error from pants.core.goals import package from pants.core.goals.package import ( BuiltPackage, @@ -651,16 +650,6 @@ class GenericTarget(Target): # ----------------------------------------------------------------------------------------------- -@dataclass(frozen=True) -class AllAssetTargetsRequest: - def __post_init__(self) -> None: - warn_or_error( - "2.18.0.dev0", - "using `Get(AllAssetTargets, AllAssetTargetsRequest)", - "Instead, simply use `Get(AllAssetTargets)` or put `AllAssetTargets` in the rule signature", - ) - - @dataclass(frozen=True) class AllAssetTargets: resources: tuple[Target, ...] @@ -679,13 +668,6 @@ def find_all_assets(all_targets: AllTargets) -> AllAssetTargets: return AllAssetTargets(tuple(resources), tuple(files)) -@rule -def find_all_assets_request( - _: AllAssetTargetsRequest, all_asset_targets: AllAssetTargets -) -> AllAssetTargets: - return all_asset_targets - - @dataclass(frozen=True) class AllAssetTargetsByPath: resources: FrozenDict[PurePath, frozenset[Target]] diff --git a/src/python/pants/engine/internals/specs_rules.py b/src/python/pants/engine/internals/specs_rules.py index b64e84b53a53..d31533588bb4 100644 --- a/src/python/pants/engine/internals/specs_rules.py +++ b/src/python/pants/engine/internals/specs_rules.py @@ -543,7 +543,7 @@ async def find_valid_field_sets_for_target_roots( secondary_owner_targets.add(tgt) if secondary_owner_targets: warn_or_error( - removal_version="2.18.0.dev0", + removal_version="2.18.0.dev1", entity=softwrap( """ indirectly referring to a target by using a corresponding file argument, when the diff --git a/src/python/pants/jvm/goals/lockfile_test.py b/src/python/pants/jvm/goals/lockfile_test.py index 8ba8cbe2e5f9..f05f65361d98 100644 --- a/src/python/pants/jvm/goals/lockfile_test.py +++ b/src/python/pants/jvm/goals/lockfile_test.py @@ -103,7 +103,6 @@ def mk(name): artifact='artifact', version='1', jar='jar.jar', - excludes=['ex:clude'], ) mk('one') diff --git a/src/python/pants/jvm/resolve/common.py b/src/python/pants/jvm/resolve/common.py index 2041c44cd89d..e6c723d866b9 100644 --- a/src/python/pants/jvm/resolve/common.py +++ b/src/python/pants/jvm/resolve/common.py @@ -13,7 +13,6 @@ from pants.engine.target import Target from pants.jvm.target_types import ( JvmArtifactArtifactField, - JvmArtifactExcludeDependenciesField, JvmArtifactExclusionsField, JvmArtifactFieldSet, JvmArtifactGroupField, @@ -162,7 +161,6 @@ def from_jvm_artifact_target(cls, target: Target) -> ArtifactRequirement: "`JvmArtifactFieldSet` fields present." ) - excludes_coords = target[JvmArtifactExcludeDependenciesField].value or () exclusions = target[JvmArtifactExclusionsField].value or () return ArtifactRequirement( coordinate=Coordinate( @@ -176,10 +174,7 @@ def from_jvm_artifact_target(cls, target: Target) -> ArtifactRequirement: if target[JvmArtifactJarSourceField].value else None ), - excludes=frozenset( - [*(exclusion.to_coord_str() for exclusion in exclusions), *excludes_coords] - ) - or None, + excludes=frozenset([*(exclusion.to_coord_str() for exclusion in exclusions)]) or None, ) def with_extra_excludes(self, *excludes: str) -> ArtifactRequirement: diff --git a/src/python/pants/jvm/target_types.py b/src/python/pants/jvm/target_types.py index 80cb615e25fd..17d4f32f8d75 100644 --- a/src/python/pants/jvm/target_types.py +++ b/src/python/pants/jvm/target_types.py @@ -267,26 +267,6 @@ class JvmProvidesTypesField(StringSequenceField): ) -class JvmArtifactExcludeDependenciesField(StringSequenceField): - alias = "excludes" - help = help_text( - """ - A list of unversioned coordinates (i.e. `group:artifact`) that should be excluded - as dependencies when this artifact is resolved. - - This does not prevent this artifact from being included in the resolve as a dependency - of other artifacts that depend on it, and is currently intended as a way to resolve - version conflicts in complex resolves. - - These values are passed directly to Coursier, and if specified incorrectly will show a - parse error from Coursier. - """ - ) - - removal_hint = "Use `exclusions` field instead" - removal_version = "2.18.0.dev0" - - @dataclass(frozen=True) class JvmArtifactExclusion: alias: ClassVar[str] = "jvm_exclude" @@ -405,7 +385,6 @@ class JvmArtifactTarget(Target): JvmArtifactUrlField, # TODO: should `JvmArtifactFieldSet` have an `all_fields` field? JvmArtifactJarSourceField, JvmArtifactResolveField, - JvmArtifactExcludeDependenciesField, JvmArtifactExclusionsField, JvmJdkField, JvmMainClassNameField,