From 092a6b13a4047084c63c110e2fcc1c5c97371472 Mon Sep 17 00:00:00 2001 From: Sean Gillies Date: Thu, 29 Feb 2024 11:09:44 -0700 Subject: [PATCH 01/15] Require Python 3.9+ Drop older versions from test matrix, update GDAL versions. --- .github/workflows/tests.yml | 12 +++++------- CHANGES.txt | 8 ++++++++ README.rst | 2 +- pyproject.toml | 5 ++--- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index acc240df4..82f81f2e4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -39,18 +39,16 @@ jobs: fail-fast: false matrix: include: - - python-version: '3.7' - gdal-version: '3.4.3' - - python-version: '3.8' + - python-version: '3.9' gdal-version: '3.4.3' - python-version: '3.9' gdal-version: '3.5.3' - python-version: '3.10' gdal-version: '3.6.4' - python-version: '3.11' - gdal-version: '3.7.1' + gdal-version: '3.7.3' - python-version: '3.12' - gdal-version: '3.7.1' + gdal-version: '3.8.3' steps: - uses: actions/checkout@v4 @@ -94,9 +92,9 @@ jobs: matrix: include: - os: macos-latest - python-version: '3.10' + python-version: '3.11' - os: windows-latest - python-version: '3.10' + python-version: '3.11' steps: - uses: actions/checkout@v4 diff --git a/CHANGES.txt b/CHANGES.txt index f0c2f0280..c18b0dd3e 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -3,6 +3,14 @@ Changes All issue numbers are relative to https://github.com/Toblerity/Fiona/issues. +Next +---- + +Python version: + +Fiona 1.10 will be compatible with Numpy versions 1 and 2 and will require +Python version 3.9 or higher. + 1.9.5 (2023-10-11) ------------------ diff --git a/README.rst b/README.rst index e75fc8394..76c749048 100644 --- a/README.rst +++ b/README.rst @@ -47,7 +47,7 @@ environment variable. Many users find Anaconda and conda-forge a good way to install Fiona and get access to more optional format drivers (like GML). -Fiona 2.0 requires Python 3.7 or higher and GDAL 3.2 or higher. +Fiona 1.10 requires Python 3.9 or higher and GDAL 3.4 or higher. Python Usage ============ diff --git a/pyproject.toml b/pyproject.toml index 7f9c8359f..9561c640f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,14 +20,13 @@ classifiers = [ "Intended Audience :: Science/Research", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Topic :: Scientific/Engineering :: GIS", ] -requires-python = ">=3.7" +requires-python = ">=3.9" dependencies = [ "attrs>=19.2.0", "certifi", From e711ed255f9af7e8749e353cab8b5ceff303d4c5 Mon Sep 17 00:00:00 2001 From: Sean Gillies Date: Thu, 29 Feb 2024 12:51:20 -0700 Subject: [PATCH 02/15] Remove unused c++ cdef class and directive --- fiona/_vsiopener.pyx | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/fiona/_vsiopener.pyx b/fiona/_vsiopener.pyx index c94be1f24..9bc6966ff 100644 --- a/fiona/_vsiopener.pyx +++ b/fiona/_vsiopener.pyx @@ -1,12 +1,8 @@ -# cython: language_level=3, boundscheck=False -# distutils: language = c++ """Bridge between Python file openers and GDAL VSI. Based on _filepath.pyx. """ -# include "gdal.pxi" - import contextlib from contextvars import ContextVar import logging @@ -25,15 +21,6 @@ from fiona.errors import OpenerRegistrationError log = logging.getLogger(__name__) - -# NOTE: This has to be defined outside of gdal.pxi or other C extensions will -# try to compile C++ only code included in this header. -cdef extern from "cpl_vsi_virtual.h": - cdef cppclass VSIFileManager: - @staticmethod - void* GetHandler(const char*) - - # Prefix for all in-memory paths used by GDAL's VSI system # Except for errors and log messages this shouldn't really be seen by the user cdef str PREFIX = "/vsipyopener/" From eb568adf1ec4c9bdba93e7cbcc0285415e44d37e Mon Sep 17 00:00:00 2001 From: Sean Gillies Date: Thu, 29 Feb 2024 13:02:13 -0700 Subject: [PATCH 03/15] Add numpy dependency for conda builds --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 82f81f2e4..7e0da63cd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -109,7 +109,7 @@ jobs: run: | conda config --prepend channels conda-forge conda config --set channel_priority strict - conda create -n test python=${{ matrix.python-version }} libgdal geos=3.10.3 cython=3 + conda create -n test python=${{ matrix.python-version }} 'libgdal geos=3.10.3 cython=3 numpy>=1.25,<2' source activate test python -m pip install -e . || python -m pip install -e . python -m pip install -r requirements-dev.txt @@ -120,7 +120,7 @@ jobs: run: | conda config --prepend channels conda-forge conda config --set channel_priority strict - conda create -n test python=${{ matrix.python-version }} libgdal geos=3.10.3 cython=3 + conda create -n test python=${{ matrix.python-version }} 'libgdal geos=3.10.3 cython=3 numpy>=1.25,<2' source activate test GDAL_VERSION="3.5" python setup.py build_ext -I"C:\\Miniconda\\envs\\test\\Library\\include" -lgdal_i -L"C:\\Miniconda\\envs\\test\\Library\\lib" install python -m pip install -r requirements-dev.txt From 1a23709c7c67691fb4933b9c1cab377ee6f7a393 Mon Sep 17 00:00:00 2001 From: Sean Gillies Date: Thu, 29 Feb 2024 13:06:08 -0700 Subject: [PATCH 04/15] Second try at numpy spec --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7e0da63cd..7182b6b8a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -109,7 +109,7 @@ jobs: run: | conda config --prepend channels conda-forge conda config --set channel_priority strict - conda create -n test python=${{ matrix.python-version }} 'libgdal geos=3.10.3 cython=3 numpy>=1.25,<2' + conda create -n test python=${{ matrix.python-version }} 'libgdal geos=3.10.3 cython=3 numpy<2' source activate test python -m pip install -e . || python -m pip install -e . python -m pip install -r requirements-dev.txt @@ -120,7 +120,7 @@ jobs: run: | conda config --prepend channels conda-forge conda config --set channel_priority strict - conda create -n test python=${{ matrix.python-version }} 'libgdal geos=3.10.3 cython=3 numpy>=1.25,<2' + conda create -n test python=${{ matrix.python-version }} 'libgdal geos=3.10.3 cython=3 numpy<2' source activate test GDAL_VERSION="3.5" python setup.py build_ext -I"C:\\Miniconda\\envs\\test\\Library\\include" -lgdal_i -L"C:\\Miniconda\\envs\\test\\Library\\lib" install python -m pip install -r requirements-dev.txt From 2714cf159c1b1d3f46a0c9fae6c34225519b46e8 Mon Sep 17 00:00:00 2001 From: Sean Gillies Date: Thu, 29 Feb 2024 15:03:07 -0700 Subject: [PATCH 05/15] Again with the version spec --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7182b6b8a..4b019cdd8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -109,7 +109,7 @@ jobs: run: | conda config --prepend channels conda-forge conda config --set channel_priority strict - conda create -n test python=${{ matrix.python-version }} 'libgdal geos=3.10.3 cython=3 numpy<2' + conda create -n test python=${{ matrix.python-version }} libgdal geos=3.10.3 cython=3 "numpy>=1.25,<2" source activate test python -m pip install -e . || python -m pip install -e . python -m pip install -r requirements-dev.txt @@ -120,7 +120,7 @@ jobs: run: | conda config --prepend channels conda-forge conda config --set channel_priority strict - conda create -n test python=${{ matrix.python-version }} 'libgdal geos=3.10.3 cython=3 numpy<2' + conda create -n test python=${{ matrix.python-version }} 'libgdal geos=3.10.3 cython=3 "numpy>=1.25,<2" source activate test GDAL_VERSION="3.5" python setup.py build_ext -I"C:\\Miniconda\\envs\\test\\Library\\include" -lgdal_i -L"C:\\Miniconda\\envs\\test\\Library\\lib" install python -m pip install -r requirements-dev.txt From 8d7ae008077a55f12d5f0cf6116c8d79c90cabc2 Mon Sep 17 00:00:00 2001 From: Sean Gillies Date: Thu, 29 Feb 2024 15:05:46 -0700 Subject: [PATCH 06/15] Fix broken YAML --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4b019cdd8..96003e3e0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -120,7 +120,7 @@ jobs: run: | conda config --prepend channels conda-forge conda config --set channel_priority strict - conda create -n test python=${{ matrix.python-version }} 'libgdal geos=3.10.3 cython=3 "numpy>=1.25,<2" + conda create -n test python=${{ matrix.python-version }} libgdal geos=3.10.3 cython=3 "numpy>=1.25,<2" source activate test GDAL_VERSION="3.5" python setup.py build_ext -I"C:\\Miniconda\\envs\\test\\Library\\include" -lgdal_i -L"C:\\Miniconda\\envs\\test\\Library\\lib" install python -m pip install -r requirements-dev.txt From 8d0b52c94acd5664856ad063e64084558f559633 Mon Sep 17 00:00:00 2001 From: Sean Gillies Date: Thu, 29 Feb 2024 17:18:27 -0700 Subject: [PATCH 07/15] Address weird Windows path parsing --- fiona/_path.py | 14 ++++++++++---- tests/test__path.py | 13 +++++++++++++ 2 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 tests/test__path.py diff --git a/fiona/_path.py b/fiona/_path.py index 045a62a09..b3cc744aa 100644 --- a/fiona/_path.py +++ b/fiona/_path.py @@ -65,7 +65,13 @@ class _ParsedPath(_Path): @classmethod def from_uri(cls, uri): parts = urlparse(uri) - path = pathlib.Path(parts.path).as_posix() if parts.path else parts.path + if sys.platform == "win32" and re.match(r"^[a-zA-Z]\:", parts.netloc) and not parts.path: + parsed_path = parts.netloc + parsed_netloc = None + else: + parsed_path = parts.path + parsed_netloc = parts.netloc + path = pathlib.Path(parsed_path).as_posix() if parsed_path else parsed_path scheme = parts.scheme or None if parts.query: @@ -78,11 +84,11 @@ def from_uri(cls, uri): else: archive = None - if parts.scheme and parts.netloc: + if scheme and parsed_netloc: if archive: - archive = parts.netloc + archive + archive = parsed_netloc + archive else: - path = parts.netloc + path + path = parsed_netloc + path return _ParsedPath(path, archive, scheme) diff --git a/tests/test__path.py b/tests/test__path.py new file mode 100644 index 000000000..bf610d006 --- /dev/null +++ b/tests/test__path.py @@ -0,0 +1,13 @@ +"""_path tests.""" + +import sys + +from fiona._path import _parse_path, _vsi_path + + +def test_parse_zip_windows(monkeypatch): + """Parse a zip+ Windows path.""" + monkeypatch.setattr(sys, "platform", "win32") + path = _parse_path("zip://D:\\a\\Fiona\\Fiona\\tests\\data\\coutwildrnp.zip!coutwildrnp.shp") + vsi_path = _vsi_path(path) + assert vsi_path == "/vsizip/D:\\a\\Fiona\\Fiona\\tests\\data\\coutwildrnp.zip/coutwildrnp.shp" From 4fd6c4136724a3d5c4d227a32d1ded311c081390 Mon Sep 17 00:00:00 2001 From: Sean Gillies Date: Thu, 29 Feb 2024 17:36:08 -0700 Subject: [PATCH 08/15] Adjust a few tests --- tests/test_collection.py | 5 +++-- tests/test_layer.py | 12 ++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/tests/test_collection.py b/tests/test_collection.py index 105c816ac..8e7ecae6c 100644 --- a/tests/test_collection.py +++ b/tests/test_collection.py @@ -2,6 +2,7 @@ import datetime import logging +from pathlib import Path import random import re import sys @@ -98,14 +99,14 @@ def shapefile(self, path_coutwildrnp_shp): def test_open_repr(self, path_coutwildrnp_shp): assert repr(self.c) == ( - f"" ) def test_closed_repr(self, path_coutwildrnp_shp): self.c.close() assert repr(self.c) == ( - f"" ) diff --git a/tests/test_layer.py b/tests/test_layer.py index 9e6b1196e..0105332b1 100644 --- a/tests/test_layer.py +++ b/tests/test_layer.py @@ -1,3 +1,7 @@ +"""Layer tests.""" + +from pathlib import Path + import pytest import fiona @@ -18,14 +22,14 @@ def shapefile(self, path_coutwildrnp_shp): def test_open_repr(self, path_coutwildrnp_shp): assert repr(self.c) == ( - f"" ) def test_closed_repr(self, path_coutwildrnp_shp): self.c.close() assert repr(self.c) == ( - f"" ) @@ -42,14 +46,14 @@ def shapefile(self, data_dir): def test_open_repr(self, data_dir): assert repr(self.c) == ( - f"" ) def test_closed_repr(self, data_dir): self.c.close() assert repr(self.c) == ( - f"" ) From 00286512e4020754b49c190392413166ebe2cb42 Mon Sep 17 00:00:00 2001 From: Sean Gillies Date: Thu, 29 Feb 2024 18:45:04 -0700 Subject: [PATCH 09/15] Moar windows/posix path bs --- tests/test__path.py | 2 +- tests/test_collection.py | 2 +- tests/test_collection_legacy.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test__path.py b/tests/test__path.py index bf610d006..e1f6b42b3 100644 --- a/tests/test__path.py +++ b/tests/test__path.py @@ -10,4 +10,4 @@ def test_parse_zip_windows(monkeypatch): monkeypatch.setattr(sys, "platform", "win32") path = _parse_path("zip://D:\\a\\Fiona\\Fiona\\tests\\data\\coutwildrnp.zip!coutwildrnp.shp") vsi_path = _vsi_path(path) - assert vsi_path == "/vsizip/D:\\a\\Fiona\\Fiona\\tests\\data\\coutwildrnp.zip/coutwildrnp.shp" + assert Path(vsi_path).as_posix() == "/vsizip/D:/a/Fiona/Fiona/tests/data/coutwildrnp.zip/coutwildrnp.shp" diff --git a/tests/test_collection.py b/tests/test_collection.py index 8e7ecae6c..0e38e4268 100644 --- a/tests/test_collection.py +++ b/tests/test_collection.py @@ -111,7 +111,7 @@ def test_closed_repr(self, path_coutwildrnp_shp): ) def test_path(self, path_coutwildrnp_shp): - assert self.c.path == path_coutwildrnp_shp + assert self.c.path == Path(path_coutwildrnp_shp).as_posix() def test_name(self): assert self.c.name == "coutwildrnp" diff --git a/tests/test_collection_legacy.py b/tests/test_collection_legacy.py index 1acd7d842..f46f1ec25 100644 --- a/tests/test_collection_legacy.py +++ b/tests/test_collection_legacy.py @@ -21,14 +21,14 @@ def tearDown(self): def test_open_repr(self): assert repr(self.c) == ( - f"" ) def test_closed_repr(self): self.c.close() assert repr(self.c) == ( - f"" ) From 7bc1e493b3b39e5147805ce7e8f1f9625c15f5b5 Mon Sep 17 00:00:00 2001 From: Sean Gillies Date: Thu, 29 Feb 2024 18:52:31 -0700 Subject: [PATCH 10/15] import Path --- tests/test__path.py | 1 + tests/test_collection_legacy.py | 1 + 2 files changed, 2 insertions(+) diff --git a/tests/test__path.py b/tests/test__path.py index e1f6b42b3..3813ab962 100644 --- a/tests/test__path.py +++ b/tests/test__path.py @@ -1,5 +1,6 @@ """_path tests.""" +from pathlib import Path import sys from fiona._path import _parse_path, _vsi_path diff --git a/tests/test_collection_legacy.py b/tests/test_collection_legacy.py index f46f1ec25..f34bf6109 100644 --- a/tests/test_collection_legacy.py +++ b/tests/test_collection_legacy.py @@ -1,5 +1,6 @@ # Testing collections and workspaces +from pathlib import Path import unittest import re From 7b6cd5cfd9cfab11fbbbe4a27e0a4549d5067048 Mon Sep 17 00:00:00 2001 From: Sean Gillies Date: Fri, 1 Mar 2024 08:54:04 -0700 Subject: [PATCH 11/15] Assert that drive letter remains and ! is gone in win32 path test --- tests/test__path.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test__path.py b/tests/test__path.py index 3813ab962..68d4f2677 100644 --- a/tests/test__path.py +++ b/tests/test__path.py @@ -11,4 +11,5 @@ def test_parse_zip_windows(monkeypatch): monkeypatch.setattr(sys, "platform", "win32") path = _parse_path("zip://D:\\a\\Fiona\\Fiona\\tests\\data\\coutwildrnp.zip!coutwildrnp.shp") vsi_path = _vsi_path(path) - assert Path(vsi_path).as_posix() == "/vsizip/D:/a/Fiona/Fiona/tests/data/coutwildrnp.zip/coutwildrnp.shp" + assert vsi_path.startswith("/vsizip/D") + assert vsi_path.endswith("coutwildrnp.zip/coutwildrnp.shp") From 0420972c64b5cb12cb1319db0f6805abfbfd124d Mon Sep 17 00:00:00 2001 From: Sean Gillies Date: Fri, 1 Mar 2024 12:52:54 -0700 Subject: [PATCH 12/15] Stop using as_posix in _path.py --- fiona/_path.py | 20 ++++++-------------- tests/test_collection.py | 6 +++--- tests/test_collection_legacy.py | 4 ++-- tests/test_layer.py | 8 ++++---- 4 files changed, 15 insertions(+), 23 deletions(-) diff --git a/fiona/_path.py b/fiona/_path.py index b3cc744aa..8d511a738 100644 --- a/fiona/_path.py +++ b/fiona/_path.py @@ -5,6 +5,7 @@ """ +import os import pathlib import re import sys @@ -71,7 +72,8 @@ def from_uri(cls, uri): else: parsed_path = parts.path parsed_netloc = parts.netloc - path = pathlib.Path(parsed_path).as_posix() if parsed_path else parsed_path + + path = parsed_path scheme = parts.scheme or None if parts.query: @@ -150,31 +152,21 @@ def _parse_path(path): """ if isinstance(path, _Path): return path - - elif pathlib and isinstance(path, pathlib.PurePath): - return _ParsedPath(path.as_posix(), None, None) - + elif isinstance(path, pathlib.PurePath): + return _ParsedPath(os.fspath(path), None, None) elif isinstance(path, str): - if sys.platform == "win32" and re.match(r"^[a-zA-Z]\:", path): - if pathlib: - return _ParsedPath(pathlib.Path(path).as_posix(), None, None) - else: - return _UnparsedPath(path) - + return _ParsedPath(path, None, None) elif path.startswith('/vsi'): return _UnparsedPath(path) - else: parts = urlparse(path) - else: raise PathError("invalid path '{!r}'".format(path)) # if the scheme is not one of Rasterio's supported schemes, we # return an UnparsedPath. if parts.scheme: - if all(p in SCHEMES for p in parts.scheme.split('+')): return _ParsedPath.from_uri(path) diff --git a/tests/test_collection.py b/tests/test_collection.py index 0e38e4268..6a5b794f0 100644 --- a/tests/test_collection.py +++ b/tests/test_collection.py @@ -99,19 +99,19 @@ def shapefile(self, path_coutwildrnp_shp): def test_open_repr(self, path_coutwildrnp_shp): assert repr(self.c) == ( - f"" ) def test_closed_repr(self, path_coutwildrnp_shp): self.c.close() assert repr(self.c) == ( - f"" ) def test_path(self, path_coutwildrnp_shp): - assert self.c.path == Path(path_coutwildrnp_shp).as_posix() + assert self.c.path == path_coutwildrnp_shp def test_name(self): assert self.c.name == "coutwildrnp" diff --git a/tests/test_collection_legacy.py b/tests/test_collection_legacy.py index f34bf6109..88a48a917 100644 --- a/tests/test_collection_legacy.py +++ b/tests/test_collection_legacy.py @@ -22,14 +22,14 @@ def tearDown(self): def test_open_repr(self): assert repr(self.c) == ( - f"" ) def test_closed_repr(self): self.c.close() assert repr(self.c) == ( - f"" ) diff --git a/tests/test_layer.py b/tests/test_layer.py index 0105332b1..18fe5a309 100644 --- a/tests/test_layer.py +++ b/tests/test_layer.py @@ -22,14 +22,14 @@ def shapefile(self, path_coutwildrnp_shp): def test_open_repr(self, path_coutwildrnp_shp): assert repr(self.c) == ( - f"" ) def test_closed_repr(self, path_coutwildrnp_shp): self.c.close() assert repr(self.c) == ( - f"" ) @@ -46,14 +46,14 @@ def shapefile(self, data_dir): def test_open_repr(self, data_dir): assert repr(self.c) == ( - f"" ) def test_closed_repr(self, data_dir): self.c.close() assert repr(self.c) == ( - f"" ) From 5a8e1757217d5408154554058ed82b01f45b2fa6 Mon Sep 17 00:00:00 2001 From: Sean Gillies Date: Fri, 1 Mar 2024 13:27:38 -0700 Subject: [PATCH 13/15] Fix archive/path parsing bug --- fiona/_path.py | 4 ++-- tests/test__path.py | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/fiona/_path.py b/fiona/_path.py index 8d511a738..f25842f93 100644 --- a/fiona/_path.py +++ b/fiona/_path.py @@ -66,8 +66,8 @@ class _ParsedPath(_Path): @classmethod def from_uri(cls, uri): parts = urlparse(uri) - if sys.platform == "win32" and re.match(r"^[a-zA-Z]\:", parts.netloc) and not parts.path: - parsed_path = parts.netloc + if sys.platform == "win32" and re.match(r"^[a-zA-Z]\:", parts.netloc): + parsed_path = f"{parts.netloc}{parts.path}" parsed_netloc = None else: parsed_path = parts.path diff --git a/tests/test__path.py b/tests/test__path.py index 68d4f2677..8c60eaea8 100644 --- a/tests/test__path.py +++ b/tests/test__path.py @@ -13,3 +13,12 @@ def test_parse_zip_windows(monkeypatch): vsi_path = _vsi_path(path) assert vsi_path.startswith("/vsizip/D") assert vsi_path.endswith("coutwildrnp.zip/coutwildrnp.shp") + + +def test_parse_zip_windows(monkeypatch): + """Parse a tar+ Windows path.""" + monkeypatch.setattr(sys, "platform", "win32") + path = _parse_path("tar://D:\\a\\Fiona\\Fiona\\tests\\data\\coutwildrnp.tar!testing/coutwildrnp.shp") + vsi_path = _vsi_path(path) + assert vsi_path.startswith("/vsitar/D") + assert vsi_path.endswith("coutwildrnp.tar/testing/coutwildrnp.shp") From 1ece5fffe3354ea25f9b60ffa52ba0247236ad84 Mon Sep 17 00:00:00 2001 From: Sean Gillies Date: Fri, 1 Mar 2024 14:20:53 -0700 Subject: [PATCH 14/15] Update RTD build environment, adding numpy --- environment.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/environment.yml b/environment.yml index 4b5348b50..ec05a395b 100644 --- a/environment.yml +++ b/environment.yml @@ -7,6 +7,7 @@ dependencies: - python=3.9.* - libgdal=3.4.* - cython=3 +- numpy>=1.25,<2 - sphinx-click - sphinx-rtd-theme - pip: From 9a614cb3d3fa0d2276eccd9c09f18e736fa56c9c Mon Sep 17 00:00:00 2001 From: Sean Gillies Date: Fri, 1 Mar 2024 14:45:21 -0700 Subject: [PATCH 15/15] Remove unused imports in tests. --- tests/test__path.py | 1 - tests/test_collection.py | 1 - tests/test_collection_legacy.py | 1 - tests/test_layer.py | 2 -- 4 files changed, 5 deletions(-) diff --git a/tests/test__path.py b/tests/test__path.py index 8c60eaea8..bafe859fb 100644 --- a/tests/test__path.py +++ b/tests/test__path.py @@ -1,6 +1,5 @@ """_path tests.""" -from pathlib import Path import sys from fiona._path import _parse_path, _vsi_path diff --git a/tests/test_collection.py b/tests/test_collection.py index 6a5b794f0..105c816ac 100644 --- a/tests/test_collection.py +++ b/tests/test_collection.py @@ -2,7 +2,6 @@ import datetime import logging -from pathlib import Path import random import re import sys diff --git a/tests/test_collection_legacy.py b/tests/test_collection_legacy.py index 88a48a917..1acd7d842 100644 --- a/tests/test_collection_legacy.py +++ b/tests/test_collection_legacy.py @@ -1,6 +1,5 @@ # Testing collections and workspaces -from pathlib import Path import unittest import re diff --git a/tests/test_layer.py b/tests/test_layer.py index 18fe5a309..d80aa01d9 100644 --- a/tests/test_layer.py +++ b/tests/test_layer.py @@ -1,7 +1,5 @@ """Layer tests.""" -from pathlib import Path - import pytest import fiona