Skip to content
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

Avoid requiring editable builds (-e) for running tests #108

Closed
leofang opened this issue Sep 16, 2024 · 2 comments
Closed

Avoid requiring editable builds (-e) for running tests #108

leofang opened this issue Sep 16, 2024 · 2 comments
Assignees
Labels
cuda.bindings Everything related to the cuda.bindings module enhancement Any code-related improvements P1 Medium priority - Should do

Comments

@leofang
Copy link
Member

leofang commented Sep 16, 2024

Right now it is quite subtle that the test/benchmark suites are designed to only allow editable builds to run. For normal builds, pytest has a hard time importing the needed modules. I stumbled over this for a few times.

pip install -e .

This should be fixed.

@leofang leofang added enhancement Any code-related improvements P1 Medium priority - Should do labels Sep 16, 2024
@leofang leofang self-assigned this Sep 16, 2024
@github-actions github-actions bot added the triage Needs the team's attention label Sep 16, 2024
@leofang leofang removed the triage Needs the team's attention label Sep 16, 2024
@leofang leofang added this to the cuda-python 12-next, 11-next milestone Oct 10, 2024
@leofang
Copy link
Member Author

leofang commented Oct 10, 2024

Not sure if this is related, but instead of the current layout for tests/examples/benchmarks

  • cuda/setup.py
  • cuda/cuda/bindings/tests
  • cuda/cuda/bindings/examples
  • cuda/cuda/bindings/benchmarks

ideally the layout should have been made such that they are outside of source tree and living side-by-side with setup.py for the package, so

  • cuda/setup.py
  • cuda/cuda/bindings/
  • cuda/tests
  • cuda/examples
  • cuda/benchmarks

I probably made a bad mistake back then (leofang#1) 😓

cc @vzhurba01

@leofang leofang added the cuda.bindings Everything related to the cuda.bindings module label Oct 10, 2024
vzhurba01 added a commit that referenced this issue Oct 11, 2024
- Issue #102: Rename root cuda to cuda_bindings
- Issue #145: Explain layout change
- Issue #108: Resolve how to run editable builds
vzhurba01 added a commit that referenced this issue Oct 11, 2024
- Issue #102: Rename root cuda to cuda_bindings
- Issue #145: Explain layout change
- Issue #108: Resolve how to run editable builds
@vzhurba01
Copy link
Collaborator

Resolved by MR #159. Updated cuda-python/cuda/README.md with how to run.

The final commands are:
Command to test against in-tree builds:

  • unittests: cuda-python/cuda_bindings$ python -m pytest tests/
  • samples: cuda-python/cuda_bindings$ python -m pytest examples/

Command to test against distributable package (wheels/conda)

  • unittests: cuda-python/cuda_bindings$ pytest tests/
  • samples: cuda-python/cuda_bindings$ pytest examples/

Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cuda.bindings Everything related to the cuda.bindings module enhancement Any code-related improvements P1 Medium priority - Should do
Projects
None yet
Development

No branches or pull requests

2 participants