-
Notifications
You must be signed in to change notification settings - Fork 0
133 lines (100 loc) · 4.84 KB
/
Copy pathci.yml
File metadata and controls
133 lines (100 loc) · 4.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: CI
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
permissions:
contents: read
jobs:
smoke-minimal:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"
- name: Install minimal pinned dependencies
run: |
python -m pip install -e . --no-deps
python -m pip install matplotlib==3.10.8 networkx==3.6.1 numpy==2.4.3 pytest==9.0.2 quimb==1.13.0
- name: Run headless example
run: python scripts/verify.py smoke
- name: Pytest
run: python scripts/verify.py tests
wheel-smoke:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ["3.12", "3.13"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install build tool
run: python -m pip install build==1.4.2 twine==6.2.0 "setuptools>=77"
- name: Build package artifacts
run: python scripts/verify.py package
- name: Create wheel test venv
run: python -m venv .wheel-venv
- name: Create sdist test venv
run: python -m venv .sdist-venv
- name: Install wheel (Linux)
if: runner.os != 'Windows'
run: .wheel-venv/bin/python -m pip install dist/*.whl
- name: Install wheel (Windows)
if: runner.os == 'Windows'
run: .wheel-venv\Scripts\python -m pip install (Get-ChildItem dist\*.whl | Select-Object -First 1).FullName
- name: Smoke import and render (Linux)
if: runner.os != 'Windows'
run: |
.wheel-venv/bin/python -c "import matplotlib; matplotlib.use('Agg'); import tensor_network_viz; from tensor_network_viz import PlotConfig, pair_tensor, show_tensor_network; trace=[pair_tensor('A', 'x', 'r0', 'ab,b->a')]; fig, _ = show_tensor_network(trace, engine='einsum', view='2d', config=PlotConfig(tensor_label_refinement='never'), show=False); assert fig is not None"
- name: Smoke import and render (Windows)
if: runner.os == 'Windows'
run: .wheel-venv\Scripts\python -c "import matplotlib; matplotlib.use('Agg'); import tensor_network_viz; from tensor_network_viz import PlotConfig, pair_tensor, show_tensor_network; trace=[pair_tensor('A', 'x', 'r0', 'ab,b->a')]; fig, _ = show_tensor_network(trace, engine='einsum', view='2d', config=PlotConfig(tensor_label_refinement='never'), show=False); assert fig is not None"
- name: Install sdist (Linux)
if: runner.os != 'Windows'
run: .sdist-venv/bin/python -m pip install dist/*.tar.gz
- name: Install sdist (Windows)
if: runner.os == 'Windows'
run: .sdist-venv\Scripts\python -m pip install (Get-ChildItem dist\*.tar.gz | Select-Object -First 1).FullName
- name: Smoke sdist import and render (Linux)
if: runner.os != 'Windows'
run: |
.sdist-venv/bin/python -c "import matplotlib; matplotlib.use('Agg'); import tensor_network_viz; from tensor_network_viz import PlotConfig, pair_tensor, show_tensor_network; trace=[pair_tensor('A', 'x', 'r0', 'ab,b->a')]; fig, _ = show_tensor_network(trace, engine='einsum', view='2d', config=PlotConfig(tensor_label_refinement='never'), show=False); assert fig is not None"
- name: Smoke sdist import and render (Windows)
if: runner.os == 'Windows'
run: .sdist-venv\Scripts\python -c "import matplotlib; matplotlib.use('Agg'); import tensor_network_viz; from tensor_network_viz import PlotConfig, pair_tensor, show_tensor_network; trace=[pair_tensor('A', 'x', 'r0', 'ab,b->a')]; fig, _ = show_tensor_network(trace, engine='einsum', view='2d', config=PlotConfig(tensor_label_refinement='never'), show=False); assert fig is not None"
lint-and-test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ["3.11", "3.12", "3.13"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install PyTorch (CPU)
run: python -m pip install torch --index-url https://download.pytorch.org/whl/cpu
- name: Install pinned dev requirements
run: python -m pip install -r requirements.dev.txt
- name: Quality
run: python scripts/verify.py quality
- name: Smoke example
run: python scripts/verify.py smoke
- name: Pytest
run: python scripts/verify.py tests
- name: Security
run: python scripts/verify.py security