Skip to content

Commit 05c3fd2

Browse files
Deprecate --python-setup-platforms (#10596)
We decided in #9562 that it's not worth the complexity to support `--python-setup-platforms`. Specifically, we decided 1) We only want to consider `platforms` in the context of running `python_binary`, rather than always using the option in our `pex.py` code. 2) We only want to consider `platforms` if the user went out of their way to specify them, given how we no longer are setting interpreter constraints if `platforms` was given because this overrides the constraints (#9563). So, a default value of `--python-setup-platforms=['current']` would lead to us naively setting `platforms` instead of using interpreter constraints like normal. Instead, users will need to explicitly specify the `platforms` field on any `python_binary` that they care about. [ci skip-rust] [ci skip-build-wheels]
1 parent d636075 commit 05c3fd2

1 file changed

Lines changed: 16 additions & 21 deletions

File tree

src/python/pants/python/python_setup.py

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ def register_options(cls, register):
7474
default=["current"],
7575
help="A list of platforms to be supported by this Python environment. Each platform"
7676
"is a string, as returned by pkg_resources.get_supported_platform().",
77+
removal_version="2.1.0.dev0",
78+
removal_hint=(
79+
"The option `--python-setup-platforms` does not do anything anymore. Instead, "
80+
"explicitly set the `platforms` field on each `python_binary`."
81+
),
7782
)
7883
register(
7984
"--interpreter-cache-dir",
@@ -85,6 +90,7 @@ def register_options(cls, register):
8590
removal_version="2.1.0.dev0",
8691
removal_hint=(
8792
"The option `--python-setup-interpreter-cache-dir` does not do anything anymore."
93+
"Instead, use the global option `--named-caches-dir`."
8894
),
8995
)
9096
register(
@@ -96,7 +102,8 @@ def register_options(cls, register):
96102
"If unspecified, a standard path under the workdir is used.",
97103
removal_version="2.1.0.dev0",
98104
removal_hint=(
99-
"The option `--python-setup-resolver-cache-dir` does not do anything anymore."
105+
"The option `--python-setup-resolver-cache-dir` does not do anything anymore. "
106+
"Instead, use the global option `--named-caches-dir`."
100107
),
101108
)
102109
register(
@@ -105,6 +112,12 @@ def register_options(cls, register):
105112
type=bool,
106113
default=UnsetBool,
107114
help="Whether to include pre-releases when resolving requirements.",
115+
removal_version="2.1.0.dev0",
116+
removal_hint=(
117+
"The option `--python-setup-resolver-allow-prereleases` does not no anything. To "
118+
"use a pre-release, explicitly use that pre-release version in your requirement "
119+
"string, e.g. `my_dist==99.0.dev0`."
120+
),
108121
)
109122
register(
110123
"--interpreter-search-paths",
@@ -160,26 +173,8 @@ def interpreter_search_paths(self):
160173
return self.expand_interpreter_search_paths(self.options.interpreter_search_paths)
161174

162175
@property
163-
def platforms(self):
164-
return self.options.platforms
165-
166-
@property
167-
def interpreter_cache_dir(self):
168-
return self.options.interpreter_cache_dir or os.path.join(self.scratch_dir, "interpreters")
169-
170-
@property
171-
def resolver_cache_dir(self):
172-
return self.options.resolver_cache_dir or os.path.join(
173-
self.scratch_dir, "resolved_requirements"
174-
)
175-
176-
@property
177-
def resolver_allow_prereleases(self):
178-
return self.options.resolver_allow_prereleases
179-
180-
@property
181-
def manylinux(self):
182-
manylinux = self.options.resolver_manylinux
176+
def manylinux(self) -> Optional[str]:
177+
manylinux = cast(Optional[str], self.options.resolver_manylinux)
183178
if manylinux is None or manylinux.lower() in ("false", "no", "none"):
184179
return None
185180
return manylinux

0 commit comments

Comments
 (0)