{% set name = "thinc" %}
{% set version = "6.11.2" %}
{% set sha256sum = "028a014192e1914c151222794781d14e1c9fddf47a859aa36077f07871d0c30a" %}

package:
  name: {{ name }}
  version: {{ version }}

source:
  fn: {{ name }}-{{ version }}.tar.gz
  url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz
  sha256: {{ sha256sum }}
  patches:
    - 0001-Don-t-force-bitness-of-output-binaries.patch
    - 0002-Fix-link-command-generation-for-THINC_BLAS.patch

build:
  number: 0
  script:
    - export THINC_BLAS=$PREFIX/lib/libopenblas{{ SHLIB_EXT }}  # [unix and blas_impl == 'openblas']
    - export THINC_BLAS=$PREFIX/lib/libmkl_rt{{ SHLIB_EXT }}    # [unix and blas_impl == 'mkl']
    - set THINC_BLAS=%LIBRARY_LIB%\mkl_rt.lib      # [win and blas_impl == 'mkl']
    - python setup.py install --single-version-externally-managed --record=record.txt
  skip: True  # [blas_impl == 'openblas' and win]

requirements:
  host:
    - msinttypes  # [win and vc<14]
    - python
    - setuptools
    - numpy
    - mkl-devel {{ mkl }}  # [blas_impl == 'mkl']
    - openblas-devel {{ openblas }}  # [blas_impl == 'openblas']

  build:
    - {{ compiler('c') }}
    - {{ compiler('cxx') }}

  run:
    - python
    - {{ pin_compatible('numpy') }}
    - murmurhash >=0.28,<0.30
    - cymem >=1.30,<1.32
    - preshed >=1.0.0,<2.0.0
    - tqdm >=4.10.0,<5.0.0
    - cytoolz
    - plac >=0.9,<1.0
    - six >=1.10.0,<2.0.0
    - wrapt >=1.10.10,<1.11.0
    - dill >=0.2.7,<0.3.0
    - termcolor >=1.1.0,<1.2.0
    - pathlib >=1.0.0,<2.0.0  # [py27]
    - msgpack-numpy >=0.4.1
    - msgpack-python >=0.5.6

test:
  requires:
    - hypothesis
    - pytest
    - mock
    - nomkl  # [x86 and blas_impl != 'mkl']

  imports:
    - thinc
    - thinc.api
    - thinc.linear
    - thinc.extra
    - thinc.extra._vendorized
    - thinc.neural
    - thinc.neural._classes

about:
  home: https://github.com/explosion/thinc/
  license: MIT
  license_file: LICENSE
  summary: 'thinc: Learn super-sparse multi-class models'
  description: |
    thinc is a Cython library for learning models with millions of parameters
    and dozens of classes. It drives https://spacy.io , a pipeline of very
    efficient NLP components. I’ve only used thinc from Cython; no real Python
    API is currently available.
  dev_url: https://github.com/explosion/thinc

extra:
  recipe-maintainers:
    - rmax
