Skip to content

Commit

Permalink
Merge pull request #3 from andersy005/patch-CI
Browse files Browse the repository at this point in the history
Patch CI
  • Loading branch information
andersy005 authored Nov 19, 2019
2 parents e3154e1 + d96d2d3 commit 1beadf3
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 11 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.6', '3.7', '3.8']
python-version: [3.6, 3.7, 3.8]
name: Python ${{ matrix.python-version }} build
steps:
- name: Checkout
Expand All @@ -25,11 +25,12 @@ jobs:
architecture: "x64"
- name: Install dependencies
run: |
python -m pip install "dask[complete]" xarray toolz pytest codecov pytest-cov
python -m pip install .
# $CONDA is an environment variable pointing to the root of the miniconda directory
$CONDA/bin/conda create -n dev -c conda-forge python=${{ matrix.python-version }} --file requirements-dev.txt --quiet
source $CONDA/bin/activate dev
$CONDA_PREFIX/bin/python -m pip install . --quiet
$CONDA/bin/conda list
- name: Run tests
run: |
pytest --junitxml=test-reports/junit.xml --cov=./ --verbose
- name: Upload coverage
run: |
codecov
source $CONDA/bin/activate dev
$CONDA_PREFIX/bin/pytest --junitxml=test-reports/junit.xml --cov=./ --verbose
7 changes: 7 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
numpy
xarray
dask
toolz
netCDF4
pytest
pytest-cov
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ select = B,C,E,F,W,T4,B9

[isort]
known_first_party=intake_esm
known_third_party=dask,numpy,pytest,setuptools,toolz,xarray
known_third_party=dask,numpy,pkg_resources,pytest,setuptools,toolz,xarray
multi_line_output=3
include_trailing_comma=True
force_grid_wrap=0
Expand Down
6 changes: 4 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

"""The setup script."""

import sys
from setuptools import setup
from os.path import exists

from setuptools import setup

if exists('README.md'):
with open('README.md') as f:
long_description = f.read()
Expand All @@ -30,5 +30,7 @@
test_suite='tests',
tests_require=test_requirements,
url='https://github.com/matt-long/xpersist',
use_scm_version={'version_scheme': 'post-release', 'local_scheme': 'dirty-tag'},
setup_requires=['setuptools_scm', 'setuptools>=30.3.0'],
zip_safe=False,
)
10 changes: 9 additions & 1 deletion xpersist/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
settings = {'cache_dir': 'xpersist_cache'}

from .core import *
from pkg_resources import DistributionNotFound, get_distribution

from .core import * # noqa: F403, F401

try:
__version__ = get_distribution(__name__).version
except DistributionNotFound:
# package is not installed
pass

0 comments on commit 1beadf3

Please sign in to comment.