{% set version = "0.16.0.1" %}

package:
  name: pysam
  version: '{{ version }}'

source:
  url: https://github.com/pysam-developers/pysam/archive/v{{ version }}.tar.gz
  sha256: a61e98e299fa93ba121aab521081282b61bc978bb9052d33b26b38f8fe15573e

build:
  number: 1
  binary_relocation: False # [linux]

requirements:
  build:
    - {{ compiler('c') }}
  host:
    - cython
    - python
    - setuptools
    - zlib
    - xz
    - bzip2
    - libdeflate
    - libcurl
    - openssl  # [not osx]
  run:
    - python
    - zlib
    - xz
    - bzip2
    - libdeflate
    - libcurl
    - openssl  # [not osx]

test:
  imports:
    - pysam
  commands:
    # xref https://github.com/pysam-developers/pysam/issues/920
    # Please keep this to avoid the aforementioned regression
    - python -c "import pysam; import errno; exec(\"try:\n    pysam.AlignmentFile('s3:expect_invalid_argument')\nexcept EnvironmentError as e:\n    assert e.errno == errno.EINVAL\")"

about:
  home: https://github.com/pysam-developers/pysam
  license: MIT
  summary: "Pysam is a python module for reading and manipulating Samfiles. It is a lightweight wrapper of the samtools C-API. Pysam also includes an interface for tabix."

extra:
  identifiers:
    - biotools:pysam
    - doi:10.1093/bioinformatics/btp352
