{% set name = 'bob.ip.binseg' %}
{% set project_dir = environ.get('RECIPE_DIR') + '/..' %}

package:
  name: {{ name }}
  version: {{ environ.get('BOB_PACKAGE_VERSION', '0.0.1') }}

build:
  skip: true  # [not (linux or (osx and py==37))]
  number: {{ environ.get('BOB_BUILD_NUMBER', 0) }}
  run_exports:
    - {{ pin_subpackage(name) }}
  script:
    - cd {{ project_dir }}
    {% if environ.get('BUILD_EGG') %}
    - python setup.py sdist --formats=zip
    {% endif %}
    - python setup.py install --single-version-externally-managed --record record.txt
    # installs the documentation source, readme to share/doc so it is available
    # during test time
    - install -d "${PREFIX}/share/doc/{{ name }}"
    - cp -R README.rst requirements.txt doc "${PREFIX}/share/doc/{{ name }}/"

requirements:
  host:
    - python {{ python }}
    - setuptools {{ setuptools }}
    - numpy {{ numpy }}
    - scipy {{ scipy }}
    - h5py {{ h5py }}
    - pytorch {{ pytorch }}
    - torchvision  {{ torchvision }}  # [linux or (osx and py==37)]
    - bob.extension
  run:
    - python
    - setuptools
    - {{ pin_compatible('numpy') }}
    - {{ pin_compatible('scipy') }}
    - {{ pin_compatible('pytorch') }}
    - {{ pin_compatible('torchvision') }}  # [linux or (osx and py==37)]
    - matplotlib
    - pandas
    - pillow
    - psutil
    - h5py
    - tqdm
    - tabulate

test:
  imports:
    - {{ name }}
  commands:
    - nosetests --with-coverage --cover-package={{ name }} --cover-erase --cover-html-dir={{ project_dir }}/sphinx/coverage --cover-html --cover-xml-file={{ project_dir }}/coverage.xml --cover-xml -sv {{ name }}
    - sphinx-build -aEW {{ project_dir }}/doc {{ project_dir }}/sphinx
    - sphinx-build -aEb doctest {{ project_dir }}/doc sphinx
    - conda inspect linkages -p $PREFIX {{ name }}  # [not win]
    - conda inspect objects -p $PREFIX {{ name }}  # [osx]
  requires:
    - bob-devel {{ bob_devel }}.*
    - nose
    - coverage
    - sphinx
    - sphinx_rtd_theme
    - sphinxcontrib-programoutput
    - graphviz
    - font-ttf-dejavu-sans-mono

about:
  summary: Binary Segmentation Benchmark Package for Bob
  home: https://www.idiap.ch/software/bob/
  license: GNU General Public License v3 (GPLv3)
  license_family: GPL
