Skip to content

Commit 718c414

Browse files
authored
MAINT: test on Python 3.12, update actions, use ruff format (#54)
* DOC: fix formatting * MAINT: add PYthon 3.12, use ruff formatter * ignore conflicting rules
1 parent 0a3d081 commit 718c414

10 files changed

Lines changed: 33 additions & 19 deletions

File tree

.github/workflows/release.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ jobs:
1111
runs-on: ubuntu-18.04
1212

1313
steps:
14-
- uses: actions/checkout@master
14+
- uses: actions/checkout@v4
1515

1616
- name: Set up Python
17-
uses: actions/setup-python@v2
17+
uses: actions/setup-python@v4
1818
with:
1919
python-version: "3.x"
2020

@@ -24,7 +24,7 @@ jobs:
2424
python -m build
2525
2626
- name: Publish distribution to PyPI
27-
uses: pypa/gh-action-pypi-publish@master
27+
uses: pypa/gh-action-pypi-publish@v1
2828
with:
2929
user: __token__
3030
password: ${{ secrets.pypi_password }}

.github/workflows/tests.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@ jobs:
1717
strategy:
1818
matrix:
1919
os: [macos-latest, ubuntu-latest, windows-latest]
20-
environment-file: [ci/latest.yaml]
20+
environment-file: [ci/312.yaml]
2121
include:
2222
- environment-file: ci/39.yaml
2323
os: ubuntu-latest
2424
- environment-file: ci/310.yaml
2525
os: ubuntu-latest
26+
- environment-file: ci/311.yaml
27+
os: ubuntu-latest
2628
- environment-file: ci/dev.yaml
2729
os: ubuntu-latest
2830
defaults:
@@ -31,14 +33,13 @@ jobs:
3133

3234
steps:
3335
- name: checkout repo
34-
uses: actions/checkout@v2
36+
uses: actions/checkout@v4
3537

3638
- name: setup micromamba
37-
uses: mamba-org/provision-with-micromamba@main
39+
uses: mamba-org/setup-micromamba@v1
3840
with:
3941
environment-file: ${{ matrix.environment-file }}
4042
micromamba-version: "latest"
41-
channel-priority: "flexible"
4243

4344
- name: Install xvec
4445
run: pip install .

.pre-commit-config.yaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
files: 'xvec\/'
22
repos:
3-
- repo: https://github.com/psf/black
4-
rev: 23.9.1
5-
hooks:
6-
- id: black
7-
language_version: python3
83
- repo: https://github.com/astral-sh/ruff-pre-commit
9-
rev: "v0.0.292"
4+
rev: v0.1.2
105
hooks:
116
- id: ruff
7+
- id: ruff-format
128

139
ci:
1410
autofix_prs: false

ci/310.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ channels:
44
dependencies:
55
- python=3.10
66
# required
7-
- shapely=2
7+
- shapely >=2
88
- xarray
99
- pyproj
1010
# testing

ci/latest.yaml renamed to ci/311.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: xvec
22
channels:
33
- conda-forge
44
dependencies:
5-
- python
5+
- python=3.11
66
# required
7-
- shapely=2
7+
- shapely >=2
88
- xarray
99
- pyproj
1010
# testing

ci/312.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.12
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ channels:
44
dependencies:
55
- python=3.9
66
# required
7-
- shapely=2
7+
- shapely >=2
88
- xarray
99
- pyproj
1010
# testing

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,4 @@ line-length = 88
5656
select = ["E", "F", "W", "I", "UP", "B", "A", "C4", "Q"]
5757
exclude = ["doc"]
5858
target-version = "py39"
59+
ignore = ['E501', 'Q000', 'Q001', 'Q002', 'Q003', 'W191']

xvec/accessor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,7 @@ def extract_points(
957957
crs : Any, optional
958958
Cordinate reference system of shapely geometries. If ``points`` have a
959959
``.crs`` attribute (e.g. ``geopandas.GeoSeries`` or a ``DataArray`` with
960-
``"crs"`` in ``.attrs`), ``crs`` will be automatically inferred. For more
960+
``"crs"`` in ``.attrs``), ``crs`` will be automatically inferred. For more
961961
generic objects (numpy array, list), CRS shall be specified manually.
962962
index : bool, optional
963963
If `points` is a GeoSeries, ``index=True`` will attach its index as another

xvec/index.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ def _get_common_crs(crs_set: set[CRS | None]):
3535
warnings.warn( # noqa: B028
3636
"CRS not set for some of the concatenation inputs. "
3737
f"Setting output's CRS as {names[0]} "
38-
"(the single non-null CRS provided)."
38+
"(the single non-null CRS provided).",
39+
stacklevel=3,
3940
)
4041
return crs_not_none[0]
4142

0 commit comments

Comments
 (0)