Enhance notebook testing and API key retrieval#56
Merged
Conversation
- Updated `test_notebooks.py` to improve integration tests for Jupyter notebooks. - Added a timeout for notebook execution and improved error handling. - Skipped tests if the IONQ_API_KEY environment variable is not set. - Refactored notebook execution logic into a separate function for clarity. - Introduced `helpers.py` to centralize IonQ API key retrieval. - Implemented a function to get the API key from the environment or prompt the user interactively if not set.
- Add detailed logging to GitHub Actions workflow with step-by-step output - Add environment verification step to show Python version and packages - Add test summary step that runs even if tests fail - Enhance test_notebooks.py with detailed execution logging: - Show timestamp and duration for each notebook - Display progress with visual separators - Provide summary with pass/fail counts - Add better error reporting - Add pytest and nbconvert to environment.yml (required for tests) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add discovery job to find all notebooks dynamically - Use matrix strategy to run each notebook in parallel - Set fail-fast: false to see all failures - Add per-notebook execution logging with timestamps - Upload HTML artifacts for each notebook - Add summary job to report overall status - Significantly reduces total CI/CD time Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Replace qasm3_drawer with pyqasm.draw per qBraid SDK changelog - Add pyqasm to pip install dependencies - Update import statement and function call Fixes: ImportError: cannot import name 'qasm3_drawer' from 'qbraid.visualization' Reference: qBraid/qBraid#943 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add pyproject.toml with all dependencies for modern Python packaging - Create new GitHub Actions workflow using uv (test_notebooks_uv.yml) - Update README with uv installation instructions (recommended method) - Keep conda workflow as fallback option Benefits of uv: - 10-100x faster dependency resolution than pip/conda - Significantly faster package installation - Better caching and reproducible builds - Compatible with entire PyPI ecosystem Expected improvement: Reduce dependency installation from ~60s to ~10s Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Performance comparison (average per notebook): - Conda: ~3 minutes - uv: ~1 minute - Improvement: 2.8x faster (66% reduction) Specific improvements: - api.ipynb: 3m5s → 47s (3.9x faster) - qbraid.ipynb: 3m11s → 1m4s (3x faster) - cuda-quantum: 3m9s → 1m24s (2.25x faster) - pennylane.ipynb: 3m7s → 54s (3.5x faster) - cirq.ipynb: 2m58s → 57s (3.1x faster) - qiskit.ipynb: 2m53s → 55s (3.2x faster) Benefits: ✓ Much faster dependency resolution and installation ✓ More efficient CI/CD minute usage ✓ Modern Python packaging with pyproject.toml ✓ Better developer experience The conda environment.yml is kept for local development compatibility. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updated
test_notebooks.pyto improve integration tests for Jupyter notebooks.Introduced
helpers.pyto centralize IonQ API key retrieval.