Skip to content

Commit d2a7dba

Browse files
authored
CI: test on Py3.9+ (#33)
* CI: test on Py3.9+ * compat with py39+ * make ruff happy
1 parent 2141768 commit d2a7dba

8 files changed

Lines changed: 43 additions & 7 deletions

File tree

.github/workflows/tests.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ jobs:
1919
os: [macos-latest, ubuntu-latest, windows-latest]
2020
environment-file: [ci/latest.yaml]
2121
include:
22+
- environment-file: ci/39.yaml
23+
os: ubuntu-latest
24+
- environment-file: ci/310.yaml
25+
os: ubuntu-latest
2226
- environment-file: ci/dev.yaml
2327
os: ubuntu-latest
2428
defaults:

ci/310.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: xvec
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- python=3.10
6+
# required
7+
- shapely=2
8+
- xarray
9+
- pyproj
10+
# testing
11+
- pytest
12+
- pytest-cov
13+
- pytest-xdist
14+
- pytest-reportlog
15+
- geopandas-base

ci/39.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: xvec
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- python=3.9
6+
# required
7+
- shapely=2
8+
- xarray
9+
- pyproj
10+
# testing
11+
- pytest
12+
- pytest-cov
13+
- pytest-xdist
14+
- pytest-reportlog
15+
- geopandas-base

ci/dev.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
name: xvec_dev
22
channels:
33
- conda-forge
4-
- conda-forge/label/shapely_dev
54
dependencies:
65
- python
76
# to build from source

ci/latest.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
name: xvec
22
channels:
33
- conda-forge
4-
- conda-forge/label/shapely_dev
54
dependencies:
65
- python
76
# required

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ classifiers = [
2525
"Programming Language :: Python :: 3",
2626
"Topic :: Scientific/Engineering :: GIS",
2727
]
28-
requires-python = ">=3.8"
28+
requires-python = ">=3.9"
2929
dependencies = [
3030
"xarray >= 2022.12.0",
3131
"pyproj >= 3.0.0",
@@ -55,4 +55,4 @@ exclude_lines = [
5555
line-length = 88
5656
select = ["E", "F", "W", "I", "UP", "B", "A", "C4", "Q"]
5757
exclude = ["doc"]
58-
target-version = "py38"
58+
target-version = "py39"

xvec/accessor.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
from __future__ import annotations
2+
13
import warnings
2-
from typing import Any, Hashable, Mapping, Sequence, Union
4+
from collections.abc import Hashable, Mapping, Sequence
5+
from typing import Any
36

47
import numpy as np
58
import pandas as pd
@@ -18,7 +21,7 @@ class XvecAccessor:
1821
Currently works on coordinates with :class:`xvec.GeometryIndex`.
1922
"""
2023

21-
def __init__(self, xarray_obj: Union[xr.Dataset, xr.DataArray]):
24+
def __init__(self, xarray_obj: xr.Dataset | xr.DataArray):
2225
"""xvec init, nothing to be done here."""
2326
self._obj = xarray_obj
2427
self._geom_coords_all = [

xvec/index.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
from __future__ import annotations
22

33
import warnings
4-
from typing import Any, Hashable, Iterable, Mapping, Sequence
4+
from collections.abc import Hashable, Iterable, Mapping, Sequence
5+
from typing import Any
56

67
import numpy as np
78
import pandas as pd

0 commit comments

Comments
 (0)