Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace TravisCI tests with GitHub Actions #524

Merged
merged 34 commits into from
Nov 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
4b4ba09
Replace TravisCI tests with GitHub Actions
philippjfr Nov 17, 2020
fae8a63
Remove appveyor
philippjfr Nov 17, 2020
ef7a64b
Switch to conda-incubator action
philippjfr Nov 17, 2020
46cfaf4
auto-update-conda
philippjfr Nov 17, 2020
78553b1
Add conda-forge
philippjfr Nov 17, 2020
9ef7137
Add py38 to tox.ini
philippjfr Nov 17, 2020
dcf0a58
Add pyepsg to dependencies
philippjfr Nov 17, 2020
9cf2a61
Update test
philippjfr Nov 17, 2020
7842137
Drop conda-forge
philippjfr Nov 17, 2020
f3fcc15
Minor fix
philippjfr Nov 17, 2020
00cfacf
Fixed geo test
philippjfr Nov 17, 2020
9271f57
Fix some timedelta tests
philippjfr Nov 17, 2020
4317918
Drop py3.8 tests for now
philippjfr Nov 17, 2020
231a923
Skip certain geo tests on windows
philippjfr Nov 17, 2020
45d0e04
Skip windows on py2.7
philippjfr Nov 17, 2020
aa692d3
Require examples_extra
philippjfr Nov 17, 2020
2528d85
Fixed tests
philippjfr Nov 17, 2020
c2b3a79
Install pygraphviz from conda-forge
philippjfr Nov 17, 2020
934dda5
Clean up setup.py
philippjfr Nov 17, 2020
1366ffd
Fix flakes
philippjfr Nov 17, 2020
5c19003
Do not install pygraphviz on windows
philippjfr Nov 18, 2020
3eebb54
Drop osx
philippjfr Nov 18, 2020
0cfce68
Skip geo tests on windows
philippjfr Nov 18, 2020
b12aec9
Correctly activate env
philippjfr Nov 18, 2020
589354b
Change skip nbsmoke definition
philippjfr Nov 18, 2020
f5a5256
Made test config version and platform specific
philippjfr Nov 18, 2020
eec85d0
Make conda-forge explicit
philippjfr Nov 18, 2020
cf592ec
Skip examples on py2
philippjfr Nov 18, 2020
8921eb1
Fix networkx test
philippjfr Nov 18, 2020
7196c7d
Fix py2 import in intake module
philippjfr Nov 18, 2020
90b21a4
Fixed flake
philippjfr Nov 18, 2020
9f6a033
Fix super
philippjfr Nov 18, 2020
0779397
Fixed flake
philippjfr Nov 18, 2020
835ceef
Try to fix coveralls
philippjfr Nov 18, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions .appveyor.yml

This file was deleted.

109 changes: 109 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: tests
on:
push:
branches:
- master
pull_request:
branches:
- '*'

jobs:
test_suite:
name: Pytest on ${{ matrix.os }} with Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'windows-latest']
python-version: [2.7, 3.6, 3.7]
exclude:
- os: windows-latest
python-version: 2.7
timeout-minutes: 30
defaults:
run:
shell: bash -l {0}
env:
DESC: "Python ${{ matrix.python-version }} tests"
HV_REQUIREMENTS: "unit_tests"
PYTHON_VERSION: ${{ matrix.python-version }}
CHANS_DEV: "-c pyviz/label/dev"
CHANS: "-c pyviz"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: "100"
- uses: actions/setup-python@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
- uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
- name: Fetch unshallow
run: git fetch --prune --tags --unshallow
- name: conda setup
run: |
conda config --set always_yes True
conda install -c pyviz "pyctdev>=0.5"
doit ecosystem_setup
conda install nodejs
doit env_create ${{ env.CHANS_DEV}} --python=${{ matrix.python-version }}
- name: doit develop_install py2
if: startsWith(matrix.python-version, 2.)
run: |
eval "$(conda shell.bash hook)"
conda activate test-environment
conda list
doit develop_install -c pyviz/label/dev -o tests
- name: doit develop_install py3
if: startsWith(matrix.python-version, 3.)
run: |
eval "$(conda shell.bash hook)"
conda activate test-environment
conda list
doit develop_install ${{ env.CHANS_DEV}} -o examples -o tests
- name: pygraphviz
if: contains(matrix.os, 'ubuntu')
run: |
eval "$(conda shell.bash hook)"
conda activate test-environment
conda install -c conda-forge pygraphviz
- name: doit env_capture
run: |
eval "$(conda shell.bash hook)"
conda activate test-environment
doit env_capture
- name: doit test_flakes
run: |
eval "$(conda shell.bash hook)"
conda activate test-environment
doit test_flakes
- name: doit test_unit
run: |
eval "$(conda shell.bash hook)"
conda activate test-environment
doit test_unit
- name: test examples ubuntu
if: contains(matrix.os, 'ubuntu') && startsWith(matrix.python-version, 3.)
run: |
eval "$(conda shell.bash hook)"
conda activate test-environment
bokeh sampledata
doit test_examples_extra
- name: test examples windows
if: contains(matrix.os, 'windows')
run: |
eval "$(conda shell.bash hook)"
conda activate test-environment
bokeh sampledata
doit test_examples
- name: codecov
env:
github-token: ${{ secrets.GITHUB_TOKEN }}
if: startsWith(matrix.python-version, 3.)
run: |
eval "$(conda shell.bash hook)"
conda activate test-environment
coveralls
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ env:
- PYTHON_VERSION=3.6

