Skip to content

Commit

Permalink
Merge pull request #9 from andersy005/master
Browse files Browse the repository at this point in the history
Fix tests
  • Loading branch information
andersy005 committed Feb 26, 2019
2 parents a4d144b + 485cc7f commit e62402e
Show file tree
Hide file tree
Showing 15 changed files with 436 additions and 354 deletions.
79 changes: 55 additions & 24 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ workflows:
jobs:
- "python-3.7"
- "python-3.6"
- "docs-and-linting"
- "docs-build"
- "test-linting"




jobs:
"python-3.6":
docker:
- image: continuumio/miniconda:latest
- image: conda/miniconda3:latest

environment:
PYTHON: "3.6"
Expand All @@ -27,7 +28,7 @@ jobs:
key: deps-3.6

- run: # install and activate conda environment
name: configure conda
name: Install conda environment
command: ./ci/install-circle.sh

- run:
Expand All @@ -49,14 +50,14 @@ jobs:

"python-3.7":
docker:
- image: continuumio/miniconda:latest
- image: conda/miniconda3:latest

environment:
PYTHON: "3.7"
ENV_NAME: "xcollection-dev"

steps:

# Get our data and merge with upstream
- checkout

Expand All @@ -65,14 +66,14 @@ jobs:
key: deps-3.7

- run: # install and activate conda environment
name: configure conda
name: Install conda environment
command: ./ci/install-circle.sh
- run:
command: |
source activate ${ENV_NAME}
pytest --junitxml=test-reports/junit.xml --cov=./
# Cache some files for a speedup in subsequent builds
- save_cache:
key: deps-3.7
Expand All @@ -85,18 +86,18 @@ jobs:

- store_artifacts:
path: test-reports


"docs-and-linting":

"test-linting":
docker:
- image: continuumio/miniconda:latest
- image: conda/miniconda3:latest

environment:
PYTHON: "3.7"
ENV_NAME: "xcollection-dev"

steps:

# Get our data and merge with upstream
- checkout

Expand All @@ -105,34 +106,64 @@ jobs:
key: deps-3.7

- run: # install and activate conda environment
name: configure conda
name: Install conda environment
command: ./ci/install-circle.sh

- run:
name: Code Coverage + Code Styling with (black, flake8, isort)
name: Code Styling with (black, flake8, isort)
command: |
source activate ${ENV_NAME}
echo "[Upload coverage]"
codecov
echo "[flake8]"
flake8
flake8
echo "[black]"
black --check .
black --check --line-length=100 -S --exclude='intake_esm/_version.py|versioneer.py' .
echo "[isort]"
isort --recursive --check-only .
isort --recursive -w 100 --check-only .
# Cache some files for a speedup in subsequent builds
- save_cache:
key: deps-3.7
paths:
- "/opt/conda/envs/${ENV_NAME}/"
- "/opt/conda/pkgs"


"docs-build":
docker:
- image: conda/miniconda3:latest

environment:
PYTHON: "3.7"
ENV_NAME: "xcollection-dev"

steps:

# Get our data and merge with upstream
- checkout

# Restore cached files to speed things up
- restore_cache:
key: deps-3.7

- run: # install and activate conda environment
name: Install conda environment
command: ./ci/install-circle.sh


- run:
name: Check documentation build
name: Check documentation build
command: |
source activate ${ENV_NAME}
pushd docs
make html
popd
# Cache some files for a speedup in subsequent builds
- save_cache:
key: deps-3.7
Expand All @@ -141,6 +172,6 @@ jobs:
- "/opt/conda/pkgs"

# Tell Circle to store the documentation output in a folder that we can access later
- store_artifacts:
- store_artifacts:
path: docs/_build/html
destination: html
20 changes: 17 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,34 @@
repos:

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.1.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-docstring-first
- id: check-json
- id: check-added-large-files
- id: check-yaml
- id: double-quote-string-fixer

- repo: https://github.com/ambv/black
rev: 18.9b0
hooks:
- id: black

args: ["--line-length", "100", "--skip-string-normalization",
"--exclude", '''/(xcollection/_version.py|versioneer.py)/''']

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.1.0
hooks:
- id: flake8

