Repository: holoviz/hvplot

Issue:
Support Python 3.11
Python 3.11 provides major performance improvement that I would like to take advantage of when using the HoloViz ecosystem.

Panel and HoloViews already support python 3.11 according to Pypi.

Please support python 3.11. Thanks.


Discussion:

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -38,8 +38,7 @@ def get_setup_version(reponame):
 ]
 
 _examples = [
-    'geoviews >=1.6.0',
-    'numba >=0.51.0',
+    'geoviews >=1.9.0',
     'geopandas',
     'xarray >=0.18.2',
     'networkx >=2.6.3',
@@ -48,7 +47,6 @@ def get_setup_version(reponame):
     'intake-parquet >=0.2.3',
     'intake-xarray >=0.5.0',
     'dask >=2021.3.0',
-    'datashader >=0.6.5',
     'notebook >=5.4',
     'rasterio',
     'cartopy',
@@ -57,7 +55,6 @@ def get_setup_version(reponame):
     'scipy >=1.5.3',
     'pillow >=8.2.0',
     'selenium >=3.141.0',
-    'spatialpandas >=0.4.3',
     'scikit-image >=0.17.2',
     'python-snappy >=0.6.0',
     'pooch >=1.6.0',
@@ -71,6 +68,14 @@ def get_setup_version(reponame):
     'ipykernel <6.18.0'  # temporary
 ]
 
+# Packages not working on python 3.11 because of numba
+if sys.version_info < (3, 11):
+    _examples += [
+        'numba >=0.51.0',
+        'datashader >=0.6.5',
+        'spatialpandas >=0.4.3',
+    ]
+
 extras_require = {
     'tests': [
         'codecov',
@@ -132,6 +137,7 @@ def get_setup_version(reponame):
         "Programming Language :: Python :: 3.8",
         "Programming Language :: Python :: 3.9",
         "Programming Language :: Python :: 3.10",
+        "Programming Language :: Python :: 3.11",
         "Operating System :: OS Independent",
         "Intended Audience :: Science/Research",
         "Intended Audience :: Developers",


Test patch:
diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml
--- a/.github/workflows/test.yaml
+++ b/.github/workflows/test.yaml
@@ -10,9 +10,6 @@ on:
   schedule:
     - cron: '0 15 * * SUN'
 
-env:
-  CACHE_VERSION: 3
-
 jobs:
   pre_commit:
     name: Run pre-commit hooks
@@ -37,76 +34,32 @@ jobs:
       fail-fast: false
       matrix:
         os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
-        python-version: ['3.7', '3.8', '3.9', '3.10']
-        include:
-        - os: ubuntu-latest
-          path: /usr/share/miniconda3/envs/
-        - os: macos-latest
-          path: /Users/runner/miniconda3/envs/
-        - os: windows-latest
-          path: C:\Miniconda3\envs\
-        exclude:
-          # Excluded because of issues with the geo-stack
-          - os: 'macos-latest'
-            python-version: '3.7'
+        # 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: 90
     defaults:
       run:
-        shell: bash -l {0}
+        shell: bash -el {0}
     env:
       DESC: "Python ${{ matrix.python-version }} tests"
       GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-      MAMBA_NO_BANNER: 1
     steps:
-      - uses: actions/checkout@v3
-        with:
-          fetch-depth: "100"
-      - uses: conda-incubator/setup-miniconda@v2
+      - uses: pyviz-dev/holoviz_tasks/install@v0.1a9
         with:
-          miniconda-version: "latest"
-      - name: Fetch unshallow
-        run: git fetch --prune --tags --unshallow
-      - name: Get Today's date for cache
-        run: echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
-      - name: conda cache
-        uses: actions/cache@v2
-        with:
-          path: ${{ matrix.path }}
-          key: ${{ runner.os }}-conda-${{ matrix.python-version }}-${{ hashFiles('setup.py') }}-tests_examples-${{ env.TODAY }}-${{ env.CACHE_VERSION }}
-        id: cache
-      - name: conda setup
-        if: steps.cache.outputs.cache-hit != 'true'
-        run: |
-          conda install -n base -c defaults "conda>=4.12"
-          # TODO: remove pin
-          conda install -n base -c conda-forge "mamba<0.26" --no-update-deps
-          conda create -n test-environment
-          conda activate test-environment
-          conda config --env --append channels pyviz/label/dev --append channels conda-forge
-          conda config --env --remove channels defaults
-          conda install python=${{ matrix.python-version }} pyctdev
-      - name: doit develop_install
-        if: matrix.os != 'macos-latest' && steps.cache.outputs.cache-hit != 'true'
-        run: |
-          conda activate test-environment
-          conda list
-          doit develop_install -o examples -o tests --conda-mode=mamba
-      - name: doit develop_install macos hack
-        if: matrix.os == 'macos-latest' && steps.cache.outputs.cache-hit != 'true'
-        run: |
-          conda activate test-environment
-          conda list
-          doit develop_install -o examples -o tests --conda-mode=mamba || echo "Keep going"
-          pip install --no-deps --no-build-isolation -e .
-      - name: hvplot install if env cached
-        if: steps.cache.outputs.cache-hit == 'true'
-        run: |
-          conda activate test-environment
-          python -m pip install --no-deps --no-build-isolation -e .
-      - 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 examples -o tests"
+          cache: true
+          conda-update: true
+          conda-mamba: mamba
+        id: install
+      - name: patch fiona/geostack on Python 3.7 / Macos
+        if: steps.install.outputs.cache-hit != 'true' && contains(matrix.os, 'macos') && matrix.python-version == '3.7'
         run: |
           conda activate test-environment
-          doit env_capture
+          mamba install "fiona=1.8" "gdal=3.3"
       - name: doit test_flakes
         run: |
           conda activate test-environment
@@ -116,6 +69,8 @@ jobs:
           conda activate test-environment
           doit test_unit
       - name: test examples
+        # Should be removed when numba support python 3.11
+        if: matrix.python-version != '3.11'
         run: |
           conda activate test-environment
           bokeh sampledata