Skip to content

Commit 1beadf3

Browse files
authored
Merge pull request #3 from andersy005/patch-CI
Patch CI
2 parents e3154e1 + d96d2d3 commit 1beadf3

File tree

5 files changed

+29
-11
lines changed

5 files changed

+29
-11
lines changed

.github/workflows/main.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414
strategy:
1515
matrix:
16-
python-version: ['3.6', '3.7', '3.8']
16+
python-version: [3.6, 3.7, 3.8]
1717
name: Python ${{ matrix.python-version }} build
1818
steps:
1919
- name: Checkout
@@ -25,11 +25,12 @@ jobs:
2525
architecture: "x64"
2626
- name: Install dependencies
2727
run: |
28-
python -m pip install "dask[complete]" xarray toolz pytest codecov pytest-cov
29-
python -m pip install .
28+
# $CONDA is an environment variable pointing to the root of the miniconda directory
29+
$CONDA/bin/conda create -n dev -c conda-forge python=${{ matrix.python-version }} --file requirements-dev.txt --quiet
30+
source $CONDA/bin/activate dev
31+
$CONDA_PREFIX/bin/python -m pip install . --quiet
32+
$CONDA/bin/conda list
3033
- name: Run tests
3134
run: |
32-
pytest --junitxml=test-reports/junit.xml --cov=./ --verbose
33-
- name: Upload coverage
34-
run: |
35-
codecov
35+
source $CONDA/bin/activate dev
36+
$CONDA_PREFIX/bin/pytest --junitxml=test-reports/junit.xml --cov=./ --verbose

requirements-dev.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
numpy
2+
xarray
3+
dask
4+
toolz
5+
netCDF4
6+
pytest
7+
pytest-cov

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ select = B,C,E,F,W,T4,B9
77

88
[isort]
99
known_first_party=intake_esm
10-
known_third_party=dask,numpy,pytest,setuptools,toolz,xarray
10+
known_third_party=dask,numpy,pkg_resources,pytest,setuptools,toolz,xarray
1111
multi_line_output=3
1212
include_trailing_comma=True
1313
force_grid_wrap=0

setup.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33

44
"""The setup script."""
55

6-
import sys
7-
from setuptools import setup
86
from os.path import exists
97

8+
from setuptools import setup
9+
1010
if exists('README.md'):
1111
with open('README.md') as f:
1212
long_description = f.read()
@@ -30,5 +30,7 @@
3030
test_suite='tests',
3131
tests_require=test_requirements,
3232
url='https://github.com/matt-long/xpersist',
33+
use_scm_version={'version_scheme': 'post-release', 'local_scheme': 'dirty-tag'},
34+
setup_requires=['setuptools_scm', 'setuptools>=30.3.0'],
3335
zip_safe=False,
3436
)

xpersist/__init__.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
settings = {'cache_dir': 'xpersist_cache'}
22

3-
from .core import *
3+
from pkg_resources import DistributionNotFound, get_distribution
4+
5+
from .core import * # noqa: F403, F401
6+
7+
try:
8+
__version__ = get_distribution(__name__).version
9+
except DistributionNotFound:
10+
# package is not installed
11+
pass

0 commit comments

Comments
 (0)