-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create ci.yaml * Create linting.yaml * Update .pre-commit-config.yaml * Delete .stickler.yml * Delete .travis.yml * Update README.md * Create codecov.yml * Delete .coveragerc * Update setup.cfg * Update setup.py * Update and rename environment-py37-upstream_master.yml to environment-upstream-dev * Rename environment-py37.yml to environment-py3.7.yml * Rename environment-py38.yml to environment-py3.8.yml * Update ci.yaml * Update ci.yaml * Rename environment-upstream-dev to environment-upstream-dev.yml * Update setup.py * Update environment-py3.7.yml * Update environment-py3.8.yml * Update environment-upstream-dev.yml * Update environment-upstream-dev.yml * Update environment-upstream-dev.yml * Update ci.yaml
- Loading branch information
Showing
13 changed files
with
185 additions
and
102 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: CI | ||
on: | ||
push: | ||
branches: | ||
- "master" | ||
pull_request: | ||
branches: | ||
- "*" | ||
schedule: | ||
- cron: "0 13 * * 1" | ||
|
||
jobs: | ||
build: | ||
name: Build (${{ matrix.python-version }} | ${{ matrix.os }}) | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: ["ubuntu-latest"] | ||
python-version: ["3.7", "3.8"] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Cache conda | ||
uses: actions/cache@v1 | ||
env: | ||
# Increase this value to reset cache if ci/environment.yml has not changed | ||
CACHE_NUMBER: 0 | ||
with: | ||
path: ~/conda_pkgs_dir | ||
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('ci/environment-py${{ matrix.python-version }}.yml') }} | ||
- uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
activate-environment: test_env_xarrayutils # Defined in ci/environment*.yml | ||
auto-update-conda: false | ||
python-version: ${{ matrix.python-version }} | ||
environment-file: ci/environment-py${{ matrix.python-version }}.yml | ||
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! | ||
- name: Set up conda environment | ||
shell: bash -l {0} | ||
run: | | ||
python -m pip install -e . | ||
conda list | ||
- name: Run Tests | ||
shell: bash -l {0} | ||
run: | | ||
pytest -n auto --cov=./ --cov-report=xml | ||
- name: Upload code coverage to Codecov | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
file: ./coverage.xml | ||
flags: unittests | ||
env_vars: OS,PYTHON | ||
name: codecov-umbrella | ||
fail_ci_if_error: false | ||
upstream-dev: | ||
name: Build (upstream-dev) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Cache conda | ||
uses: actions/cache@v1 | ||
env: | ||
# Increase this value to reset cache if ci/environment-upstream-dev.yml has not changed | ||
CACHE_NUMBER: 0 | ||
with: | ||
path: ~/conda_pkgs_dir | ||
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('ci/environment-upstream-dev.yml') }} | ||
- uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
activate-environment: test_env_xarrayutils # Defined in ci/environment-upstream-dev.yml | ||
auto-update-conda: false | ||
python-version: 3.8 | ||
environment-file: ci/environment-upstream-dev.yml | ||
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! | ||
- name: Set up conda environment | ||
shell: bash -l {0} | ||
run: | | ||
python -m pip install -e . | ||
conda list | ||
- name: Run Tests | ||
shell: bash -l {0} | ||
run: | | ||
pytest -n auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: code-style | ||
on: | ||
push: | ||
branches: "*" | ||
pull_request: | ||
branches: master | ||
jobs: | ||
pre-commit: | ||
name: pre-commit | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
- name: set up python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
- name: Run pre-commit | ||
uses: pre-commit/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,5 @@ | ||
repos: | ||
- repo: local | ||
- repo: https://github.com/python/black | ||
rev: stable | ||
hooks: | ||
- id: black | ||
name: black | ||
language: system | ||
entry: black | ||
types: ["python"] |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,3 +20,4 @@ dependencies: | |
- pip: | ||
- codecov | ||
- pytest-cov | ||
- pytest-xdist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,3 +20,4 @@ dependencies: | |
- pip: | ||
- codecov | ||
- pytest-cov | ||
- pytest-xdist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
codecov: | ||
require_ci_to_pass: no | ||
max_report_age: off | ||
|
||
comment: false | ||
|
||
coverage: | ||
precision: 2 | ||
round: down | ||
status: | ||
project: | ||
default: | ||
target: 95 | ||
informational: true | ||
patch: off | ||
changes: off |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,55 @@ | ||
import sys | ||
import os | ||
import versioneer | ||
from setuptools import setup, find_packages | ||
|
||
DISTNAME = "xarrayutils" | ||
LICENSE = "MIT" | ||
AUTHOR = "Julius Busecke" | ||
AUTHOR_EMAIL = "[email protected]" | ||
URL = "https://github.com/jbusecke/xarrayutils" | ||
CLASSIFIERS = [ | ||
"Development Status :: 4 - Beta", | ||
"License :: OSI Approved :: Apache Software License", | ||
"Operating System :: OS Independent", | ||
"Intended Audience :: Science/Research", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 2", | ||
"Programming Language :: Python :: 2.7", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.5", | ||
"Programming Language :: Python :: 3.6", | ||
"Programming Language :: Python :: 3.7", | ||
"Topic :: Scientific/Engineering", | ||
] | ||
|
||
INSTALL_REQUIRES = ["xarray >= 0.15.0"] | ||
SETUP_REQUIRES = ["pytest-runner"] | ||
TESTS_REQUIRE = ["pytest >= 2.8", "coverage"] | ||
here = os.path.dirname(__file__) | ||
with open(os.path.join(here, "README.md"), encoding="utf-8") as f: | ||
long_description = f.read() | ||
|
||
if sys.version_info[:2] < (2, 7): | ||
TESTS_REQUIRE += ["unittest2 == 0.5.1"] | ||
install_requires = ["xarray>=0.14.1", "dask", "numpy"] | ||
doc_requires = [ | ||
"sphinx", | ||
"sphinxcontrib-srclinks", | ||
"sphinx-pangeo-theme", | ||
"numpydoc", | ||
"IPython", | ||
"nbsphinx", | ||
] | ||
|
||
DESCRIPTION = "Utilities for xarray dataarrays/datasets" | ||
LONG_DESCRIPTION = """To be written. | ||
""" | ||
extras_require = { | ||
"complete": install_requires, | ||
"docs": doc_requires, | ||
} | ||
extras_require["dev"] = extras_require["complete"] + [ | ||
"pytest", | ||
"pytest-cov", | ||
"flake8", | ||
"black", | ||
"codecov", | ||
] | ||
|
||
setup( | ||
name=DISTNAME, | ||
name="xarrayutils", | ||
description="A collection of various tools for data analysis built on top of xarray and xgcm", | ||
url="https://github.com/jbusecke/xarrayutils", | ||
author="xarrayutils Developers", | ||
author_email="[email protected]", | ||
license="MIT", | ||
classifiers=[ | ||
"Development Status :: 4 - Beta", | ||
"Intended Audience :: Science/Research", | ||
"Topic :: Scientific/Engineering", | ||
"License :: OSI Approved :: MIT License", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
], | ||
packages=find_packages(exclude=["docs", "tests", "tests.*", "docs.*"]), | ||
install_requires=install_requires, | ||
extras_require=extras_require, | ||
python_requires=">=3.7", | ||
version=versioneer.get_version(), | ||
cmdclass=versioneer.get_cmdclass(), | ||
license=LICENSE, | ||
author=AUTHOR, | ||
author_email=AUTHOR_EMAIL, | ||
classifiers=CLASSIFIERS, | ||
description=DESCRIPTION, | ||
long_description=LONG_DESCRIPTION, | ||
install_requires=INSTALL_REQUIRES, | ||
setup_requires=SETUP_REQUIRES, | ||
tests_require=TESTS_REQUIRE, | ||
url=URL, | ||
packages=find_packages(), | ||
long_description=long_description, | ||
long_description_content_type="text/markdown", | ||
) |