diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 42a00ff..a166abc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,14 +22,17 @@ jobs: python-version: 3.6 - os: macos-latest python-version: 3.8 - timeout-minutes: 40 + # Fiona for Python 3.6 on Windows has build issues + # See https://github.com/conda-forge/fiona-feedstock/issues/171 for more details + - os: windows-latest + python-version: 3.6 + timeout-minutes: 60 defaults: run: shell: bash -l {0} env: PYTHON_VERSION: ${{ matrix.python-version }} - CHANS_DEV: "-c pyviz/label/dev" - CHANS_OSX: "-c pyviz/label/dev -c conda-forge" + CHANS_DEV: "-c conda-forge -c pyviz/label/dev" CHANS: "-c pyviz" GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: @@ -42,6 +45,7 @@ jobs: - uses: conda-incubator/setup-miniconda@v2 with: miniconda-version: "latest" + python-version: ${{ matrix.python-version }} - name: Fetch run: git fetch --prune --tags - name: conda setup @@ -50,21 +54,12 @@ jobs: conda install -c pyviz "pyctdev>=0.5" doit ecosystem_setup doit env_create ${{ env.CHANS_DEV}} --python=${{ matrix.python-version }} - - name: doit develop_install osx - if: contains(matrix.os, 'macos') - run: | - eval "$(conda shell.bash hook)" - conda activate test-environment - doit develop_install ${{ env.CHANS_OSX }} -o tests - pip install hilbertcurve - name: doit develop_install - if: (!contains(matrix.os, 'macos')) run: | eval "$(conda shell.bash hook)" conda activate test-environment conda list doit develop_install ${{ env.CHANS_DEV }} -o tests - pip install hilbertcurve - name: doit env_capture run: | eval "$(conda shell.bash hook)" diff --git a/setup.py b/setup.py index 23849e8..3c880bc 100644 --- a/setup.py +++ b/setup.py @@ -1,13 +1,13 @@ -import sys - import param + from setuptools import find_packages, setup extras_require = { 'tests': [ 'codecov', 'flake8', - 'geopandas', + 'hilbertcurve', + 'geopandas-base', 'hypothesis', 'pytest-cov', 'pytest', @@ -29,27 +29,15 @@ install_requires = [ 'fsspec', 'numba', - 'pandas>=0.25', + 'pandas >=0.25', 'param', - 'pyarrow>=0.15', + 'pyarrow >=1.0', 'python-snappy', 'retrying', + 'numpy', + 'dask[complete] >=2.0' ] -# Checking for platform explicitly because -# pyctdev does not handle dependency conditions -# such as 'numpy<1.20;platform_system=="Darwin"' -if sys.platform == 'darwin': - install_requires.extend([ - 'dask[complete]>=2.0,<2020.12', - 'numpy<1.20', - ]) -else: - install_requires.extend([ - 'dask[complete]>=2.0', - 'numpy', - ]) - setup_args = dict( name='spatialpandas', version=param.version.get_setup_version( diff --git a/spatialpandas/dask.py b/spatialpandas/dask.py index c09f76e..d10fb03 100644 --- a/spatialpandas/dask.py +++ b/spatialpandas/dask.py @@ -15,7 +15,12 @@ from dask import delayed from dask.dataframe.core import get_parallel_type from dask.dataframe.partitionquantiles import partition_quantiles -from dask.dataframe.utils import make_array_nonempty, make_meta, meta_nonempty +from dask.dataframe.extensions import make_array_nonempty +try: + from dask.dataframe.dispatch import make_meta_dispatch + from dask.dataframe.backends import meta_nonempty +except ImportError: + from dask.dataframe.utils import make_meta as make_meta_dispatch, meta_nonempty from .geodataframe import GeoDataFrame from .geometry.base import GeometryDtype, _BaseCoordinateIndexer @@ -99,7 +104,7 @@ def persist(self, **kwargs): ) -@make_meta.register(GeoSeries) +@make_meta_dispatch.register(GeoSeries) def make_meta_series(s, index=None): result = s.head(0) if index is not None: @@ -546,7 +551,7 @@ def __getitem__(self, key): return result -@make_meta.register(GeoDataFrame) +@make_meta_dispatch.register(GeoDataFrame) def make_meta_dataframe(df, index=None): result = df.head(0) if index is not None: