Repository navigation
87 lines (83 loc) · 3.12 KB
/
Copy pathtests.yml
File metadata and controls
87 lines (83 loc) · 3.12 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
name: Tests
on:
push:
branches: [main, develop, "feature/**", "fix/**"]
pull_request:
branches: [main, develop]
workflow_dispatch:
workflow_call:
jobs:
cpython:
name: CPython ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.12", "3.14"]
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
- name: Install
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[test,dev,registry]"
- name: Check that no application package is installed
run: |
python -c "import importlib.util as u, sys; found=[n for n in ('datalab','sigima','sigimax','guidata','qtpy') if u.find_spec(n)]; sys.exit(f'Unexpected packages: {found}' if found else 0)"
- name: Lint with Ruff
run: |
ruff format --check .
ruff check --output-format=github .
- name: Test with pytest
run: pytest -v
pyodide:
name: Pyodide 0.26.4 (Node)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.12"
- uses: actions/setup-node@v6
with:
node-version: "22"
- name: Build wheel
run: |
python -m pip install --upgrade pip
python -m pip wheel . --no-deps -w dist
- name: Run golden vectors and pytest in Pyodide
working-directory: tests/pyodide
run: |
npm install --no-audit --no-fund
node run_pyodide.mjs "$(ls ../../dist/*.whl)"
clean-env:
name: Capsule CLI in a clean environment
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.12"
- name: Build a wheel and capsules from the reference workspaces
run: |
python -m pip install --upgrade pip
python -m pip wheel . --no-deps -w dist
python -m venv /tmp/build-env
/tmp/build-env/bin/pip install -q "$(ls dist/*.whl)[hdf5]"
for edition in desktop web; do
/tmp/build-env/bin/python examples/workspace_to_capsule.py \
"tests/fixtures/workspaces/${edition}_chain.h5" "/tmp/${edition}.dlcapsule"
done
- name: Validate and inspect without NumPy, h5py or any application
run: |
python -m venv /tmp/clean-env
/tmp/clean-env/bin/pip install -q "$(ls dist/*.whl)"
/tmp/clean-env/bin/python -c "import importlib.util as u, sys; found=[n for n in ('numpy','h5py','datalab','sigima','qtpy') if u.find_spec(n)]; sys.exit(f'Unexpected packages: {found}' if found else 0)"
cd /tmp
for edition in desktop web; do
/tmp/clean-env/bin/workspace-capsule validate "${edition}.dlcapsule"
/tmp/clean-env/bin/workspace-capsule inspect "${edition}.dlcapsule"
/tmp/clean-env/bin/workspace-capsule inspect "${edition}.dlcapsule" --json > /dev/null
done