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

Switch to holoviz_tasks/install action #5384

Merged
merged 24 commits into from
Dec 14, 2022
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
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
79 changes: 27 additions & 52 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
fetch-depth: "1"
- name: set PY
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
Expand All @@ -34,67 +34,35 @@ jobs:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
python-version: ['3.7', '3.9', '3.11']
timeout-minutes: 90
# Run on the full set on schedule, workflow_dispatch and push&tags events, otherwise on a subset.
python-version: ${{ ( github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || ( github.event_name == 'push' && github.ref_type == 'tag' ) ) && fromJSON('["3.7", "3.8", "3.9", "3.10", "3.11"]') || fromJSON('["3.7", "3.9", "3.11"]') }}
timeout-minutes: 120 # Because slow conda solve on Python 3.7
defaults:
run:
shell: bash -l {0}
env:
HV_REQUIREMENTS: "-o flakes -o tests -o examples_tests"
DESC: "Python ${{ matrix.python-version }} tests"
PYTHON_VERSION: ${{ matrix.python-version }}
SETUPTOOLS_ENABLE_FEATURES: "legacy-editable"
DISPLAY: ":99.0"
PYTHONIOENCODING: "utf-8"
MPLBACKEND: "Agg"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: "100"
- uses: conda-incubator/setup-miniconda@v2
- uses: pyviz-dev/holoviz_tasks/[email protected]
with:
miniconda-version: "latest"
- name: Fetch unshallow
run: git fetch --prune --tags --unshallow
- name: conda update conda
# Temporarily update conda in its own step
# to filter out Python 3.11 as there are issues
# with the latest conda. When this is resolved,
# move this back into the step below.
if: matrix.python-version != '3.11'
run: conda update -n base -c defaults conda
- name: conda setup
run: |
conda config --prepend channels conda-forge
conda config --prepend channels bokeh/label/dev
conda config --prepend channels pyviz/label/dev
conda config --remove channels defaults
conda config --set channel_priority strict
conda create -n test-environment python=${{ matrix.python-version }} pyctdev
- name: doit env_capture
name: unit_test_suite
python-version: ${{ matrix.python-version }}
channel-priority: strict
channels: pyviz/label/dev,conda-forge,nodefaults
envs: "-o flakes -o tests -o examples_tests"
cache: true
conda-update: true
id: install
- name: bokeh sampledata
run: |
conda activate test-environment
doit env_capture
- name: doit develop_install
if: matrix.os != 'macos-latest'
run: |
conda activate test-environment
conda list
doit develop_install ${{ env.HV_REQUIREMENTS }}
python -c "from param import version; print(version.Version.setup_version('.', 'holoviews', archive_commit='$Format:%h$'))"
echo "-----"
git describe
# Temporary hacked step as on MacOS doit develop_install updated CPython leading to a pyctdev failure
- name: doit develop_install
if: matrix.os == 'macos-latest'
run: |
conda activate test-environment
conda list
doit develop_install ${{ env.HV_REQUIREMENTS }} || echo "Keep going"
pip install --no-deps --no-build-isolation -e .
python -c "from param import version; print(version.Version.setup_version('.', 'holoviews', archive_commit='$Format:%h$'))"
echo "-----"
git describe
- name: doit env_capture
run: |
conda activate test-environment
doit env_capture
bokeh sampledata
- name: doit test_flakes
run: |
conda activate test-environment
Expand All @@ -104,9 +72,16 @@ jobs:
conda activate test-environment
doit test_unit
- name: test examples
if: matrix.python-version != '3.11'
run: |
conda activate test-environment
doit test_examples
- name: test examples - python 3.11
# Should be removed when numba support python 3.11
if: matrix.python-version == '3.11'
run: |
conda activate test-environment
pytest -n auto --dist loadscope --nbval-lax examples/reference/elements
- name: codecov
run: |
conda activate test-environment
Expand Down
26 changes: 15 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,25 @@