stages:
- test
- name: test
if: tag =~ ^v(\d+|\.)+([a-z]|rc)?\d?$
- name: docs
if: tag =~ ^v(\d+|\.)*[^a-z]\d*$ OR tag = website
- name: docs_dev
Expand Down
3 changes: 2 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
include hvplot/.version
include README.rst
include LICENSE
include hvplot/.version
graft examples
global-exclude *.py[co]
global-exclude *~
Expand Down
4 changes: 2 additions & 2 deletions examples/user_guide/NetworkX.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -600,8 +600,8 @@
"G.add_edge('c', 'f', weight=0.9)\n",
"G.add_edge('a', 'd', weight=0.3)\n",
"\n",
"elarge = [(u, v) for (u, v, d) in G.edges(data=True) if d['weight'] > 0.5]\n",
"esmall = [(u, v) for (u, v, d) in G.edges(data=True) if d['weight'] <= 0.5]\n",
"elarge = [(u, v) for (u, v, attr) in G.edges(data=True) if attr['weight'] > 0.5]\n",
"esmall = [(u, v) for (u, v, attr) in G.edges(data=True) if attr['weight'] <= 0.5]\n",
"\n",
"pos = nx.spring_layout(G) # positions for all nodes\n",
"\n",
Expand Down
5 changes: 4 additions & 1 deletion hvplot/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1042,7 +1042,10 @@ def method_wrapper(ds, x, y):
name = data.name or self.label or self.value_label
dataset = Dataset(data, self.indexes, name)
else:
dataset = Dataset(data, self.indexes)
try:
dataset = Dataset(data, self.indexes)
except Exception:
dataset = Dataset(data)
dataset = dataset.redim(**self._redim)
obj = method(x, y)
obj._dataset = dataset
Expand Down
2 changes: 2 additions & 0 deletions hvplot/intake.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import absolute_import

from distutils.version import LooseVersion

from . import hvPlot, post_patch
Expand Down
13 changes: 7 additions & 6 deletions hvplot/tests/testcharts.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@


class TestChart2D(ComparisonTestCase):

def setUp(self):
try:
import numpy as np
Expand Down Expand Up @@ -76,7 +77,7 @@ def test_heatmap_2d_derived_x_and_y(self):
class TestChart2DDask(TestChart2D):

def setUp(self):
super().setUp()
super(TestChart2DDask, self).setUp()
try:
import dask.dataframe as dd
except:
Expand Down Expand Up @@ -250,27 +251,27 @@ def test_time_df_sorts_on_plot(self):
scrambled = self.time_df.sample(frac=1)
plot = scrambled.hvplot(x='time')
assert (plot.data == self.time_df).all().all()
assert (plot.data.time.diff()[1:].astype('int') > 0).all()
assert len(plot.data.time.unique()) == len(plot.data.time)

def test_time_df_does_not_sort_on_plot_if_sort_date_off(self):
scrambled = self.time_df.sample(frac=1)
plot = scrambled.hvplot(x='time', sort_date=False)
assert (plot.data == scrambled).all().all()
assert not (plot.data.time.diff()[1:].astype('int') > 0).all()
assert len(plot.data.time.unique()) == len(plot.data.time)

def test_time_df_sorts_on_plot_using_index_as_x(self):
df = self.time_df.set_index('time')
scrambled = df.sample(frac=1)
plot = scrambled.hvplot()
assert (plot.data['time'] == df.index).all()
assert (plot.data.time.diff()[1:].astype('int') > 0).all()
assert len(plot.data.time.unique()) == len(plot.data.time)

def test_time_df_does_not_sort_on_plot_if_sort_date_off_using_index_as_x(self):
df = self.time_df.set_index('time')
scrambled = df.sample(frac=1)
plot = scrambled.hvplot(sort_date=False)
assert (plot.data.time == scrambled.index).all().all()
assert not (plot.data.time.diff()[1:].astype('int') > 0).all()
assert len(plot.data.time.unique()) == len(plot.data.time)

