scikit-image

Форк
0
/
azure-pipelines.yml 
227 строк · 8.0 Кб
1
# Azure Pipelines configuration file for Continuous Integration
2
# for building the package and running the tests under Windows.
3
variables:
4
  PIP_CACHE_DIR: $(Pipeline.Workspace)/.pip
5
  # data cache dir determined via: print(pooch.os_cache('scikit-image'))
6
  SKIMAGE_DATA_CACHE_FOLDER: C:\Users\VssAdministrator\AppData\Local\scikit-image\scikit-image\Cache
7

8
jobs:
9
  - job: "Default"
10
    pool:
11
      vmImage: "windows-latest"
12
    strategy:
13
      maxParallel: 10
14
      matrix:
15
        Python312-x64:
16
          PYTHON_VERSION: "3.12"
17
          ARCH: "x64"
18
        Python312-x64-pre:
19
          PYTHON_VERSION: "3.12"
20
          ARCH: "x64"
21
          PIP_FLAGS: "--pre"
22
        Python311-x64-docs:
23
          PYTHON_VERSION: "3.11"
24
          ARCH: "x64"
25
          BUILD_DOCS: "true"
26
        Python311-x64-gallery:
27
          PYTHON_VERSION: "3.11"
28
          ARCH: "x64"
29
          TEST_EXAMPLES: "true"
30
        Python310-x64:
31
          PYTHON_VERSION: "3.10"
32
          ARCH: "x64"
33
        Python39-x64:
34
          PYTHON_VERSION: "3.9"
35
          ARCH: "x64"
36
    continueOnError: false
37
    timeoutInMinutes: 60
38

39
    steps:
40
      - task: UsePythonVersion@0
41
        inputs:
42
          versionSpec: "$(PYTHON_VERSION)"
43
          architecture: "$(ARCH)"
44
        name: python
45

46
      # https://docs.microsoft.com/en-us/azure/devops/pipelines/release/caching?view=azure-devops
47
      - task: Cache@2
48
        inputs:
49
          key: '"skimage_data" | skimage/data/_registry.py'
50
          path: $(SKIMAGE_DATA_CACHE_FOLDER)
51
        displayName: Cache scikit-image data files
52
        # the line below (continueOnError: true) can be removed when the following issue is addressed:
53
        # https://github.com/scikit-image/scikit-image/issues/6048
54
        continueOnError: true
55

56
      # https://docs.microsoft.com/en-us/azure/devops/pipelines/release/caching?view=azure-devops#pythonpip
57
      - task: Cache@2
58
        inputs:
59
          key: '"Python$(PYTHON_VERSION)-$(ARCH)" | "$(Agent.OS)" | requirements/build.txt | requirements/default.txt | requirements/test.txt | requirements/docs.txt'
60
          restoreKeys: |
61
            "Python$(PYTHON_VERSION)-$(ARCH)" | "$(Agent.OS)"
62
            "Python$(PYTHON_VERSION)-$(ARCH)"
63
          path: $(PIP_CACHE_DIR)
64
        displayName: Cache pip packages
65
        # the line below (continueOnError: true) can be removed when the following issue is addressed:
66
        # https://github.com/scikit-image/scikit-image/issues/6048
67
        continueOnError: true
68

69
      - bash: |
70
          set -ex
71
          PYTHON="$(python.pythonLocation)\\python.exe"
72

73
          # Update pip
74
          $PYTHON -m pip install -U pip
75

76
          # Check that we have the expected version and architecture for Python
77
          $PYTHON --version
78
          $PYTHON -m pip --version
79
          $PYTHON -c "import struct; print('Void pointer width is', struct.calcsize('P') * 8)"
80

81
          # print out the pip cache dir followed by the variable defined above
82
          # to confirm that they match
83
          $PYTHON -m pip cache dir
84
          echo "PIP_CACHE_DIR: $PIP_CACHE_DIR"
85

86
          # Install the build and runtime dependencies of the project
87
          $PYTHON -m pip install ${PIP_FLAGS} -r requirements/build.txt
88
          $PYTHON -m pip list
89

90
          # Disable C99 complex if PyWavelets needs to be built from source.
91
          # The compiler used will be MSVC, but C99 may be detected improperly
92
          USE_C99_COMPLEX=0 $PYTHON -m pip install ${PIP_FLAGS} -r requirements/default.txt
93

94
          $PYTHON -m pip list
95
        displayName: "Pre-installation"
96

97
      - bash: |
98
          set -ex
99
          PYTHON="$(python.pythonLocation)\\python.exe"
100
          if [ "$(ARCH)" = "x86" ] ; then
101
              export CXXFLAGS="-m32"
102
          fi
103

104
          ## To list all installed packages:
105
          choco list
106

107
          # Remove other gcc compilers
108

109
          ## This would be the best way to uninstall, but is SLOW:
110
          # choco uninstall llvm mingw rtools strawberryperl -x
111

112
          # Remove mingw gcc
