{% set name = "mlflow" %}
{% set version = "2.5.0" %}
{% set sha256 = "f992ae8ea9c73502344baf48c4ec447aa9efbfa8965bc090868e6163234f4eb0" %}

# MLFlow offers two variants, a "normal" install and a "skinny" install with
# a reduced installation and fewer dependencies. The skinny installation is obtained
# by setting the environment variable MLFLOW_SKINNY at pip install time. For conda
# we accomplish this with two conda packages, mflow and mlflow-skinny. Note that this
# is not the same as matplotlib-base/matplotlib, where the only differences is the
# dependency set; the installed code is different as well.

{% if mlflow_variant == "skinny" %}
{% set mlflow_suffix = "-skinny" %}
{% set mlflow_other = "" %}
{% else %}
{% set mlflow_suffix = "" %}
{% set mlflow_other = "-skinny" %}
{% endif %}

package:
  name: mlflow{{ mlflow_suffix }}
  version: {{ version }}

source:
  url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz
  sha256: {{ sha256 }}

build:
  number: 0
  entry_points:
    - mlflow=mlflow.cli:cli
  skip: true  # [py<38 or s390x]
  script: |
{% if mlflow_variant == "skinny" %}
    export MLFLOW_SKINNY=1  # [not win]
    set MLFLOW_SKINNY=1  # [win]
{% endif %}
    {{ PYTHON }} -m pip install . --no-deps --no-build-isolation --ignore-installed --no-cache-dir -vvv

requirements:
  host:
    - pip
    - python
    - setuptools
    - wheel
  run:
    - python
    - click >=7.0,<9.0
    - cloudpickle <3.0
    - databricks-cli >=0.8.7,<1
    - entrypoints <1.0
    - gitpython >=2.1.0,<4.0
    - pyyaml >=5.1,<7.0
    - protobuf >=3.12.0,<5.0
    - pytz <2024
    - requests >=2.17.3,<3.0
    - packaging <24
    - importlib-metadata <7,>=3.7.0,!=4.7.0
    - sqlparse >=0.4.0,<1.0
{% if mlflow_variant != "skinny" %}
    - alembic <2,!=1.10
    - docker-py >=4.0.0,<7.0
    - flask <3.0
    - numpy <2.0
    - scipy <2.0
    - pandas <3.0
    - querystring_parser <2.0
    - sqlalchemy >=1.4.0,<3
    - gunicorn <21  # [not win]
    - waitress <3  # [win]
    - scikit-learn <2.0
    - pyarrow <13,>=4.0.0
    - markdown >=3.3,<4.0
    - jinja2 <4,>=2.11  # [not win]
    - jinja2 <4,>=3.0  # [win]
    - matplotlib-base <4.0
    # - prometheus_flask_exporter <1
{% endif %}
  run_constrained:
    - mlflow{{ mlflow_other }} <0a0
    - mxnet !=1.8.0
    - fastai >=2.4.1
    - spacy >=3.3.0
    - tensorflow >=2.8.0
    - torch >=1.11.0
    - torchvision >=0.12.0
    - pytorch_lightning >=1.5.10
    - xgboost >=0.82
    - onnx >=1.11.0
    - shap >=0.40
test:
  imports:
    - mlflow
    - mlflow.projects
    - mlflow.protos
    - mlflow.rfunc
    - mlflow.store
    - mlflow.tracking
    - mlflow.utils
{% if mlflow_variant != "skinny" %}
    - mlflow.models
    - mlflow.pyfunc
    - mlflow.pytorch
    - mlflow.sagemaker
    - mlflow.server
{% endif %}
  commands:
    - mlflow --help
    # docker-py 4.4.1 causes pip check to fail because it expects a precise
    # version of pywin32 (see below). We cannot currently ignore that single
    # pip check failure so we have to ignore all of them for now. But the pin
    # below does allow us to confirm for older versions of Python at least.
    - pip check  # [not win]
  requires:
    - pip
    - pywin32 227  # [win and py<=38]

about:
  home: https://mlflow.org/
{% if mlflow_variant == "skinny" %}
  summary: "MLflow Skinny: A Lightweight Machine Learning Lifecycle Platform Client"
  description: |
    MLflow Skinny is a lightweight MLflow package without SQL storage, server,
    UI, or data science dependencies.
{% else %}
  summary: "MLflow: A Machine Learning Lifecycle Platform"
  description: |
    MLflow is a platform to streamline machine learning development, including tracking
    experiments, packaging code into reproducible runs, and sharing and deploying models.
    MLflow offers a set of lightweight APIs that can be used with any existing machine
    learning application or library (TensorFlow, PyTorch, XGBoost, etc), wherever you
    currently run ML code (e.g. in notebooks, standalone applications or the cloud).
{% endif %}
  license: Apache-2.0
  license_family: APACHE
  license_file: LICENSE.txt
  doc_url: https://mlflow.org
  dev_url: https://github.com/mlflow/mlflow

extra:
  feedstock-name: mlflow
  recipe-maintainers:
    - harupy
    - aarondav
    - ahirreddy
    - andrewmchen
    - aveshcsingh
    - dbczumar
    - jaroslawk
    - mateiz
    - mparkhe
    - pogil
    - smurching
    - sueann
    - tomasatdatabricks
    - xhochy
    - zangr
    - janjagusch
