From 1cae476896cfbfadd02148f2f70eb86d6567f0d7 Mon Sep 17 00:00:00 2001 From: muryanto1 Date: Wed, 6 May 2020 12:47:33 -0700 Subject: [PATCH 1/5] upload from branch --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c14ca0f..8fa9939 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -52,9 +52,9 @@ aliases: - &conda_upload name: conda_upload command: | - if [[ $CIRCLE_BRANCH != "master" ]]; then - exit 0 - fi + #if [[ $CIRCLE_BRANCH != "master" ]]; then + # exit 0 + #fi source $WORKDIR/miniconda/etc/profile.d/conda.sh conda activate base UPLOAD_OPTIONS="-t $CONDA_UPLOAD_TOKEN upload -u $USER -l $LABEL" From ffc93634014d838e9747a2c888bd4089d9fd7656 Mon Sep 17 00:00:00 2001 From: muryanto1 Date: Fri, 8 May 2020 16:13:39 -0700 Subject: [PATCH 2/5] add running tests with nompi packages and mpich packages --- .circleci/config.yml | 225 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 190 insertions(+), 35 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8fa9939..1521a6c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -37,7 +37,8 @@ aliases: command: | source $WORKDIR/miniconda/etc/profile.d/conda.sh conda activate base - conda create -y -n $ENV_NAME --use-local $CHANNELS "$CONDA_PY_VER" $PKG_NAME $PKGS $COVERAGE_PKGS + echo "conda create -y -n $ENV_NAME --use-local $CHANNELS \"$CONDA_PY_VER\" $PKG_NAME $PKGS $COVERAGE_PKGS \"$LIBNETCDF\"" + conda create -y -n $ENV_NAME --use-local $CHANNELS "$CONDA_PY_VER" $PKG_NAME $PKGS $COVERAGE_PKGS "$LIBNETCDF" conda activate $ENV_NAME conda list @@ -69,7 +70,10 @@ aliases: conda deactivate jobs: - macos_setup: + # + # setup_miniconda, rerender and build -- 'cdutil' is noarch + # + macos_build: macos: xcode: "11.4.0" environment: @@ -88,7 +92,7 @@ jobs: paths: - macos_build - linux_setup: + linux_build: machine: image: circleci/classic:latest environment: @@ -107,15 +111,18 @@ jobs: paths: - linux_build - macos_cdutil_py36: + # + # run tests with libnetcdf nompi + # + macos_cdutil_nompi_py36: macos: xcode: "11.4.0" environment: WORKDIR: /Users/distiller/project/macos_build PKG_NAME: "cdutil" - REPO_NAME: "cdutil" ENV_NAME: "test_cdutil" CONDA_PY_VER: "python>=3.6,<3.7" + LIBNETCDF: "libnetcdf=*=nompi_*" steps: - checkout - attach_workspace: @@ -126,15 +133,15 @@ jobs: path: tests_html destination: tests_html - macos_cdutil_py37: + macos_cdutil_nompi_py37: macos: xcode: "11.4.0" environment: WORKDIR: /Users/distiller/project/macos_build PKG_NAME: "cdutil" - REPO_NAME: "cdutil" ENV_NAME: "test_cdutil" CONDA_PY_VER: "python>=3.7,<3.8" + LIBNETCDF: "libnetcdf=*=nompi_*" steps: - checkout - attach_workspace: @@ -145,15 +152,15 @@ jobs: path: tests_html destination: tests_html - macos_cdutil_py38: + macos_cdutil_nompi_py38: macos: xcode: "11.4.0" environment: WORKDIR: /Users/distiller/project/macos_build PKG_NAME: "cdutil" - REPO_NAME: "cdutil" ENV_NAME: "test_cdutil" CONDA_PY_VER: "python>=3.8,<3.9" + LIBNETCDF: "libnetcdf=*=nompi_*" steps: - checkout - attach_workspace: @@ -164,15 +171,15 @@ jobs: path: tests_html destination: tests_html - linux_cdutil_py36: + linux_cdutil_nompi_py36: machine: image: circleci/classic:latest environment: WORKDIR: /home/circleci/project/linux_build PKG_NAME: "cdutil" - REPO_NAME: "cdutil" ENV_NAME: "test_cdutil" CONDA_PY_VER: "python>=3.6,<3.7" + LIBNETCDF: "libnetcdf=*=nompi_*" steps: - checkout - attach_workspace: @@ -183,15 +190,15 @@ jobs: path: tests_html destination: tests_html - linux_cdutil_py37: + linux_cdutil_nompi_py37: machine: image: circleci/classic:latest environment: WORKDIR: /home/circleci/project/linux_build PKG_NAME: "cdutil" - REPO_NAME: "cdutil" ENV_NAME: "test_cdutil" CONDA_PY_VER: "python>=3.7,<3.8" + LIBNETCDF: "libnetcdf=*=nompi_*" COVERAGE: "-c tests/coverage.json --coverage-from-egg" COVERAGE_PKGS: "coverage coveralls" steps: @@ -205,15 +212,135 @@ jobs: path: tests_html destination: tests_html - linux_cdutil_py38: + linux_cdutil_nompi_py38: machine: image: circleci/classic:latest environment: WORKDIR: /home/circleci/project/linux_build PKG_NAME: "cdutil" - REPO_NAME: "cdutil" ENV_NAME: "test_cdutil" CONDA_PY_VER: "python>=3.8,<3.9" + LIBNETCDF: "libnetcdf=*=nompi_*" + steps: + - checkout + - attach_workspace: + at: . + - run: *setup_run_tests + - run: *run_tests + - store_artifacts: + path: tests_html + destination: tests_html + + # + # run tests with libnetcdf mpich + # + macos_cdutil_mpich_py36: + macos: + xcode: "11.4.0" + environment: + WORKDIR: /Users/distiller/project/macos_build + PKG_NAME: "cdutil" + ENV_NAME: "test_cdutil" + CONDA_PY_VER: "python>=3.6,<3.7" + LIBNETCDF: "libnetcdf=*=mpi_mpich_*" + steps: + - checkout + - attach_workspace: + at: . + - run: *setup_run_tests + - run: *run_tests + - store_artifacts: + path: tests_html + destination: tests_html + + macos_cdutil_mpich_py37: + macos: + xcode: "11.4.0" + environment: + WORKDIR: /Users/distiller/project/macos_build + PKG_NAME: "cdutil" + ENV_NAME: "test_cdutil" + CONDA_PY_VER: "python>=3.7,<3.8" + LIBNETCDF: "libnetcdf=*=mpi_mpich_*" + steps: + - checkout + - attach_workspace: + at: . + - run: *setup_run_tests + - run: *run_tests + - store_artifacts: + path: tests_html + destination: tests_html + + macos_cdutil_mpich_py38: + macos: + xcode: "11.4.0" + environment: + WORKDIR: /Users/distiller/project/macos_build + PKG_NAME: "cdutil" + ENV_NAME: "test_cdutil" + CONDA_PY_VER: "python>=3.8,<3.9" + LIBNETCDF: "libnetcdf=*=mpi_mpich_*" + steps: + - checkout + - attach_workspace: + at: . + - run: *setup_run_tests + - run: *run_tests + - store_artifacts: + path: tests_html + destination: tests_html + + linux_cdutil_mpich_py36: + machine: + image: circleci/classic:latest + environment: + WORKDIR: /home/circleci/project/linux_build + PKG_NAME: "cdutil" + ENV_NAME: "test_cdutil" + CONDA_PY_VER: "python>=3.6,<3.7" + LIBNETCDF: "libnetcdf=*=mpi_mpich_*" + steps: + - checkout + - attach_workspace: + at: . + - run: *setup_run_tests + - run: *run_tests + - store_artifacts: + path: tests_html + destination: tests_html + + linux_cdutil_mpich_py37: + machine: + image: circleci/classic:latest + environment: + WORKDIR: /home/circleci/project/linux_build + PKG_NAME: "cdutil" + ENV_NAME: "test_cdutil" + CONDA_PY_VER: "python>=3.7,<3.8" + LIBNETCDF: "libnetcdf=*=mpi_mpich_*" + COVERAGE: "-c tests/coverage.json --coverage-from-egg" + COVERAGE_PKGS: "coverage coveralls" + steps: + - checkout + - attach_workspace: + at: . + - run: *setup_run_tests + - run: *run_tests + - run: *run_coveralls + - store_artifacts: + path: tests_html + destination: tests_html + + linux_cdutil_mpich_py38: + machine: + image: circleci/classic:latest + environment: + WORKDIR: /home/circleci/project/linux_build + PKG_NAME: "cdutil" + ENV_NAME: "test_cdutil" + CONDA_PY_VER: "python>=3.8,<3.9" + LIBNETCDF: "libnetcdf=*=mpi_mpich_*" steps: - checkout - attach_workspace: @@ -243,31 +370,59 @@ workflows: version: 2 cdutil: jobs: - - macos_setup - - linux_setup - - macos_cdutil_py36: + - macos_build + - linux_build + - macos_cdutil_nompi_py36: requires: - - macos_setup - - macos_cdutil_py37: + - macos_build + - macos_cdutil_nompi_py37: requires: - - macos_setup - - macos_cdutil_py38: + - macos_build + - macos_cdutil_nompi_py38: requires: - - macos_setup - - linux_cdutil_py36: + - macos_build + - linux_cdutil_nompi_py36: requires: - - linux_setup - - linux_cdutil_py37: + - linux_build + - linux_cdutil_nompi_py37: requires: - - linux_setup - - linux_cdutil_py38: + - linux_build + - linux_cdutil_nompi_py38: requires: - - linux_setup + - linux_build + + - macos_cdutil_mpich_py36: + requires: + - macos_build + - macos_cdutil_mpich_py37: + requires: + - macos_build + - macos_cdutil_mpich_py38: + requires: + - macos_build + - linux_cdutil_mpich_py36: + requires: + - linux_build + - linux_cdutil_mpich_py37: + requires: + - linux_build + - linux_cdutil_mpich_py38: + requires: + - linux_build + - upload: requires: - - macos_cdutil_py36 - - macos_cdutil_py37 - - macos_cdutil_py38 - - linux_cdutil_py36 - - linux_cdutil_py37 - - linux_cdutil_py38 + - macos_cdutil_nompi_py36 + - macos_cdutil_nompi_py37 + - macos_cdutil_nompi_py38 + - linux_cdutil_nompi_py36 + - linux_cdutil_nompi_py37 + - linux_cdutil_nompi_py38 + + - macos_cdutil_mpich_py36 + - macos_cdutil_mpich_py37 + - macos_cdutil_mpich_py38 + - linux_cdutil_mpich_py36 + - linux_cdutil_mpich_py37 + - linux_cdutil_mpich_py38 + From 471167faa109e48b52527fa58712541d60c6b43e Mon Sep 17 00:00:00 2001 From: muryanto1 Date: Thu, 21 May 2020 16:30:47 -0700 Subject: [PATCH 3/5] updated circleci workflow so that upload will only run if it satisfies the filter (branch) --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1521a6c..2e511d2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -53,9 +53,6 @@ aliases: - &conda_upload name: conda_upload command: | - #if [[ $CIRCLE_BRANCH != "master" ]]; then - # exit 0 - #fi source $WORKDIR/miniconda/etc/profile.d/conda.sh conda activate base UPLOAD_OPTIONS="-t $CONDA_UPLOAD_TOKEN upload -u $USER -l $LABEL" @@ -425,4 +422,7 @@ workflows: - linux_cdutil_mpich_py36 - linux_cdutil_mpich_py37 - linux_cdutil_mpich_py38 + filters: + branches: + only: master From 42c83ccbdd010ddc0b386acb94ee4cfeed023b0b Mon Sep 17 00:00:00 2001 From: muryanto1 Date: Thu, 21 May 2020 17:30:31 -0700 Subject: [PATCH 4/5] fixed flake8 (3.8.1) failures --- cdutil/create_landsea_mask.py | 1 - cdutil/region.py | 1 - cdutil/sftbyrgn.py | 1 - cdutil/times.py | 3 +-- cdutil/vertical.py | 1 - tests/test_cdutil_flake8.py | 2 +- 6 files changed, 2 insertions(+), 7 deletions(-) diff --git a/cdutil/create_landsea_mask.py b/cdutil/create_landsea_mask.py index 062eb84..93a5469 100644 --- a/cdutil/create_landsea_mask.py +++ b/cdutil/create_landsea_mask.py @@ -1,7 +1,6 @@ import cdms2 import MV2 import os -import cdat_info import pkg_resources egg_path = pkg_resources.resource_filename(pkg_resources.Requirement.parse("cdutil"), "share/cdutil") diff --git a/cdutil/region.py b/cdutil/region.py index 869c108..5dd6bc9 100644 --- a/cdutil/region.py +++ b/cdutil/region.py @@ -1,6 +1,5 @@ # Adapted for numpy/ma/cdms2 by convertcdms.py from cdms2.selectors import SelectorComponent -import cdat_info import warnings diff --git a/cdutil/sftbyrgn.py b/cdutil/sftbyrgn.py index 73ab1f9..c9f96bf 100644 --- a/cdutil/sftbyrgn.py +++ b/cdutil/sftbyrgn.py @@ -9,7 +9,6 @@ import genutil import cdms2 import os -import cdat_info import pkg_resources diff --git a/cdutil/times.py b/cdutil/times.py index 18a8567..d69e97f 100644 --- a/cdutil/times.py +++ b/cdutil/times.py @@ -4,7 +4,6 @@ import cdms2 import cdtime import numpy.ma -import cdat_info try: basestring @@ -320,7 +319,7 @@ def mergeTime(ds, statusbar=1, fill_value=1.e20): raise Exception # to exit the it and i loops elif val.value > vals[v]: break - except BaseException as err: + except BaseException: pass if statusbar is not None and nt != 1: if not isinstance(prev[0], type(0)): diff --git a/cdutil/vertical.py b/cdutil/vertical.py index 778f4c4..71df268 100644 --- a/cdutil/vertical.py +++ b/cdutil/vertical.py @@ -3,7 +3,6 @@ import genutil import cdms2 import numpy -import cdat_info def reconstructPressureFromHybrid(ps, A, B, Po): diff --git a/tests/test_cdutil_flake8.py b/tests/test_cdutil_flake8.py index 8afa38c..2d4fd9a 100644 --- a/tests/test_cdutil_flake8.py +++ b/tests/test_cdutil_flake8.py @@ -11,7 +11,7 @@ def testFlake8(self): pth = os.path.dirname(__file__) pth = os.path.join(pth, "..") pth = os.path.abspath(pth) - pth = os.path.join(pth, "Lib") + pth = os.path.join(pth, "cdutil") print() print() print() From d88d743bd99ae33f2f4628aba2b8c2e97d57a1f2 Mon Sep 17 00:00:00 2001 From: muryanto1 Date: Thu, 21 May 2020 17:44:38 -0700 Subject: [PATCH 5/5] removed cdat_info from 'build' section of recipe --- recipe/meta.yaml.in | 1 - 1 file changed, 1 deletion(-) diff --git a/recipe/meta.yaml.in b/recipe/meta.yaml.in index b12a2a5..d5146f3 100644 --- a/recipe/meta.yaml.in +++ b/recipe/meta.yaml.in @@ -15,7 +15,6 @@ requirements: build: - python - setuptools - - cdat_info run: - python - cdms2