https://bugzilla.redhat.com/show_bug.cgi?id=2274105
Tomáš Hrnčiar <thrnciar(a)redhat.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|RAWHIDE |---
Status|CLOSED |NEW
Summary|python-rasterio fails to |python-rasterio fails to
|build with pytest 8: |build with pytest 8:
|ImportError: |TypeError: exceptions must
|/lib64/libgdal.so.34: |be derived from Warning,
|undefined symbol: |not <class 'NoneType'>
|_ZNK5arrow16KeyValueMetadat |
|a8ContainsESt17basic_string |
|_viewIcSt11char_traitsIcEE |
Keywords| |Reopened
--- Comment #4 from Tomáš Hrnčiar <thrnciar(a)redhat.com> ---
With fixed gdal I see other problems with pytest 8.
=================================== FAILURES
===================================
_________________________________ test_shapes
__________________________________
runner = <click.testing.CliRunner object at 0x7f9c69a25f40>
pixelated_image_file =
'/tmp/pytest-of-mockbuild/pytest-0/test_shapes0/pixelated_image.tif'
def test_shapes(runner, pixelated_image_file):
with pytest.warns(None):
tests/test_rio_shapes.py:22:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = WarningsChecker(record=True), expected_warning = None, match_expr = None
def __init__(
self,
expected_warning: Union[Type[Warning], Tuple[Type[Warning], ...]] =
Warning,
match_expr: Optional[Union[str, Pattern[str]]] = None,
*,
_ispytest: bool = False,
) -> None:
check_ispytest(_ispytest)
super().__init__(_ispytest=True)
msg = "exceptions must be derived from Warning, not %s"
if isinstance(expected_warning, tuple):
for exc in expected_warning:
if not issubclass(exc, Warning):
raise TypeError(msg % type(exc))
expected_warning_tup = expected_warning
elif isinstance(expected_warning, type) and issubclass(
expected_warning, Warning
):
expected_warning_tup = (expected_warning,)
else:
raise TypeError(msg % type(expected_warning))
E
TypeError: exceptions must be derived from Warning, not <class
'NoneType'>
/usr/lib/python3.12/site-packages/_pytest/recwarn.py:285: TypeError
------------------------------ Captured log setup
------------------------------
DEBUG rasterio._env:env.py:326 GDAL data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 PROJ data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 Started GDALEnv: self=<rasterio._env.GDALEnv
object at 0x7f9c69a247c0>.
DEBUG rasterio._env:env.py:362 Stopped GDALEnv <rasterio._env.GDALEnv object
at 0x7f9c69a247c0>.
DEBUG rasterio._env:env.py:326 GDAL data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 PROJ data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 Started GDALEnv: self=<rasterio._env.GDALEnv
object at 0x7f9c69a24d60>.
DEBUG rasterio._env:env.py:362 Stopped GDALEnv <rasterio._env.GDALEnv object
at 0x7f9c69a24d60>.
_____________________________ test_shapes_sequence
_____________________________
runner = <click.testing.CliRunner object at 0x7f9c69a246e0>
pixelated_image_file =
'/tmp/pytest-of-mockbuild/pytest-0/test_shapes_sequence0/pixelated_image.tif'
def test_shapes_sequence(runner, pixelated_image_file):
"""
--sequence option should produce 4 features in series rather than
inside a feature collection.
"""
with pytest.warns(None):
tests/test_rio_shapes.py:47:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = WarningsChecker(record=True), expected_warning = None, match_expr = None
def __init__(
self,
expected_warning: Union[Type[Warning], Tuple[Type[Warning], ...]] =
Warning,
match_expr: Optional[Union[str, Pattern[str]]] = None,
*,
_ispytest: bool = False,
) -> None:
check_ispytest(_ispytest)
super().__init__(_ispytest=True)
msg = "exceptions must be derived from Warning, not %s"
if isinstance(expected_warning, tuple):
for exc in expected_warning:
if not issubclass(exc, Warning):
raise TypeError(msg % type(exc))
expected_warning_tup = expected_warning
elif isinstance(expected_warning, type) and issubclass(
expected_warning, Warning
):
expected_warning_tup = (expected_warning,)
else:
raise TypeError(msg % type(expected_warning))
E
TypeError: exceptions must be derived from Warning, not <class
'NoneType'>
/usr/lib/python3.12/site-packages/_pytest/recwarn.py:285: TypeError
------------------------------ Captured log setup
------------------------------
DEBUG rasterio._env:env.py:326 GDAL data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 PROJ data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 Started GDALEnv: self=<rasterio._env.GDALEnv
object at 0x7f9c69a25900>.
DEBUG rasterio._env:env.py:362 Stopped GDALEnv <rasterio._env.GDALEnv object
at 0x7f9c69a25900>.
DEBUG rasterio._env:env.py:326 GDAL data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 PROJ data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 Started GDALEnv: self=<rasterio._env.GDALEnv
object at 0x7f9c69a26f50>.
DEBUG rasterio._env:env.py:362 Stopped GDALEnv <rasterio._env.GDALEnv object
at 0x7f9c69a26f50>.
______________________________ test_shapes_indent
______________________________
runner = <click.testing.CliRunner object at 0x7f9c69a247d0>
pixelated_image_file =
'/tmp/pytest-of-mockbuild/pytest-0/test_shapes_indent0/pixelated_image.tif'
def test_shapes_indent(runner, pixelated_image_file):
"""
--indent option should produce lots of newlines and contiguous spaces
"""
with pytest.warns(None):
tests/test_rio_shapes.py:94:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = WarningsChecker(record=True), expected_warning = None, match_expr = None
def __init__(
self,
expected_warning: Union[Type[Warning], Tuple[Type[Warning], ...]] =
Warning,
match_expr: Optional[Union[str, Pattern[str]]] = None,
*,
_ispytest: bool = False,
) -> None:
check_ispytest(_ispytest)
super().__init__(_ispytest=True)
msg = "exceptions must be derived from Warning, not %s"
if isinstance(expected_warning, tuple):
for exc in expected_warning:
if not issubclass(exc, Warning):
raise TypeError(msg % type(exc))
expected_warning_tup = expected_warning
elif isinstance(expected_warning, type) and issubclass(
expected_warning, Warning
):
expected_warning_tup = (expected_warning,)
else:
raise TypeError(msg % type(expected_warning))
E
TypeError: exceptions must be derived from Warning, not <class
'NoneType'>
/usr/lib/python3.12/site-packages/_pytest/recwarn.py:285: TypeError
------------------------------ Captured log setup
------------------------------
DEBUG rasterio._env:env.py:326 GDAL data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 PROJ data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 Started GDALEnv: self=<rasterio._env.GDALEnv
object at 0x7f9c69a242b0>.
DEBUG rasterio._env:env.py:362 Stopped GDALEnv <rasterio._env.GDALEnv object
at 0x7f9c69a242b0>.
DEBUG rasterio._env:env.py:326 GDAL data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 PROJ data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 Started GDALEnv: self=<rasterio._env.GDALEnv
object at 0x7f9c69a25f60>.
DEBUG rasterio._env:env.py:362 Stopped GDALEnv <rasterio._env.GDALEnv object
at 0x7f9c69a25f60>.
_____________________________ test_shapes_compact
______________________________
runner = <click.testing.CliRunner object at 0x7f9c69a24890>
pixelated_image_file =
'/tmp/pytest-of-mockbuild/pytest-0/test_shapes_compact0/pixelated_image.tif'
def test_shapes_compact(runner, pixelated_image_file):
with pytest.warns(None):
tests/test_rio_shapes.py:107:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = WarningsChecker(record=True), expected_warning = None, match_expr = None
def __init__(
self,
expected_warning: Union[Type[Warning], Tuple[Type[Warning], ...]] =
Warning,
match_expr: Optional[Union[str, Pattern[str]]] = None,
*,
_ispytest: bool = False,
) -> None:
check_ispytest(_ispytest)
super().__init__(_ispytest=True)
msg = "exceptions must be derived from Warning, not %s"
if isinstance(expected_warning, tuple):
for exc in expected_warning:
if not issubclass(exc, Warning):
raise TypeError(msg % type(exc))
expected_warning_tup = expected_warning
elif isinstance(expected_warning, type) and issubclass(
expected_warning, Warning
):
expected_warning_tup = (expected_warning,)
else:
raise TypeError(msg % type(expected_warning))
E
TypeError: exceptions must be derived from Warning, not <class
'NoneType'>
/usr/lib/python3.12/site-packages/_pytest/recwarn.py:285: TypeError
------------------------------ Captured log setup
------------------------------
DEBUG rasterio._env:env.py:326 GDAL data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 PROJ data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 Started GDALEnv: self=<rasterio._env.GDALEnv
object at 0x7f9c69a26170>.
DEBUG rasterio._env:env.py:362 Stopped GDALEnv <rasterio._env.GDALEnv object
at 0x7f9c69a26170>.
DEBUG rasterio._env:env.py:326 GDAL data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 PROJ data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 Started GDALEnv: self=<rasterio._env.GDALEnv
object at 0x7f9c69a267a0>.
DEBUG rasterio._env:env.py:362 Stopped GDALEnv <rasterio._env.GDALEnv object
at 0x7f9c69a267a0>.
_______________ test_no_notgeoref_warning[transform0-None-None]
________________
transform = Affine(2.0, 0.0, 0.0,
0.0, 2.0, 0.0), gcps = None
rpcs = None
@pytest.mark.parametrize('transform, gcps, rpcs', [(Affine.identity() *
Affine.scale(2.0), None, None),
(None,
[rasterio.control.GroundControlPoint(0, 0, 0, 0, 0)], None),
(None, None,
gen_rpcs())])
def test_no_notgeoref_warning(transform, gcps, rpcs):
with rasterio.MemoryFile() as mem:
with mem.open(driver='GTiff', width=10, height=10,
dtype='uint8',
count=1, transform=transform) as src:
if gcps:
src.gcps = (gcps, rasterio.crs.CRS.from_epsg(4326))
if rpcs:
src.rpcs = rpcs
with pytest.warns(None) as record:
tests/test_warnings.py:39:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = WarningsChecker(record=True), expected_warning = None, match_expr = None
def __init__(
self,
expected_warning: Union[Type[Warning], Tuple[Type[Warning], ...]] =
Warning,
match_expr: Optional[Union[str, Pattern[str]]] = None,
*,
_ispytest: bool = False,
) -> None:
check_ispytest(_ispytest)
super().__init__(_ispytest=True)
msg = "exceptions must be derived from Warning, not %s"
if isinstance(expected_warning, tuple):
for exc in expected_warning:
if not issubclass(exc, Warning):
raise TypeError(msg % type(exc))
expected_warning_tup = expected_warning
elif isinstance(expected_warning, type) and issubclass(
expected_warning, Warning
):
expected_warning_tup = (expected_warning,)
else:
raise TypeError(msg % type(expected_warning))
E
TypeError: exceptions must be derived from Warning, not <class
'NoneType'>
/usr/lib/python3.12/site-packages/_pytest/recwarn.py:285: TypeError
------------------------------ Captured log call
-------------------------------
DEBUG rasterio._env:env.py:326 GDAL data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 PROJ data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 Started GDALEnv: self=<rasterio._env.GDALEnv
object at 0x7f9c69539db0>.
DEBUG rasterio._env:env.py:362 Stopped GDALEnv <rasterio._env.GDALEnv object
at 0x7f9c69539db0>.
DEBUG rasterio._env:env.py:326 GDAL data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 PROJ data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 Started GDALEnv: self=<rasterio._env.GDALEnv
object at 0x7f9c69539a20>.
DEBUG rasterio._env:env.py:362 Stopped GDALEnv <rasterio._env.GDALEnv object
at 0x7f9c69539a20>.
__________________ test_no_notgeoref_warning[None-gcps1-None]
__________________
transform = None
gcps = [GroundControlPoint(row=0, col=0, x=0, y=0, z=0,
id='880bc5f6-f581-430d-93a0-2973401cfaca')]
rpcs = None
@pytest.mark.parametrize('transform, gcps, rpcs', [(Affine.identity() *
Affine.scale(2.0), None, None),
(None,
[rasterio.control.GroundControlPoint(0, 0, 0, 0, 0)], None),
(None, None,
gen_rpcs())])
def test_no_notgeoref_warning(transform, gcps, rpcs):
with rasterio.MemoryFile() as mem:
with mem.open(driver='GTiff', width=10, height=10,
dtype='uint8',
count=1, transform=transform) as src:
if gcps:
src.gcps = (gcps, rasterio.crs.CRS.from_epsg(4326))
if rpcs:
src.rpcs = rpcs
with pytest.warns(None) as record:
tests/test_warnings.py:39:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = WarningsChecker(record=True), expected_warning = None, match_expr = None
def __init__(
self,
expected_warning: Union[Type[Warning], Tuple[Type[Warning], ...]] =
Warning,
match_expr: Optional[Union[str, Pattern[str]]] = None,
*,
_ispytest: bool = False,
) -> None:
check_ispytest(_ispytest)
super().__init__(_ispytest=True)
msg = "exceptions must be derived from Warning, not %s"
if isinstance(expected_warning, tuple):
for exc in expected_warning:
if not issubclass(exc, Warning):
raise TypeError(msg % type(exc))
expected_warning_tup = expected_warning
elif isinstance(expected_warning, type) and issubclass(
expected_warning, Warning
):
expected_warning_tup = (expected_warning,)
else:
raise TypeError(msg % type(expected_warning))
E
TypeError: exceptions must be derived from Warning, not <class
'NoneType'>
/usr/lib/python3.12/site-packages/_pytest/recwarn.py:285: TypeError
------------------------------ Captured log call
-------------------------------
DEBUG rasterio._env:env.py:326 GDAL data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 PROJ data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 Started GDALEnv: self=<rasterio._env.GDALEnv
object at 0x7f9c6953aa70>.
DEBUG rasterio._env:env.py:362 Stopped GDALEnv <rasterio._env.GDALEnv object
at 0x7f9c6953aa70>.
DEBUG rasterio._env:env.py:326 GDAL data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 PROJ data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 Started GDALEnv: self=<rasterio._env.GDALEnv
object at 0x7f9c689efd90>.
DEBUG rasterio._env:env.py:362 Stopped GDALEnv <rasterio._env.GDALEnv object
at 0x7f9c689efd90>.
__________________ test_no_notgeoref_warning[None-None-rpcs2]
__________________
transform = None, gcps = None
rpcs = RPC(height_off=89.0, height_scale=701.0, lat_off=49.2199,
lat_scale=0.3093, line_den_coeff=[1.0, 0.0009222511757408093...8e-05,
-1.230207121465409e-06, -2.830467933081173e-06], samp_off=3724.0,
samp_scale=3725.0, err_bias=0.5, err_rand=0.5)
@pytest.mark.parametrize('transform, gcps, rpcs', [(Affine.identity() *
Affine.scale(2.0), None, None),
(None,
[rasterio.control.GroundControlPoint(0, 0, 0, 0, 0)], None),
(None, None,
gen_rpcs())])
def test_no_notgeoref_warning(transform, gcps, rpcs):
with rasterio.MemoryFile() as mem:
with mem.open(driver='GTiff', width=10, height=10,
dtype='uint8',
count=1, transform=transform) as src:
if gcps:
src.gcps = (gcps, rasterio.crs.CRS.from_epsg(4326))
if rpcs:
src.rpcs = rpcs
with pytest.warns(None) as record:
tests/test_warnings.py:39:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = WarningsChecker(record=True), expected_warning = None, match_expr = None
def __init__(
self,
expected_warning: Union[Type[Warning], Tuple[Type[Warning], ...]] =
Warning,
match_expr: Optional[Union[str, Pattern[str]]] = None,
*,
_ispytest: bool = False,
) -> None:
check_ispytest(_ispytest)
super().__init__(_ispytest=True)
msg = "exceptions must be derived from Warning, not %s"
if isinstance(expected_warning, tuple):
for exc in expected_warning:
if not issubclass(exc, Warning):
raise TypeError(msg % type(exc))
expected_warning_tup = expected_warning
elif isinstance(expected_warning, type) and issubclass(
expected_warning, Warning
):
expected_warning_tup = (expected_warning,)
else:
raise TypeError(msg % type(expected_warning))
E
TypeError: exceptions must be derived from Warning, not <class
'NoneType'>
/usr/lib/python3.12/site-packages/_pytest/recwarn.py:285: TypeError
------------------------------ Captured log call
-------------------------------
DEBUG rasterio._env:env.py:326 GDAL data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 PROJ data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 Started GDALEnv: self=<rasterio._env.GDALEnv
object at 0x7f9c689ec640>.
DEBUG rasterio._env:env.py:362 Stopped GDALEnv <rasterio._env.GDALEnv object
at 0x7f9c689ec640>.
DEBUG rasterio._env:env.py:326 GDAL data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 PROJ data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 Started GDALEnv: self=<rasterio._env.GDALEnv
object at 0x7f9c689edba0>.
DEBUG rasterio._env:env.py:362 Stopped GDALEnv <rasterio._env.GDALEnv object
at 0x7f9c689edba0>.
================================== XFAILURES
===================================
________________________ test_set_colorinterp_all[1_0]
_________________________
path_4band_no_colorinterp =
'/tmp/pytest-of-mockbuild/pytest-0/test_set_colorinterp_all_1_0_0/4band-byte-no-ci.tif'
ci = <ColorInterp.gray: 1>
@pytest.mark.parametrize("ci", ColorInterp.__members__.values())
def test_set_colorinterp_all(path_4band_no_colorinterp, ci):
"""Test setting with all color interpretations."""
if ci.value == 1:
pytest.xfail("Setting colorinterp to gray fails with
GDAL 2.3, see
https://github.com/rasterio/rasterio/issues/1234")
E
_pytest.outcomes.XFailed: Setting colorinterp to gray fails with
GDAL 2.3, see
https://github.com/rasterio/rasterio/issues/1234
tests/test_colorinterp.py:88: XFailed
________________________ test_set_colorinterp_all[1_1]
_________________________
path_4band_no_colorinterp =
'/tmp/pytest-of-mockbuild/pytest-0/test_set_colorinterp_all_1_1_0/4band-byte-no-ci.tif'
ci = <ColorInterp.gray: 1>
@pytest.mark.parametrize("ci", ColorInterp.__members__.values())
def test_set_colorinterp_all(path_4band_no_colorinterp, ci):
"""Test setting with all color interpretations."""
if ci.value == 1:
pytest.xfail("Setting colorinterp to gray fails with
GDAL 2.3, see
https://github.com/rasterio/rasterio/issues/1234")
E
_pytest.outcomes.XFailed: Setting colorinterp to gray fails with
GDAL 2.3, see
https://github.com/rasterio/rasterio/issues/1234
tests/test_colorinterp.py:88: XFailed
___________________________ test_aws_unsigned_subenv
___________________________
gdalenv = None
@pytest.mark.xfail(
reason="Turning off signing in an inner env does not work in Rasterio
1.0")
def test_aws_unsigned_subenv(gdalenv):
"""Create an Env with no AWS signing."""
with rasterio.Env(
aws_access_key_id='id', aws_secret_access_key='key',
aws_session_token='token', region_name='null-island-1'):
with rasterio.env.Env(aws_unsigned=True):
assert getenv()['AWS_NO_SIGN_REQUEST'] == 'YES'
assert getenv().get('AWS_ACCESS_KEY_ID') is
None
E AssertionError: assert 'id' is None
E + where 'id' = <built-in method get of dict object at
0x7f9c682fc440>('AWS_ACCESS_KEY_ID')
E + where <built-in method get of dict object at
0x7f9c682fc440> = {'AWS_ACCESS_KEY_ID': 'id',
'AWS_NO_SIGN_REQUEST': 'YES',
'AWS_REGION': 'null-island-1', 'AWS_SECRET_ACCESS_KEY':
'key', ...}.get
E + where {'AWS_ACCESS_KEY_ID': 'id',
'AWS_NO_SIGN_REQUEST': 'YES', 'AWS_REGION':
'null-island-1',
'AWS_SECRET_ACCESS_KEY': 'key', ...} = getenv()
tests/test_env.py:289: AssertionError
------------------------------ Captured log call
-------------------------------
DEBUG rasterio._env:env.py:326 GDAL data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 PROJ data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 Started GDALEnv: self=<rasterio._env.GDALEnv
object at 0x7f9c682fabf0>.
DEBUG rasterio._env:env.py:362 Stopped GDALEnv <rasterio._env.GDALEnv object
at 0x7f9c682fabf0>.
DEBUG rasterio._env:env.py:326 GDAL data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 PROJ data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 Started GDALEnv: self=<rasterio._env.GDALEnv
object at 0x7f9c68525330>.
DEBUG rasterio._env:env.py:362 Stopped GDALEnv <rasterio._env.GDALEnv object
at 0x7f9c68525330>.
______________________________ test_issue2353bis
_______________________________
caplog = <_pytest.logging.LogCaptureFixture object at 0x7f9c683533e0>
path_rgb_byte_tif =
'/builddir/build/BUILD/rasterio-1.3.9/tests/data/RGB.byte.tif'
@pytest.mark.xfail(gdal_version < GDALVersion(3, 3), reason="GDAL <3.3
will
not warn")
@pytest.mark.xfail(gdal_version > GDALVersion(3, 3), reason="GDAL > 3.3
will not warn")
def test_issue2353bis(caplog, path_rgb_byte_tif):
"""Ensure VRT doesn't leave errors behind."""
from rasterio.vrt import WarpedVRT
with caplog.at_level(logging.INFO):
with rasterio.open('tests/data/goes.tif') as src:
with WarpedVRT(src, dst_crs="EPSG:3857") as vrt:
pass
assert "Ignoring error" in caplog.text
E AssertionError: assert 'Ignoring error' in ''
E + where '' = <_pytest.logging.LogCaptureFixture object at
0x7f9c683533e0>.text
tests/test_err.py:68: AssertionError
------------------------------ Captured log call
-------------------------------
DEBUG rasterio._env:env.py:326 GDAL data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 PROJ data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 Started GDALEnv: self=<rasterio._env.GDALEnv
object at 0x7f9c68353400>.
DEBUG rasterio._env:env.py:362 Stopped GDALEnv <rasterio._env.GDALEnv object
at 0x7f9c68353400>.
DEBUG rasterio._env:env.py:326 GDAL data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 PROJ data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 Started GDALEnv: self=<rasterio._env.GDALEnv
object at 0x7f9c68350eb0>.
DEBUG rasterio._env:env.py:362 Stopped GDALEnv <rasterio._env.GDALEnv object
at 0x7f9c68350eb0>.
____________________________ test_vsifile_copyfiles
____________________________
path_rgb_msk_byte_tif =
'/builddir/build/BUILD/rasterio-1.3.9/tests/data/RGB2.byte.tif'
@pytest.mark.xfail(reason="Copying is not supported by FilePath")
def test_vsifile_copyfiles(path_rgb_msk_byte_tif):
"""Multiple files can be copied to a FilePath using
copyfiles"""
with rasterio.open(path_rgb_msk_byte_tif) as src:
src_basename = os.path.basename(src.name)
with FilePath(dirname="foo",
filename=src_basename) as vsifile:
E TypeError: _FilePath.__init__()
missing 1 required positional
argument: 'filelike_obj'
tests/test_filepath.py:162: TypeError
------------------------------ Captured log call
-------------------------------
DEBUG rasterio._env:env.py:326 GDAL data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 PROJ data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 Started GDALEnv: self=<rasterio._env.GDALEnv
object at 0x7f9c68552350>.
DEBUG rasterio._env:env.py:362 Stopped GDALEnv <rasterio._env.GDALEnv object
at 0x7f9c68552350>.
DEBUG rasterio._env:env.py:326 GDAL data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 PROJ data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 Started GDALEnv: self=<rasterio._env.GDALEnv
object at 0x7f9c685526e0>.
DEBUG rasterio._env:env.py:362 Stopped GDALEnv <rasterio._env.GDALEnv object
at 0x7f9c685526e0>.
______________________________ test_multi_vsifile
______________________________
path_rgb_msk_byte_tif =
'/builddir/build/BUILD/rasterio-1.3.9/tests/data/RGB2.byte.tif'
@pytest.mark.xfail(reason="FilePath does not implement '.files' property
properly.")
def test_multi_vsifile(path_rgb_msk_byte_tif):
"""Multiple files can be copied to a FilePath using
copyfiles"""
with open(path_rgb_msk_byte_tif, "rb") as tif_fp, open(
path_rgb_msk_byte_tif + ".msk", "rb"
) as msk_fp:
with FilePath(
tif_fp, dirname="bar", filename="foo.tif"
) as tifvsifile, FilePath(msk_fp, dirname="bar",
filename="foo.tif.msk"):
with tifvsifile.open() as src:
assert sorted(os.path.basename(fn) for fn in
src.files) == sorted(['foo.tif', 'foo.tif.msk'])
E
AssertionError: assert [] == ['foo.tif', 'foo.tif.msk']
E
E Right contains 2 more items, first extra item: 'foo.tif'
E Use -v to get more diff
tests/test_filepath.py:178: AssertionError
------------------------------ Captured log call
-------------------------------
DEBUG rasterio._env:env.py:326 GDAL data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 PROJ data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 Started GDALEnv: self=<rasterio._env.GDALEnv
object at 0x7f9c682f4fd0>.
DEBUG rasterio._env:env.py:362 Stopped GDALEnv <rasterio._env.GDALEnv object
at 0x7f9c682f4fd0>.
DEBUG rasterio._env:env.py:326 GDAL data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 PROJ data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 Started GDALEnv: self=<rasterio._env.GDALEnv
object at 0x7f9c682f5210>.
DEBUG rasterio._env:env.py:362 Stopped GDALEnv <rasterio._env.GDALEnv object
at 0x7f9c682f5210>.
________________________________ test_issue1982
________________________________
???
rasterio/_base.pyx:310:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
rasterio/_base.pyx:221: in rasterio._base.open_dataset
???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
???
E rasterio._err.CPLE_HttpResponseError: CURL error:
Could not resolve host:
raw.githubusercontent.com
rasterio/_err.pyx:221: CPLE_HttpResponseError
During handling of the above exception, another exception occurred:
capfd = <_pytest.capture.CaptureFixture object at 0x7f9c69737f20>
@pytest.mark.xfail(reason="GDAL 3.1 skips overviews because of background
layer")
def test_issue1982(capfd):
"""See a curl request for overview file"""
# Note: the underlying GDAL issue has been fixed after 3.1.3. The
# rasterio 1.1.6 wheels published to PyPI will include a patched
# 2.4.4 that also fixes the issue. This test will XPASS in the
# rasterio-wheels tests.
with rasterio.Env(CPL_CURL_VERBOSE=True), rasterio.open(
"https://raw.githubusercontent.com/mapbox/rasterio/master/tests/data/green.tif"
) as src:
tests/test_read_boundless.py:159:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../BUILDROOT/python-rasterio-1.3.9-4.fc41.x86_64/usr/lib64/python3.12/site-packages/rasterio/env.py:451:
in wrapper
return f(*args, **kwds)
../../BUILDROOT/python-rasterio-1.3.9-4.fc41.x86_64/usr/lib64/python3.12/site-packages/rasterio/__init__.py:304:
in open
dataset = DatasetReader(path, driver=driver, sharing=sharing, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
???
E rasterio.errors.RasterioIOError: CURL error: Could
not resolve host:
raw.githubusercontent.com
rasterio/_base.pyx:312: RasterioIOError
----------------------------- Captured stderr call
-----------------------------
* Couldn't find host
raw.githubusercontent.com in the .netrc file; using
defaults
* Could not resolve host:
raw.githubusercontent.com
* Closing connection
* Couldn't find host
raw.githubusercontent.com in the .netrc file; using
defaults
* Could not resolve host:
raw.githubusercontent.com
* Closing connection
------------------------------ Captured log call
-------------------------------
DEBUG rasterio._env:env.py:326 GDAL data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 PROJ data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 Started GDALEnv: self=<rasterio._env.GDALEnv
object at 0x7f9c697354e0>.
INFO rasterio._env:__init__.py:304 GDAL signalled an error: err_no=11,
msg='CURL error: Could not resolve host: raw.githubusercontent.com'
DEBUG rasterio._env:env.py:362 Stopped GDALEnv <rasterio._env.GDALEnv object
at 0x7f9c697354e0>.
DEBUG rasterio._env:env.py:326 GDAL data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 PROJ data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 Started GDALEnv: self=<rasterio._env.GDALEnv
object at 0x7f9c69736f20>.
DEBUG rasterio._env:env.py:362 Stopped GDALEnv <rasterio._env.GDALEnv object
at 0x7f9c69736f20>.
__________________ test_transform_bounds_densify[0-expected0]
__________________
density = 0
expected = (-1688721.99764, -350040.3688, 1688799.61159, 2236495.86829)
@pytest.mark.xfail(reason="Projection extents have changed with PROJ 9")
@pytest.mark.parametrize(
"density,expected",
[
(0, (-1688721.99764, -350040.36880, 1688799.61159, 2236495.86829)),
(100, (-1688721.99764, -555239.84875, 1688799.61159,
2236495.86829)),
],
)
def test_transform_bounds_densify(density, expected):
# This transform is non-linear along the edges, so densification
produces
# a different result than otherwise
src_crs = CRS.from_epsg(4326)
dst_crs = CRS.from_epsg(2163)
with rasterio.Env(OSR_USE_NON_DEPRECATED="NO"):
assert np.allclose(
expected,
transform_bounds(src_crs, dst_crs, -120, 40, -80, 64,
densify_pts=density),
)
E assert False
E + where False = <function allclose at
0x7f9c72c37170>((-1688721.99764, -350040.3688, 1688799.61159, 2236495.86829),
(-1684563.0570904743, -350364.3902387434, 1684630.976568975,
2234511.8820722257))
E + where <function allclose at 0x7f9c72c37170> = np.allclose
E + and (-1684563.0570904743, -350364.3902387434,
1684630.976568975, 2234511.8820722257) = transform_bounds(CRS.from_epsg(4326),
CRS.from_epsg(2163), -120, 40, -80, 64, densify_pts=0)
tests/test_warp.py:306: AssertionError
----------------------------- Captured stderr call
-----------------------------
Warning 1: CRS EPSG:2163 is deprecated. Its non-deprecated replacement
EPSG:9311 will be used instead. To use the original CRS, set the
OSR_USE_NON_DEPRECATED configuration option to NO.
------------------------------ Captured log call
-------------------------------
DEBUG rasterio._env:env.py:326 GDAL data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 PROJ data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 Started GDALEnv: self=<rasterio._env.GDALEnv
object at 0x7f9c689ef8e0>.
DEBUG rasterio._env:env.py:362 Stopped GDALEnv <rasterio._env.GDALEnv object
at 0x7f9c689ef8e0>.
_________________ test_transform_bounds_densify[100-expected1]
_________________
density = 100
expected = (-1688721.99764, -555239.84875, 1688799.61159, 2236495.86829)
@pytest.mark.xfail(reason="Projection extents have changed with PROJ 9")
@pytest.mark.parametrize(
"density,expected",
[
(0, (-1688721.99764, -350040.36880, 1688799.61159, 2236495.86829)),
(100, (-1688721.99764, -555239.84875, 1688799.61159,
2236495.86829)),
],
)
def test_transform_bounds_densify(density, expected):
# This transform is non-linear along the edges, so densification
produces
# a different result than otherwise
src_crs = CRS.from_epsg(4326)
dst_crs = CRS.from_epsg(2163)
with rasterio.Env(OSR_USE_NON_DEPRECATED="NO"):
assert np.allclose(
expected,
transform_bounds(src_crs, dst_crs, -120, 40, -80, 64,
densify_pts=density),
)
E assert False
E + where False = <function allclose at
0x7f9c72c37170>((-1688721.99764, -555239.84875, 1688799.61159, 2236495.86829),
(-1684563.0570904743, -555777.4735945498, 1684630.976568975,
2234511.8820722257))
E + where <function allclose at 0x7f9c72c37170> = np.allclose
E + and (-1684563.0570904743, -555777.4735945498,
1684630.976568975, 2234511.8820722257) = transform_bounds(CRS.from_epsg(4326),
CRS.from_epsg(2163), -120, 40, -80, 64, densify_pts=100)
tests/test_warp.py:306: AssertionError
------------------------------ Captured log call
-------------------------------
DEBUG rasterio._env:env.py:326 GDAL data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 PROJ data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 Started GDALEnv: self=<rasterio._env.GDALEnv
object at 0x7f9c689ece20>.
DEBUG rasterio._env:env.py:362 Stopped GDALEnv <rasterio._env.GDALEnv object
at 0x7f9c689ece20>.
__________________________ test_target_aligned_pixels
__________________________
@pytest.mark.xfail(reason="Projection extents have changed with PROJ 8")
def test_target_aligned_pixels():
"""Issue 853 has been resolved"""
with rasterio.open("tests/data/world.rgb.tif") as src:
source = src.read(1)
profile = src.profile
dst_crs = "EPSG:3857"
with rasterio.Env(CHECK_WITH_INVERT_PROJ=False):
# Calculate the ideal dimensions and transformation in the new crs
dst_affine, dst_width, dst_height = calculate_default_transform(
src.crs, dst_crs, src.width, src.height, *src.bounds
)
dst_affine, dst_width, dst_height = aligned_target(
dst_affine, dst_width, dst_height, 10000.0
)
profile["height"] = dst_height
profile["width"] = dst_width
out = np.empty(shape=(dst_height, dst_width), dtype=np.uint8)
reproject(
source,
out,
src_transform=src.transform,
src_crs=src.crs,
dst_transform=dst_affine,
dst_crs=dst_crs,
resampling=Resampling.nearest,
)
# Check that there are no black borders
assert out[:, 0].all()
E assert False
E + where False = <built-in method all of numpy.ndarray object at
0x7f9c62e8e970>()
E + where <built-in method all of numpy.ndarray object at
0x7f9c62e8e970> = array([0, 0, 0, ..., 0, 0, 0], dtype=uint8).all
tests/test_warp.py:1446: AssertionError
------------------------------ Captured log call
-------------------------------
DEBUG rasterio._env:env.py:326 GDAL data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 PROJ data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 Started GDALEnv: self=<rasterio._env.GDALEnv
object at 0x7f9c693c69e0>.
DEBUG rasterio._env:env.py:362 Stopped GDALEnv <rasterio._env.GDALEnv object
at 0x7f9c693c69e0>.
DEBUG rasterio._env:env.py:326 GDAL data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 PROJ data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 Started GDALEnv: self=<rasterio._env.GDALEnv
object at 0x7f9c693c4f40>.
DEBUG rasterio._env:env.py:362 Stopped GDALEnv <rasterio._env.GDALEnv object
at 0x7f9c693c4f40>.
DEBUG rasterio._env:env.py:326 GDAL data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 PROJ data files are available at built-in
paths.
DEBUG rasterio._env:env.py:326 Started GDALEnv: self=<rasterio._env.GDALEnv
object at 0x7f9c693c73d0>.
DEBUG rasterio._env:env.py:362 Stopped GDALEnv <rasterio._env.GDALEnv object
at 0x7f9c693c73d0>.
_______________________ test_resample_no_invert_proj[1]
________________________
method = <Resampling.bilinear: 1>
@pytest.mark.parametrize("method", SUPPORTED_RESAMPLING)
def test_resample_no_invert_proj(method):
"""Nearest and bilinear should produce valid results with
CHECK_WITH_INVERT_PROJ = False
"""
if method in (
Resampling.bilinear,
Resampling.cubic,
Resampling.cubic_spline,
Resampling.lanczos,
):
pytest.xfail(
reason="Some
resampling methods succeed but produce blank
images. "
"See
https://github.com/rasterio/rasterio/issues/614"
)
E _pytest.outcomes.XFailed: Some resampling methods succeed but
produce blank images. See
https://github.com/rasterio/rasterio/issues/614
tests/test_warp.py:1464: XFailed
_______________________ test_resample_no_invert_proj[2]
________________________
method = <Resampling.cubic: 2>
@pytest.mark.parametrize("method", SUPPORTED_RESAMPLING)
def test_resample_no_invert_proj(method):
"""Nearest and bilinear should produce valid results with
CHECK_WITH_INVERT_PROJ = False
"""
if method in (
Resampling.bilinear,
Resampling.cubic,
Resampling.cubic_spline,
Resampling.lanczos,
):
pytest.xfail(
reason="Some
resampling methods succeed but produce blank
images. "
"See
https://github.com/rasterio/rasterio/issues/614"
)
E _pytest.outcomes.XFailed: Some resampling methods succeed but
produce blank images. See
https://github.com/rasterio/rasterio/issues/614
tests/test_warp.py:1464: XFailed
_______________________ test_resample_no_invert_proj[3]
________________________
method = <Resampling.cubic_spline: 3>
@pytest.mark.parametrize("method", SUPPORTED_RESAMPLING)
def test_resample_no_invert_proj(method):
"""Nearest and bilinear should produce valid results with
CHECK_WITH_INVERT_PROJ = False
"""
if method in (
Resampling.bilinear,
Resampling.cubic,
Resampling.cubic_spline,
Resampling.lanczos,
):
pytest.xfail(
reason="Some
resampling methods succeed but produce blank
images. "
"See
https://github.com/rasterio/rasterio/issues/614"
)
E _pytest.outcomes.XFailed: Some resampling methods succeed but
produce blank images. See
https://github.com/rasterio/rasterio/issues/614
tests/test_warp.py:1464: XFailed
_______________________ test_resample_no_invert_proj[4]
________________________
method = <Resampling.lanczos: 4>
@pytest.mark.parametrize("method", SUPPORTED_RESAMPLING)
def test_resample_no_invert_proj(method):
"""Nearest and bilinear should produce valid results with
CHECK_WITH_INVERT_PROJ = False
"""
if method in (
Resampling.bilinear,
Resampling.cubic,
Resampling.cubic_spline,
Resampling.lanczos,
):
pytest.xfail(
reason="Some
resampling methods succeed but produce blank
images. "
"See
https://github.com/rasterio/rasterio/issues/614"
)
E _pytest.outcomes.XFailed: Some resampling methods succeed but
produce blank images. See
https://github.com/rasterio/rasterio/issues/614
tests/test_warp.py:1464: XFailed
FAILED tests/test_rio_shapes.py::test_shapes - TypeError: exceptions must be
...
FAILED tests/test_rio_shapes.py::test_shapes_sequence - TypeError:
exceptions...
FAILED tests/test_rio_shapes.py::test_shapes_indent - TypeError: exceptions
m...
FAILED tests/test_rio_shapes.py::test_shapes_compact - TypeError: exceptions
...
FAILED tests/test_warnings.py::test_no_notgeoref_warning[transform0-None-None]
FAILED tests/test_warnings.py::test_no_notgeoref_warning[None-gcps1-None] -
T...
FAILED tests/test_warnings.py::test_no_notgeoref_warning[None-None-rpcs2] -
T...
= 7 failed, 2061 passed, 11 skipped, 20 deselected, 14 xfailed, 8 xpassed, 282
warnings in 46.54s =
--
You are receiving this mail because:
You are on the CC list for the bug.
https://bugzilla.redhat.com/show_bug.cgi?id=2274105
Report this comment as SPAM:
https://bugzilla.redhat.com/enter_bug.cgi?product=Bugzilla&format=rep...