pywt

Форк
0
/
tests.yml 
267 строк · 8.7 Кб
1
name: Tests
2

3
on:
4
  push:
5
    branches:
6
      - v1.**
7
  pull_request:
8
    branches:
9
      - main
10
      - v1.**
11

12
concurrency:
13
  # avoid duplicate runs on both pushes and PRs
14
  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
15
  cancel-in-progress: true
16

17
env:
18
  # Coloured output for GitHub Actions
19
  FORCE_COLOR: 3
20
  # Some common environment variables for both GNU/Linux and macOS jobs
21
  MPLBACKEND: Agg
22
  CYTHON_TRACE: 1
23
  CYTHONSPEC: cython
24
  NUMPY_MIN: numpy==1.23.0
25
  CYTHON_MIN: cython==3.0.4
26
  SCIPY_MIN: scipy==1.9.0
27

28
jobs:
29
  test_pywavelets_linux:
30
    name: linux-cp${{ matrix.python-version }}-${{ matrix.OPTIONS_NAME }}
31
    runs-on: ubuntu-latest
32
    strategy:
33
      # Ensure that a wheel builder finishes even if another fails
34
      fail-fast: false
35
      matrix:
36
        python-version: ["3.10", "3.11", "3.12"]
37
        MINIMUM_REQUIREMENTS: [0]
38
        USE_SCIPY: [0]
39
        USE_SDIST: [0]
40
        REFGUIDE_CHECK: [1]
41
        PIP_FLAGS: [""]
42
        OPTIONS_NAME: ["default"]
43
        include:
44
          - platform_id: manylinux_x86_64
45
            python-version: "3.10"
46
            MINIMUM_REQUIREMENTS: 1
47
            OPTIONS_NAME: "minimum-req"
48
          - platform_id: manylinux_x86_64
49
            python-version: "3.10"
50
            USE_SCIPY: 1
51
            OPTIONS_NAME: "with-scipy"
52
          - platform_id: manylinux_x86_64
53
            python-version: "3.10"
54
            USE_SDIST: 1
55
            OPTIONS_NAME: "install-from-sdist"
56
          - platform_id: manylinux_x86_64
57
            python-version: "3.12"
58
            PIP_FLAGS: "--pre"
59
            OPTIONS_NAME: "pre-releases"
60
          - platform_id: manylinux_x86_64
61
            python-version: "3.12"
62
            OPTIONS_NAME: "editable-install"
63
    steps:
64
      - name: Checkout PyWavelets
65
        uses: actions/checkout@v4
66

67
      - name: Setup Python
68
        uses: actions/setup-python@v5
69
        with:
70
          python-version: ${{ matrix.python-version}}
71
          allow-prereleases: true
72

73
      - name: Build package
74
        env:
75
          VERSION: ${{ matrix.python-version }}
76
          MINIMUM_REQUIREMENTS: ${{ matrix.MINIMUM_REQUIREMENTS }}
77
          PIP_FLAGS: ${{ matrix.PIP_FLAGS }}
78
          USE_SDIST: ${{ matrix.USE_SDIST }}
79
          USE_SCIPY: ${{ matrix.USE_SCIPY }}
80
          REFGUIDE_CHECK: ${{ matrix.REFGUIDE_CHECK }}
81
          OPTIONS_NAME: ${{ matrix.OPTIONS_NAME }}
82
        run: |
83
          uname -a
84
          df -h
85
          ulimit -a
86
          # ccache -s
87
          which python
88
          python --version
89
          # sudo apt-get install libatlas-base-dev
90
          pip install --upgrade pip build
91
          # Set numpy version first, other packages link against it
92
          if [ "${MINIMUM_REQUIREMENTS}" == "1" ]; then
93
              pip install ${CYTHON_MIN}
94
              pip install ${NUMPY_MIN}
95
              if [ "${USE_SCIPY}" == "1" ]; then pip install ${SCIPY_MIN}; fi
96
          else
97
              pip install ${PIP_FLAGS} cython
98
              pip install ${PIP_FLAGS} numpy
99
              if [ "${USE_SCIPY}" == "1" ]; then pip install ${PIP_FLAGS} scipy; fi
100
          fi
101
          pip install ${PIP_FLAGS} matplotlib pytest
102

103
            set -o pipefail
104
            if [ "${USE_SDIST}" == "1" ]; then
105
                python -m build --sdist
106
                pip install dist/pyw*.tar.gz -v
107
            elif [ "${REFGUIDE_CHECK}" == "1" ]; then
108
                pip install sphinx numpydoc scipy-doctest
109
                pip install . -v
110
            else
111
                pip install . -v
112
            fi
113

114
          if [ "${OPTIONS_NAME}" == "editable-install" ]; then
115
              pip install meson-python>=0.16.0 matplotlib pytest ninja
116
              pip install -e . --no-build-isolation
117
          fi
118

119
      - name: Run tests
120
        env:
121
          USE_SDIST: ${{ matrix.USE_SDIST }}
122
          REFGUIDE_CHECK: ${{ matrix.REFGUIDE_CHECK }}
123
          OPTIONS_NAME: ${{ matrix.OPTIONS_NAME }}
124
        run: |
125
          set -o pipefail
126
          # Move out of source directory to avoid finding local pywt
127
          pushd demo
128
          if [ "${USE_SDIST}" == "1" ]; then
129
              pytest --pyargs pywt
130
              python ../pywt/tests/test_doc.py
131
          elif [ "${REFGUIDE_CHECK}" == "1" ]; then
132
              # doctest docstrings
