View Raw Ebuild
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DISTUTILS_EXT=1
DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{11..14} )
inherit distutils-r1
DESCRIPTION="Fast and direct raster I/O for use with Numpy and SciPy"
HOMEPAGE="https://rasterio.readthedocs.io"
SRC_URI="https://github.com/rasterio/rasterio/archive/refs/tags/${PV}.tar.gz -> ${P}.gh.tar.gz"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="examples ipython plot s3"
PROPERTIES="test_network"
RESTRICT="test"
DEPEND=">=dev-python/numpy-2:=[${PYTHON_USEDEP}]
>=sci-libs/gdal-2.1.0:=[${PYTHON_USEDEP},aux-xml(+),jpeg(+),png,threads(+)]
" #965329
RDEPEND="${DEPEND}
dev-python/affine[${PYTHON_USEDEP}]
dev-python/attrs[${PYTHON_USEDEP}]
dev-python/certifi[${PYTHON_USEDEP}]
>=dev-python/click-8.3[${PYTHON_USEDEP}]
>=dev-python/cligj-0.5[${PYTHON_USEDEP}]
dev-python/pyparsing[${PYTHON_USEDEP}]
ipython? ( >=dev-python/ipython-2.0[${PYTHON_USEDEP}] )
plot? ( dev-python/matplotlib[${PYTHON_USEDEP}] )
s3? ( >=dev-python/boto3-1.2.4[${PYTHON_USEDEP}] )
"
BDEPEND=">=dev-python/cython-3.1[${PYTHON_USEDEP}]
test? (
dev-python/aiohttp[${PYTHON_USEDEP}]
>=dev-python/boto3-1.2.4[${PYTHON_USEDEP}]
dev-python/fsspec[${PYTHON_USEDEP}]
dev-python/matplotlib[${PYTHON_USEDEP}]
dev-python/requests[${PYTHON_USEDEP}]
dev-python/shapely[${PYTHON_USEDEP}]
sci-libs/gdal:=[${PYTHON_USEDEP},aux-xml(+),hdf5,jpeg(+),netcdf,png,threads(+)]
)
"
EPYTEST_PLUGINS=( hypothesis )
distutils_enable_tests pytest
distutils_enable_sphinx docs dev-python/sphinx-click dev-python/sphinx-rtd-theme
#python_prepare_all() {
# use doc && { sed -i "/language\ = /s/None/'en'/" docs/conf.py || die ; }
#
# distutils-r1_python_prepare_all
#}
python_compile_all() {
# No module named 'rasterio._io'
use doc && [[ -d ${PN} ]] && { mv {,_}${PN} || die ; }
sphinx_compile_all
[[ -d _${PN} ]] && { mv {_,}${PN} || die ; }
}
python_install_all() {
if use examples; then
docompress -x "/usr/share/doc/${PF}/examples"
docinto examples
dodoc -r examples/.
fi
distutils-r1_python_install_all
}
python_test() {
# No module named 'rasterio._io'
[[ -d ${PN} ]] && { mv {,_}${PN} || die ; }
epytest
[[ -d _${PN} ]] && { mv {_,}${PN} || die ; }
}