File: tests_env.yml

package info (click to toggle)
qutip 5.2.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,684 kB
  • sloc: python: 45,351; cpp: 456; makefile: 175; sh: 16
file content (61 lines) | stat: -rw-r--r-- 1,910 bytes parent folder | download
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
name: Test family projects

on:
  workflow_dispatch:
    inputs:
      version:
        description: 'Which version, empty for development, `release` for latest released version'
        default: ""

  pull_request:

defaults:
  run:
    # The slightly odd shell call is to force bash to read .bashrc, which is
    # necessary for having conda behave sensibly.
    shell: bash -l -e {0}

jobs:
  tests:
    name: ${{ matrix.repo }}
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        repo: [qutip-qip, qutip-jax, qutip-qoc, qutip-qtrl]

    steps:
      - uses: actions/checkout@v4
      - uses: conda-incubator/setup-miniconda@v3
        with:
          auto-update-conda: true
          python-version: 3.11

      - name: Install QuTiP and dependencies
        run: |
          # Install the extra requirement
          python -m pip install pytest pytest-rerunfailures  # tests
          python -m pip install numpy scipy cython filelock
          python -m pip install -e . -v --no-build-isolation
      - name: Install QuTiP family package
        run: |
          # jax cannot be installed from requirement (cpu vs gpu issue)
          python -m pip install jax[cpu]
          cd ..
          git clone https://github.com/qutip/${{ matrix.repo }}.git
          cd ${{ matrix.repo }}
          if [[ $inputs.version == "release" ]]; then
            # Checkout the latest tag as the latest release
            git fetch --tags
            git checkout $(git describe --tags "$(git rev-list --tags --max-count=1)")
          elif [[ "${{ inputs.version }}" ]]; then
            git checkout ${{ inputs.version }}
          fi
          python -m pip install .[full]
      - name: Print python environment
        run: |
          pip list
      - name: Run test
        run: |
          cd ../${{ matrix.repo }}
          pytest tests -vv -W "ignore::DeprecationWarning"