Skip to content

Commit

Permalink
Remove deprecated python-setup options (#10984)
Browse files Browse the repository at this point in the history
[ci skip-rust]
[ci skip-build-wheels]
  • Loading branch information
Eric-Arellano committed Oct 17, 2020
1 parent 20cc1e4 commit 9edbd82
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 58 deletions.
8 changes: 4 additions & 4 deletions src/python/pants/engine/internals/options_parsing_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,27 @@

from pants.engine.rules import SubsystemRule
from pants.option.scope import GLOBAL_SCOPE, Scope, ScopedOptions
from pants.python.python_setup import PythonSetup
from pants.python.python_repos import PythonRepos
from pants.testutil.rule_runner import QueryRule, RuleRunner
from pants.util.logging import LogLevel


@pytest.fixture
def rule_runner() -> RuleRunner:
return RuleRunner(rules=[SubsystemRule(PythonSetup), QueryRule(ScopedOptions, (Scope,))])
return RuleRunner(rules=[SubsystemRule(PythonRepos), QueryRule(ScopedOptions, (Scope,))])


def test_options_parse_scoped(rule_runner: RuleRunner) -> None:
rule_runner.set_options(
["-ldebug"], env=dict(PANTS_PANTSD="True", PANTS_BUILD_IGNORE='["ignoreme/"]')
)
global_options = rule_runner.request(ScopedOptions, [Scope(GLOBAL_SCOPE)])
python_setup_options = rule_runner.request(ScopedOptions, [Scope("python-setup")])
python_repos_options = rule_runner.request(ScopedOptions, [Scope("python-repos")])

assert global_options.options.level == LogLevel.DEBUG
assert global_options.options.pantsd is True
assert global_options.options.build_ignore == ["ignoreme/"]
assert python_setup_options.options.platforms == ["current"]
assert python_repos_options.options.indexes == ["https://pypi.org/simple/"]


def test_options_parse_memoization(rule_runner: RuleRunner) -> None:
Expand Down
55 changes: 1 addition & 54 deletions src/python/pants/python/python_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from pex.variables import Variables

from pants.base.build_environment import get_buildroot
from pants.option.custom_types import UnsetBool, file_option
from pants.option.custom_types import file_option
from pants.option.subsystem import Subsystem
from pants.util.memo import memoized_property

Expand Down Expand Up @@ -85,59 +85,6 @@ def register_options(cls, register):
"given binary. Requires [python-setup].requirement_constraints to be set."
),
)
register(
"--platforms",
advanced=True,
type=list,
metavar="<platform>",
default=["current"],
help="A list of platforms to be supported by this Python environment. Each platform"
"is a string, as returned by pkg_resources.get_supported_platform().",
removal_version="2.1.0.dev0",
removal_hint=(
"The option `--python-setup-platforms` does not do anything anymore. Instead, "
"explicitly set the `platforms` field on each `pex_binary` target."
),
)
register(
"--interpreter-cache-dir",
advanced=True,
default=None,
metavar="<dir>",
help="The parent directory for the interpreter cache. "
"If unspecified, a standard path under the workdir is used.",
removal_version="2.1.0.dev0",
removal_hint=(
"The option `--python-setup-interpreter-cache-dir` does not do anything anymore."
"Instead, use the global option `--named-caches-dir`."
),
)
register(
"--resolver-cache-dir",
advanced=True,
default=None,
metavar="<dir>",
help="The parent directory for the requirement resolver cache. "
"If unspecified, a standard path under the workdir is used.",
removal_version="2.1.0.dev0",
removal_hint=(
"The option `--python-setup-resolver-cache-dir` does not do anything anymore. "
"Instead, use the global option `--named-caches-dir`."
),
)
register(
"--resolver-allow-prereleases",
advanced=True,
type=bool,
default=UnsetBool,
help="Whether to include pre-releases when resolving requirements.",
removal_version="2.1.0.dev0",
removal_hint=(
"The option `--python-setup-resolver-allow-prereleases` does not no anything. To "
"use a pre-release, explicitly use that pre-release version in your requirement "
"string, e.g. `my_dist==99.0.dev0`."
),
)
register(
"--interpreter-search-paths",
advanced=True,
Expand Down

0 comments on commit 9edbd82

Please sign in to comment.