# Copyright (c) 2018-2022, NVIDIA CORPORATION.

{% set version = environ.get('GIT_DESCRIBE_TAG', '0.0.0.dev').lstrip('v') + environ.get('VERSION_SUFFIX', '') %}
{% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %}
{% set py_version=environ.get('CONDA_PY', 36) %}
{% set cuda_version='.'.join(environ.get('CUDA', '11.5').split('.')[:2]) %}
{% set cuda_major=cuda_version.split('.')[0] %}

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

source:
  git_url: ../../..

build:
  number: {{ GIT_DESCRIBE_NUMBER }}
  string: cuda_{{ cuda_major }}_py{{ py_version }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }}
  script_env:
    - VERSION_SUFFIX
    - PARALLEL_LEVEL
  # libcudf's run_exports pinning is looser than we would like
  ignore_run_exports:
    - libcudf
  ignore_run_exports_from:
    - {{ compiler('cuda') }}

requirements:
  build:
    - cmake {{ cmake_version }}
    - {{ compiler('c') }}
    - {{ compiler('cxx') }}
    - {{ compiler('cuda') }} {{ cuda_version }}
    - sysroot_{{ target_platform }} {{ sysroot_version }}
  host:
    - protobuf>=3.20.1,<3.21.0a0
    - python
    - cython >=0.29,<0.30
    - scikit-build>=0.13.1
    - setuptools
    - numba >=0.56.2
    - dlpack>=0.5,<0.6.0a0
    - pyarrow =9
    - libcudf ={{ version }}
    - rmm ={{ minor_version }}
    - cudatoolkit ={{ cuda_version }}
  run:
    - protobuf>=3.20.1,<3.21.0a0
    - python
    - typing_extensions
    - pandas >=1.0,<1.6.0dev0
    - cupy >=9.5.0,<12.0.0a0
    - numba >=0.56.2
    - numpy
    - {{ pin_compatible('pyarrow', max_pin='x.x.x') }}
    - libcudf {{ version }}
    - fastavro >=0.22.0
    - {{ pin_compatible('rmm', max_pin='x.x') }}
    - fsspec>=0.6.0
    - {{ pin_compatible('cudatoolkit', max_pin='x', min_pin='x') }}
    - nvtx >=0.2.1
    - packaging
    - cachetools
    - cubinlinker  # [linux64]  # CUDA enhanced compatibility.
    - cuda-python >=11.5,<11.7.1
test:                                   # [linux64]
  requires:                             # [linux64]
    - cudatoolkit {{ cuda_version }}.*  # [linux64]
  imports:                              # [linux64]
    - cudf                              # [linux64]

about:
  home: https://rapids.ai/
  license: Apache-2.0
  license_family: APACHE
  license_file: LICENSE
  summary: cuDF GPU DataFrame core library
