Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clone repo associated current version #489

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/doc_builder/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

import yaml
from packaging import version as package_version

from . import __version__

hf_cache_home = os.path.expanduser(
os.getenv("HF_HOME", os.path.join(os.getenv("XDG_CACHE_HOME", "~/.cache"), "huggingface"))
Expand Down Expand Up @@ -157,13 +157,14 @@ def get_cached_repo():
"""
os.makedirs(DOC_BUILDER_CACHE, exist_ok=True)
cache_repo_path = Path(DOC_BUILDER_CACHE) / "doc-builder-repo"
repTag = "v"+__version__;
if not cache_repo_path.is_dir():
print(
"To build the HTML doc, we need the kit subfolder of the `doc-builder` repo. Cloning it and caching at "
f"{cache_repo_path}."
)
_ = subprocess.run(
"git clone https://github.com/huggingface/doc-builder.git".split(),
f"git clone --branch {repTag} https://github.com/huggingface/doc-builder.git".split(),
stderr=subprocess.PIPE,
check=True,
encoding="utf-8",
Expand Down