sci-libs/vtk: fix QA warnings
[gentoo.git] / sci-libs / cartopy / cartopy-0.18.0_beta1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 PYTHON_COMPAT=( python3_{6,7} )
7 inherit distutils-r1 virtualx
8
9 MY_PV=${PV/_beta/b}
10 MY_P=${PN}-${MY_PV}
11
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"
15
16 LICENSE="LGPL-3"
17 SLOT="0"
18 KEYWORDS="~amd64 ~x86"
19 IUSE="test"
20 RESTRICT="!test? ( test )"
21 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
22
23 RDEPEND="
24         ${PYTHON_DEPS}
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}]
33 "
34
35 DEPEND="${RDEPEND}
36         dev-python/setuptools[${PYTHON_USEDEP}]
37         dev-python/cython[${PYTHON_USEDEP}]
38         sci-libs/geos
39         sci-libs/proj
40 "
41
42 distutils_enable_tests pytest
43
44 DEPEND+="test? (
45                 dev-python/filelock[${PYTHON_USEDEP}]
46                 dev-python/mock[${PYTHON_USEDEP}]
47                 dev-python/pytest[${PYTHON_USEDEP}]
48         )"
49
50 S="${WORKDIR}"/${MY_P}
51
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
59 }
60
61 python_test() {
62         cd "${BUILD_DIR}"
63         # drop all tests needing network access
64         virtx pytest -vv -m "not network and not natural_earth" || die "test failed"
65 }