-
Notifications
You must be signed in to change notification settings - Fork 259
Add PEP723 metadata to cuda_core examples #1799
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| #!/bin/bash | ||
|
|
||
| # SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| # Runs a directory of examples using `uv run` to test that the PEP 723 | ||
| # dependency metadata in them is valid. | ||
|
|
||
| # We allow a resolution to fail for cuda_core or cuda_bindings only, since there | ||
| # we assume it is pinned to some future release. This allows examples to be | ||
| # written for unreleased features. Testing examples against prereleases is | ||
| # already covered by CI elsewhere. | ||
|
|
||
| TARGET_DIR=$1 | ||
|
|
||
| if [ -z "$TARGET_DIR" ]; then | ||
| echo "Usage: $0 <directory>" | ||
| exit 1 | ||
| fi | ||
|
|
||
| FAILED=0 | ||
|
|
||
| while IFS= read -r -d '' file; do | ||
| echo "Running $file..." | ||
| OUTPUT=$(uv run "$file" 2>&1) | ||
| EXIT_CODE=$? | ||
|
|
||
| if [ $EXIT_CODE -ne 0 ]; then | ||
| if echo "$OUTPUT" | grep -Eq "Because only cuda-(core|bindings)"; then | ||
| echo "SKIPPED: $file (No solution found)" | ||
| else | ||
| echo "FAILED: $file" | ||
| echo "$OUTPUT" | ||
| FAILED=1 | ||
| fi | ||
| else | ||
| echo "PASSED: $file" | ||
| fi | ||
|
Comment on lines
+28
to
+38
|
||
| done < <(find "$TARGET_DIR" -name "*.py" -print0) | ||
|
Comment on lines
+23
to
+39
|
||
|
|
||
| if [ $FAILED -ne 0 ]; then | ||
| exit 1 | ||
| fi | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Running the full
cuda_core/examples/directory viauv runin CI inherits the same risk as the tool: examples that are interactive, long-running, or require a display/context can hang/fail the workflow. It would be more reliable to call the tool with a curated subset of examples known to terminate quickly (or to add filtering/timeout support in the tool and use it here).