# Note that this feedstock must be paired with bumping the version of
# `arrow-cpp-feedstock` and the SHA-256 hashes should match between the packages.
{% set version = "11.0.0" %}
{% set filename = "apache-arrow-" + version + ".tar.gz" %}
{% set sha256 = "2dd8f0ea0848a58785628ee3a57675548d509e17213a2f5d72b0d900b43f5430" %}

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

source:
  url: https://archive.apache.org/dist/arrow/arrow-{{ version }}/{{ filename }}
  sha256: {{ sha256 }}

build:
  number: 1
  # arrow-cpp is not available for s390x, see arrow-cpp-feedstock for details.
  skip: true  # [s390x or py<37]
  rpaths:
    - lib/
    - {{ SP_DIR }}/pyarrow
  missing_dso_whitelist:
    # These can be found in {{ SP_DIR }}, see the tests below
    - "*/libarrow_python{{ SHLIB_EXT }}"         # [unix]
    - "*/libarrow_python_flight{{ SHLIB_EXT }}"  # [unix]
    - "*/arrow_python.dll"                # [win]
    - "*/arrow_python_flight.dll"         # [win]

requirements:
  build:
    - cmake
    - ninja
    - make  # [unix]
    - {{ compiler('c') }}
    - {{ compiler('cxx') }}
  host:
    # directly pin boost-cpp as we also seem to directly include boost symbols
    # in the Python modules.
    - arrow-cpp {{ version }}
    - boost-cpp 1.82
    - cython 0.29.32
    - numpy
    - pip
    - python
    - setuptools
    - setuptools_scm
    - uriparser 0.9.3
    - wheel
  run:
    - {{ pin_compatible('numpy', lower_bound='1.16.6') }}
    - boost-cpp
    - python
    - gflags

test:
  imports:
    - pyarrow
    - pyarrow.compute
    - pyarrow.csv
    - pyarrow.dataset
    - pyarrow.filesystem
    - pyarrow.flight
    - pyarrow.json
    - pyarrow.orc
    - pyarrow.parquet
    # Deprecated: will be removed in v12.0.0
    - pyarrow.plasma  # [not win]
    - pyarrow.fs
    - pyarrow._s3fs
    - pyarrow._hdfs
  commands:
    - test ! -f ${SP_DIR}/pyarrow/tests/test_array.py       # [unix]
    - if exist %SP_DIR%/pyarrow/tests/test_array.py exit 1  # [win]
    - test -f ${SP_DIR}/pyarrow/libarrow_python_flight${SHLIB_EXT}  # [unix]
    - test -f ${SP_DIR}/pyarrow/libarrow_python${SHLIB_EXT}  # [unix]
    - if not exist %SP_DIR%\pyarrow\arrow_python.dll exit 1                   # [win]
    - if not exist %SP_DIR%\pyarrow\arrow_python_flight.dll exit 1            # [win]

about:
  home: https://github.com/apache/arrow
  license: Apache-2.0
  license_family: Apache
  license_file: LICENSE.txt
  summary: 'Python libraries for Apache Arrow'
  description: |
    This library provides a Python API for functionality provided by the Arrow C++ libraries, 
    along with tools for Arrow integration and interoperability with pandas, NumPy, and other 
    software in the Python ecosystem.
  dev_url: https://github.com/apache/arrow/tree/master/python
  doc_url: https://github.com/apache/arrow/blob/master/docs/source/developers/python.rst

extra:
  recipe-maintainers:
    - wesm
    - xhochy
    - jreback
    - cpcloud
    - pcmoritz
    - robertnishihara
    - siddharthteotia
    - kou
    - kszucs
    - pitrou 
