Skip to content

Commit 713c893

Browse files
committed
try out what happens if we copy all of xarray's azure configuration
1 parent c14e2c1 commit 713c893

13 files changed

+548
-32
lines changed

azure-pipelines.yml

Lines changed: 81 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,58 @@
1-
# Python package
2-
# Create and test a Python package on multiple Python versions.
3-
# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more:
4-
# https://docs.microsoft.com/azure/devops/pipelines/languages/python
5-
6-
trigger:
7-
- master
1+
variables:
2+
pytest_extra_flags: ''
3+
allow_failure: false
4+
upstream_dev: false
85

96
jobs:
7+
108
- job: Linux
9+
strategy:
10+
matrix:
11+
py36-bare-minimum:
12+
conda_env: py36-bare-minimum
13+
py36-min-all-deps:
14+
conda_env: py36-min-all-deps
15+
py36-min-nep18:
16+
conda_env: py36-min-nep18
17+
py36:
18+
conda_env: py36
19+
py37:
20+
conda_env: py37
21+
py38:
22+
conda_env: py38
23+
py38-all-but-dask:
24+
conda_env: py38-all-but-dask
25+
py38-upstream-dev:
26+
conda_env: py38
27+
upstream_dev: true
28+
py38-flaky:
29+
conda_env: py38
30+
pytest_extra_flags: --run-flaky --run-network-tests
31+
allow_failure: true
1132
pool:
1233
vmImage: 'ubuntu-16.04'
34+
steps:
35+
- template: ci/azure/unit-tests.yml
36+
37+
- job: MacOSX
1338
strategy:
1439
matrix:
15-
Python36:
16-
python.version: '3.6'
17-
Python37:
18-
python.version: '3.7'
19-
Python38:
20-
python.version: '3.8'
21-
40+
py38:
41+
conda_env: py38
42+
pool:
43+
vmImage: 'macOS-10.15'
2244
steps:
23-
- task: UsePythonVersion@0
24-
inputs:
25-
versionSpec: '$(python.version)'
26-
displayName: 'Use Python $(python.version)'
27-
28-
- script: |
29-
python -m pip install --upgrade pip
30-
pip install -r requirements.txt
31-
displayName: 'Install dependencies'
32-
33-
- script: |
34-
pip install pytest pytest-azurepipelines pytest-cov
35-
pytest --verbose --cov=./ --cov-report=xml
36-
displayName: 'pytest'
45+
- template: ci/azure/unit-tests.yml
3746

38-
- script: |
39-
curl https://codecov.io/bash > codecov.sh
40-
bash codecov.sh -t aba016f6-96be-4bc3-bdbe-caa6b6aff815
41-
displayName: 'Upload coverage to codecov.io'
47+
- job: Windows
48+
strategy:
49+
matrix:
50+
py37:
51+
conda_env: py37-windows
52+
pool:
53+
vmImage: 'vs2017-win2016'
54+
steps:
55+
- template: ci/azure/unit-tests.yml
4256

4357
- job: LintFlake8
4458
pool:
@@ -59,3 +73,38 @@ jobs:
5973
displayName: Install black
6074
- bash: black --check .
6175
displayName: black formatting check
76+
77+
- job: TypeChecking
78+
variables:
79+
conda_env: py38
80+
pool:
81+
vmImage: 'ubuntu-16.04'
82+
steps:
83+
- template: ci/azure/install.yml
84+
- bash: |
85+
source activate xarray-tests
86+
mypy .
87+
displayName: mypy type checks
88+
89+
- job: isort
90+
variables:
91+
conda_env: py38
92+
pool:
93+
vmImage: 'ubuntu-16.04'
94+
steps:
95+
- template: ci/azure/install.yml
96+
- bash: |
97+
source activate xarray-tests
98+
isort -rc --check .
99+
displayName: isort formatting checks
100+
101+
- job: MinimumVersionsPolicy
102+
pool:
103+
vmImage: 'ubuntu-16.04'
104+
steps:
105+
- template: ci/azure/add-conda-to-path.yml
106+
- bash: |
107+
conda install -y pyyaml
108+
python ci/min_deps_check.py ci/requirements/py36-bare-minimum.yml
109+
python ci/min_deps_check.py ci/requirements/py36-min-all-deps.yml
110+
displayName: minimum versions policy

