2010YOUY01 commented on code in PR #25313:
URL: https://github.com/apache/datafusion/pull/25313#discussion_r4014947537
##########
dev/rust_lint.sh:
##########
@@ -88,6 +91,22 @@ done
SCRIPT_NAME="$(basename "${BASH_SOURCE[0]}")"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+# `ci/scripts/check_asf_yaml_status_checks.py` runs with `python3` from PATH
+# and imports PyYAML. Report a missing prerequisite before any tool is
+# installed or any formatter runs.
+ensure_python_with_yaml() {
+ if ! command -v python3 &> /dev/null; then
+ echo "[${SCRIPT_NAME}] python3 was not found on PATH. Install Python 3 to
run ci/scripts/check_asf_yaml_status_checks.py." >&2
+ exit 1
+ fi
+ if ! python3 -c 'import yaml' &> /dev/null; then
+ echo "[${SCRIPT_NAME}] PyYAML is not installed for $(command -v python3).
Install it in your active Python environment with: python3 -m pip install
pyyaml" >&2
Review Comment:
nit: the error message could say something like 'please run through `uv`'
Now internal python scripts should be run through `uv` package manager, so
```
# Get dependency setup automatically
uv run ./dev/rust_lint.sh
```
Reference: https://github.com/apache/datafusion/pull/20414
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]