{% set version = "0.28.1" %}

package:
  name: modin-packages
  version: {{ version }}

source:
  url: https://github.com/modin-project/modin/archive/refs/tags/{{ version }}.tar.gz
  sha256: f705b0a11b0569e5ad032d2abed310b2bb61bfdd5f0b29192a8a2881ebde4ed0
  # The vendored versioneer.py uses deprecated configparser.SafeConfigParser, causing build to fail on 3.12
  patches:  # [py>=312]
    - update_versioneer.patch # [py>=312]

build:
  number: 0
  skip: true  # [py<39]
requirements:
  build:  # [py>=312]
    - patch  # [not win and py>=312]
    - m2-patch  # [win and py>=312]
  host:
    - pip
    - python
    - setuptools
    - wheel

# the outputs map the modin extras on PyPI (see upstream definition
# https://github.com/modin-project/modin/blob/0.10.1/setup.py#L40-L45)
# from "modin[<extra>]" to "modin-<extra>" as a conda-forge package.
outputs:
  - name: modin-all
    build:
      skip: true  # [py<39]
    requirements:
      host:
        - python
      run:
        - python
        - {{ pin_subpackage('modin-core', exact=True) }}
        - {{ pin_subpackage('modin-dask', exact=True) }}
        # ray-default isn't available on s390x
        # ray doesn't support 3.12 yet: https://github.com/ray-project/ray/issues/40211
        - {{ pin_subpackage('modin-ray', exact=True) }}  # [py<312 and (not s390x)]
    test:
      imports:
        # dummy test; actual tests are in subpackages
        - modin

  # compatibility with packagename before split into options
  - name: modin
    build:
      skip: true  # [py<39]
    requirements:
      host:
        - python
      run:
        - python
        # modin needs at least one engine; use dask as it is more light-weight than ray
        - {{ pin_subpackage('modin-dask', exact=True) }}
    test:
      requires:
        - pip
      commands:
        - pip check
      imports:
        - modin
        - modin.pandas

  - name: modin-core
    build:
      skip: true  # [py<39]
      script: {{ PYTHON }} -m pip install . --no-deps --no-build-isolation --ignore-installed -vv
    requirements:
      host:
        - pip
        - python
        - setuptools
        - wheel
      run:
        - python
        - packaging >=21.0
        - pandas ==2.2.1
        - numpy >=1.22.4
        - fsspec >=2022.11.0
        - psutil >=5.8.0
    test:
      source_files:
        - modin
      imports:
        - modin
        - modin.pandas
      requires:
        - pip
        - distributed >=2.22.0
        - dask >=2.22.0
        - pytest
        - boto3
        - requests
        - matplotlib-base >=3.6.1
        - xarray >=2022.03.0
        - pyarrow >=7.0.0
        - s3fs >=2022.05.0
        - numexpr <2.8.5  # [py<312]

      commands:
        # Skip pip check on win due to strict dependency in docker-py
        - pip check  # [not win]
        # Running subset of tests sourced from https://github.com/modin-project/modin/blob/0.26.1/.github/workflows/ci.yml#L535
        - pytest modin/pandas/test/dataframe/test_udf.py  # [py<312]
        - pytest modin/pandas/test/dataframe/test_reduce.py modin/pandas/test/dataframe/test_window.py modin/pandas/test/dataframe/test_pickle.py modin/pandas/test/dataframe/test_binary.py modin/pandas/test/dataframe/test_iter.py  # [not win]
        - pytest -m "not exclude_in_sanity" modin/pandas/test/test_series.py
        - pytest -m "not exclude_in_sanity" modin/pandas/test/dataframe/test_map_metadata.py modin/pandas/test/test_expanding.py modin/pandas/test/test_reshape.py modin/pandas/test/test_general.py modin/pandas/test/test_concat.py  # [not win]
        - pytest modin/test/interchange/dataframe_protocol/test_general.py modin/pandas/test/test_concat.py modin/test/interchange/dataframe_protocol/pandas/test_protocol.py modin/pandas/test/test_rolling.py

  - name: modin-dask
    build:
      skip: true  # [py<39]
    requirements:
      host:
        - python
      run:
        - python
        - {{ pin_subpackage('modin-core', exact=True) }}
        - dask >=2.22.0
        - distributed >=2.22.0
    test:
      imports:
        - modin
        - modin.pandas
      commands:
        - python -c "import modin.pandas as pd, modin.config as cfg; cfg.Engine.put('Dask'); df = pd.DataFrame([])"

  - name: modin-ray
    build:
      # ray-default isn't available on s390x or python 3.12
      skip: true  # [py<39 or py>311]
      skip: true  # [s390x]
    requirements:
      host:
        - python
      run:
        - python
        - {{ pin_subpackage('modin-core', exact=True) }}
        - ray-default >=1.13.0,!=2.5.0
        - pyarrow >=7.0.0
    test:
      imports:
        - modin
        - modin.pandas
      commands:
        - python -c "import modin.pandas as pd, modin.config as cfg; cfg.Engine.put('Ray'); df = pd.DataFrame([])"

about:
  home: https://github.com/modin-project/modin
  license: Apache-2.0
  license_family: Apache
  license_file: LICENSE
  summary: Speed up your Pandas workflows by changing a single line of code
  description: |
    Modin is a drop-in replacement for pandas. 
    While pandas is single-threaded, Modin lets you instantly speed up your workflows 
    by scaling pandas so it uses all of your cores. Modin works especially well on larger datasets, 
    where pandas becomes painfully slow or runs out of memory.
  doc_url: https://modin.readthedocs.io/
  dev_url: https://github.com/modin-project/modin

extra:
  recipe-maintainers:
    - devin-petersohn
    - h-vetinari
    - vnlitvinov
    - maksimbo1
  feedstock-name: modin