ci/azure/add-conda-to-path.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# https://docs.microsoft.com/en-us/azure/devops/pipelines/languages/anaconda
2+
steps:
3+
4+
- bash: |
5+
echo "##vso[task.prependpath]$CONDA/bin"
6+
displayName: Add conda to PATH (Linux)
7+
condition: eq(variables['Agent.OS'], 'Linux')
8+
9+
- bash: |
10+
echo "##vso[task.prependpath]$CONDA/bin"
11+
sudo chown -R $USER $CONDA
12+
displayName: Add conda to PATH (OS X)
13+
condition: eq(variables['Agent.OS'], 'Darwin')
14+
15+
- powershell: |
16+
Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
17+
displayName: Add conda to PATH (Windows)
18+
condition: eq(variables['Agent.OS'], 'Windows_NT')

ci/azure/install.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
parameters:
2+
env_file: ci/requirements/$CONDA_ENV.yml
3+
4+
steps:
5+
6+
- template: add-conda-to-path.yml
7+
8+
- bash: |
9+
conda update -y conda
10+
conda env create -n xarray-tests --file ${{ parameters.env_file }}
11+
displayName: Install conda dependencies
12+
13+
# TODO: add sparse back in, once Numba works with the development version of
14+
# NumPy again: https://github.com/pydata/xarray/issues/4146
15+
- bash: |
16+
source activate xarray-tests
17+
conda uninstall -y --force \
18+
numpy \
19+
scipy \
20+
pandas \
21+
matplotlib \
22+
dask \
23+
distributed \
24+
zarr \
25+
cftime \
26+
rasterio \
27+
pint \
28+
bottleneck \
29+
sparse
30+
python -m pip install \
31+
-i https://pypi.anaconda.org/scipy-wheels-nightly/simple \
32+
--no-deps \
33+
--pre \
34+
--upgrade \
35+
numpy \
36+
scipy \
37+
pandas
38+
python -m pip install \
39+
-f https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com \
40+
--no-deps \
41+
--pre \
42+
--upgrade \
43+
matplotlib
44+
python -m pip install \
45+
--no-deps \
46+
--upgrade \
47+
git+https://github.com/dask/dask \
48+
git+https://github.com/dask/distributed \
49+
git+https://github.com/zarr-developers/zarr \
50+
git+https://github.com/Unidata/cftime \
51+
git+https://github.com/mapbox/rasterio \
52+
git+https://github.com/hgrecco/pint \
53+
git+https://github.com/pydata/bottleneck
54+
condition: eq(variables['UPSTREAM_DEV'], 'true')
55+
displayName: Install upstream dev dependencies
56+
57+
- bash: |
58+
source activate xarray-tests
59+
python -m pip install --no-deps -e .
60+
displayName: Install xarray
61+
62+
- bash: |
63+
source activate xarray-tests
64+
conda info -a
65+
conda list
66+
python xarray/util/print_versions.py
67+
displayName: Version info

ci/azure/unit-tests.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
steps:
2+
3+
- template: install.yml
4+
5+
- bash: |
6+
source activate xarray-tests
7+
python -OO -c "import xarray"
8+
displayName: Import xarray
9+
10+
# Work around for allowed test failures:
11+
# https://github.com/microsoft/azure-pipelines-tasks/issues/9302
12+
- bash: |
13+
source activate xarray-tests
14+
pytest \
15+
--junitxml=junit/test-results.xml \
16+
--cov=xarray \
17+
--cov-report=xml \
18+
$(pytest_extra_flags) || [ "$ALLOW_FAILURE" = "true" ]
19+
displayName: Run tests
20+
21+
- bash: |
22+
curl https://codecov.io/bash > codecov.sh
23+
bash codecov.sh -t 688f4d53-31bb-49b5-8370-4ce6f792cf3d
24+
displayName: Upload coverage to codecov.io
25+
26+
# TODO: publish coverage results to Azure, once we can merge them across
27+
# multiple jobs: https://stackoverflow.com/questions/56776185
28+
29+
- task: PublishTestResults@2
30+
condition: succeededOrFailed()
31+
inputs:
32+
testResultsFiles: '**/test-*.xml'
33+
failTaskOnFailedTests: false
34+
testRunTitle: '$(Agent.JobName)'