133
              pytest --doctest-modules --pyargs pywt -v  --doctest-collect=api
134
              # Run Sphinx HTML docs builder, converting warnings to errors
135
              # Move back out of demo/ to root directory
136
              cd ..
137
              pip install -r util/readthedocs/requirements.txt
138
              sphinx-build -b html -W --keep-going -d _build/doctrees doc/source doc/build
139
          else
140
              pytest --pyargs pywt
141
          fi
142
          popd
143

144
  test_pywavelets_linux_free_threaded:
145
    name: linux-cp313t-with-scipy
146
    runs-on: ubuntu-latest
147
    strategy:
148
      # Ensure that a wheel builder finishes even if another fails
149
      fail-fast: false
150

151
    steps:
152
      - name: Checkout PyWavelets
153
        uses: actions/checkout@v4
154

155
      # TODO: replace with setup-python when there is support
156
      - uses: deadsnakes/action@6c8b9b82fe0b4344f4b98f2775fcc395df45e494 # v3.1.0
157
        with:
158
          python-version: "3.13-dev"
159
          nogil: true
160

161
      - name: Build package
162
        run: |
163
          which python
164
          python --version
165
          pip install --upgrade pip build
166
          # We need nightly wheels for free-threaded support and latest fixes
167
          pip install --pre -i https://pypi.anaconda.org/scientific-python-nightly-wheels/simple cython numpy scipy
168
          pip install pytest meson-python ninja
169
          pip install . -v --no-build-isolation
170

171
      - name: Run tests
172
        env:
173
          PYTHON_GIL: 0
174
        run: |
175
          # Move out of source directory to avoid finding local pywt
176
          cd demo
177
          pytest --pyargs pywt
178

179
  test_pywavelets_macos:
180
    name: macos-cp${{ matrix.python-version }}-${{ matrix.OPTIONS_NAME }}
181
    runs-on: macos-latest
182
    strategy:
183
      # Ensure that a wheel builder finishes even if another fails
184
      fail-fast: false
185
      matrix:
186
        python-version: ["3.10", "3.12"]
187
        MINIMUM_REQUIREMENTS: [0]
188
        USE_SCIPY: [0]
189
        USE_SDIST: [0]
190
        REFGUIDE_CHECK: [0]
191
        PIP_FLAGS: [""]
192
        OPTIONS_NAME: ["default"]
193
        include:
194
          - python-version: "3.10"
195
            MINIMUM_REQUIREMENTS: 1
196
            OPTIONS_NAME: "osx-minimum-req"
197
          - python-version: "3.12"
198
            PIP_FLAGS: "--pre"
199
            OPTIONS_NAME: "pre-releases"
200

201
    steps:
202
      - name: Checkout PyWavelets
203
        uses: actions/checkout@v4
204

205
      - name: Setup Python
206
        uses: actions/setup-python@v5
207
        with:
208
          python-version: ${{ matrix.python-version}}
209
          allow-prereleases: true
210

211
      - name: Build package
212
        env:
213
          VERSION: ${{ matrix.python-version }}
214
          MINIMUM_REQUIREMENTS: ${{ matrix.MINIMUM_REQUIREMENTS }}
215
          PIP_FLAGS: ${{ matrix.PIP_FLAGS }}
216
          USE_SDIST: ${{ matrix.USE_SDIST }}
217
          USE_SCIPY: ${{ matrix.USE_SCIPY }}
218
          REFGUIDE_CHECK: ${{ matrix.REFGUIDE_CHECK }}
219
          CC: /usr/bin/clang
220
          CXX: /usr/bin/clang++
221
        run: |
222
          uname -a
223
          df -h
224
          ulimit -a
225
          which python
226
          python --version
227
          pip install --upgrade pip build
228
          # Set numpy version first, other packages link against it
229
          if [ "${MINIMUM_REQUIREMENTS}" == "1" ]; then
230
              pip install ${CYTHON_MIN} ${NUMPY_MIN}
231
              if [ "${USE_SCIPY}" == "1" ]; then pip install ${SCIPY_MIN}; fi
232
          else
233
              pip install ${PIP_FLAGS} cython numpy
234
              if [ "${USE_SCIPY}" == "1" ]; then pip install ${PIP_FLAGS} scipy; fi
235
          fi
236
          pip install ${PIP_FLAGS} matplotlib pytest
237

238
            set -o pipefail
239
            if [ "${USE_SDIST}" == "1" ]; then
240
                python -m build --sdist
241
                pip install pywavelets* -v
242
            elif [ "${REFGUIDE_CHECK}" == "1" ]; then
243
                pip install sphinx numpydoc scipy-doctest
244
                pip install . -v
245
            else
246
                pip install . -v
247
            fi
248

249
      - name: Run tests
250
        env:
251
          PIP_FLAGS: ${{ matrix.PIP_FLAGS }}
252
          USE_SDIST: ${{ matrix.USE_SDIST }}
253
          REFGUIDE_CHECK: ${{ matrix.REFGUIDE_CHECK }}
254
        run: |
255
          # Move out of source directory to avoid finding local pywt
256
          pushd demo
257
          if [ "${USE_SDIST}" == "1" ]; then
258
              pytest --pyargs pywt
259
              python ../pywt/tests/test_doc.py
260
          elif [ "${REFGUIDE_CHECK}" == "1" ]; then
261
              # doctests docstrings
262
              pytest --doctest-modules --pyargs pywt -v  --doctest-collect=api
263
              pytest --doctest-modules --pyargs pywt.data -v
264
          else
265
              pytest --pyargs pywt
266
          fi
267
          popd
268

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.