python3Packages.cyvcf2: init at 0.34.0 (#564256)

This commit is contained in:
Peder Bergebakken Sundt
2026-09-17 17:39:29 +00:00
committed by GitHub
2 changed files with 91 additions and 0 deletions

View File

@@ -0,0 +1,89 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
python,
# build-system
cmake,
cython,
ninja,
numpy,
scikit-build-core,
# nativeBuildInputs
pkg-config,
# buildInputs
htslib,
# dependencies
click,
coloredlogs,
# tests
pytestCheckHook,
}:
buildPythonPackage (finalAttrs: {
pname = "cyvcf2";
version = "0.34.0";
pyproject = true;
__structuredAttrs = true;
src = fetchFromGitHub {
owner = "brentp";
repo = "cyvcf2";
tag = "v${finalAttrs.version}";
hash = "sha256-XDo2cEcZm5y6u9Gc2e7q2tg8pt3C/5cmnWRe6Dr5x7M=";
};
build-system = [
cmake
cython
ninja
numpy
scikit-build-core
];
dontUseCmakeConfigure = true;
nativeBuildInputs = [
pkg-config
];
buildInputs = [
htslib
];
env = {
# Link against the system htslib instead of building the bundled submodule
CYVCF2_HTSLIB_MODE = "EXTERNAL";
};
dependencies = [
click
coloredlogs
numpy
];
pythonImportsCheck = [ "cyvcf2" ];
nativeCheckInputs = [
pytestCheckHook
];
# The test suite lives inside the package directory and relies on relative imports
# (`from ..cyvcf2 import VCF`) as well as data files next to it, so it must run from the source
# tree. Bring the compiled extension along.
preCheck = ''
cp $out/${python.sitePackages}/cyvcf2/cyvcf2*.so cyvcf2/
'';
meta = {
description = "Cython wrapper around htslib built for fast parsing of Variant Call Format (VCF) files";
homepage = "https://github.com/brentp/cyvcf2";
changelog = "https://github.com/brentp/cyvcf2/blob/${finalAttrs.src.rev}/CHANGES.md";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ GaetanLepage ];
};
})

View File

@@ -3983,6 +3983,8 @@ self: super: with self; {
cytoolz = callPackage ../development/python-modules/cytoolz { };
cyvcf2 = callPackage ../development/python-modules/cyvcf2 { };
cyvest = callPackage ../development/python-modules/cyvest { };
dacite = callPackage ../development/python-modules/dacite { };