- repo: https://github.com/asottile/seed-isort-config
rev: v1.5.0
rev: v1.6.0
hooks:
- id: seed-isort-config
- repo: https://github.com/pre-commit/mirrors-isort
rev: v4.3.4
hooks:
- id: isort
- id: isort
args: ["line_length=100"]
5 changes: 2 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
xcollection
===============================

.. image:: https://img.shields.io/circleci/project/github/NCAR/xcollection/master.svg?style=for-the-badge
.. image:: https://img.shields.io/circleci/project/github/NCAR/xcollection/master.svg?style=for-the-badge&logo=circleci
:target: https://circleci.com/gh/NCAR/xcollection/tree/master

.. image:: https://img.shields.io/codecov/c/github/NCAR/xcollection.svg?style=for-the-badge
Expand All @@ -16,7 +16,7 @@ xcollection
.. image:: https://img.shields.io/pypi/v/xcollection.svg?style=for-the-badge
:target: https://pypi.org/project/xcollection
:alt: Python Package Index

.. image:: https://img.shields.io/conda/vn/conda-forge/xcollection.svg?style=for-the-badge
:target: https://anaconda.org/conda-forge/xcollection
:alt: Conda Version
Expand All @@ -26,4 +26,3 @@ xcollection.
See documentation_ for more information.

.. _documentation: https://xcollection.readthedocs.io/en/latest/

39 changes: 20 additions & 19 deletions ci/environment-dev-3.6.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,34 @@ name: xcollection-dev
channels:
- conda-forge
dependencies:
- python=3.6
- numpy
- xarray
- netcdf4
- zarr
- autopep8
- black
- codecov
- coverage
- dask
- distributed
- autopep8
- esmpy
- flake8
- black
- git
- intake
- intake-xarray
- ipykernel
- isort
- nbsphinx
- netcdf4
- numpy
- numpydoc
- pytest
- coverage
- pytest-cov
- codecov
- sphinx>=1.6
- python=3.6
- recommonmark
- sphinx_rtd_theme
- recommonmark
- numpydoc
- nbsphinx
- ipykernel
- xesmf
- esmpy
- intake-xarray
- intake
- sphinx>=1.6
- tqdm
- xarray
- xesmf
- zarr
- pip:
- sphinx_copybutton
- git+https://github.com/NCAR/esmlab.git

- git+https://github.com/NCAR/intake-esm.git
43 changes: 22 additions & 21 deletions ci/environment-dev-3.7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,35 @@ name: xcollection-dev
channels:
- conda-forge
dependencies:
- python=3.7
- numpy
- xarray>=0.11.3
- netcdf4
- zarr
- dask
- distributed
- autopep8
- black
- isort
- codecov
- coverage
- dask
- distributed
- esmpy
- flake8
- git
- intake
- intake-xarray
- ipykernel
- isort
- make
- nbsphinx
- netcdf4
- numpy
- numpydoc
- pytest
- coverage
- pytest-cov
- codecov
- sphinx>=1.6
- python=3.7
- recommonmark
- sphinx_rtd_theme
- recommonmark
- numpydoc
- nbsphinx
- ipykernel
- make
- xesmf
- esmpy
- intake-xarray
- intake
- sphinx>=1.6
- tqdm
- xarray>=0.11.3
- xesmf
- zarr
- pip:
- sphinx_copybutton
- git+https://github.com/NCAR/esmlab.git

- git+https://github.com/NCAR/intake-esm.git
3 changes: 1 addition & 2 deletions ci/install-circle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ set -e
set -eo pipefail

conda config --set always_yes true --set changeps1 false --set quiet true
conda update -q conda
conda config --add channels conda-forge
conda env create -f ci/environment-dev-${PYTHON}.yml --name=${ENV_NAME} --quiet
conda env list
source activate ${ENV_NAME}
pip install --no-deps --quiet -e .
conda list -n ${ENV_NAME}
conda list -n ${ENV_NAME}
Loading

0 comments on commit e62402e

Please sign in to comment.