From 1abfc56437e08067e4a2ea51084a0fd24f3f98fa Mon Sep 17 00:00:00 2001 From: James Gaboardi Date: Fri, 24 Dec 2021 10:53:46 -0500 Subject: [PATCH] add 310 to CI matrix (#208) * add 310 to CI matrix * resolve collections.Iterable failure * slim down testing matrix * path correction * streamline matrix logic --- .ci/{39-DEV.yaml => 310-DEV.yaml} | 2 +- .ci/310.yaml | 27 +++++++++++++++++++++++++++ .github/workflows/unittests.yml | 12 +++++++----- setup.py | 1 + spopt/region/util.py | 2 +- 5 files changed, 37 insertions(+), 7 deletions(-) rename .ci/{39-DEV.yaml => 310-DEV.yaml} (94%) create mode 100644 .ci/310.yaml diff --git a/.ci/39-DEV.yaml b/.ci/310-DEV.yaml similarity index 94% rename from .ci/39-DEV.yaml rename to .ci/310-DEV.yaml index e084899e..ecb4ccbb 100644 --- a/.ci/39-DEV.yaml +++ b/.ci/310-DEV.yaml @@ -2,7 +2,7 @@ name: test channels: - conda-forge dependencies: - - python=3.9 + - python=3.10 - geopandas>=0.7.0 - matplotlib - networkx diff --git a/.ci/310.yaml b/.ci/310.yaml new file mode 100644 index 00000000..b0270bfb --- /dev/null +++ b/.ci/310.yaml @@ -0,0 +1,27 @@ +name: test +channels: + - conda-forge +dependencies: + - python=3.10 + - geopandas>=0.7.0 + - libpysal + - matplotlib + - networkx + - numpy>=1.3 + - pandas>=1 + - scikit-learn>=0.22 + - scipy>=1.0 + - shapely + - spenc + - spaghetti + # testing + - codecov + - coverage + - pytest + - pytest-cov + # docs + - nbsphinx + - numpydoc + - sphinx + - sphinxcontrib-bibtex + - sphinx_bootstrap_theme diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml index edd7ff2c..8e3b4980 100644 --- a/.github/workflows/unittests.yml +++ b/.github/workflows/unittests.yml @@ -15,11 +15,13 @@ timeout-minutes: 30 strategy: matrix: - os: ['macos-latest', 'ubuntu-latest', 'windows-latest'] - environment-file: [.ci/37.yaml, .ci/38.yaml, .ci/39.yaml] + os: [ubuntu-latest] + environment-file: [.ci/37.yaml, .ci/38.yaml, .ci/39.yaml, .ci/310.yaml, .ci/310-DEV.yaml] include: - - environment-file: .ci/39-DEV.yaml - os: ubuntu-latest + - environment-file: .ci/310.yaml + os: macos-latest + - environment-file: .ci/310.yaml + os: windows-latest steps: - name: checkout repo @@ -34,7 +36,7 @@ shell: bash -l {0} run: pip install pulp - - name: install bleeding edge libpysal (only Ubuntu / Python 3.9) + - name: install bleeding edge libpysal (only Ubuntu / Python 3.10) shell: bash -l {0} run: pip install git+https://github.com/pysal/libpysal.git@master if: matrix.os == 'ubuntu-latest' && contains(matrix.environment-file, 'DEV') diff --git a/setup.py b/setup.py index cc685f29..7753656a 100644 --- a/setup.py +++ b/setup.py @@ -56,6 +56,7 @@ def setup_package(): "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", ], license="3-Clause BSD", packages=find_packages(), diff --git a/spopt/region/util.py b/spopt/region/util.py index 326f454d..be9686c1 100755 --- a/spopt/region/util.py +++ b/spopt/region/util.py @@ -65,7 +65,7 @@ def array_from_dict_values(dct, sorted_keys=None, flat_output=False, dtype=np.fl """ if sorted_keys is None: sorted_keys = sorted(dct) - iterable_values = isinstance(dct[sorted_keys[0]], collections.Iterable) + iterable_values = isinstance(dct[sorted_keys[0]], collections.abc.Iterable) if iterable_values: it = itertools.chain.from_iterable(dct[key] for key in sorted_keys) else: