Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working environment for Python 3.9 (pin to !=3.9.0) #885

Merged
merged 18 commits into from
Jan 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/action-conda-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ on:
jobs:

publish:
name: publish / python-3.8 / ubuntu-latest
name: publish / python-3.9 / ubuntu-latest
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: "3.8"
python-version: "3.9"
miniconda-version: "latest"
channels: conda-forge
- name: Show conda config
Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:
fail-fast: false
matrix:
os: ['ubuntu-latest'] # may extent to osx in the future
python-version: ["3.6", "3.7", "3.8"]
python-version: ["3.6", "3.7", "3.8", "3.9"]
runs-on: ${{ matrix.os }}
needs: publish
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/action-install-from-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
runs-on: "ubuntu-latest"
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
python-version: [3.6, 3.7, 3.8, 3.9]
# fail-fast set to False allows all other tests
# in the worflow to run regardless of any fail
fail-fast: false
Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
runs-on: "macos-latest"
strategy:
matrix:
python-version: [3.6, 3.7] # 3.8 not working as of 07-Sep-2020
python-version: [3.6, 3.7] # 3.8 not working as of 07-Sep-2020; 3.9 unchartered
fail-fast: false
name: OSX Python ${{ matrix.python-version }}
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/action-install-from-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
runs-on: "ubuntu-latest"
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
python-version: [3.6, 3.7, 3.8, 3.9]
# fail-fast set to False allows all other tests
# in the worflow to run regardless of any fail
fail-fast: false
Expand Down Expand Up @@ -74,7 +74,7 @@ jobs:
runs-on: "macos-latest"
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
python-version: [3.6, 3.7, 3.8, 3.9]
fail-fast: false
name: OSX Python ${{ matrix.python-version }}
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/action-install-from-source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
runs-on: "ubuntu-latest"
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
python-version: [3.6, 3.7, 3.8, 3.9]
fail-fast: false
name: Linux Python ${{ matrix.python-version }}
steps:
Expand Down Expand Up @@ -71,7 +71,7 @@ jobs:
runs-on: "macos-latest"
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
python-version: [3.6, 3.7, 3.8] # 3.9 don't work yet on 6 Jan 2021
fail-fast: false
name: OSX Python ${{ matrix.python-version }}
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/action-pypi-build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up Python 3.8
- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.8
python-version: 3.9
- name: Install pep517
run: >-
python -m
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/action-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
runs-on: "ubuntu-latest"
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
python-version: [3.6, 3.7, 3.8, 3.9]
fail-fast: false
name: Linux Python ${{ matrix.python-version }}
steps:
Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:
runs-on: "macos-latest"
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
python-version: [3.6, 3.7, 3.8] # 3.9 is still dodgy on 6 Jan 2021
fail-fast: false
name: OSX Python ${{ matrix.python-version }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ dependencies:
- esmpy
- iris>=2.2.1
- graphviz
- python>=3.6,<3.9 # if 3.7 lxml will not import correctly if <4.5.0
- python>=3.6 # if 3.7 lxml will not import correctly if <4.5.0
- python-stratify
- scipy<1.6 # until ESMValGroup/ESMValCore/issues/927 gets resolved
4 changes: 2 additions & 2 deletions package/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ build:
requirements:
build:
- git
- python>=3.6,<3.9
- python>=3.6
# Normally installed via pip:
- pytest-runner
- setuptools_scm
run:
# esmvaltool
- python>=3.6,<3.9
- python>=3.6
- graphviz
- iris>=2.2.1
- python-stratify
Expand Down
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
'install': [
'cf-units',
'dask[array]',
# fiona: 1.8.18/py39, they seem weary to build manylinux wheels
# so we may have to install from conda-forge in the future
'fiona',
'fire',
'nc-time-axis', # needed by iris.plot
Expand Down
32 changes: 23 additions & 9 deletions tests/unit/preprocessor/_regrid_esmpy/test_regrid_esmpy.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
"""Unit tests for the esmvalcore.preprocessor._regrid_esmpy module."""
import sys
from unittest import mock

import cf_units
import iris
import numpy as np
import pytest
from iris.exceptions import CoordinateNotFoundError

import tests
from esmvalcore.preprocessor._regrid_esmpy import (build_regridder,
build_regridder_2d,
coords_iris_to_esmpy,
cube_to_empty_field,
get_grid,
get_grid_representant,
get_grid_representants,
get_representant,
is_lon_circular, regrid)
from esmvalcore.preprocessor._regrid_esmpy import (
build_regridder,
build_regridder_2d,
coords_iris_to_esmpy,
cube_to_empty_field,
get_grid,
get_grid_representant,
get_grid_representants,
get_representant,
is_lon_circular,
regrid,
)


def identity(*args, **kwargs):
Expand Down Expand Up @@ -355,6 +360,9 @@ def test_coords_iris_to_esmpy_2d_non_circular(self):
self.assert_array_equal(esmpy_lon_corners,
self.expected_esmpy_lon_corners)

@pytest.mark.skipif(sys.version_info.major == 3
and sys.version_info.minor == 9,
reason="bug in mock.py for Python 3.9.0 and 3.9.1")
def test_get_grid_circular(self):
"""Test building of ESMF grid from iris cube circular longitude."""
expected_get_coords_calls = [
Expand All @@ -375,6 +383,9 @@ def test_get_grid_circular(self):
mg.add_item.assert_called_once_with(mock.sentinel.gi_mask,
mock.sentinel.sl_center)

@pytest.mark.skipif(sys.version_info.major == 3
and sys.version_info.minor == 9,
reason="bug in mock.py for Python 3.9.0 and 3.9.1")
def test_get_grid_non_circular(self):
"""Test building of ESMF grid from iris cube non circular longitude."""
expected_get_coords_calls = [
Expand Down Expand Up @@ -431,6 +442,9 @@ def test_is_lon_circular_2d_aux_coords_non_circ(self):

@mock.patch('ESMF.Grid', MockGrid)
@mock.patch('ESMF.Field')
@pytest.mark.skipif(sys.version_info.major == 3
and sys.version_info.minor == 9,
reason="bug in mock.py for Python 3.9.0 and 3.9.1")
def test_cube_to_empty_field(self, mock_field):
"""Test building of empty field from iris cube."""
field = cube_to_empty_field(self.cube)
Expand Down