{% set name = "numba" %}
{% set version = "0.57.1" %}
{% set numpy_min_ver = "1.21" %}  # [py<311]
{% set numpy_min_ver = "1.23" %}  # [py==311]

package:
  name: numba
  version: {{ version }}

source:
  url: https://github.com/numba/{{ name }}/archive/{{ version }}.tar.gz
  sha256: 3fa256ab0da922b9339711b9909201d02db41c3d31ba9b259d27b68eb3d3083c
  patches:
    - patches/ignore_deprecation_warning_in_import_test.patch  # [py>=310 and win]
    # This forces a benign DeprecationWarning in test_import.py to be ignored.

build:
  number: 0
  entry_points:
    - numba = numba.misc.numba_entry:main
  script:
    - export CC="${CC} -pthread"  # [linux]
    - export CXX="${CXX} -pthread"  # [linux]
    - {{ PYTHON }} -m pip install . --no-deps  --no-build-isolation --ignore-installed -vvv
  skip: true  # [python_impl == 'pypy']
  skip: true  # [py<38 or s390x]
  ignore_run_exports:
    - libllvm14 >=14.0.6,<14.1.0a0

requirements:
  build:
    - {{ compiler('c') }}
    - {{ compiler('cxx') }}
    # llvm is needed for the headers
    - llvm-openmp              # [osx]
    - m2-patch  # [py>=310 and win]
  host:
    - python
    - pip
    - setuptools
    - wheel
    - llvmlite 0.40.0
    - numpy {{ numpy_min_ver }}
    - tbb-devel 2021.8.0
    - _openmp_mutex 5.1        # [linux]
    - importlib_metadata  # [py<39]
  run:
    - python
    - importlib_metadata  # [py<39]
    - llvmlite >=0.40.0,<0.41.0a0
    # NumPy has a hard upper limit.
    # NumPy 1.22.0, 1.22.1, 1.22.2 are all broken for ufuncs
    # xref: https://github.com/numba/numba/issues/7756
    # NumPy >=1.23 breaks with CUDA test: test_reinterpret_array_type
    # xref: https://github.com/numba/numba/issues/8529
    - numpy >={{ numpy_min_ver }},!=1.22.0,!=1.22.1,!=1.22.2,<1.25
    # needed for pkg_resources

  run_constrained:
    - tbb >=2021.6,<2022
    # avoid confusion from openblas bugs
    - libopenblas !=0.3.6      # [x86_64]
    - libopenblas >=0.3.18, !=0.3.20  # [arm64]
    # CUDA 10.2 or later is required for CUDA support
    - cudatoolkit >=10.2
    # scipy 1.0 or later
    - scipy >=1.0
    # CUDA Python 11.6 or later
    - cuda-python >=11.6

test:
  requires:
    # Required to test optional Numba features
    - jinja2
    - cffi
    - scipy
    - ipython
    - ipykernel
    - pygments
    - pexpect
    - setuptools
    - pip
    - wheel
    - tbb >=2021.0, <2022
    - llvm-openmp              # [osx]
    # Need these for AOT. Do not init msvc as it may not be present
    - {{ compiler('c') }}      # [not win]
    - {{ compiler('cxx') }}    # [not win]

  imports:
    - numba
    - numba.core.annotations
    - numba.core.datamodel
    - numba.core.rewrites
    - numba.core.runtime
    - numba.core.typeconv
    - numba.core.typing
    - numba.core.unsafe
    - numba.cuda
    - numba.cuda.cudadrv
    - numba.cuda.kernels
    - numba.cuda.simulator
    - numba.cuda.simulator.cudadrv
    - numba.cuda.tests
    - numba.cuda.tests.cudadrv
    - numba.cuda.tests.data
    - numba.cuda.tests.cudapy
    - numba.cuda.tests.cudasim
    - numba.cuda.tests.nocuda
    - numba.experimental.jitclass
    - numba.np.ufunc
    - numba.pycc
    - numba.scripts
    - numba.testing
    - numba.tests
    - numba.tests.npyufunc

about:
  home: https://numba.pydata.org
  license: BSD-2-Clause
  license_family: BSD
  license_file: LICENSE
  summary: NumPy aware dynamic Python compiler using LLVM
  description: |
    Numba is an Open Source NumPy-aware optimizing compiler for Python 
    sponsored by Anaconda, Inc. It uses the remarkable LLVM compiler 
    infrastructure to compile Python syntax to machine code."
  dev_url: https://github.com/numba/numba
  doc_source_url: https://github.com/numba/numba/tree/{{ version }}/docs

extra:
  recipe-maintainers:
    - souravsingh
    - marcelotrevisani
    - henryiii
    - mbargull
    - jakirkham
    - step21
