{% set name = "snowflake-ml-python" %}
{% set version = "1.0.11" %}

package:
  name: {{ name|lower }}
  version: {{ version }}

source:
  url: https://github.com/snowflakedb/{{ name }}/archive/refs/tags/{{ version }}.tar.gz
  sha256: 6f8c2d55122eec0541b30d32c41bca59db3e36685828f83b98ec33a832a082f3

build:
  number: 0
  skip: True # [py<38 or py>311]
  # Skip Windows (on CI) because it needs a manual build for now.
  # Skip s390x and ppc64 since they lack bazel.
  skip: True # [s390x or ppc64le]
  skip: True # [win]

requirements:
  build:
    - git         # [not win]
    # Bazel has rules to run Miniconda to build the package so make sure that the Miniconda and conda-libmamba-solver versions are correct, 
    # because it can affect the build process, see https://github.com/snowflakedb/snowflake-ml-python/blob/main/third_party/rules_conda/conda.bzl
    - bazel 6.2.0
    - {{ compiler('c') }}
  host:
    - python
    - pip
    - setuptools
    - wheel
  run:
    - absl-py >=0.15,<2
    - anyio >=3.5.0,<4
    - cloudpickle >=2.0.0
    - fsspec >=2022.11,<2024
    - numpy >=1.23,<2
    - packaging >=20.9,<24
    - pandas >=1.0.0,<2
    - pytimeparse>=1.1.8,<2
    - python
    - pyyaml >=6.0,<7
    # requests is an extra dependency for fsspec[http]
    - requests
    - s3fs >=2022.11,<2024
    - scikit-learn >=1.2.1,<1.4
    - scipy >=1.9,<2
    - snowflake-connector-python >=3.0.4,<4
    - snowflake-snowpark-python >=1.5.1,<2
    - sqlparse >=0.4,<1
    - typing-extensions >=4.1.0,<5
    - xgboost >=1.7.3,<2
    - cachetools >=3.1.1,<5

  run_constrained:
    - lightgbm ==3.3.5
    - shap ==0.42.1
    - mlflow >=2.1.0,<2.4
    - sentencepiece >=0.1.95,<0.2
    - tensorflow >=2.9,<3,!=2.12.0
    - tokenizers>=0.10,<1
    - torchdata >=0.4,<1
    - transformers >=4.29.2,<5

test:
  imports:
    - snowflake.ml
    - snowflake.ml.fileset
    - snowflake.ml.model
    - snowflake.ml.modeling
    - snowflake.ml.registry
    - snowflake.ml.utils
  requires:
    - pip
  commands:
    # On win-64 this does not pick up xgboost for some reason, so skip it.
    - pip check   # [not win]

about:
  home: https://github.com/snowflakedb/snowflake-ml-python
  summary: Snowflake machine learning library.
  license: Apache-2.0
  license_family: Apache
  license_file: LICENSE.txt
  description: |
    The machine learning client library that is used for interacting with Snowflake
    to build machine learning solutions. Functionalities include model uploading,
    training, feature engineering, etc.
  dev_url: https://github.com/snowflakedb/snowflake-ml-python
  doc_url: https://docs.snowflake.com/developer-guide/snowpark-ml/index

extra:
  recipe-maintainers:
    - sumit0190
