Skip to content

Commit 3b43660

Browse files
committed
Build: remove all reshim commands
They are not needed anymore because the `reshim` happens automatically inside each of the `asdf` plugins now. The new version of the `asdf` and its plugin handle this in a better way than how we are handling it here. Requires: readthedocs/readthedocs-docker-images#189
1 parent dd07a3e commit 3b43660

File tree

2 files changed

+2
-41
lines changed

2 files changed

+2
-41
lines changed

readthedocs/doc_builder/director.py

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"""Build process director."""
2+
13
import os
24
import tarfile
35

@@ -357,34 +359,11 @@ def check_old_output_directory(self):
357359
raise BuildUserError(BuildUserError.BUILD_OUTPUT_OLD_DIRECTORY_USED)
358360

359361
def run_build_commands(self):
360-
reshim_commands = (
361-
{"pip", "install"},
362-
{"conda", "create"},
363-
{"conda", "install"},
364-
{"mamba", "create"},
365-
{"mamba", "install"},
366-
{"poetry", "install"},
367-
)
368362
cwd = self.data.project.checkout_path(self.data.version.slug)
369363
environment = self.build_environment
370364
for command in self.data.config.build.commands:
371365
environment.run(command, escape_command=False, cwd=cwd)
372366

373-
# Execute ``asdf reshim python`` if the user is installing a
374-
# package since the package may contain an executable
375-
# See https://github.com/readthedocs/readthedocs.org/pull/9150#discussion_r882849790
376-
for reshim_command in reshim_commands:
377-
# Convert tuple/list into set to check reshim command is a
378-
# subset of the command itself. This is to find ``pip install``
379-
# but also ``pip -v install`` and ``python -m pip install``
380-
if reshim_command.issubset(command.split()):
381-
environment.run(
382-
*["asdf", "reshim", "python"],
383-
escape_command=False,
384-
cwd=cwd,
385-
record=False,
386-
)
387-
388367
html_output_path = os.path.join(cwd, BUILD_COMMANDS_OUTPUT_PATH_HTML)
389368
if not os.path.exists(html_output_path):
390369
raise BuildUserError(BuildUserError.BUILD_COMMANDS_WITHOUT_OUTPUT)

readthedocs/projects/tests/test_build_tasks.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -889,7 +889,6 @@ def test_build_tools(self, load_yaml_config):
889889
[
890890
mock.call("asdf", "install", "python", python_version),
891891
mock.call("asdf", "global", "python", python_version),
892-
mock.call("asdf", "reshim", "python", record=False),
893892
mock.call(
894893
"python",
895894
"-mpip",
@@ -900,13 +899,10 @@ def test_build_tools(self, load_yaml_config):
900899
),
901900
mock.call("asdf", "install", "nodejs", nodejs_version),
902901
mock.call("asdf", "global", "nodejs", nodejs_version),
903-
mock.call("asdf", "reshim", "nodejs", record=False),
904902
mock.call("asdf", "install", "rust", rust_version),
905903
mock.call("asdf", "global", "rust", rust_version),
906-
mock.call("asdf", "reshim", "rust", record=False),
907904
mock.call("asdf", "install", "golang", golang_version),
908905
mock.call("asdf", "global", "golang", golang_version),
909-
mock.call("asdf", "reshim", "golang", record=False),
910906
mock.ANY,
911907
]
912908
)
@@ -988,31 +984,27 @@ def test_build_tools_cached(self, load_yaml_config, build_tools_storage, tarfile
988984
record=False,
989985
),
990986
mock.call("asdf", "global", "python", python_version),
991-
mock.call("asdf", "reshim", "python", record=False),
992987
mock.call(
993988
"mv",
994989
mock.ANY,
995990
f"/home/docs/.asdf/installs/nodejs/{nodejs_version}",
996991
record=False,
997992
),
998993
mock.call("asdf", "global", "nodejs", nodejs_version),
999-
mock.call("asdf", "reshim", "nodejs", record=False),
1000994
mock.call(
1001995
"mv",
1002996
mock.ANY,
1003997
f"/home/docs/.asdf/installs/rust/{rust_version}",
1004998
record=False,
1005999
),
10061000
mock.call("asdf", "global", "rust", rust_version),
1007-
mock.call("asdf", "reshim", "rust", record=False),
10081001
mock.call(
10091002
"mv",
10101003
mock.ANY,
10111004
f"/home/docs/.asdf/installs/golang/{golang_version}",
10121005
record=False,
10131006
),
10141007
mock.call("asdf", "global", "golang", golang_version),
1015-
mock.call("asdf", "reshim", "golang", record=False),
10161008
mock.ANY,
10171009
]
10181010
)
@@ -1046,7 +1038,6 @@ def test_build_commands(self, load_yaml_config):
10461038
[
10471039
mock.call("asdf", "install", "python", python_version),
10481040
mock.call("asdf", "global", "python", python_version),
1049-
mock.call("asdf", "reshim", "python", record=False),
10501041
mock.call(
10511042
"python",
10521043
"-mpip",
@@ -1063,14 +1054,6 @@ def test_build_commands(self, load_yaml_config):
10631054
escape_command=False,
10641055
cwd=mock.ANY,
10651056
),
1066-
mock.call(
1067-
"asdf",
1068-
"reshim",
1069-
"python",
1070-
escape_command=False,
1071-
record=False,
1072-
cwd=mock.ANY,
1073-
),
10741057
mock.call(
10751058
"pelican --settings docs/pelicanconf.py --output $READTHEDOCS_OUTPUT/html/ docs/",
10761059
escape_command=False,
@@ -1194,7 +1177,6 @@ def test_python_mamba_commands(self, load_yaml_config):
11941177
[
11951178
mock.call("asdf", "install", "python", "mambaforge-4.10.3-10"),
11961179
mock.call("asdf", "global", "python", "mambaforge-4.10.3-10"),
1197-
mock.call("asdf", "reshim", "python", record=False),
11981180
mock.call(
11991181
"mamba",
12001182
"env",

0 commit comments

Comments
 (0)