ci/requirements/doc.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: xarray-docs
2+
channels:
3+
# Don't change to pkgs/main, as it causes random timeouts in readthedocs
4+
- conda-forge
5+
dependencies:
6+
- python=3.8
7+
- bottleneck
8+
- cartopy
9+
- cfgrib>=0.9
10+
- dask>=2.10
11+
- h5netcdf>=0.7.4
12+
- ipykernel
13+
- ipython
14+
- iris>=2.3
15+
- jupyter_client
16+
- nbsphinx
17+
- netcdf4>=1.5
18+
- numba
19+
- numpy>=1.17
20+
- pandas>=1.0
21+
- rasterio>=1.1
22+
- seaborn
23+
- setuptools
24+
- sphinx>=2.3
25+
- sphinx_rtd_theme>=0.4
26+
- zarr>=2.4

ci/requirements/py36-bare-minimum.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: xarray-tests
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- python=3.6
6+
- coveralls
7+
- pip
8+
- pytest
9+
- pytest-cov
10+
- pytest-env
11+
- numpy=1.15
12+
- pandas=0.25
13+
- setuptools=41.2

ci/requirements/py36-min-all-deps.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: xarray-tests
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
# MINIMUM VERSIONS POLICY: see doc/installing.rst
6+
# Run ci/min_deps_check.py to verify that this file respects the policy.
7+
# When upgrading python, numpy, or pandas, must also change
8+
# doc/installing.rst and setup.py.
9+
- python=3.6
10+
- black
11+
- boto3=1.9
12+
- bottleneck=1.2
13+
- cartopy=0.17
14+
- cdms2=3.1
15+
- cfgrib=0.9
16+
- cftime=1.0
17+
- coveralls
18+
- dask=2.5
19+
- distributed=2.5
20+
- flake8
21+
- h5netcdf=0.7
22+
- h5py=2.9 # Policy allows for 2.10, but it's a conflict-fest
23+
- hdf5=1.10
24+
- hypothesis
25+
- iris=2.2
26+
- isort
27+
- lxml=4.4 # Optional dep of pydap
28+
- matplotlib=3.1
29+
- msgpack-python=0.6 # remove once distributed is bumped. distributed GH3491
30+
- mypy=0.761 # Must match .pre-commit-config.yaml
31+
- nc-time-axis=1.2
32+
- netcdf4=1.4
33+
- numba=0.44
34+
- numpy=1.15
35+
- pandas=0.25
36+
# - pint # See py36-min-nep18.yml
37+
- pip
38+
- pseudonetcdf=3.0
39+
- pydap=3.2
40+
- pynio=1.5
41+
- pytest
42+
- pytest-cov
43+
- pytest-env
44+
- rasterio=1.0
45+
- scipy=1.3
46+
- seaborn=0.9
47+
- setuptools=41.2
48+
# - sparse # See py36-min-nep18.yml
49+
- toolz=0.10
50+
- zarr=2.3
51+
- pip:
52+
- numbagg==0.1

ci/requirements/py36-min-nep18.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: xarray-tests
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
# Optional dependencies that require NEP18, such as sparse and pint,
6+
# require drastically newer packages than everything else
7+
- python=3.6
8+
- coveralls
9+
- dask=2.5
10+
- distributed=2.5
11+
- msgpack-python=0.6 # remove once distributed is bumped. distributed GH3491
12+
- numpy=1.17
13+
- pandas=0.25
14+
- pip
15+
- pytest
16+
- pytest-cov
17+
- pytest-env
18+
- scipy=1.2
19+
- setuptools=41.2
20+
- sparse=0.8
21+
- pip:
22+
- pint==0.13

0 commit comments

Comments
 (0)