Build: define `reshim_commands` as set
@@ -341,14 +341,14 @@ class BuildDirector:
environment.run(*command.split(), escape_command=False, cwd=cwd)
def run_build_commands(self):
- reshim_commands = (
+ reshim_commands = {
("pip", "install"),
("conda", "create"),
("conda", "install"),
("mamba", "create"),
("mamba", "install"),
("poetry", "install"),
- )
+ }
cwd = self.data.project.checkout_path(self.data.version.slug)
environment = self.vcs_environment
for command in self.data.config.build.commands:
@@ -356,11 +356,12 @@ class BuildDirector:
# Execute ``asdf reshim python`` if the user is installing a
# package since the package may contain an executable
+ # See https://github.com/readthedocs/readthedocs.org/pull/9150#discussion_r882849790
for reshim_command in reshim_commands:
# Convert tuple/list into set to check reshim command is a
# subset of the command itself. This is to find ``pip install``
# but also ``pip -v install`` and ``python -m pip install``
- if set(reshim_command).issubset(command.split()):
+ if reshim_command.issubset(command.split()):
environment.run(
*["asdf", "reshim", "python"],
escape_command=False,
