Skip to content

Commit 4455f7d

Browse files
author
Joseph Hamman
committed
travis to gha
1 parent 6b23a2c commit 4455f7d

File tree

7 files changed

+113
-51
lines changed

7 files changed

+113
-51
lines changed

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: pip
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
- package-ecosystem: "github-actions"
8+
directory: "/"
9+
schedule:
10+
interval: "daily"

.github/workflows/main.yaml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: "*"
6+
pull_request:
7+
branches: master
8+
schedule:
9+
- cron: "0 0 * * *"
10+
11+
jobs:
12+
lint:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/[email protected]
16+
- uses: actions/[email protected]
17+
- uses: pre-commit/[email protected]
18+
19+
test:
20+
name: ${{ matrix.python-version }}-build
21+
runs-on: ubuntu-latest
22+
strategy:
23+
matrix:
24+
python-version: [3.7, 3.8]
25+
steps:
26+
- uses: actions/[email protected]
27+
- name: Setup Python
28+
uses: actions/[email protected]
29+
with:
30+
python-version: ${{ matrix.python-version }}
31+
architecture: x64
32+
- uses: actions/[email protected]
33+
with:
34+
path: ~/.cache/pip
35+
key: ${{ runner.os }}-pip-${{ hashFiles('**/dev-requirements.txt') }}
36+
restore-keys: |
37+
${{ runner.os }}-pip-
38+
- run: |
39+
python -m pip install -r dev-requirements.txt
40+
python -m pip install --no-deps -e .
41+
python -m pip list
42+
- name: Running Tests
43+
run: |
44+
python -m pytest --cov=./ --cov-report=xml --verbose
45+
- name: Upload coverage to Codecov
46+
uses: codecov/codecov-action@v1
47+
if: ${{ matrix.python-version }} == 3.7
48+
with:
49+
file: ./coverage.xml
50+
fail_ci_if_error: false
51+
52+
test-upstream:
53+
name: ${{ matrix.python-version }}-dev-build
54+
runs-on: ubuntu-latest
55+
strategy:
56+
matrix:
57+
python-version: [3.7, 3.8]
58+
steps:
59+
- uses: actions/[email protected]
60+
- name: Setup Python
61+
uses: actions/[email protected]
62+
with:
63+
python-version: ${{ matrix.python-version }}
64+
architecture: x64
65+
- uses: actions/[email protected]
66+
with:
67+
path: ~/.cache/pip
68+
key: ${{ runner.os }}-pip-${{ hashFiles('**/dev-requirements.txt') }}
69+
restore-keys: |
70+
${{ runner.os }}-pip-
71+
- run: |
72+
python -m pip install -r dev-requirements.txt
73+
python -m pip install --no-deps --upgrade \
74+
git+https://github.com/dask/dask \
75+
git+https://github.com/pydata/xarray \
76+
python -m pip install --no-deps -e .
77+
python -m pip list
78+
- name: Running Tests
79+
run: |
80+
python -m pytest --verbose

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ var/
2222
*.egg-info/
2323
.installed.cfg
2424
*.egg
25+
doc/_build/
2526

2627
# PyInstaller
2728
# Usually these files are written by a python script from a template

.travis.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

dev-requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
pytest>=2.8
2+
coverage
3+
-r requirements.txt

requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dask
2+
numpy>=1.17
3+
xarray>=0.16

setup.py

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
LICENSE = 'Apache'
1212
AUTHOR = 'xbatcher Developers'
1313
AUTHOR_EMAIL = '[email protected]'
14-
URL = 'https://github.com/xgcm/xbatcher'
14+
URL = 'https://github.com/pangeo/xbatcher'
1515
CLASSIFIERS = [
1616
'Development Status :: 4 - Beta',
1717
'License :: OSI Approved :: Apache Software License',
@@ -24,15 +24,19 @@
2424
'Topic :: Scientific/Engineering',
2525
]
2626

27-
INSTALL_REQUIRES = ['xarray', 'dask', 'numpy']
28-
SETUP_REQUIRES = []
29-
TESTS_REQUIRE = ['pytest >= 2.8', 'coverage']
30-
3127
DESCRIPTION = "Batch generation from xarray dataset"
32-
def readme():
33-
return "TODO"
34-
#with open('README.rst') as f:
35-
# return f.read()
28+
29+
with open('requirements.txt') as f:
30+
install_requires = f.read().strip().split('\n')
31+
32+
with open('dev-requirements.txt') as f:
33+
test_requires = f.read().strip().split('\n')
34+
35+
if os.path.exists('README.rst'):
36+
with open('README.rst') as f:
37+
long_description = f.read()
38+
else:
39+
long_description = ''
3640

3741

3842
setup(name=DISTNAME,
@@ -42,9 +46,8 @@ def readme():
4246
author_email=AUTHOR_EMAIL,
4347
classifiers=CLASSIFIERS,
4448
description=DESCRIPTION,
45-
long_description=readme(),
46-
install_requires=INSTALL_REQUIRES,
47-
setup_requires=SETUP_REQUIRES,
48-
tests_require=TESTS_REQUIRE,
49+
long_description=long_description,
50+
python_requires='>=3.7',
51+
install_requires=install_requires,
4952
url=URL,
5053
packages=find_packages())

0 commit comments

Comments
 (0)