Toblerity / Fiona

Fiona reads and writes geographic data files
https://fiona.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
1.14k stars 202 forks source link

1.9.5: pytest is failing #1317

Closed kloczek closed 8 months ago

kloczek commented 8 months ago

I'm packaging your module as an rpm package so I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.

Here is pytest output: ```console + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-fiona-1.9.5-5.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-fiona-1.9.5-5.fc35.x86_64/usr/lib/python3.8/site-packages + /usr/bin/pytest -ra -m 'not network' ImportError while loading conftest '/home/tkloczko/rpmbuild/BUILD/Fiona-1.9.5/tests/conftest.py'. tests/conftest.py:15: in import fiona ../../BUILDROOT/python-fiona-1.9.5-5.fc35.x86_64/usr/lib64/python3.8/site-packages/fiona/__init__.py:49: in from fiona.collection import BytesCollection, Collection ../../BUILDROOT/python-fiona-1.9.5-5.fc35.x86_64/usr/lib64/python3.8/site-packages/fiona/collection.py:10: in from fiona.ogrext import Iterator, ItemsIterator, KeysIterator fiona/ogrext.pyx:31: in init fiona.ogrext from fiona.env import Env ../../BUILDROOT/python-fiona-1.9.5-5.fc35.x86_64/usr/lib64/python3.8/site-packages/fiona/env.py:25: in from fiona.session import Session, DummySession ../../BUILDROOT/python-fiona-1.9.5-5.fc35.x86_64/usr/lib64/python3.8/site-packages/fiona/session.py:7: in from fiona.path import parse_path, UnparsedPath ../../BUILDROOT/python-fiona-1.9.5-5.fc35.x86_64/usr/lib64/python3.8/site-packages/fiona/path.py:38: in @attr.s(slots=True) E AttributeError: module 'attr' has no attribute 's' ```
List of installed modules in build env: ```console Package Version ----------------------------- ------- alabaster 0.7.13 attr 0.3.2 Babel 2.14.0 build 1.0.3 charset-normalizer 3.3.2 click 8.1.7 cppclean 0.13 Cython 3.0.6 distro 1.8.0 dnf 4.18.2 docutils 0.20.1 exceptiongroup 1.1.3 gpg 1.23.2 idna 3.6 imagesize 1.4.1 importlib-metadata 7.0.0 iniconfig 2.0.0 installer 0.7.0 Jinja2 3.1.2 libdnf 0.72.0 MarkupSafe 2.1.3 numpy 1.24.4 packaging 23.2 pluggy 1.3.0 Pygments 2.17.2 pyproject_hooks 1.0.0 pytest 7.4.3 python-dateutil 2.8.2 pytz 2023.3 requests 2.31.0 setuptools 69.0.2 six 1.16.0 snowballstemmer 2.2.0 Sphinx 7.1.2 sphinx-click 5.0.1 sphinxcontrib-applehelp 1.0.4 sphinxcontrib-devhelp 1.0.5 sphinxcontrib-htmlhelp 2.0.4 sphinxcontrib-jsmath 1.0.1 sphinxcontrib-qthelp 1.0.3 sphinxcontrib-serializinghtml 1.1.9 tomli 2.0.1 urllib3 1.26.18 wheel 0.42.0 zipp 3.17.0 ```
sgillies commented 8 months ago

@kloczek attr.s comes from https://www.attrs.org/en/stable/api-attr.html#core, not https://github.com/denis-ryzhkov/attr. All of this project's Python dependencies are list at https://github.com/Toblerity/Fiona/blob/master/pyproject.toml#L37.

kloczek commented 8 months ago

After install correct module in build env now pytest is failing with call trace and deprecation message

