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

CI: also install the dependencies with pip #1276

Merged
merged 25 commits into from
Feb 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
MPLBACKEND: "Agg"
CONDA_UPLOAD_TOKEN: ${{ secrets.CONDA_UPLOAD_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: "100"
- uses: actions/setup-python@v4
Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
PPP: ${{ secrets.PPP }}
PYPI: "https://upload.pypi.org/legacy/"
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: "100"
- uses: actions/setup-python@v4
Expand Down
49 changes: 46 additions & 3 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ on:
- cron: '0 15 * * SUN'

jobs:
build_docs:
name: Documentation
conda_build_docs:
name: Documentation:conda
runs-on: 'ubuntu-latest'
timeout-minutes: 120
defaults:
Expand All @@ -39,7 +39,7 @@ jobs:
name: Documentation
python-version: "3.11"
channels: pyviz,conda-forge,nodefaults
envs: "-o doc -o examples"
envs: "-o doc -o examples -o geo -o graphviz"
cache: true
conda-update: true
- name: Set and echo git ref
Expand Down Expand Up @@ -82,3 +82,46 @@ jobs:
publish_dir: ./builtdocs
cname: hvplot.holoviz.org
force_orphan: true
pip_build_docs:
name: Documentation:pip
runs-on: 'ubuntu-latest'
timeout-minutes: 120
defaults:
run:
shell: bash -l {0}
env:
DESC: "Documentation build"
MPLBACKEND: "Agg"
MOZ_HEADLESS: 1
DISPLAY: ":99.0"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: install
run: pip install ."[doc, examples, geo]"
- name: pip list
run: pip list
- name: Set and echo git ref
id: vars
run: |
echo "Deploying from ref ${GITHUB_REF#refs/*/}"
echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: bokeh sampledata
run: |
conda activate test-environment
bokeh sampledata
- name: generate rst
run: |
conda activate test-environment
nbsite generate-rst --org holoviz --project-name hvplot
- name: build docs
run: |
conda activate test-environment
nbsite build --what=html --output=builtdocs --org holoviz --project-name hvplot
- name: report failure
if: failure()
run: cat /tmp/sphinx-*.log | tail -n 100
83 changes: 35 additions & 48 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@ jobs:
name: Run pre-commit
runs-on: 'ubuntu-latest'
steps:
- uses: holoviz-dev/holoviz_tasks/pre-commit@v0.1a17
- uses: holoviz-dev/holoviz_tasks/pre-commit@v0.1a19
setup:
name: Setup workflow
runs-on: ubuntu-latest
outputs:
matrix: ${{ env.MATRIX }}
matrix_option: ${{ env.MATRIX_OPTION }}
steps:
- name: Set matrix option
run: |
Expand All @@ -56,29 +57,30 @@ jobs:
run: |
MATRIX=$(jq -nsc '{
"os": ["ubuntu-latest", "macos-latest", "windows-latest"],
"python-version": ["3.8", "3.11"]
"python-version": ["3.8", "3.12"]
}')
echo "MATRIX=$MATRIX" >> $GITHUB_ENV
- name: Set test matrix with 'full' option
if: env.MATRIX_OPTION == 'full'
run: |
MATRIX=$(jq -nsc '{
"os": ["ubuntu-latest", "macos-latest", "windows-latest"],
"python-version": ["3.8", "3.9", "3.10", "3.11"]
"python-version": ["3.8", "3.9", "3.10", "3.11", "3.12"]
}')
echo "MATRIX=$MATRIX" >> $GITHUB_ENV
- name: Set test matrix with 'downstream' option
if: env.MATRIX_OPTION == 'downstream'
run: |
MATRIX=$(jq -nsc '{
"os": ["ubuntu-latest"],
"python-version": ["3.11"]
"python-version": ["3.12"]
}')
echo "MATRIX=$MATRIX" >> $GITHUB_ENV

test_suite:
name: Pytest on ${{ matrix.os }} with Python ${{ matrix.python-version }}
conda_suite:
name: conda tests:${{ matrix.os }}:${{ matrix.python-version }}
needs: [pre_commit, setup]
if: needs.setup.outputs.matrix_option != 'default'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -88,13 +90,13 @@ jobs:
run:
shell: bash -el {0}
steps:
- uses: holoviz-dev/holoviz_tasks/install@v0.1a17
- uses: holoviz-dev/holoviz_tasks/install@v0.1a19
with:
name: unit_test_suite
python-version: ${{ matrix.python-version }}
channel-priority: strict
channels: pyviz/label/dev,conda-forge,nodefaults
envs: "-o examples_tests -o tests -o examples_conda"
envs: "-o examples_tests -o tests -o geo -o graphviz"
cache: ${{ github.event.inputs.cache || github.event.inputs.cache == '' }}
conda-update: true
id: install
Expand All @@ -107,53 +109,38 @@ jobs:
conda activate test-environment
bokeh sampledata
doit test_examples
- name: codecov
run: |
conda activate test-environment
codecov
core_test_suite:
name: Core tests on Python ${{ matrix.python-version }}, ${{ matrix.os }}
pip_test:
name: pip tests:${{ matrix.os }}:${{ matrix.python-version }}
needs: [pre_commit, setup]
timeout-minutes: 90
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest']
python-version: ['3.12']
timeout-minutes: 120
matrix: ${{ fromJson(needs.setup.outputs.matrix) }}
defaults:
run:
shell: bash -el {0}
env:
DESC: "Python ${{ matrix.python-version }}, ${{ matrix.os }} core tests"
PYTHON_VERSION: ${{ matrix.python-version }}
shell: bash -l {0}
steps:
# Add back when this works on Python 3.12
# - uses: holoviz-dev/holoviz_tasks/install@v0.1a17
# with:
# name: core_test_suite
# python-version: ${{ matrix.python-version }}
# # channel-priority: strict
# channels: pyviz/label/dev,conda-forge,nodefaults
# envs: "-o tests_core -o tests_ci"
# cache: ${{ github.event.inputs.cache || github.event.inputs.cache == '' }}
# conda-update: true
# id: install
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: "100"
- name: Fetch unshallow
run: git fetch --prune --tags --unshallow -f
- uses: actions/setup-python@v4
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: 3.12
- run: |
python -m pip install -ve '.[tests_core]'
python-version: ${{ matrix.python-version }}
- name: install without geo
# Because cartopy cannot be installed on Python 3.8 on these platforms
if: matrix.python-version == '3.8' && contains(fromJSON('["ubuntu-latest", "windows-latest"]'), matrix.os)
run: pip install ."[tests, examples_tests, hvdev]"
- name: install with geo
if: matrix.python-version != '3.8' || !contains(fromJSON('["ubuntu-latest", "windows-latest"]'), matrix.os)
run: pip install ."[tests, examples_tests, geo, hvdev, hvdev_geo]"
- name: pip list
run: pip list
- name: bokeh sampledata
run: |
# conda activate test-environment
bokeh sampledata
- name: doit test_unit
run: |
# conda activate test-environment
pytest hvplot
run: bokeh sampledata
- name: unit tests
run: pytest -v hvplot --cov=hvplot --cov-append
- name: examples tests
run: pytest -n auto --dist loadscope --nbval-lax -p no:python
- name: codecov
run: codecov
23 changes: 23 additions & 0 deletions examples/conftest.py
Original file line number Diff line number Diff line change
@@ -1 +1,24 @@
collect_ignore_glob = []

try:
import pygraphviz
except ModuleNotFoundError:
collect_ignore_glob += [
"user_guide/NetworkX.ipynb",
]

try:
import geoviews
except ModuleNotFoundError:
collect_ignore_glob += [
"getting_started/hvplot.ipynb",
"reference/geopandas/*.ipynb",
"reference/xarray/contour.ipynb",
"reference/xarray/contourf.ipynb",
"reference/xarray/image.ipynb",
"reference/xarray/quadmesh.ipynb",
"reference/xarray/vectorfield.ipynb",
"user_guide/Explorer.ipynb",
"user_guide/Geographic_Data.ipynb",
"user_guide/Integrations.ipynb",
]
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ license_file = LICENSE
[tool:pyctdev.conda]
namespace_map =
geoviews=geoviews-core
ibis-framework=ibis-duckdb
ibis-framework[duckdb]=ibis-duckdb
41 changes: 30 additions & 11 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,24 @@ def get_setup_version(reponame):
'ibis-framework', # ibis-duckdb on conda
]

extras_require['geo'] = [
'cartopy',
'fiona',
'geopandas',
'geoviews >=1.9.0',
'pyproj',
'rasterio',
'rioxarray',
'spatialpandas >=0.4.3',
]

# graphviz is difficult to install with pip, ok with conda.
extras_require['graphviz'] = [
'pygraphviz',
]

# Dependencies required to run the notebooks
extras_require['examples'] = [
'geoviews >=1.9.0',
'geopandas',
'xarray >=0.18.2',
'networkx >=2.6.3',
'streamz >=0.3.0',
Expand All @@ -84,28 +98,20 @@ def get_setup_version(reponame):
'intake-xarray >=0.5.0',
'dask >=2021.3.0',
'notebook >=5.4',
'rasterio',
'cartopy',
'pyproj',
's3fs >=2022.1.0',
'scipy >=1.5.3',
'pillow >=8.2.0',
'selenium >=3.141.0',
'scikit-image >=0.17.2',
'python-snappy >=0.6.0',
'pooch >=1.6.0',
'fiona',
'rioxarray',
'matplotlib',
'plotly',
'pygraphviz',
'ipywidgets',
'numba >=0.51.0',
'datashader >=0.6.5',
'spatialpandas >=0.4.3',
'polars',
'fugue',
'ibis-framework', # ibis-duckdb on conda
'ibis-framework[duckdb]', # ibis-duckdb on conda
]

# Run the example tests by installing examples_tests together with tests
Expand All @@ -117,6 +123,19 @@ def get_setup_version(reponame):
'sphinxext-rediraffe',
]

extras_require['hvdev'] = [
'panel >=0.0.1a1',
'param >=0.0.1a1',
'holoviews >=0.0.1a1',
'datashader >=0.0.1a1',
'colorcet >=0.0.1a1',
'pyviz_comms >=0.0.1a1',
]

extras_require['hvdev_geo'] = [
'geoviews >=0.0.1a1',
]

# until pyproject.toml/equivalent is widely supported (setup_requires
# doesn't work well with pip)
extras_require['build'] = [
Expand Down
Loading