113
          #rm /c/ProgramData/Chocolatey/bin/gcc
114
          #rm /c/ProgramData/Chocolatey/bin/g++
115
          #rm /c/ProgramData/Chocolatey/bin/c++
116
          # Remove perl gcc
117
          rm -rf /c/Strawberry
118

119
          which ccache || true
120
          which c++ || true
121

122
          ## Uncomment the next line, and you'll remain with only MSVC.
123
          # rm -rf "/c/Program Files/LLVM"
124
          ## We're compiling with clang for now because MSVC 19 and
125
          ## Pythran don't play well together.
126

127
          which clang || true
128

129
          # Compile the package and build the wheel
130
          $PYTHON -m build --no-isolation --skip-dependency-check --wheel
131

132
          # Install the generated wheel package
133
          ls dist
134
          $PYTHON -m pip install ${PIP_FLAGS} --no-index --find-links dist/ scikit-image
135
        displayName: "Installation"
136

137
      - bash: |
138
          set -ex
139
          PYTHON="$(python.pythonLocation)\\python.exe"
140

141
          # Install the test dependencies
142
          $PYTHON -m pip install ${PIP_FLAGS} -r requirements/test.txt
143
          $PYTHON -m pip list
144

145
          # Set non-UI Matplotlib backend
146
          cd ${AGENT_BUILDDIRECTORY}  # D:\a\1
147
          echo "backend : Agg" > matplotlibrc
148
        displayName: "Pre-testing"
149

150
      - bash: |
151
          set -ex
152
          PYTHON="$(python.pythonLocation)\\python.exe"
153

154
          # Change the working directory in order to run the tests
155
          # on the installed version of skimage
156
          cd ${AGENT_BUILDDIRECTORY}  # D:\a\1
157

158
          # Show the info about the installed scikit-image
159
          $PYTHON -c "import skimage; print(skimage.__path__)"
160

161
          # Show the path pooch is using for the data cache
162
          # (this should match the SKIMAGE_DATA_CACHE_FOLDER variable above)
163
          $PYTHON -c "import pooch; print(pooch.os_cache('scikit-image'))"
164
          echo "SKIMAGE_DATA_CACHE_FOLDER: $SKIMAGE_DATA_CACHE_FOLDER"
165

166
          # Force matplotlib to use the prepared config
167
          export MATPLOTLIBRC=${AGENT_BUILDDIRECTORY}
168

169
          # Run unit tests with pytest
170
          # We don't test docstring examples (--doctest-plus) on
171
          # Windows due to inconsistent ndarray formatting in `numpy`.
172
          # For more details, see https://github.com/numpy/numpy/issues/13468
173
          export TEST_ARGS="-v --cov=skimage"
174
          $PYTHON -m pytest ${TEST_ARGS} --pyargs skimage
175
        displayName: "Package testing"
176

177
      - bash: |
178
          set -ex
179
          PYTHON="$(python.pythonLocation)\\python.exe"
180
          $PYTHON -m asv check -v -E existing
181
        displayName: Check benchmarks
182

183
      - bash: |
184
          set -ex
185
          export PYTHON="$(python.pythonLocation)\\python.exe"
186

187
          # Install the doc dependencies
188
          $PYTHON -m pip install ${PIP_FLAGS} -r requirements/docs.txt
189
          $PYTHON -m pip list
190

191
          # Build the documentation
192
          choco install optipng
193
          export SPHINXCACHE=${AGENT_BUILDDIRECTORY}/.cache/sphinx
194
          export SPHINXOPTS=-W
195
          make -C doc html
196
        condition: eq(variables['BUILD_DOCS'], 'true')
197
        displayName: "Documentation testing"
198

199
      - bash: |
200
          set -ex
201
          PYTHON="$(python.pythonLocation)\\python.exe"
202

203
          # Install the doc dependencies
204
          $PYTHON -m pip install ${PIP_FLAGS} -r requirements/docs.txt
205
          $PYTHON -m pip list
206

207
          # Force matplotlib to use the prepared config
208
          export MATPLOTLIBRC=${AGENT_BUILDDIRECTORY}
209

210
          # Run example applications
211
          for f in doc/examples/*/*.py; do
212
            # Comment out any plotly.io.show() calls before running the example.
213
            # Plotly opens a web browser, which often seemed to cause the CI to
214
            # hang and timeout.
215
            sed -i 's/plotly.io.show/# plotly.io.show/g' ${f}
216

217
            $PYTHON -W ignore:Matplotlib:UserWarning "${f}"
218
            if [ $? -ne 0 ]; then
219
              exit 1
220
            fi
221
          done
222
        condition: eq(variables['TEST_EXAMPLES'], 'true')
223
        displayName: "Gallery testing"
224
#  - bash: |
225
#      # -- Publish the .whl artifacts
226
#      # -- Upload the content of dist/*.whl to a public wheelhouse
227
#    displayName: 'Further consideration'
228

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

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

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

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