Skip to content

Commit 5b5b434

Browse files
committed
fix github workflow unittest
1 parent 7686939 commit 5b5b434

1 file changed

Lines changed: 20 additions & 7 deletions

File tree

.github/workflows/python-package.yml

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,30 @@ jobs:
2828
sudo apt-get update
2929
sudo apt-get install -y build-essential
3030
31-
- name: Install dependencies
31+
- name: Install Python tooling
3232
run: |
33-
python -m pip install --upgrade pip
33+
python -m pip install --upgrade pip setuptools wheel
3434
python -m pip install flake8
35-
python -m pip install . --use-pep517
3635
37-
- name: Lint with flake8 (nonblocking)
36+
# Install your project (this pulls deps from pyproject.toml, including numpy/scipy/matplotlib)
37+
- name: Install package + runtime deps (PEP 517)
3838
run: |
39-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
39+
python -m pip install -e . --use-pep517
4040
41-
- name: Test with unittest
41+
# Build the extension in the checkout so "import bloch" (from repo) can find the .so
42+
- name: Build C extension in-place
43+
run: |
44+
python setup.py build_ext --inplace
45+
46+
- name: Verify extension is importable (from checkout)
4247
run: |
43-
python -m unittest -v
48+
python -c "import bloch.bloch_simulator as m; print('OK:', m)"
4449
50+
# Make lint non-blocking and exclude generated dirs (recommended)
51+
- name: Lint with flake8 (non-blocking)
52+
run: |
53+
flake8 . --count --exit-zero --max-line-length=127 --statistics --exclude build,dist,*.egg-info,__pycache__
54+
55+
- name: Test with unittest
56+
run: |
57+
python -m unittest discover -v -s bloch/tests -t .

0 commit comments

Comments
 (0)