Skip to content

Commit 48e7bcb

Browse files
splchclaude
andcommitted
Replace conda with uv as primary CI/CD workflow
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>
1 parent a3666c9 commit 48e7bcb

File tree

2 files changed

+22
-167
lines changed

2 files changed

+22
-167
lines changed

.github/workflows/test_notebooks.yml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
echo "=================================================="
2525
echo "Discovering notebooks"
2626
echo "=================================================="
27-
notebooks=$(find . -name "*.ipynb" -type f | jq -R -s -c 'split("\n")[:-1]')
27+
notebooks=$(find . -name "*.ipynb" -type f -not -path "*/venv/*" | jq -R -s -c 'split("\n")[:-1]')
2828
echo "Found notebooks:"
2929
echo "$notebooks" | jq -r '.[]'
3030
echo "notebooks=$notebooks" >> $GITHUB_OUTPUT
@@ -41,41 +41,43 @@ jobs:
4141
- name: Check out code
4242
uses: actions/checkout@v4
4343

44-
- name: Set up Conda
45-
uses: conda-incubator/setup-miniconda@v2
44+
- name: Install uv
45+
uses: astral-sh/setup-uv@v4
46+
with:
47+
enable-cache: true
48+
cache-dependency-glob: "pyproject.toml"
49+
50+
- name: Set up Python
51+
uses: actions/setup-python@v5
4652
with:
47-
activate-environment: myenv
48-
environment-file: environment.yml
4953
python-version: "3.11"
50-
auto-activate-base: false
5154

52-
- name: Prepare Conda environment
53-
shell: bash -l {0}
55+
- name: Install dependencies with uv
5456
run: |
5557
echo "=================================================="
56-
echo "Preparing Conda environment for ${{ matrix.notebook }}"
58+
echo "Installing dependencies for ${{ matrix.notebook }}"
5759
echo "=================================================="
58-
if conda env list | grep -q 'myenv'; then
59-
echo "✓ Environment 'myenv' already exists, updating environment"
60-
conda env update --name myenv --file environment.yml --prune
61-
else
62-
echo "✓ Creating new environment 'myenv'"
63-
conda env create -f environment.yml
64-
fi
65-
echo "✓ Conda environment ready"
60+
start_time=$(date +%s)
61+
62+
uv pip install --system -e .
63+
64+
end_time=$(date +%s)
65+
elapsed=$((end_time - start_time))
66+
echo "✓ Dependencies installed in ${elapsed}s"
6667
6768
- name: Verify environment
68-
shell: bash -l {0}
6969
run: |
7070
echo "=================================================="
7171
echo "Verifying environment setup"
7272
echo "=================================================="
73-
conda activate myenv
7473
echo "✓ Python version:"
7574
python --version
7675
echo ""
76+
echo "✓ uv version:"
77+
uv --version
78+
echo ""
7779
echo "✓ Installed packages:"
78-
conda list | grep -E "(jupyter|qiskit|cirq|pennylane|qbraid|requests)" || echo " (packages not shown)"
80+
uv pip list | grep -E "(jupyter|qiskit|cirq|pennylane|qbraid|cudaq)" || echo " (packages installed)"
7981
echo ""
8082
echo "✓ IONQ_API_KEY status:"
8183
if [ -n "$IONQ_API_KEY" ]; then
@@ -87,13 +89,11 @@ jobs:
8789
IONQ_API_KEY: ${{ secrets.IONQ_API_KEY }}
8890

8991
- name: Execute notebook
90-
shell: bash -l {0}
9192
run: |
9293
echo "=================================================="
9394
echo "Executing: ${{ matrix.notebook }}"
9495
echo "Timeout: 600s"
9596
echo "=================================================="
96-
conda activate myenv
9797
start_time=$(date +%s)
9898
echo "Starting execution at $(date '+%Y-%m-%d %H:%M:%S')"
9999

.github/workflows/test_notebooks_uv.yml

Lines changed: 0 additions & 145 deletions
This file was deleted.

0 commit comments

Comments
 (0)