diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 1576f2e..1dfbf98 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -11,10 +11,10 @@ jobs: runs-on: ubuntu-18.04 steps: - - uses: actions/checkout@master + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: "3.x" @@ -24,7 +24,7 @@ jobs: python -m build - name: Publish distribution to PyPI - uses: pypa/gh-action-pypi-publish@master + uses: pypa/gh-action-pypi-publish@v1 with: user: __token__ password: ${{ secrets.pypi_password }} diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 7a3fe29..61eb68c 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -17,12 +17,14 @@ jobs: strategy: matrix: os: [macos-latest, ubuntu-latest, windows-latest] - environment-file: [ci/latest.yaml] + environment-file: [ci/312.yaml] include: - environment-file: ci/39.yaml os: ubuntu-latest - environment-file: ci/310.yaml os: ubuntu-latest + - environment-file: ci/311.yaml + os: ubuntu-latest - environment-file: ci/dev.yaml os: ubuntu-latest defaults: @@ -31,14 +33,13 @@ jobs: steps: - name: checkout repo - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: setup micromamba - uses: mamba-org/provision-with-micromamba@main + uses: mamba-org/setup-micromamba@v1 with: environment-file: ${{ matrix.environment-file }} micromamba-version: "latest" - channel-priority: "flexible" - name: Install xvec run: pip install . diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 56424a9..42aad9e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,14 +1,10 @@ files: 'xvec\/' repos: - - repo: https://github.com/psf/black - rev: 23.9.1 - hooks: - - id: black - language_version: python3 - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.0.292" + rev: v0.1.2 hooks: - id: ruff + - id: ruff-format ci: autofix_prs: false diff --git a/ci/310.yaml b/ci/310.yaml index 700b7b3..094238d 100644 --- a/ci/310.yaml +++ b/ci/310.yaml @@ -4,7 +4,7 @@ channels: dependencies: - python=3.10 # required - - shapely=2 + - shapely >=2 - xarray - pyproj # testing diff --git a/ci/latest.yaml b/ci/311.yaml similarity index 84% rename from ci/latest.yaml rename to ci/311.yaml index 035e532..172d8f4 100644 --- a/ci/latest.yaml +++ b/ci/311.yaml @@ -2,9 +2,9 @@ name: xvec channels: - conda-forge dependencies: - - python + - python=3.11 # required - - shapely=2 + - shapely >=2 - xarray - pyproj # testing diff --git a/ci/312.yaml b/ci/312.yaml new file mode 100644 index 0000000..39d848a --- /dev/null +++ b/ci/312.yaml @@ -0,0 +1,15 @@ +name: xvec +channels: + - conda-forge +dependencies: + - python=3.12 + # required + - shapely >=2 + - xarray + - pyproj + # testing + - pytest + - pytest-cov + - pytest-xdist + - pytest-reportlog + - geopandas-base diff --git a/ci/39.yaml b/ci/39.yaml index 74d0b20..d65bf20 100644 --- a/ci/39.yaml +++ b/ci/39.yaml @@ -4,7 +4,7 @@ channels: dependencies: - python=3.9 # required - - shapely=2 + - shapely >=2 - xarray - pyproj # testing diff --git a/pyproject.toml b/pyproject.toml index 858a062..b32baae 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,3 +56,4 @@ line-length = 88 select = ["E", "F", "W", "I", "UP", "B", "A", "C4", "Q"] exclude = ["doc"] target-version = "py39" +ignore = ['E501', 'Q000', 'Q001', 'Q002', 'Q003', 'W191'] diff --git a/xvec/accessor.py b/xvec/accessor.py index d2fcd21..fae4185 100644 --- a/xvec/accessor.py +++ b/xvec/accessor.py @@ -957,7 +957,7 @@ def extract_points( crs : Any, optional Cordinate reference system of shapely geometries. If ``points`` have a ``.crs`` attribute (e.g. ``geopandas.GeoSeries`` or a ``DataArray`` with - ``"crs"`` in ``.attrs`), ``crs`` will be automatically inferred. For more + ``"crs"`` in ``.attrs``), ``crs`` will be automatically inferred. For more generic objects (numpy array, list), CRS shall be specified manually. index : bool, optional If `points` is a GeoSeries, ``index=True`` will attach its index as another diff --git a/xvec/index.py b/xvec/index.py index 4cbc1ee..04478a6 100644 --- a/xvec/index.py +++ b/xvec/index.py @@ -35,7 +35,8 @@ def _get_common_crs(crs_set: set[CRS | None]): warnings.warn( # noqa: B028 "CRS not set for some of the concatenation inputs. " f"Setting output's CRS as {names[0]} " - "(the single non-null CRS provided)." + "(the single non-null CRS provided).", + stacklevel=3, ) return crs_not_none[0]