@@ -312,33 +312,15 @@ def run(self):
312
312
# /home/docs/.asdf/shims:/home/docs/.asdf/bin
313
313
# :/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
314
314
# docs@bfe702e31cdd:~$
315
- #
316
- # On old Docker images we have different PATH:
317
- #
318
- # $ sudo docker run -it readthedocs/build:latest /bin/bash
319
- # docs@656e38a30fa4:/$ echo $PATH
320
- # /home/docs/.pyenv /shims:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/docs/.conda /bin:/home/docs/.pyenv/bin
321
- # docs@656e38a30fa4:/$
315
+ asdf_paths = (
316
+ f"/home/ { settings . RTD_DOCKER_USER } /.asdf/shims"
317
+ f":/home/ { settings . RTD_DOCKER_USER } /.asdf/bin"
318
+ )
319
+ if settings . RTD_DOCKER_COMPOSE :
320
+ asdf_paths += ":/root/.asdf /shims:/root/.asdf /bin"
321
+
322
322
default_paths = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
323
- if self .build_env .container_image in (
324
- "readthedocs/build:ubuntu-22.04" ,
325
- "readthedocs/build:ubuntu-20.04" ,
326
- ):
327
- # Use ASDF path for newer images
328
- python_paths = "/home/docs/.asdf/shims:/home/docs/.asdf/bin"
329
- paths = f"{ python_paths } :{ default_paths } "
330
-
331
- # On local development, we are using root user
332
- if settings .RTD_DOCKER_COMPOSE :
333
- paths = paths .replace ("/home/docs/" , "/root/" )
334
- else :
335
- # Use PYENV for older images
336
- paths = (
337
- "/home/docs/.pyenv/shims:/home/docs/.cargo/bin"
338
- f":{ default_paths } :"
339
- "/home/docs/.conda/bin:/home/docs/.pyenv/bin"
340
- )
341
- environment ["PATH" ] = paths
323
+ environment ["PATH" ] = f"{ asdf_paths } :{ default_paths } "
342
324
343
325
# Prepend the BIN_PATH if it's defined
344
326
if self .bin_path :
0 commit comments