Skip to content

Commit 8e93c0e

Browse files
committed
Install from pylock.toml when available
1 parent bcb4425 commit 8e93c0e

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

build_docs.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -822,18 +822,20 @@ def build_venv(self) -> None:
822822
venv_name += f"-{self.select_output}"
823823
venv_path = self.build_root / venv_name
824824
venv.create(venv_path, symlinks=os.name != "nt", with_pip=True, clear=True)
825+
python = venv_path / "bin" / "python"
826+
run((python, "-m", "pip", "install", "--upgrade", "pip"))
827+
828+
if (self.checkout / "Doc" / "pylock.toml").exists():
829+
requirements.remove("-rrequirements.txt")
830+
run(
831+
(python, "-m", "pip", "install", "-rpylock.toml"),
832+
cwd=self.checkout / "Doc",
833+
)
825834
run(
826-
(
827-
venv_path / "bin" / "python",
828-
"-m",
829-
"pip",
830-
"install",
831-
self.theme,
832-
*requirements,
833-
),
835+
(python, "-m", "pip", "install", self.theme, *requirements),
834836
cwd=self.checkout / "Doc",
835837
)
836-
run((venv_path / "bin" / "python", "-m", "pip", "freeze", "--all"))
838+
run((python, "-m", "pip", "freeze", "--all"))
837839
self.venv = venv_path
838840

839841
def setup_indexsidebar(self) -> None:

0 commit comments

Comments
 (0)