+ /usr/bin/pytest -ra -m 'not network'
==================================================================================== test session starts ====================================================================================
platform linux -- Python 3.8.18, pytest-7.4.3, pluggy-1.3.0
GDAL: 3.8.1 (3080100)
Supported drivers: CSV, DGN, DXF, ESRI Shapefile, ESRIJSON, FlatGeobuf, GML, GPKG, GeoJSON, GeoJSONSeq, Idrisi, MapInfo File, OGR_GMT, OGR_PDS, OpenFileGDB, PCIDSK, S57, SQLite, TopoJSON
rootdir: /home/tkloczko/rpmbuild/BUILD/Fiona-1.9.5
configfile: pytest.ini
testpaths: tests
plugins: anyio-4.1.0, asyncio-0.23.2, mock-3.12.0, vcr-1.0.2
asyncio: mode=strict
collected 426 items
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/_pytest/main.py", line 271, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/_pytest/main.py", line 324, in _main
INTERNALERROR>     config.hook.pytest_collection(session=session)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_hooks.py", line 493, in __call__
INTERNALERROR>     return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_manager.py", line 115, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_callers.py", line 152, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_result.py", line 114, in get_result
INTERNALERROR>     raise exc.with_traceback(exc.__traceback__)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_callers.py", line 77, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/_pytest/main.py", line 335, in pytest_collection
INTERNALERROR>     session.perform_collect()
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/_pytest/main.py", line 675, in perform_collect
INTERNALERROR>     self.items.extend(self.genitems(node))
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/_pytest/main.py", line 845, in genitems
INTERNALERROR>     yield from self.genitems(subnode)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/_pytest/main.py", line 842, in genitems
INTERNALERROR>     rep = collect_one_node(node)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/_pytest/runner.py", line 546, in collect_one_node
INTERNALERROR>     ihook.pytest_collectstart(collector=collector)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_hooks.py", line 493, in __call__
INTERNALERROR>     return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_manager.py", line 115, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_callers.py", line 113, in _multicall
INTERNALERROR>     raise exception.with_traceback(exception.__traceback__)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/_callers.py", line 77, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pytest_asyncio/plugin.py", line 612, in pytest_collectstart
INTERNALERROR>     pyobject = collector.obj
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/_pytest/python.py", line 315, in obj
INTERNALERROR>     self._obj = obj = self._getobj()
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/_pytest/python.py", line 533, in _getobj
INTERNALERROR>     return self._importtestmodule()
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/_pytest/python.py", line 622, in _importtestmodule
INTERNALERROR>     mod = import_path(self.path, mode=importmode, root=self.config.rootpath)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/_pytest/pathlib.py", line 540, in import_path
INTERNALERROR>     spec.loader.exec_module(mod)  # type: ignore[union-attr]
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/_pytest/assertion/rewrite.py", line 186, in exec_module
INTERNALERROR>     exec(co, module.__dict__)
INTERNALERROR>   File "/home/tkloczko/rpmbuild/BUILD/Fiona-1.9.5/tests/test_fio_info.py", line 5, in <module>
INTERNALERROR>     from pkg_resources import iter_entry_points
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 118, in <module>
INTERNALERROR>     warnings.warn(
INTERNALERROR> DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html

=================================================================================== no tests ran in 0.78s ===================================================================================
mwtoews commented 8 months ago

this was resolved in maint-1.9 with 1f3ca4dd965f5e7f3544bc48dcdffe1ceaccfd7f

kloczek commented 8 months ago

Thank you however even with that commit still have few few units failing

Here is pytest output: ```console + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-fiona-1.9.5-5.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-fiona-1.9.5-5.fc35.x86_64/usr/lib/python3.8/site-packages + /usr/bin/pytest -ra -m 'not network' ==================================================================================== test session starts ==================================================================================== platform linux -- Python 3.8.18, pytest-7.4.3, pluggy-1.3.0 GDAL: 3.8.1 (3080100) Supported drivers: CSV, DGN, DXF, ESRI Shapefile, ESRIJSON, FlatGeobuf, GML, GPKG, GeoJSON, GeoJSONSeq, Idrisi, MapInfo File, OGR_GMT, OGR_PDS, OpenFileGDB, PCIDSK, S57, SQLite, TopoJSON rootdir: /home/tkloczko/rpmbuild/BUILD/Fiona-1.9.5 configfile: pytest.ini testpaths: tests plugins: anyio-4.1.0, asyncio-0.23.2, mock-3.12.0, vcr-1.0.2 asyncio: mode=strict collected 1761 items / 5 deselected / 1756 selected tests/test__env.py ............... [ 0%] tests/test_bigint.py ... [ 1%] tests/test_binary_field.py . [ 1%] tests/test_bounds.py .....s........s.. [ 2%] tests/test_bytescollection.py ......................................s [ 4%] tests/test_collection.py ............................................................................................................ [ 10%] tests/test_collection_crs.py ...... [ 10%] tests/test_collection_legacy.py .................................. [ 12%] tests/test_compound_crs.py . [ 12%] tests/test_crs.py ................. [ 13%] tests/test_cursor_interruptions.py .................... [ 14%] tests/test_curve_geometries.py . [ 14%] tests/test_datetime.py ...sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss. [ 20%] tests/test_driver_options.py . [ 20%] tests/test_drivers.py . [ 20%] tests/test_drvsupport.py sssssssssssssssssssssssssssssssssssssssssssssssss.. [ 23%] tests/test_encoding.py ... [ 23%] tests/test_env.py .......... [ 24%] tests/test_feature.py ......... [ 24%] tests/test_geojson.py ...... [ 25%] tests/test_geometry.py ................ [ 25%] tests/test_geopackage.py ... [ 26%] tests/test_http_session.py .................................... [ 28%] tests/test_integration.py . [ 28%] tests/test_layer.py ......................................................................................................... [ 34%] tests/test_listing.py .................. [ 35%] tests/test_logutils.py .... [ 35%] tests/test_memoryfile.py ...........................F...............s........ [ 38%] tests/test_meta.py ................................................................................................................... [ 44%] tests/test_model.py ................................... [ 46%] tests/test_multiconxn.py ........ [ 47%] tests/test_non_counting_layer.py FFFFFF [ 47%] tests/test_open.py ... [ 47%] tests/test_profile.py .. [ 48%] tests/test_props.py ...... [ 48%] tests/test_read_drivers.py .. [ 48%] tests/test_remove.py ............ [ 49%] tests/test_revolvingdoor.py . [ 49%] tests/test_rfc3339.py .............. [ 50%] tests/test_rfc64_tin.py .. [ 50%] tests/test_schema.py ........................................................sss........F. [ 54%] tests/test_schema_geom.py ........... [ 54%] tests/test_session.py .............s [ 55%] tests/test_slice.py ................................................................................................................................................................. [ 64%] ..................................................................................................................................................................................... [ 75%] .................................................................................................................. [ 81%] tests/test_subtypes.py .. [ 81%] tests/test_topojson.py . [ 81%] tests/test_transactions.py . [ 81%] tests/test_transform.py .......................... [ 83%] tests/test_unicode.py .....x. [ 83%] tests/test_version.py ..s [ 83%] tests/test_vfs.py ..................................................................................X......................................................X......................... [ 93%] ......X..................................X..................................X.................X....................... [ 99%] tests/test_write.py .... [100%] ========================================================================================= FAILURES ========================================================================================== ____________________________________________________________________________ test_write_memoryfile_drivers[GML] _____________________________________________________________________________ driver = 'GML', testdata_generator = ._testdata_generator at 0x7fdbcafc3af0> @pytest.mark.parametrize( "driver", [ driver for driver in supported_drivers if _driver_supports_mode(driver, "w") and supports_vsi(driver) and driver not in {"MapInfo File"} ], ) def test_write_memoryfile_drivers(driver, testdata_generator): """ Test if driver is able to write to memoryfile """ range1 = list(range(0, 5)) schema, crs, records1, _, _ = testdata_generator(driver, range1, []) with MemoryFile() as memfile: with memfile.open(driver=driver, schema=schema) as c: c.writerecords(records1) with memfile.open(driver=driver) as c: assert driver == c.driver items = list(c) > assert len(items) == len(range1) E assert 0 == 5 E + where 0 = len([]) E + and 5 = len([0, 1, 2, 3, 4]) tests/test_memoryfile.py:237: AssertionError ------------------------------------------------------------------------------------- Captured log call ------------------------------------------------------------------------------------- INFO fiona.ogrext:io.py:86 Setting extension: root='/vsimem/3dd45f9f86fd4d2e817a72c61c10f9f5/3dd45f9f86fd4d2e817a72c61c10f9f5', extension='.gml' DEBUG fiona.ogrext:collection.py:246 File doesn't exist. Creating a new one... DEBUG fiona._env:env.py:315 GDAL data files are available at built-in paths. DEBUG fiona._env:env.py:315 PROJ data files are available at built-in paths. DEBUG fiona._env:env.py:315 GDAL data files are available at built-in paths. DEBUG fiona._env:env.py:315 PROJ data files are available at built-in paths. DEBUG fiona.ogrext:collection.py:246 Created layer 3dd45f9f86fd4d2e817a72c61c10f9f5 DEBUG fiona.ogrext:collection.py:246 Writing started DEBUG fiona._env:env.py:315 GDAL data files are available at built-in paths. DEBUG fiona._env:env.py:315 PROJ data files are available at built-in paths. DEBUG fiona.ogrext:collection.py:558 Transaction supported: 0 DEBUG fiona.ogrext:collection.py:667 Flushed data source cache DEBUG fiona.collection:collection.py:678 Flushed buffer DEBUG fiona.collection:collection.py:680 Stopped session DEBUG fiona._env:env.py:315 GDAL data files are available at built-in paths. DEBUG fiona._env:env.py:315 PROJ data files are available at built-in paths. DEBUG fiona.ogrext:collection.py:453 OLC_FASTSETNEXTBYINDEX: 0 DEBUG fiona.ogrext:collection.py:453 OLC_FASTFEATURECOUNT: 0 DEBUG fiona.ogrext:collection.py:453 Next index: 0 DEBUG fiona.ogrext:test_memoryfile.py:236 Next index: 1 ERROR fiona._env:test_memoryfile.py:236 XML Parsing Error: invalid element name 'ogr:' at line 11, column 10 DEBUG fiona.collection:collection.py:678 Flushed buffer DEBUG fiona.collection:collection.py:680 Stopped session ___________________________________________________________________ TestNonCountingLayer.test_fail_getitem_negative_index ___________________________________________________________________ > cogr_ds = exc_wrap_pointer( fiona/ogrext.pyx:136: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > raise exc E fiona._err.CPLE_OpenFailedError: '/home/tkloczko/rpmbuild/BUILD/Fiona-1.9.5/tests/data/test_gpx.gpx' not recognized as a supported file format. fiona/_err.pyx:291: CPLE_OpenFailedError During handling of the above exception, another exception occurred: self = def setUp(self): > self.c = fiona.open(self.path_gpx, "r", layer="track_points") tests/test_non_counting_layer.py:12: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../BUILDROOT/python-fiona-1.9.5-5.fc35.x86_64/usr/lib64/python3.8/site-packages/fiona/env.py:457: in wrapper return f(*args, **kwds) ../../BUILDROOT/python-fiona-1.9.5-5.fc35.x86_64/usr/lib64/python3.8/site-packages/fiona/__init__.py:292: in open colxn = Collection( ../../BUILDROOT/python-fiona-1.9.5-5.fc35.x86_64/usr/lib64/python3.8/site-packages/fiona/collection.py:243: in __init__ self.session.start(self, **kwargs) fiona/ogrext.pyx:588: in fiona.ogrext.Session.start self.cogr_ds = gdal_open_vector(path_c, 0, drivers, kwargs) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > raise DriverError(str(exc)) E fiona.errors.DriverError: '/home/tkloczko/rpmbuild/BUILD/Fiona-1.9.5/tests/data/test_gpx.gpx' not recognized as a supported file format. fiona/ogrext.pyx:143: DriverError ------------------------------------------------------------------------------------- Captured log call ------------------------------------------------------------------------------------- DEBUG fiona._env:env.py:315 GDAL data files are available at built-in paths. DEBUG fiona._env:env.py:315 PROJ data files are available at built-in paths. ERROR fiona._env:collection.py:243 `/home/tkloczko/rpmbuild/BUILD/Fiona-1.9.5/tests/data/test_gpx.gpx' not recognized as a supported file format. _____________________________________________________________________________ TestNonCountingLayer.test_getitem _____________________________________________________________________________ > cogr_ds = exc_wrap_pointer( fiona/ogrext.pyx:136: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > raise exc E fiona._err.CPLE_OpenFailedError: '/home/tkloczko/rpmbuild/BUILD/Fiona-1.9.5/tests/data/test_gpx.gpx' not recognized as a supported file format. fiona/_err.pyx:291: CPLE_OpenFailedError During handling of the above exception, another exception occurred: self = def setUp(self): > self.c = fiona.open(self.path_gpx, "r", layer="track_points") tests/test_non_counting_layer.py:12: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../BUILDROOT/python-fiona-1.9.5-5.fc35.x86_64/usr/lib64/python3.8/site-packages/fiona/env.py:457: in wrapper return f(*args, **kwds) ../../BUILDROOT/python-fiona-1.9.5-5.fc35.x86_64/usr/lib64/python3.8/site-packages/fiona/__init__.py:292: in open colxn = Collection( ../../BUILDROOT/python-fiona-1.9.5-5.fc35.x86_64/usr/lib64/python3.8/site-packages/fiona/collection.py:243: in __init__ self.session.start(self, **kwargs) fiona/ogrext.pyx:588: in fiona.ogrext.Session.start self.cogr_ds = gdal_open_vector(path_c, 0, drivers, kwargs) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > raise DriverError(str(exc)) E fiona.errors.DriverError: '/home/tkloczko/rpmbuild/BUILD/Fiona-1.9.5/tests/data/test_gpx.gpx' not recognized as a supported file format. fiona/ogrext.pyx:143: DriverError ------------------------------------------------------------------------------------- Captured log call ------------------------------------------------------------------------------------- DEBUG fiona._env:env.py:315 GDAL data files are available at built-in paths. DEBUG fiona._env:env.py:315 PROJ data files are available at built-in paths. ERROR fiona._env:collection.py:243 `/home/tkloczko/rpmbuild/BUILD/Fiona-1.9.5/tests/data/test_gpx.gpx' not recognized as a supported file format. ____________________________________________________________________________ TestNonCountingLayer.test_len_fail _____________________________________________________________________________ > cogr_ds = exc_wrap_pointer( fiona/ogrext.pyx:136: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > raise exc E fiona._err.CPLE_OpenFailedError: '/home/tkloczko/rpmbuild/BUILD/Fiona-1.9.5/tests/data/test_gpx.gpx' not recognized as a supported file format. fiona/_err.pyx:291: CPLE_OpenFailedError During handling of the above exception, another exception occurred: self = def setUp(self): > self.c = fiona.open(self.path_gpx, "r", layer="track_points") tests/test_non_counting_layer.py:12: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../BUILDROOT/python-fiona-1.9.5-5.fc35.x86_64/usr/lib64/python3.8/site-packages/fiona/env.py:457: in wrapper return f(*args, **kwds) ../../BUILDROOT/python-fiona-1.9.5-5.fc35.x86_64/usr/lib64/python3.8/site-packages/fiona/__init__.py:292: in open colxn = Collection( ../../BUILDROOT/python-fiona-1.9.5-5.fc35.x86_64/usr/lib64/python3.8/site-packages/fiona/collection.py:243: in __init__ self.session.start(self, **kwargs) fiona/ogrext.pyx:588: in fiona.ogrext.Session.start self.cogr_ds = gdal_open_vector(path_c, 0, drivers, kwargs) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > raise DriverError(str(exc)) E fiona.errors.DriverError: '/home/tkloczko/rpmbuild/BUILD/Fiona-1.9.5/tests/data/test_gpx.gpx' not recognized as a supported file format. fiona/ogrext.pyx:143: DriverError ------------------------------------------------------------------------------------- Captured log call ------------------------------------------------------------------------------------- DEBUG fiona._env:env.py:315 GDAL data files are available at built-in paths. DEBUG fiona._env:env.py:315 PROJ data files are available at built-in paths. ERROR fiona._env:collection.py:243 `/home/tkloczko/rpmbuild/BUILD/Fiona-1.9.5/tests/data/test_gpx.gpx' not recognized as a supported file format. ______________________________________________________________________________ TestNonCountingLayer.test_list _______________________________________________________________________________ > cogr_ds = exc_wrap_pointer( fiona/ogrext.pyx:136: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > raise exc E fiona._err.CPLE_OpenFailedError: '/home/tkloczko/rpmbuild/BUILD/Fiona-1.9.5/tests/data/test_gpx.gpx' not recognized as a supported file format. fiona/_err.pyx:291: CPLE_OpenFailedError During handling of the above exception, another exception occurred: self = def setUp(self): > self.c = fiona.open(self.path_gpx, "r", layer="track_points") tests/test_non_counting_layer.py:12: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../BUILDROOT/python-fiona-1.9.5-5.fc35.x86_64/usr/lib64/python3.8/site-packages/fiona/env.py:457: in wrapper return f(*args, **kwds) ../../BUILDROOT/python-fiona-1.9.5-5.fc35.x86_64/usr/lib64/python3.8/site-packages/fiona/__init__.py:292: in open colxn = Collection( ../../BUILDROOT/python-fiona-1.9.5-5.fc35.x86_64/usr/lib64/python3.8/site-packages/fiona/collection.py:243: in __init__ self.session.start(self, **kwargs) fiona/ogrext.pyx:588: in fiona.ogrext.Session.start self.cogr_ds = gdal_open_vector(path_c, 0, drivers, kwargs) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > raise DriverError(str(exc)) E fiona.errors.DriverError: '/home/tkloczko/rpmbuild/BUILD/Fiona-1.9.5/tests/data/test_gpx.gpx' not recognized as a supported file format. fiona/ogrext.pyx:143: DriverError ------------------------------------------------------------------------------------- Captured log call ------------------------------------------------------------------------------------- DEBUG fiona._env:env.py:315 GDAL data files are available at built-in paths. DEBUG fiona._env:env.py:315 PROJ data files are available at built-in paths. ERROR fiona._env:collection.py:243 `/home/tkloczko/rpmbuild/BUILD/Fiona-1.9.5/tests/data/test_gpx.gpx' not recognized as a supported file format. ______________________________________________________________________________ TestNonCountingLayer.test_slice ______________________________________________________________________________ > cogr_ds = exc_wrap_pointer( fiona/ogrext.pyx:136: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > raise exc E fiona._err.CPLE_OpenFailedError: '/home/tkloczko/rpmbuild/BUILD/Fiona-1.9.5/tests/data/test_gpx.gpx' not recognized as a supported file format. fiona/_err.pyx:291: CPLE_OpenFailedError During handling of the above exception, another exception occurred: self = def setUp(self): > self.c = fiona.open(self.path_gpx, "r", layer="track_points") tests/test_non_counting_layer.py:12: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../BUILDROOT/python-fiona-1.9.5-5.fc35.x86_64/usr/lib64/python3.8/site-packages/fiona/env.py:457: in wrapper return f(*args, **kwds) ../../BUILDROOT/python-fiona-1.9.5-5.fc35.x86_64/usr/lib64/python3.8/site-packages/fiona/__init__.py:292: in open colxn = Collection( ../../BUILDROOT/python-fiona-1.9.5-5.fc35.x86_64/usr/lib64/python3.8/site-packages/fiona/collection.py:243: in __init__ self.session.start(self, **kwargs) fiona/ogrext.pyx:588: in fiona.ogrext.Session.start self.cogr_ds = gdal_open_vector(path_c, 0, drivers, kwargs) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > raise DriverError(str(exc)) E fiona.errors.DriverError: '/home/tkloczko/rpmbuild/BUILD/Fiona-1.9.5/tests/data/test_gpx.gpx' not recognized as a supported file format. fiona/ogrext.pyx:143: DriverError ------------------------------------------------------------------------------------- Captured log call ------------------------------------------------------------------------------------- DEBUG fiona._env:env.py:315 GDAL data files are available at built-in paths. DEBUG fiona._env:env.py:315 PROJ data files are available at built-in paths. ERROR fiona._env:collection.py:243 `/home/tkloczko/rpmbuild/BUILD/Fiona-1.9.5/tests/data/test_gpx.gpx' not recognized as a supported file format. ____________________________________________________________________ TestNonCountingLayer.test_warn_slice_negative_index ____________________________________________________________________ > cogr_ds = exc_wrap_pointer( fiona/ogrext.pyx:136: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > raise exc E fiona._err.CPLE_OpenFailedError: '/home/tkloczko/rpmbuild/BUILD/Fiona-1.9.5/tests/data/test_gpx.gpx' not recognized as a supported file format. fiona/_err.pyx:291: CPLE_OpenFailedError During handling of the above exception, another exception occurred: self = def setUp(self): > self.c = fiona.open(self.path_gpx, "r", layer="track_points") tests/test_non_counting_layer.py:12: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../BUILDROOT/python-fiona-1.9.5-5.fc35.x86_64/usr/lib64/python3.8/site-packages/fiona/env.py:457: in wrapper return f(*args, **kwds) ../../BUILDROOT/python-fiona-1.9.5-5.fc35.x86_64/usr/lib64/python3.8/site-packages/fiona/__init__.py:292: in open colxn = Collection( ../../BUILDROOT/python-fiona-1.9.5-5.fc35.x86_64/usr/lib64/python3.8/site-packages/fiona/collection.py:243: in __init__ self.session.start(self, **kwargs) fiona/ogrext.pyx:588: in fiona.ogrext.Session.start self.cogr_ds = gdal_open_vector(path_c, 0, drivers, kwargs) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > raise DriverError(str(exc)) E fiona.errors.DriverError: '/home/tkloczko/rpmbuild/BUILD/Fiona-1.9.5/tests/data/test_gpx.gpx' not recognized as a supported file format. fiona/ogrext.pyx:143: DriverError ------------------------------------------------------------------------------------- Captured log call ------------------------------------------------------------------------------------- DEBUG fiona._env:env.py:315 GDAL data files are available at built-in paths. DEBUG fiona._env:env.py:315 PROJ data files are available at built-in paths. ERROR fiona._env:collection.py:243 `/home/tkloczko/rpmbuild/BUILD/Fiona-1.9.5/tests/data/test_gpx.gpx' not recognized as a supported file format. ___________________________________________________________________________ test_schema_default_fields_wrong_type ___________________________________________________________________________ tmpdir = local('/tmp/pytest-of-tkloczko/pytest-71/test_schema_default_fields_wro0') def test_schema_default_fields_wrong_type(tmpdir): """Test for SchemaError if a default field is specified with a different type""" name = str(tmpdir.join("test.gpx")) schema = { "properties": OrderedDict([("ele", "str"), ("time", "datetime")]), "geometry": "Point", } with pytest.raises(SchemaError): > with fiona.open(name, "w", driver="GPX", schema=schema) as c: tests/test_schema.py:412: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../BUILDROOT/python-fiona-1.9.5-5.fc35.x86_64/usr/lib64/python3.8/site-packages/fiona/env.py:457: in wrapper return f(*args, **kwds) ../../BUILDROOT/python-fiona-1.9.5-5.fc35.x86_64/usr/lib64/python3.8/site-packages/fiona/__init__.py:303: in open colxn = Collection( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = path = UnparsedPath(path='/tmp/pytest-of-tkloczko/pytest-71/test_schema_default_fields_wro0/test.gpx'), mode = 'w', driver = 'GPX' schema = {'geometry': 'Point', 'properties': OrderedDict([('ele', 'str'), ('time', 'datetime')])}, crs = None, encoding = None, layer = None, vsi = None, archive = None enabled_drivers = None, crs_wkt = None, ignore_fields = None, ignore_geometry = False, include_fields = None, wkt_version = None, allow_unsupported_drivers = False, kwargs = {} def __init__( self, path, mode="r", driver=None, schema=None, crs=None, encoding=None, layer=None, vsi=None, archive=None, enabled_drivers=None, crs_wkt=None, ignore_fields=None, ignore_geometry=False, include_fields=None, wkt_version=None, allow_unsupported_drivers=False, **kwargs ): """The required ``path`` is the absolute or relative path to a file, such as '/data/test_uk.shp'. In ``mode`` 'r', data can be read only. In ``mode`` 'a', data can be appended to a file. In ``mode`` 'w', data overwrites the existing contents of a file. In ``mode`` 'w', an OGR ``driver`` name and a ``schema`` are required. A Proj4 ``crs`` string is recommended. If both ``crs`` and ``crs_wkt`` keyword arguments are passed, the latter will trump the former. In 'w' mode, kwargs will be mapped to OGR layer creation options. """ self._closed = True if not isinstance(path, (str, Path)): raise TypeError("invalid path: %r" % path) if not isinstance(mode, str) or mode not in ("r", "w", "a"): raise TypeError("invalid mode: %r" % mode) if driver and not isinstance(driver, str): raise TypeError("invalid driver: %r" % driver) if schema and not hasattr(schema, "get"): raise TypeError("invalid schema: %r" % schema) # Rasterio's CRS is compatible with Fiona. This class # constructor only requires that the crs value have a to_wkt() # method. if ( crs and not isinstance(crs, compat.DICT_TYPES + (str, CRS)) and not (hasattr(crs, "to_wkt") and callable(crs.to_wkt)) ): raise TypeError("invalid crs: %r" % crs) if crs_wkt and not isinstance(crs_wkt, str): raise TypeError("invalid crs_wkt: %r" % crs_wkt) if encoding and not isinstance(encoding, str): raise TypeError("invalid encoding: %r" % encoding) if layer and not isinstance(layer, (str, int)): raise TypeError("invalid name: %r" % layer) if vsi: if not isinstance(vsi, str) or not vfs.valid_vsi(vsi): raise TypeError("invalid vsi: %r" % vsi) if archive and not isinstance(archive, str): raise TypeError("invalid archive: %r" % archive) if ignore_fields is not None and include_fields is not None: raise ValueError("Cannot specify both 'ignore_fields' and 'include_fields'") if mode == "w" and driver is None: driver = driver_from_extension(path) # Check GDAL version against drivers if ( driver in driver_mode_mingdal[mode] and get_gdal_version_tuple() < driver_mode_mingdal[mode][driver] ): min_gdal_version = ".".join( list(map(str, driver_mode_mingdal[mode][driver])) ) raise DriverError( "{driver} driver requires at least GDAL {min_gdal_version} for mode '{mode}', " "Fiona was compiled against: {gdal}".format( driver=driver, mode=mode, min_gdal_version=min_gdal_version, gdal=get_gdal_release_name(), ) ) self.session = None self.iterator = None self._len = 0 self._bounds = None self._driver = None self._schema = None self._crs = None self._crs_wkt = None self.enabled_drivers = enabled_drivers self.include_fields = include_fields self.ignore_fields = ignore_fields self.ignore_geometry = bool(ignore_geometry) self._allow_unsupported_drivers = allow_unsupported_drivers self._env = None self._closed = True # Check GDAL version against drivers if ( driver in driver_mode_mingdal[mode] and get_gdal_version_tuple() < driver_mode_mingdal[mode][driver] ): min_gdal_version = ".".join( list(map(str, driver_mode_mingdal[mode][driver])) ) raise DriverError( "{driver} driver requires at least GDAL {min_gdal_version} for mode '{mode}', " "Fiona was compiled against: {gdal}".format( driver=driver, mode=mode, min_gdal_version=min_gdal_version, gdal=get_gdal_release_name(), ) ) if vsi: self.path = vfs.vsi_path(path, vsi, archive) path = parse_path(self.path) else: path = parse_path(path) self.path = vsi_path(path) if mode == "w": if layer and not isinstance(layer, str): raise ValueError("in 'w' mode, layer names must be strings") if driver == "GeoJSON": if layer is not None: raise ValueError("the GeoJSON format does not have layers") self.name = "OgrGeoJSON" # TODO: raise ValueError as above for other single-layer formats. else: self.name = layer or os.path.basename(os.path.splitext(path.path)[0]) else: if layer in (0, None): self.name = 0 else: self.name = layer or os.path.basename(os.path.splitext(path)[0]) self.mode = mode if self.mode == "w": if driver == "Shapefile": driver = "ESRI Shapefile" if not driver: raise DriverError("no driver") if not allow_unsupported_drivers: if driver not in supported_drivers: > raise DriverError("unsupported driver: %r" % driver) E fiona.errors.DriverError: unsupported driver: 'GPX' ../../BUILDROOT/python-fiona-1.9.5-5.fc35.x86_64/usr/lib64/python3.8/site-packages/fiona/collection.py:211: DriverError ------------------------------------------------------------------------------------- Captured log call ------------------------------------------------------------------------------------- DEBUG fiona._env:env.py:315 GDAL data files are available at built-in paths. DEBUG fiona._env:env.py:315 PROJ data files are available at built-in paths. ================================================================================== short test summary info ================================================================================== SKIPPED [2] tests/test_bounds.py:59: Driver does not support point geometries SKIPPED [1] tests/test_bytescollection.py:216: Changed behavior with gdal 2.3, possibly related to RFC 70:Guessing output format from output file name extension for utilities SKIPPED [21] tests/test_datetime.py:401: use '-m gdal' to run GDAL related tests. SKIPPED [9] tests/test_datetime.py:474: use '-m gdal' to run GDAL related tests. SKIPPED [30] tests/test_datetime.py:691: use '-m gdal' to run GDAL related tests. SKIPPED [12] tests/test_datetime.py:731: use '-m gdal' to run GDAL related tests. SKIPPED [12] tests/test_datetime.py:745: use '-m gdal' to run GDAL related tests. SKIPPED [9] tests/test_datetime.py:807: use '-m gdal' to run GDAL related tests. SKIPPED [4] tests/test_drvsupport.py:18: use '-m gdal' to run GDAL related tests. SKIPPED [14] tests/test_drvsupport.py:26: use '-m gdal' to run GDAL related tests. SKIPPED [5] tests/test_drvsupport.py:67: use '-m gdal' to run GDAL related tests. SKIPPED [11] tests/test_drvsupport.py:99: use '-m gdal' to run GDAL related tests. SKIPPED [7] tests/test_drvsupport.py:157: use '-m gdal' to run GDAL related tests. SKIPPED [5] tests/test_drvsupport.py:219: use '-m gdal' to run GDAL related tests. SKIPPED [3] tests/test_drvsupport.py:243: use '-m gdal' to run GDAL related tests. SKIPPED [1] tests/test_memoryfile.py:297: FileGDB driver not available SKIPPED [2] tests/test_schema.py:225: Only relevant for GDAL 1.x SKIPPED [1] tests/test_schema.py:241: Only relevant for GDAL 1.x SKIPPED [1] tests/test_session.py:65: Only raises on GDAL 1.x SKIPPED [1] tests/test_version.py:31: Requires travis CI environment XFAIL tests/test_unicode.py::TestUnicodeStringField::test_write_mismatch - OGR silently fails to convert strings XPASS tests/test_vfs.py::VsiReadingTest::test_filter_vsi The number of features present in the archive differs based on the GDAL version. XPASS tests/test_vfs.py::TestVsiReading::test_filter_vsi The number of features present in the archive differs based on the GDAL version. XPASS tests/test_vfs.py::TestZipReading::test_filter_vsi The number of features present in the archive differs based on the GDAL version. XPASS tests/test_vfs.py::TestZipArchiveReading::test_filter_vsi The number of features present in the archive differs based on the GDAL version. XPASS tests/test_vfs.py::TestZipArchiveReadingAbsPath::test_filter_vsi The number of features present in the archive differs based on the GDAL version. XPASS tests/test_vfs.py::TarArchiveReadingTest::test_filter_vsi The number of features present in the archive differs based on the GDAL version. FAILED tests/test_memoryfile.py::test_write_memoryfile_drivers[GML] - assert 0 == 5 FAILED tests/test_non_counting_layer.py::TestNonCountingLayer::test_fail_getitem_negative_index - fiona.errors.DriverError: '/home/tkloczko/rpmbuild/BUILD/Fiona-1.9.5/tests/data/test_gpx.gpx' not recognized as a supported file format. FAILED tests/test_non_counting_layer.py::TestNonCountingLayer::test_getitem - fiona.errors.DriverError: '/home/tkloczko/rpmbuild/BUILD/Fiona-1.9.5/tests/data/test_gpx.gpx' not recognized as a supported file format. FAILED tests/test_non_counting_layer.py::TestNonCountingLayer::test_len_fail - fiona.errors.DriverError: '/home/tkloczko/rpmbuild/BUILD/Fiona-1.9.5/tests/data/test_gpx.gpx' not recognized as a supported file format. FAILED tests/test_non_counting_layer.py::TestNonCountingLayer::test_list - fiona.errors.DriverError: '/home/tkloczko/rpmbuild/BUILD/Fiona-1.9.5/tests/data/test_gpx.gpx' not recognized as a supported file format. FAILED tests/test_non_counting_layer.py::TestNonCountingLayer::test_slice - fiona.errors.DriverError: '/home/tkloczko/rpmbuild/BUILD/Fiona-1.9.5/tests/data/test_gpx.gpx' not recognized as a supported file format. FAILED tests/test_non_counting_layer.py::TestNonCountingLayer::test_warn_slice_negative_index - fiona.errors.DriverError: '/home/tkloczko/rpmbuild/BUILD/Fiona-1.9.5/tests/data/test_gpx.gpx' not recognized as a supported file format. FAILED tests/test_schema.py::test_schema_default_fields_wrong_type - fiona.errors.DriverError: unsupported driver: 'GPX' ===================================================== 8 failed, 1590 passed, 151 skipped, 5 deselected, 1 xfailed, 6 xpassed in 20.36s ====================================================== ```