-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Co-authored-by: Tim Diekmann <[email protected]>
- Loading branch information
1 parent
d159f62
commit bffb448
Showing
6 changed files
with
54 additions
and
0 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
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
18 changes: 18 additions & 0 deletions
18
libs/@local/hash-graph-sdk/python/scripts/codegen_blocking.sh
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
# Thanks to: https://stackoverflow.com/a/246128/9077988 | ||
SOURCE=${BASH_SOURCE[0]} | ||
while [ -L "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink | ||
DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) | ||
SOURCE=$(readlink "$SOURCE") | ||
[[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located | ||
done | ||
DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) | ||
|
||
poetry run python "$DIR/generate_blocking.py" | ||
|
||
# We need to run black twice because ruff changes the output | ||
poetry run black "$DIR/../graph_sdk/client/blocking.py" | ||
poetry run ruff --fix "$DIR/../graph_sdk/client/blocking.py" || true | ||
poetry run black "$DIR/../graph_sdk/client/blocking.py" |
18 changes: 18 additions & 0 deletions
18
libs/@local/hash-graph-sdk/python/scripts/codegen_filter.sh
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
# Thanks to: https://stackoverflow.com/a/246128/9077988 | ||
SOURCE=${BASH_SOURCE[0]} | ||
while [ -L "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink | ||
DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) | ||
SOURCE=$(readlink "$SOURCE") | ||
[[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located | ||
done | ||
DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) | ||
|
||
poetry run python "$DIR/generate_filter.py" | ||
|
||
# We need to run black twice because ruff changes the output | ||
poetry run black "$DIR/../graph_sdk/client/blocking.py" | ||
poetry run ruff --fix "$DIR/../graph_sdk/filter/path.py" || true | ||
poetry run black "$DIR/../graph_sdk/filter/path.py" |
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