-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(frontend-python/release): Check concrete-python API docs before…
… releasing
- Loading branch information
1 parent
2afc3d2
commit 3ba18de
Showing
6 changed files
with
98 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,26 +36,32 @@ rm -rf "$FRESH_DIRECTORY" | |
# New files? | ||
echo "Warning. You might have new API-doc files to git add & push, don't forget" | ||
|
||
SED_OPT='-i' | ||
if [ $(uname) == "Darwin" ]; then | ||
SED_OPT='-i ""' | ||
fi | ||
|
||
# Fixing the path issues, to point on files in GitHub | ||
WHICH_PYTHON_VERSION=$(python3 --version | cut -f 2 -d " " | cut -f 1-2 -d ".") | ||
sed -i "" -e "s@../../$FRESH_DIRECTORY/.venvtrash/lib/python$WHICH_PYTHON_VERSION/site-packages/@../../../compilers/concrete-compiler/compiler/lib/Bindings/Python/@g" docs/dev/api/*.md | ||
sed $SED_OPT -e "s@../../$FRESH_DIRECTORY/.venvtrash/lib.*/python$WHICH_PYTHON_VERSION/site-packages/@../../../compilers/concrete-compiler/compiler/lib/Bindings/Python/@g" docs/dev/api/concrete.compiler*.md docs/dev/api/concrete.lang*.md | ||
sed $SED_OPT -e "s@../../$FRESH_DIRECTORY/.venvtrash/lib.*/python$WHICH_PYTHON_VERSION/site-packages/@../../frontends/concrete-python/@g" docs/dev/api/concrete.fhe*.md | ||
|
||
# Fixing absolute path in doc | ||
sed $SED_OPT -e "s@$PWD/$FRESH_DIRECTORY/@./@g" docs/dev/api/concrete.compiler.library_support.md | ||
|
||
# Fixing the links in README.md, which fails (missing .'s for some reason): remove the #headers | ||
sed -i "" -e "[email protected]#module-.*)@.md)@g" docs/dev/api/README.md | ||
sed -i "" -e "[email protected]#function-.*)@.md)@g" docs/dev/api/README.md | ||
sed -i "" -e "[email protected]#class-.*)@.md)@g" docs/dev/api/README.md | ||
sed $SED_OPT -e "[email protected]#module-.*)@.md)@g" docs/dev/api/README.md | ||
sed $SED_OPT -e "[email protected]#function-.*)@.md)@g" docs/dev/api/README.md | ||
sed $SED_OPT -e "[email protected]#class-.*)@.md)@g" docs/dev/api/README.md | ||
|
||
# Removed the "object addresses" and "function addresses", since they are not constant | ||
sed -i "" -e "s@object at 0x[a-zA-z0-9]*@object at ADDRESS@g" docs/*.md | ||
sed -i "" -e "s@object at 0x[a-zA-z0-9]*@object at ADDRESS@g" docs/*/*.md | ||
sed -i "" -e "s@object at 0x[a-zA-z0-9]*@object at ADDRESS@g" docs/*/*/*.md | ||
|
||
sed -i "" -e "s@function Int at 0x[a-zA-z0-9]*@function Int at ADDRESS@g" docs/*.md | ||
sed -i "" -e "s@function Int at 0x[a-zA-z0-9]*@function Int at ADDRESS@g" docs/*/*.md | ||
sed -i "" -e "s@function Int at 0x[a-zA-z0-9]*@function Int at ADDRESS@g" docs/*/*/*.md | ||
sed $SED_OPT -e "s@object at 0x[a-zA-Z0-9]*@object at ADDRESS@g" docs/*.md | ||
sed $SED_OPT -e "s@object at 0x[a-zA-Z0-9]*@object at ADDRESS@g" docs/*/*.md | ||
sed $SED_OPT -e "s@object at 0x[a-zA-Z0-9]*@object at ADDRESS@g" docs/*/*/*.md | ||
|
||
# FIXME: remove this once the PR has been merged once | ||
sed -i "" -e "s@https://github.com/zama-ai/concrete-compiler-internal/blob/main/LICENSE.txt@https://github.com/zama-ai/concrete/blob/main/LICENSE.txt@g" ./docs/dev/api/concrete.lang.dialects.md ./docs/dev/api/concrete.compiler.md ./docs/dev/api/concrete.lang.md | ||
sed $SED_OPT -e "s@function Int at 0x[a-zA-Z0-9]*@function Int at ADDRESS@g" docs/*.md | ||
sed $SED_OPT -e "s@function Int at 0x[a-zA-Z0-9]*@function Int at ADDRESS@g" docs/*/*.md | ||
sed $SED_OPT -e "s@function Int at 0x[a-zA-Z0-9]*@function Int at ADDRESS@g" docs/*/*/*.md | ||
|
||
# Was there changes? | ||
if diff -r docs docs-copy; then | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.