aboutsummaryrefslogtreecommitdiff
blob: f6fde60a33258927cbc4cb48d73be44b3a56c677 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

PYTHON_COMPAT=( python3_{10..12} )
DISTUTILS_EXT=1
DISTUTILS_USE_PEP517="setuptools"
inherit distutils-r1

DESCRIPTION="API for reading/writing vector geospatial data"
HOMEPAGE="https://github.com/Toblerity/fiona"
SRC_URI="https://github.com/Toblerity/${PN}/archive/refs/tags/${PV}.tar.gz -> ${P}.gh.tar.gz"
S="${WORKDIR}/Fiona-${PV}"

LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~x86"

RDEPEND="
	sci-libs/gdal[geos,sqlite]
	dev-python/attrs[${PYTHON_USEDEP}]
	dev-python/click-plugins[${PYTHON_USEDEP}]
	dev-python/cligj[${PYTHON_USEDEP}]
	dev-python/munch[${PYTHON_USEDEP}]
	dev-python/certifi[${PYTHON_USEDEP}]
"

BDEPEND="
	test? (
		dev-python/aiohttp[${PYTHON_USEDEP}]
		dev-python/boto3[${PYTHON_USEDEP}]
		dev-python/fsspec[${PYTHON_USEDEP}]
		dev-python/requests[${PYTHON_USEDEP}]
		sci-libs/gdal[geos,sqlite]
	)
"

distutils_enable_tests pytest

python_test() {
	local EPYTEST_DESELECT=(
		# disable tests violating network sandbox
		tests/test_vfs.py::test_open_http
		tests/test_vfs.py::test_open_zip_https
		tests/test_collection.py::test_collection_http
		tests/test_collection.py::test_collection_zip_http

		# disable tests failing due to deprecated GDAL features
		tests/test_data_paths.py::test_gdal_data_wheel
		tests/test_data_paths.py::test_proj_data_wheel
		tests/test_data_paths.py::test_env_gdal_data_wheel
		tests/test_data_paths.py::test_env_proj_data_wheel
		tests/test_datetime.py::test_datefield[GPSTrackMaker-datetime]
		tests/test_datetime.py::test_datefield_null[GPSTrackMaker-datetime]
		tests/test_drvsupport.py::test_write_or_driver_error[GPSTrackMaker]
		tests/test_drvsupport.py::test_no_append_driver_cannot_append[GPSTrackMaker]
		tests/test_drvsupport.py::test_no_append_driver_cannot_append[PCIDSK]
		tests/test_drvsupport.py::test_write_or_driver_error[DGN]

		# OGR silently fails to convert strings
		tests/test_unicode.py::TestUnicodeStringField::test_write_mismatch
	)

	mv fiona{,.bak} || die # Avoid non-working local import
	epytest
	mv fiona{.bak,} || die
}