Skip to content

Conversation

@rwgk
Copy link
Collaborator

@rwgk rwgk commented Jan 20, 2026

Closes #697

This PR is motivated by nvbug 5808967 — currently there is no automatic testing for the cuda_bindings/examples at all, therefore it is possible that the QA team is side-tracked unnecessarily by failures that we can discover in the CI here automatically.

This PR enables running the cuda_bindings/examples in wheel-based test environments, which is both a gain and a simplification (see changes in cuda_bindings/examples/common/common.py).

Non-goal for this PR: structural changes to run the examples in various environments or in different ways.

Note that scripts/run_tests.sh runs the examples by default. This PR makes scripts/run_tests.sh succeed in local wheel-based environments:

  • before this PR: XXX
  • with this PR: XXX

@copy-pr-bot
Copy link
Contributor

copy-pr-bot bot commented Jan 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.

@rwgk rwgk self-assigned this Jan 20, 2026
@rwgk
Copy link
Collaborator Author

rwgk commented Jan 20, 2026

/ok to test

@github-actions
Copy link

Analysis:
- examples were invoked via `python -m pytest` from within `cuda_bindings`
  so the repo checkout was on sys.path and imports resolved to the source tree
- `setuptools_scm` generates `cuda/bindings/_version.py` only in the built wheel,
  so the source tree lacks this file and `from cuda.bindings._version import __version__`
  fails during example collection
- running `pytest` via the installed entrypoint avoids CWD precedence and keeps
  imports coming from the installed wheel, which includes the generated version file

Change:
- switch Linux and Windows example steps to call `pytest` entrypoint
@rwgk
Copy link
Collaborator Author

rwgk commented Jan 20, 2026

/ok to test

Copy link
Contributor

@mdboom mdboom left a comment

Choose a reason for hiding this comment

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

This only gets the example tests running in CI, not all the other ways that tests get run (calling pytest directly, or pixi run test etc.) It would be preferable to do this at a higher level -- maybe it's possible to make a symlink from cuda_bindings/tests/ to cuda_bindings/examples -- so that they will be included even for local development.

@rwgk rwgk force-pushed the ci_cuda_bindings_examples branch from e34a864 to 7fa3f76 Compare January 22, 2026 16:41
@rwgk
Copy link
Collaborator Author

rwgk commented Jan 22, 2026

/ok to test

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cuda-bindings examples are not run as part of the CI

2 participants