sci-biology/pysam - 0.24.0 (gentoo)

Search

Install

Install this version:

emerge -a =sci-biology/pysam-0.24.0

If this version is masked, you can unmask it using the autounmask tool or standard emerge options:

autounmask =sci-biology/pysam-0.24.0

Or alternatively:

emerge --autounmask-write -a =sci-biology/pysam-0.24.0

Package Information

Description:
Python interface for the SAM/BAM sequence alignment and mapping format
Homepage:
https://github.com/pysam-developers/pysam https://pypi.org/project/pysam/
License:
MIT

Ebuild Details

Version EAPI Keywords Slot
0.24.0 8 ~amd64 ~x86 0
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

if [[ ${PV} == *9999 ]]; then
	inherit git-r3
	EGIT_REPO_URI="https://github.com/pysam-developers/pysam.git"
else
	SRC_URI="https://github.com/pysam-developers/pysam/archive/v${PV}.tar.gz -> ${P}.gh.tar.gz"
	KEYWORDS="~amd64 ~x86"
fi

DESCRIPTION="Python interface for the SAM/BAM sequence alignment and mapping format"
HOMEPAGE="
	https://github.com/pysam-developers/pysam
	https://pypi.org/project/pysam/"

LICENSE="MIT"
SLOT="0"

RDEPEND="=sci-libs/htslib-1.23*:="
DEPEND="${RDEPEND}"
BDEPEND="
	>=dev-python/cython-3[${PYTHON_USEDEP}]
	test? (
		=sci-biology/bcftools-1.23*
		=sci-biology/samtools-1.23*
	)"

distutils_enable_tests pytest

EPYTEST_DESELECT=(
	# only work with bundled htslib
	'tests/tabix_test.py::TestRemoteFileHTTP'
	'tests/tabix_test.py::TestRemoteFileHTTPWithHeader'

	'tests/AlignedSegment_test.py::TestBaseModifications'
)

python_prepare_all() {

	# unbundle htslib
	export HTSLIB_MODE="external"
	export HTSLIB_INCLUDE_DIR="${ESYSROOT}"/usr/include
	export HTSLIB_LIBRARY_DIR="${ESYSROOT}"/usr/$(get_libdir)
	rm -r htslib || die

	if use test; then
		einfo "Building test data"
		emake -C tests/pysam_data
		emake -C tests/cbcf_data
	fi

	# breaks with parallel build
	# need to avoid dropping .so plugins into
	# build-lib, which breaks tests
	DISTUTILS_ARGS=(
		build_ext
		--inplace
		-j1
	)
	distutils-r1_python_prepare_all
}

python_test() {
	rm -rf pysam || die
	epytest
}

Inherited Eclasses

Dependencies

DEPEND

=sci-libs/htslib-1.23*:=

RDEPEND

=sci-libs/htslib-1.23*:=

BDEPEND

	>=dev-python/cython-3[]
	test? (
		=sci-biology/bcftools-1.23*
		=sci-biology/samtools-1.23*
	)

Manifest for 0.24.0

Type File Size Source URLs
DIST pysam-0.24.0.gh.tar.gz 4198223 bytes https://github.com/pysam-developers/pysam/archive/v0.24.0.tar.gz