Skip to content

Commit

Permalink
refactor: set PYTHONIOENCODING
Browse files Browse the repository at this point in the history
  • Loading branch information
sigoden committed Jun 6, 2024
1 parent 61440a0 commit 40448af
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,4 @@ jobs:
python-version: '3.11'

- name: Run Test
run: argc test
env:
PYTHONIOENCODING: utf-8
run: argc test
10 changes: 4 additions & 6 deletions Argcfile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,11 @@ test-functions() {
cmd="$(_lang_to_cmd "$lang")"
cmd_path="$BIN_DIR/$func$ext"
if command -v "$cmd" &> /dev/null; then
"$cmd_path" "$data" | {
echo "Test $cmd_path: $(cat)"
}
echo -n "Test $cmd_path: "
"$cmd_path" "$data"
if ! _is_win; then
"$cmd" "scripts/bin.$lang" "$func" "$data" | {
echo "Test $cmd scripts/bin.$lang $func: $(cat)"
}
echo -n "Test $cmd scripts/bin.$lang $func: "
"$cmd" "scripts/bin.$lang" "$func" "$data"
fi
fi
done
Expand Down
1 change: 1 addition & 0 deletions scripts/bin.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def load_env(file_path):
except FileNotFoundError:
pass

os.environ["PYTHONIOENCODING"] = "utf-8"
os.environ["LLM_FUNCTIONS_DIR"] = os.path.join(os.path.dirname(__file__), "..")

load_env(os.path.join(os.environ["LLM_FUNCTIONS_DIR"], ".env"))
Expand Down

0 comments on commit 40448af

Please sign in to comment.