Skip to content

Commit

Permalink
Fix edge cases for installation
Browse files Browse the repository at this point in the history
  • Loading branch information
oprypin committed Nov 10, 2023
1 parent 70060c3 commit b16cd02
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ setup() {
clone_repo() {
mkdir -p "$repo_dir/repo"
(
export GIT_LFS_SKIP_SMUDGE=1
cd "$repo_dir/repo"
git init -b checkout
git fetch --depth=1 "https://github.com/$repo" "$commit"
Expand All @@ -51,6 +52,9 @@ _build() {
echo "==== Building $1 ===="
"$repo_dir/venv/bin/pip" freeze > "$repo_dir/freeze-$1.txt"
(
if grep -q mkdocstrings "$info_dir/requirements.txt"; then
export PYTHONPATH="src:.:${PYTHONPATH:+:${PYTHONPATH}}"
fi
cd "$repo_dir/repo"
../venv/bin/mkdocs build --no-strict -f "$mkdocs_yml" -d "$(pwd)/../site-$1"
)
Expand Down
1 change: 1 addition & 0 deletions normalize_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
html = re.sub(r'\b(0x)[a-f0-9]+\b', r'\1...', html)
html = re.sub(r'^(Build Date UTC ?:).+', r'\1...', html, flags=re.MULTILINE)
html = re.sub(r'\b[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}\b', r'...', html)
html = re.sub(r'(?<=id="cell-id=)\w+(?=")', r'...', html)

path.write_text(html)
9 changes: 6 additions & 3 deletions populate_projects.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,18 @@ for d in */; do (
mkdocs_yml="${BASH_REMATCH[3]}"
else
repo="${d//--//}"
branch=''
#branch=$(curl -sfL "https://api.github.com/repos/$repo" | jq -r '.default_branch')
mkdocs_yml='mkdocs.yml'
fi
if [[ -f requirements.in ]]; then
exit
fi
commit=$(curl -sfL "https://api.github.com/repos/$repo/commits?per_page=1&sha=$branch" | jq -r '.[0].sha')
echo "https://github.com/$repo/blob/$branch/$mkdocs_yml" | tee /dev/stderr >project.txt
echo "https://github.com/$repo/raw/$commit/$mkdocs_yml" >>project.txt
tail -1 project.txt | xargs curl -sfL | (mkdocs get-deps -f - || true) | grep . >requirements.in.new
tail -1 project.txt | xargs curl -sfL | (mkdocs get-deps -p ~/repos/mkdocs-catalog/projects.yaml -f - || true) | grep . >requirements.in.new
(grep -qE ' ' requirements.in || true) >>requirements.in.new
mv requirements.in.new requirements.in
); done

echo */requirements.in | xargs -t -n1 -P4 pip-compile -q --no-annotate --no-header -U
echo */requirements.in | xargs -t -n1 -P4 pip-compile -q --allow-unsafe --strip-extras --no-annotate --no-header -U

0 comments on commit b16cd02

Please sign in to comment.