Skip to content

Commit 5f8b451

Browse files
committed
CI: add Python 3.10 and Python 3.11-dev
- adjust # builds for codecov - update SciPy version to 1.7.3 - also test on "macos-latest"; skip test_nan_policy with cobyla - cannot build minimum SciPy/NumPy versions for Python 3.10, so skip - failures with Python 3.11-dev are accepted and will not fail the build
1 parent 1acdeec commit 5f8b451

File tree

3 files changed

+60
-19
lines changed

3 files changed

+60
-19
lines changed

.codecov.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
codecov:
22
token: 11c28e95-6e64-4829-9887-04e4cd661bf6
33
comment:
4-
after_n_builds: 8
4+
after_n_builds: 9
55

66
coverage:
77
status:

azure-pipelines.yml

Lines changed: 55 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ stages:
1515
steps:
1616
- task: UsePythonVersion@0
1717
inputs:
18-
versionSpec: '3.9'
18+
versionSpec: '3.10'
1919
- script: |
2020
python -m pip install --upgrade pip setuptools wheel
2121
pip install pre-commit
@@ -35,7 +35,7 @@ stages:
3535
steps:
3636
- task: UsePythonVersion@0
3737
inputs:
38-
versionSpec: '3.9'
38+
versionSpec: '3.10'
3939
- script: |
4040
python -m pip install --upgrade pip setuptools wheel
4141
pip install -r requirements-dev.txt
@@ -123,6 +123,8 @@ stages:
123123
python.version: '3.8'
124124
Python39:
125125
python.version: '3.9'
126+
Python310:
127+
python.version: '3.10'
126128

127129
steps:
128130
- task: UsePythonVersion@0
@@ -170,8 +172,8 @@ stages:
170172
vmImage: 'windows-latest'
171173
strategy:
172174
matrix:
173-
Python39:
174-
python.version: '3.9'
175+
Python310:
176+
python.version: '3.10'
175177

176178
steps:
177179
- task: UsePythonVersion@0
@@ -196,17 +198,49 @@ stages:
196198
cd doc ; .\make.bat html
197199
displayName: 'Build the HTML documentation'
198200

