Unverified Commit 0204bbde authored by OTABI Tomoya's avatar OTABI Tomoya Committed by GitHub
Browse files

Merge pull request #308478 from natsukium/htseq/update

python311Packages.htseq: 0.12.4 -> 2.0.4
parents be9b31b7 586d563f
Loading
Loading
Loading
Loading
+61 −11
Original line number Diff line number Diff line
{ lib, buildPythonPackage, fetchFromGitHub, cython, numpy, pysam, matplotlib, python, isPy27, isPy3k }:
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  fetchpatch,
  swig,
  cython,
  matplotlib,
  numpy,
  pandas,
  pysam,
  setuptools,
  pytestCheckHook,
  nix-update-script,
}:
buildPythonPackage rec {
  version = "0.12.4";
  format = "setuptools";
  pname = "htseq";
  version = "2.0.4";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "htseq";
    repo = "htseq";
    rev = "release_${version}";
    sha256 = "0y7vh249sljqjnv81060w4xkdx6f1y5zdqkh38yk926x6v9riijm";
    hash = "sha256-7ocrmuj9LOtPz9XbI5rKGcdE5JbFz/pZh00Nie65XxE=";
  };

  nativeBuildInputs = [ cython ];
  propagatedBuildInputs = [ numpy pysam matplotlib ];
  patches = [
    # https://github.com/htseq/htseq/pull/84
    (fetchpatch {
      name = "replace-distutils-with-sysconfig.patch";
      url = "https://github.com/htseq/htseq/commit/f0f1e464ee9aee56f0b44f905e7b3355b0bb8f29.patch";
      hash = "sha256-yDYkXCPy+YFgnk1rnXwCB998aZwVd5nJeejZIgeEzAo=";
     })
  ];

  checkPhase = lib.optionalString isPy27 ''
    ${python.interpreter} python2/test/test_general.py
  '' + lib.optionalString isPy3k ''
    ${python.interpreter} python3/test/test_general.py
  nativeBuildInputs = [ swig ];

  build-system = [
    cython
    numpy
    pysam
    setuptools
  ];

  dependencies = [
    numpy
    pysam
  ];

  optional-dependencies = {
    htseq-qa = [ matplotlib ];
  };

  pythonImportsCheck = [ "HTSeq" ];

  nativeCheckInputs = [
    pandas
    pytestCheckHook
  ] ++ optional-dependencies.htseq-qa;

  preCheck = ''
    rm -r src HTSeq
    export PATH=$out/bin:$PATH
  '';

  passthru.updateScript = nix-update-script {
    extraArgs = [
      "--version-regex"
      "release_(.+)"
    ];
  };

  meta = with lib; {
    homepage = "https://htseq.readthedocs.io/";
    description = "A framework to work with high-throughput sequencing data";
    maintainers = with maintainers; [ unode ];
    platforms = platforms.unix;
  };
}