Skip to content

Commit

Permalink
Provide testing support for Python 3.12 – drop support for {3.8, 3.9} (
Browse files Browse the repository at this point in the history
…#751)

* update precommit

* update CI env

* update workflows

* Python 312 support - drop 38/39

* update test for Python 312 pass (minor rounding)

* update CI versions/syntax

* proper dev install of shapely

* martin suggestion - geos

* matplotlib for esda

* matplotlib for esda

* stable -> latest

* bash evaluator

* bash evaluator [2]

* not no-optional experssion

* not no-optional expression [2]

* not no-optional expression [3]

* remove section from README
  • Loading branch information
jGaboardi authored Nov 28, 2023
1 parent c09f1ec commit 2d60044
Show file tree
Hide file tree
Showing 20 changed files with 120 additions and 172 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
strategy:
matrix:
os: ['ubuntu-latest']
environment-file: [ci/311-BASE.yaml]
environment-file: [ci/312-stable.yaml]
experimental: [false]
defaults:
run:
Expand All @@ -28,6 +28,8 @@
steps:
- name: checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches and tags.

- name: setup micromamba
uses: mamba-org/setup-micromamba@v1
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release_and_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches and tags.

- name: Set up python
uses: actions/setup-python@v4
Expand Down
48 changes: 23 additions & 25 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,32 +17,24 @@
required: false

jobs:
linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: pre-commit/[email protected]

testing:
needs: linting
name: ${{ matrix.os }}, ${{ matrix.environment-file }}
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
matrix:
os: [ubuntu-latest]
environment-file:
- ci/38-BASE.yaml
- ci/39-BASE.yaml
- ci/310-BASE.yaml
- ci/311-BARE.yaml
- ci/311-BASE.yaml
- ci/311-DEV.yaml
- ci/310-oldest.yaml
- ci/310-no-optional.yaml
- ci/310-latest.yaml
- ci/311-latest.yaml
- ci/312-latest.yaml
- ci/312-dev.yaml
include:
- environment-file: ci/311-BASE.yaml
- environment-file: ci/312-latest.yaml
os: macos-latest
- environment-file: ci/311-BASE.yaml
- environment-file: ci/312-latest.yaml
os: windows-latest
fail-fast: false

Expand All @@ -53,19 +45,14 @@
steps:
- name: checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches and tags.

- name: setup micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ${{ matrix.environment-file }}
micromamba-version: 'latest'
channel-priority: 'flexible'

- name: install bleeding edge libpysal & esda (Ubuntu / Python 3.11)
run: |
pip install git+https://github.com/pysal/libpysal.git@main
pip install git+https://github.com/pysal/esda.git@main
if: matrix.os == 'ubuntu-latest' && contains(matrix.environment-file, 'DEV')

- name: environment info
run: |
Expand All @@ -74,11 +61,22 @@
- name: spatial versions (if geopandas is installed)
run: 'python -c "import geopandas; geopandas.show_versions();"'
if: contains(matrix.environment-file, 'DEV') || contains(matrix.environment-file, 'BASE')
if: contains(matrix.environment-file, 'no-optional') != true

- name: run tests
run: |
pytest spaghetti -v -r a -n auto --cov spaghetti --doctest-modules --cov-report xml --color yes --cov-append --cov-report term-missing --timeout 60
pytest \
spaghetti \
-v \
-r a \
-n auto \
--color yes \
--cov spaghetti \
--cov-append \
--cov-report term-missing \
--cov-report xml \
--doctest-modules \
--timeout 60
- name: codecov
uses: codecov/codecov-action@v3
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
files: "spaghetti\/"
repos:
- repo: https://github.com/psf/black
rev: "23.9.1"
rev: "23.11.0"
hooks:
- id: black
language_version: python3
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.0.292"
rev: "v0.1.6"
hooks:
- id: ruff

Expand Down
20 changes: 1 addition & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,22 @@ Spaghetti is an open-source Python library for the analysis of network-based spa
<img src="docs/_static/images/mst_logo_pasta.png" width="600" height="225" />
</p>


|[![PyPI version](https://badge.fury.io/py/spaghetti.svg)](https://badge.fury.io/py/spaghetti)| [![Conda Version](https://img.shields.io/conda/vn/conda-forge/spaghetti.svg)](https://anaconda.org/conda-forge/spaghetti) | ![tag](https://img.shields.io/github/v/release/pysal/spaghetti?include_prereleases&sort=semver) | [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/pysal/spaghetti/main)
|:---:|:---:|:---:|:---:|
|[![Downloads](https://pepy.tech/badge/spaghetti)](https://pepy.tech/project/spaghetti) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/spaghetti.svg)](https://anaconda.org/conda-forge/spaghetti) | [![Documentation](https://img.shields.io/static/v1.svg?label=docs&message=current&color=9cf)](http://pysal.org/spaghetti/) | [![Gitter](https://badges.gitter.im/pysal/Spaghetti.svg)](https://gitter.im/pysal/Spaghetti?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
| ![Pypi python versions](https://img.shields.io/pypi/pyversions/spaghetti.svg) | [![Conda Recipe](https://img.shields.io/badge/recipe-spaghetti-red.svg)](https://github.com/conda-forge/spaghetti-feedstock) | [![codecov](https://codecov.io/gh/pysal/spaghetti/branch/main/graph/badge.svg)](https://codecov.io/gh/pysal/spaghetti) | [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
| [![Continuous Integration](https://github.com/pysal/spaghetti/actions/workflows/testing.yml/badge.svg)](https://github.com/pysal/spaghetti/actions/workflows/testing.yml) | [![status](https://joss.theoj.org/papers/52b8d0c81bbf311465b45bfc26379e74/status.svg)](https://joss.theoj.org/papers/52b8d0c81bbf311465b45bfc26379e74) | [![DOI](https://zenodo.org/badge/88305306.svg)](https://zenodo.org/badge/latestdoi/88305306) | [![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)


## Examples

The following are a selection of some examples that can be launched individually as interactive binders from the links on their respective pages. Additional examples can be found in the [Tutorials](https://pysal.org/spaghetti/tutorials.html) section of the documentation. See the [`pysal/notebooks`](http://pysal.org/notebooks) project for a [`jupyter-book`](https://github.com/choldgraf/jupyter-book) version of this repository.
* [Quickstart](https://pysal.org/spaghetti/notebooks/quickstart.html)
* [Shortest Path Visualization](https://pysal.org/spaghetti/notebooks/shortest-path-visualization.html)
* [Caveats](https://pysal.org/spaghetti/notebooks/caveats.html)


## Installation

Python [3.8](https://docs.python.org/3.8/), [3.9](https://docs.python.org/3.9/), [3.10](https://docs.python.org/3.10/), and [3.11](https://docs.python.org/3.11/) are tested for support by `spaghetti`. Please make sure that you are operating in a Python >= 3.8 environment.
Python >= [3.10](https://docs.python.org/3.10/) is tested for support by `spaghetti`. Please make sure that you are operating in a Python >= 3.10 environment.

**Installing with `conda` via [`conda-forge`](https://github.com/conda-forge/spaghetti-feedstock) (highly recommended)**

Expand Down Expand Up @@ -64,7 +61,6 @@ Install the most current development version of `spaghetti` by running:
$ pip install git+https://github.com/pysal/spaghetti
```


## Requirements

- [`esda`](https://pysal.org/esda/)
Expand All @@ -74,13 +70,11 @@ $ pip install git+https://github.com/pysal/spaghetti
- [`rtree`](https://rtree.readthedocs.io/en/stable/)
- [`scipy`](http://scipy.github.io/devdocs/)


## Soft Dependencies

- [`geopandas`](https://geopandas.org/en/stable/)
- [`shapely`](https://shapely.readthedocs.io/en/stable/)


## History

`spaghetti` was
Expand All @@ -103,29 +97,24 @@ such as spatial statistical tools with `esda` and integration with core componen
`libpysal.cg` (computational geometry and data structures),
`libpysal.io` (input-output), and `libpysal.examples` (built-in example data).


## Contribute

PySAL-spaghetti is under active development and contributors are welcome.

If you have any suggestions, feature requests, or bug reports, please open new [issues](https://github.com/pysal/spaghetti/issues) on GitHub. To submit patches, please review [PySAL's documentation for developers](https://pysal.org/docs/devs/), the PySAL [development guidelines](https://github.com/pysal/pysal/wiki), the `spaghetti` [contributing guidelines](https://github.com/pysal/spaghetti/blob/main/.github/CONTRIBUTING.md) before opening a [pull request](https://github.com/pysal/spaghetti/pulls). Once your changes get merged, you’ll automatically be added to the [Contributors List](https://github.com/pysal/spaghetti/graphs/contributors).


## Support

If you are having issues, please [create an issue](https://github.com/pysal/spaghetti/issues), start a [discussion](https://github.com/pysal/spaghetti/discussions), or talk to us in the [gitter room](https://gitter.im/pysal/spaghetti). All questions, comments, & discussions should happen in a public forum, where possible. Private messages and emails will not be answered in a substantive manner.


## Code of Conduct

As a PySAL-federated project, `spaghetti` follows the [Code of Conduct](https://github.com/pysal/governance/blob/main/conduct/code_of_conduct.rst) under the [PySAL governance model](https://github.com/pysal/governance).


## License

The project is licensed under the [BSD 3-Clause license](https://github.com/pysal/spaghetti/blob/main/LICENSE.txt).


## BibTeX Citation

If you use PySAL-spaghetti in a scientific publication, we would appreciate using the following citations:
Expand Down Expand Up @@ -157,13 +146,6 @@ If you use PySAL-spaghetti in a scientific publication, we would appreciate usin
}
```


## Citing Work

* **Lovelace, R**. *Open source tools for geographic analysis in transport planning*. Journal of Geographical Systems (2021). https://doi.org/10.1007/s10109-020-00342-2.
* **Rey, SJ et al**. *The **PySAL** Ecosystem: Philosophy and Implementation*. Geographical Analysis (2021). https://doi.org/10.1111/gean.12276.


## Funding
This project is/was partially funded through:

Expand Down
10 changes: 3 additions & 7 deletions ci/310-BASE.yaml → ci/310-latest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,14 @@ dependencies:
- esda
- libpysal
- numpy
- pandas>=1.0
- pandas
- pip
- rtree
- scipy>=1.0
- scipy
- watermark
# testing/formatting
- black
# testing
- codecov
- pytest
- pytest-cov
- pytest-timeout
- pytest-xdist
# optional
- geopandas>=0.12.0
- shapely>=2
15 changes: 6 additions & 9 deletions ci/311-DEV.yaml → ci/310-no-optional.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,18 @@ name: test
channels:
- conda-forge
dependencies:
- python=3.11
- python=3.10
# required
- esda
- libpysal=4.7.0 # no geopandas/shapely
- numpy
- pandas>=1.0
- pandas
- pip
- rtree
- scipy>=1.0
- watermark
# testing/formatting
- black
- scipy
# testing
- codecov
- pytest
- pytest-cov
- pytest-timeout
- pytest-xdist
# optional
- geopandas>=0.12.0
- shapely>=2
22 changes: 22 additions & 0 deletions ci/310-oldest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: test
channels:
- conda-forge
dependencies:
- python=3.10
# required
- esda=2.1
- libpysal=4.6
- numpy=1.22
- pandas=1.4
- pip
- rtree=1.0
- scipy=1.8
# testing
- codecov
- pytest
- pytest-cov
- pytest-timeout
- pytest-xdist
# optional
- geopandas=0.12
- shapely=2.0
7 changes: 3 additions & 4 deletions ci/311-BARE.yaml → ci/311-latest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ dependencies:
- esda
- libpysal
- numpy
- pandas>=1.0
- pandas
- pip
- rtree
- scipy>=1.0
- scipy
- watermark
# testing/formatting
- black
# testing
- codecov
- pytest
- pytest-cov
Expand Down
27 changes: 27 additions & 0 deletions ci/312-dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: test
channels:
- conda-forge
dependencies:
- python=3.12
# required
- geos # for shapely
- matplotlib # for esda
- numpy
- pip
- rtree
- watermark
# testing
- codecov
- pytest
- pytest-cov
- pytest-timeout
- pytest-xdist
- pip:
# dev versions of packages
- --pre --index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple --extra-index-url https://pypi.org/simple
- pandas
- scipy
- git+https://github.com/pysal/esda.git@main
- git+https://github.com/geopandas/geopandas.git@main
- git+https://github.com/pysal/libpysal.git@main
- git+https://github.com/shapely/shapely.git@main
12 changes: 4 additions & 8 deletions ci/311-BASE.yaml → ci/312-latest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,22 @@ name: test
channels:
- conda-forge
dependencies:
- python=3.11
- python=3.12
# required
- esda
- libpysal
- numpy
- pandas>=1.0
- pandas
- pip
- rtree
- scipy>=1.0
- scipy
- watermark
# testing/formatting
- black
# testing
- codecov
- pytest
- pytest-cov
- pytest-timeout
- pytest-xdist
# optional
- geopandas>=0.12.0
- shapely>=2
# for docs build action (this env only)
- nbsphinx
- numpydoc
Expand Down
24 changes: 0 additions & 24 deletions ci/38-BASE.yaml

This file was deleted.

Loading

0 comments on commit 2d60044

Please sign in to comment.