default_stages: [commit]
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
hooks:
- id: check-builtin-literals
- id: check-case-conflict
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-toml
- id: detect-private-key
- id: end-of-file-fixer
- id: check-builtin-literals
- id: check-case-conflict
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-toml
- id: detect-private-key
- id: end-of-file-fixer
exclude: \.min\.js$
- id: trailing-whitespace
- repo: https://github.com/PyCQA/flake8
- id: trailing-whitespace
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
hooks:
- id: flake8 # See 'setup.cfg' for args
- id: flake8 # See 'setup.cfg' for args
args: [holoviews]
files: holoviews/
- repo: https://github.com/hoxbro/clean_notebook
rev: 0.1.5
hooks:
- id: clean-notebook
21 changes: 2 additions & 19 deletions examples/reference/elements/plotly/Tiles.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"metadata": {},
"outputs": [],
"source": [
"hv.Layout([ts().relabel(name) for name, ts in hv.element.tiles.tile_sources.items()]).opts(\n",
Expand Down Expand Up @@ -107,22 +103,9 @@
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.9"
"pygments_lexer": "ipython3"
}
},
"nbformat": 4,
Expand Down
35 changes: 10 additions & 25 deletions examples/user_guide/Deploying_Bokeh_Apps.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@
"metadata": {},
"outputs": [],
"source": [
"hvplot = renderer.get_plot(layout)\n",
"print(hvplot)"
"plot = renderer.get_plot(layout)\n",
"print(plot)"
]
},
{
Expand All @@ -189,7 +189,7 @@
"metadata": {},
"outputs": [],
"source": [
"hvplot.state"
"plot.state"
]
},
{
Expand All @@ -212,7 +212,7 @@
"metadata": {},
"outputs": [],
"source": [
"html = renderer._figure_data(hvplot, 'html')"
"html = renderer._figure_data(plot, 'html')"
]
},
{
Expand Down Expand Up @@ -483,7 +483,7 @@
"metadata": {},
"outputs": [],
"source": [
"pn.panel(dmap).app('localhost:8888')"
"dmap"
]
},
{
Expand Down Expand Up @@ -514,11 +514,9 @@
" return hv.Curve((xs, np.sin(xs+phase))).opts(width=800)\n",
"\n",
"counter = hv.streams.Counter()\n",
"dmap = hv.DynamicMap(sine, streams=[counter])\n",
"hv.DynamicMap(sine, streams=[counter])\n",
"\n",
"dmap_pane = pn.panel(dmap)\n",
"\n",
"dmap_pane.app('localhost:8891')"
"dmap"
]
},
{
Expand All @@ -544,7 +542,7 @@
"def update():\n",
" counter.event(counter=counter.counter+1)\n",
"\n",
"cb = dmap_pane.add_periodic_callback(update, period=200)"
"cb = pn.state.add_periodic_callback(update, period=200)"
]
},
{
Expand Down Expand Up @@ -776,7 +774,7 @@
"\n",
"button = pn.widgets.Button(name='► Play', width=60, align='end')\n",
"button.on_click(animate)\n",
"callback = button.add_periodic_callback(animate_update, 50, start=False)\n",
"callback = pn.state.add_periodic_callback(animate_update, 50, start=False)\n",
"\n",
"app = pn.Column(\n",
" dmap,\n",
Expand Down Expand Up @@ -884,22 +882,9 @@
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.4"
"pygments_lexer": "ipython3"
}
},
"nbformat": 4,
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
extras_require['tests_core'] = [
'pytest',
'pytest-cov',
'pytest-xdist',
'matplotlib >=3',
'nbconvert',
'bokeh',
Expand Down Expand Up @@ -69,9 +70,7 @@
'cudf',
]

extras_require['tests_nb'] = [
'nbsmoke >=0.2.0',
]
extras_require['tests_nb'] = ['nbval']

# Notebook dependencies
extras_require["notebook"] = ["ipython >=5.4.0", "notebook"]
Expand All @@ -98,6 +97,7 @@
"shapely",
"scikit-image",
"pyarrow",
"pooch",
]

if sys.version_info < (3, 11):
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ commands = pytest holoviews --cov=./holoviews -vv
[_examples]
description = Test that default examples run
deps = .[examples_tests]
commands = pytest --nbsmoke-run -k ".ipynb" examples/reference/elements
commands = pytest -n auto --dist loadscope --nbval-lax examples -k "not Plotting_with_Bokeh and not 17-Dashboards and not Plots_and_Renderers"
hoxbro marked this conversation as resolved.
Show resolved Hide resolved

[_all_recommended]
description = Run all recommended tests
Expand Down