def test_time_df_with_groupby_as_derived_datetime(self):
plot = self.time_df.hvplot(groupby='time.dayofweek', dynamic=False)
Expand Down Expand Up @@ -306,7 +307,7 @@ def test_default_y_not_in_by(self):
class TestChart1DDask(TestChart1D):

def setUp(self):
super().setUp()
super(TestChart1DDask, self).setUp()
try:
import dask.dataframe as dd
except:
Expand Down
25 changes: 20 additions & 5 deletions hvplot/tests/testgeo.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import sys

from unittest import TestCase, SkipTest, expectedFailure

import numpy as np
Expand All @@ -8,6 +10,8 @@
class TestGeo(TestCase):

def setUp(self):
if sys.platform == "win32":
raise SkipTest("Skip geo tests on windows for now")
try:
import xarray as xr
import rasterio # noqa
Expand All @@ -29,10 +33,14 @@ def assert_projection(self, plot, proj):
opts = hv.Store.lookup_options('bokeh', plot, 'plot')
assert opts.kwargs['projection'].proj4_params['proj'] == proj

def test_plot_with_crs_as_object(self):
plot = self.da.hvplot.image('x', 'y', crs=self.crs)
self.assertCRS(plot)

class TestCRSInference(TestGeo):

def setUp(self):
if sys.platform == "win32":
raise SkipTest("Skip CRS inference on Windows")
super(TestCRSInference, self).setUp()

def test_plot_with_crs_as_proj_string(self):
plot = self.da.hvplot.image('x', 'y', crs=self.da.crs)
self.assertCRS(plot)
Expand All @@ -41,6 +49,13 @@ def test_plot_with_geo_as_true_crs_undefined(self):
plot = self.da.hvplot.image('x', 'y', geo=True)
self.assertCRS(plot)


class TestProjections(TestGeo):

def test_plot_with_crs_as_object(self):
plot = self.da.hvplot.image('x', 'y', crs=self.crs)
self.assertCRS(plot)

def test_plot_with_crs_as_attr_str(self):
da = self.da.copy()
da.attrs = {'bar': self.crs}
Expand All @@ -59,12 +74,12 @@ def test_plot_with_geo_as_true_crs_no_crs_on_data_returns_default(self):

def test_plot_with_projection_as_string(self):
da = self.da.copy()
plot = da.hvplot.image('x', 'y', projection='Robinson')
plot = da.hvplot.image('x', 'y', crs=self.crs, projection='Robinson')
self.assert_projection(plot, 'robin')

def test_plot_with_projection_as_string_google_mercator(self):
da = self.da.copy()
plot = da.hvplot.image('x', 'y', projection='GOOGLE_MERCATOR')
plot = da.hvplot.image('x', 'y', crs=self.crs, projection='GOOGLE_MERCATOR')
self.assert_projection(plot, 'merc')

def test_plot_with_projection_as_invalid_string(self):
Expand Down
2 changes: 1 addition & 1 deletion hvplot/tests/testnetworkx.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class TestOptions(TestCase):
def setUp(self):
# Create nodes (1-10) in unsorted order
nodes = np.array([1, 4, 5, 10, 8, 9, 3, 7, 2, 6])
edges = [*zip(nodes[:-1], nodes[1:])]
edges = list(zip(nodes[:-1], nodes[1:]))

g = nx.Graph()
g.add_nodes_from(nodes)
Expand Down
9 changes: 3 additions & 6 deletions hvplot/tests/testtransforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ def test_pandas_transform(self):
class TestXArrayTransforms(ComparisonTestCase):

def setUp(self):

try:
import xarray as xr
import xarray as xr # noqa
except:
raise SkipTest('xarray not available')
import hvplot.xarray # noqa

def test_xarray_transform(self):
import xarray as xr
data = np.arange(0, 60).reshape(6, 10)
Expand All @@ -42,6 +42,3 @@ def test_xarray_transform(self):
transforms=dict(value=hv.dim('value')*10)
)
self.assertEqual(img.data.value.data, da.data*10)



4 changes: 4 additions & 0 deletions hvplot/tests/testutil.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""
Tests utilities to convert data and projections
"""
import sys

import numpy as np

from unittest import TestCase, SkipTest
Expand Down Expand Up @@ -195,6 +197,8 @@ def test_process_xarray_dataset_with_x_as_derived_datetime(self):
class TestGeoUtil(TestCase):

def setUp(self):
if sys.platform == "win32":
raise SkipTest("Skip geo tests on windows for now")
try:
import geoviews # noqa
import cartopy.crs as ccrs
Expand Down
Loading