1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python3_{6,7} )
7 inherit distutils-r1 virtualx
12 DESCRIPTION="Python package for geospatial data processing and analysis"
13 HOMEPAGE="https://scitools.org.uk/cartopy"
14 SRC_URI="https://github.com/SciTools/${PN}/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz"
18 KEYWORDS="~amd64 ~x86"
20 RESTRICT="!test? ( test )"
21 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
25 dev-python/numpy[${PYTHON_USEDEP}]
26 sci-libs/pyshp[${PYTHON_USEDEP}]
27 sci-libs/Shapely[${PYTHON_USEDEP}]
28 dev-python/six[${PYTHON_USEDEP}]
29 dev-python/matplotlib[${PYTHON_USEDEP}]
30 sci-libs/scipy[${PYTHON_USEDEP}]
31 dev-python/pillow[${PYTHON_USEDEP}]
32 sci-libs/gdal[python,${PYTHON_USEDEP}]
36 dev-python/setuptools[${PYTHON_USEDEP}]
37 dev-python/cython[${PYTHON_USEDEP}]
42 distutils_enable_tests pytest
45 dev-python/filelock[${PYTHON_USEDEP}]
46 dev-python/mock[${PYTHON_USEDEP}]
47 dev-python/pytest[${PYTHON_USEDEP}]
50 S="${WORKDIR}"/${MY_P}
52 python_prepare_all() {
53 # drop test file requiring network access, which got not covered by markers
54 rm "${S}"/lib/cartopy/tests/mpl/test_crs.py || die
55 # prepare matplotlib backend for test suite
56 export MPLCONFIGDIR="${T}"
57 echo "backend : Agg" > "${MPLCONFIGDIR}"/matplotlibrc || die
58 distutils-r1_python_prepare_all
63 # drop all tests needing network access
64 virtx pytest -vv -m "not network and not natural_earth" || die "test failed"