File: tests.yml

package info (click to toggle)
python-cmaes 0.12.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 544 kB
  • sloc: python: 5,136; sh: 88; makefile: 4
file content (76 lines) | stat: -rw-r--r-- 2,786 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Run tests and linters

on:
  pull_request:
    paths:
      - '.github/workflows/tests.yml'
      - 'pyproject.toml'
      - '**.py'

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.x'
          architecture: x64
      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip setuptools
          pip install --progress-bar off numpy matplotlib scipy mypy flake8 black torch gpytorch
      - run: flake8 . --show-source --statistics
      - run: black --check .
      - run: mypy cmaes
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
    steps:
      - uses: actions/checkout@v4
      - name: Setup Python${{ matrix.python-version }}
        uses: actions/setup-python@v5
        with:
          python-version: ${{ matrix.python-version }}
          architecture: x64
      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip setuptools numpy scipy hypothesis pytest torch gpytorch
          pip install --progress-bar off .
      - run: python -m pytest tests --ignore=tests/test_free_threaded.py
  test-free-threaded:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      # TODO: Replace deadsnakes with setup-python when the support for Python 3.13t is added
      - name: Setup Python 3.13t
        uses: deadsnakes/action@v3.1.0
        with:
          python-version: "3.13-dev"
          nogil: true
      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip setuptools numpy hypothesis pytest pytest-freethreaded
          pip install --progress-bar off .
      - run: python -m pytest --threads 1 --iterations 1 tests --ignore=tests/test_free_threaded.py
      # TODO: Using `unittest` style causes `pytest-freethreaded` to fail with `ConcurrencyError`.
      #       Rewriting as top-level functions works,
      #       so a follow-up is needed to refactor from `unittest` to `pytest`.
      - run: python -m pytest --threads 1 --iterations 1 --require-gil-disabled tests/test_free_threaded.py
  test-numpy2:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Setup Python
        uses: actions/setup-python@v5
        with:
          architecture: x64
      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip setuptools scipy hypothesis pytest torch gpytorch
          python -m pip install --pre --upgrade numpy
          pip install --progress-bar off .
      - run: python -m pytest tests --ignore=tests/test_free_threaded.py