Skip to content

Test cuda_core examples#1800

Open
mdboom wants to merge 5 commits intoNVIDIA:mainfrom
mdboom:cuda-core-examples-main
Open

Test cuda_core examples#1800
mdboom wants to merge 5 commits intoNVIDIA:mainfrom
mdboom:cuda-core-examples-main

Conversation

@mdboom
Copy link
Copy Markdown
Contributor

@mdboom mdboom commented Mar 20, 2026

Prior to this PR, cuda.core examples were being parsed and imported, but not actually run, as part of CI. This updates now actually runs the ones that we can in CI. (Fixes #1798).

This also adds PEP 723 metadata to the examples so they can be run directly with uv run or pipx run. This metadata is also used to determine if a particular example can run as part of CI.

@copy-pr-bot
Copy link
Copy Markdown
Contributor

copy-pr-bot bot commented Mar 20, 2026

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@mdboom
Copy link
Copy Markdown
Contributor Author

mdboom commented Mar 20, 2026

/ok to test

@github-actions
Copy link
Copy Markdown

@mdboom
Copy link
Copy Markdown
Contributor Author

mdboom commented Mar 20, 2026

/ok to test

2 similar comments
@mdboom
Copy link
Copy Markdown
Contributor Author

mdboom commented Mar 20, 2026

/ok to test

@mdboom
Copy link
Copy Markdown
Contributor Author

mdboom commented Mar 20, 2026

/ok to test

@mdboom mdboom force-pushed the cuda-core-examples-main branch from 5ec3c5e to 9a403dc Compare March 20, 2026 19:10
@mdboom
Copy link
Copy Markdown
Contributor Author

mdboom commented Mar 20, 2026

/ok to test

11 similar comments
@mdboom
Copy link
Copy Markdown
Contributor Author

mdboom commented Mar 20, 2026

/ok to test

@mdboom
Copy link
Copy Markdown
Contributor Author

mdboom commented Mar 20, 2026

/ok to test

@mdboom
Copy link
Copy Markdown
Contributor Author

mdboom commented Mar 20, 2026

/ok to test

@mdboom
Copy link
Copy Markdown
Contributor Author

mdboom commented Mar 23, 2026

/ok to test

@mdboom
Copy link
Copy Markdown
Contributor Author

mdboom commented Mar 23, 2026

/ok to test

@mdboom
Copy link
Copy Markdown
Contributor Author

mdboom commented Mar 23, 2026

/ok to test

@mdboom
Copy link
Copy Markdown
Contributor Author

mdboom commented Mar 23, 2026

/ok to test

@mdboom
Copy link
Copy Markdown
Contributor Author

mdboom commented Mar 23, 2026

/ok to test

@mdboom
Copy link
Copy Markdown
Contributor Author

mdboom commented Mar 23, 2026

/ok to test

@mdboom
Copy link
Copy Markdown
Contributor Author

mdboom commented Mar 23, 2026

/ok to test

@mdboom
Copy link
Copy Markdown
Contributor Author

mdboom commented Mar 23, 2026

/ok to test

@mdboom mdboom force-pushed the cuda-core-examples-main branch from f03471d to 5683f54 Compare March 30, 2026 15:04
@mdboom
Copy link
Copy Markdown
Contributor Author

mdboom commented Mar 30, 2026

/ok to test

@mdboom mdboom added bug Something isn't working test Improvements or additions to tests cuda.core Everything related to the cuda.core module labels Mar 30, 2026
@mdboom
Copy link
Copy Markdown
Contributor Author

mdboom commented Mar 30, 2026

/ok to test

@mdboom mdboom marked this pull request as ready for review March 30, 2026 17:44
@mdboom mdboom requested a review from rwgk March 30, 2026 17:47
# The canonical regex as defined in PEP 723
pep723 = re.search(r"(?m)^# /// (?P<type>[a-zA-Z0-9-]+)$\s(?P<content>(^#(| .*)$\s)+)^# ///$", content)
if not pep723:
return
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could/should we enforce here that the PEP 723 information is available?

try:
importlib.metadata.distribution(name.string)
except importlib.metadata.PackageNotFoundError:
pytest.skip(f"Skipping {example} due to missing package requirement: {name}")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid multiple roundtrips adding missing packages: Maybe collect all names here and move the pytest.skip after the loop, showing all names together?

process = subprocess.run([sys.executable, example_path], capture_output=True) # noqa: S603
if process.returncode != 0:
if process.stdout:
print(process.stdout.decode())
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.decode(error="replace") to minimize distraction from the primary error

also below

@mdboom mdboom enabled auto-merge (squash) March 30, 2026 20:12
Copy link
Copy Markdown
Collaborator

@rwgk rwgk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I triggered a rerun, it looks like there was some general issue starting containers or similar. Let's see if it's cleared up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working cuda.core Everything related to the cuda.core module test Improvements or additions to tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Examples: Test cuda-core examples by calling main()

2 participants