201+
- stage: test_macOS_latest
202+
dependsOn: check_codestyle
203+
condition: succeededOrFailed()
204+
jobs:
205+
- job:
206+
pool:
207+
vmImage: 'macos-latest'
208+
strategy:
209+
matrix:
210+
Python310:
211+
python.version: '3.10'
212+
213+
steps:
214+
- task: UsePythonVersion@0
215+
inputs:
216+
versionSpec: '$(python.version)'
217+
displayName: 'Use Python $(python.version)'
218+
- script: |
219+
python -m pip install --upgrade pip setuptools wheel
220+
pip install -r requirements-dev.txt
221+
displayName: 'Install latest available version of Python dependencies'
222+
- script: |
223+
python setup.py install
224+
displayName: 'Install lmfit'
225+
- script: |
226+
pip list
227+
displayName: 'List installed Python packages'
228+
- script: |
229+
pip install pytest-azurepipelines
230+
pytest
231+
displayName: 'Run test-suite and collect coverage'
232+
199233
- stage: development_version
200234
dependsOn: check_codestyle
201235
condition: succeededOrFailed()
202236
jobs:
203-
- job: Python310_dev
237+
- job: Python311_dev
204238
pool:
205239
vmImage: 'ubuntu-latest'
206240
steps:
207241
- script: |
208242
sudo add-apt-repository ppa:deadsnakes/nightly
209-
sudo apt-get update && sudo apt-get install -y --no-install-recommends python3.10-dev python3.10-distutils
243+
sudo apt-get update && sudo apt-get install -y --no-install-recommends python3.11-dev python3.11-distutils
210244
displayName: Install Python development version from the deadsnakes PPA
211245
- script: |
212246
sudo apt-get update && sudo apt-get install -yq --no-install-suggests --no-install-recommends \
@@ -216,40 +250,44 @@ stages:
216250
- script: |
217251
export PATH=/home/vsts/.local/bin:$PATH
218252
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
219-
python3.10 get-pip.py --user
220-
pip3.10 install -U pip setuptools wheel pybind11 cython pythran
221-
displayName: 'Install pip, setuptools, wheel, pybind11, cython, and pythran'
253+
python3.11 get-pip.py --user
254+
pip3.11 install -U pip setuptools wheel pybind11 cython || echo -e "\043#vso[task.logissue type=warning;] Allowed failure for development version!!"
255+
displayName: 'Install pip, setuptools, wheel, pybind11, and cython'
222256
- script: |
223257
export PATH=/home/vsts/.local/bin:$PATH
224-
export numpy_version=1.21.3
258+
export numpy_version=1.21.4
225259
wget https://github.com/numpy/numpy/releases/download/v${numpy_version}/numpy-${numpy_version}.tar.gz
226260
tar xzvf numpy-${numpy_version}.tar.gz
227261
cd numpy-${numpy_version}
228-
python3.10 setup.py install --user
262+
python3.11 setup.py install --user || echo -e "\043#vso[task.logissue type=warning;] Allowed failure for development version!!"
229263
displayName: 'Install latest available version of NumPy'
230264
- script: |
231265
export PATH=/home/vsts/.local/bin:$PATH
232-
export scipy_version=1.7.1
266+
pip3.11 install -U pythran || echo -e "\043#vso[task.logissue type=warning;] Allowed failure for development version!!"
267+
displayName: 'Install pythran'
268+
- script: |
269+
export PATH=/home/vsts/.local/bin:$PATH
270+
export scipy_version=1.7.3
233271
wget https://github.com/scipy/scipy/releases/download/v${scipy_version}/scipy-${scipy_version}.tar.gz
234272
tar xzvf scipy-${scipy_version}.tar.gz
235273
cd scipy-${scipy_version}
236-
python3.10 setup.py install --user
274+
python3.11 setup.py install --user || echo -e "\043#vso[task.logissue type=warning;] Allowed failure for development version!!"
237275
displayName: 'Install latest available version of SciPy'
238276
- script: |
239277
export PATH=/home/vsts/.local/bin:$PATH
240278
# remove numdifftools for now as it pulls in statsmodels, that wants to build with NumPy 1.14.5
241-
pip3.10 install asteval uncertainties dill emcee flaky pytest pytest-cov
279+
pip3.11 install asteval uncertainties dill emcee flaky pytest pytest-cov || echo -e "\043#vso[task.logissue type=warning;] Allowed failure for development version!!"
242280
displayName: 'Install latest available version of Python dependencies'
243281
- script: |
244-
python3.10 setup.py install --user
282+
python3.11 setup.py install --user || echo -e "\043#vso[task.logissue type=warning;] Allowed failure for development version!!"
245283
displayName: 'Install lmfit'
246284
- script: |
247285
export PATH=/home/vsts/.local/bin:$PATH
248-
pip3.10 list
286+
pip3.11 list
249287
displayName: 'List installed Python packages'
250288
- script: |
251289
export PATH=/home/vsts/.local/bin:$PATH
252-
pip3.10 install pytest-azurepipelines
290+
pip3.11 install pytest-azurepipelines
253291
cd $(Agent.BuildDirectory)/s/tests
254292
pytest || echo -e "\043#vso[task.logissue type=warning;] Allowed failure for development version!!"
255293
displayName: 'Run test-suite'

tests/test_nose.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import sys
12
import unittest
23

34
import numpy as np
@@ -397,7 +398,9 @@ def test_nan_policy(self):
397398
self.data[0] = np.nan
398399

399400
for method in SCALAR_METHODS:
400-
if method == 'differential_evolution':
401+
if method == 'cobyla' and sys.platform == 'darwin':
402+
pytest.xfail("this aborts Python on macOS...")
403+
elif method == 'differential_evolution':
401404
pytest.raises(RuntimeError, self.mini.scalar_minimize,
402405
SCALAR_METHODS[method])
403406
else:

0 commit comments

Comments
 (0)