
Code: Select all
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{10..12} )
inherit distutils-r1
DESCRIPTION="A python package for music and audio analysis."
HOMEPAGE="https://github.com/librosa/librosa"
LICENSE="GPL-3+"
SLOT="0"
if [[ "${PV}" == *9999* ]]; then
inherit git-r3
EGIT_REPO_URI="https://github.com/librosa/librosa.git"
else
SRC_URI="https://github.com/librosa/librosa/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
KEYWORDS="amd64"
S="${WORKDIR}/${PN}-${PV}"
fi
RESTRICT="mirror"
IUSE=""
# pytest-xdist isn't really required but it helps speed up tests
BDEPEND="
dev-python/orjson[${PYTHON_USEDEP}]
"
RDEPEND="
${BDEPEND}
"
distutils_enable_tests pytest
src_prepare() {
distutils-r1_python_prepare_all
}
python_test() {
epytest -n auto
}
Code: Select all
import librosaCode: Select all
librosa.show_versions()Code: Select all
INSTALLED VERSIONS
------------------
python: 3.12.3 (main, May 21 2024, 03:35:07) [GCC 13.2.1 20240113]
librosa: 0.10.2
audioread: None
numpy: 1.26.4
scipy: None
sklearn: None
joblib: None
decorator: None
numba: None
soundfile: None
pooch: None
soxr: None
typing_extensions: None
lazy_loader: 0.4
msgpack: None
numpydoc: None
sphinx: None
sphinx_rtd_theme: None
matplotlib: None
sphinx_multiversion: None
sphinx_gallery: None
mir_eval: None
ipython: None
sphinxcontrib.rsvgconverter: None
pytest: None
pytest_mpl: None
pytest_cov: None
samplerate: None
resampy: None
presets: None
packaging: 24.0
rab0171610 wrote:You would need to install it with pip. I am not sure how others here handle python stuff that are not available through portage. The recommended method is installing to a virtual environment (venv) but I usually use the brute force method for obscure modules by using --break-system-packages. I have not had issues but others here will probably have a strong opinion about it one way or another. You will have to wait for someone else to explain what the current best practice for that is on Gentoo.
Code: Select all
pip install --help
...
--user Install to the Python user install directory for your platform. Typically ~/.local/, or %APPDATA%\Python on Windows. (See the Python documentation for site.USER_BASE for full
details.)