{% set name = "numba" %}
{% set version = "0.58.0" %}

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

source:
  url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/numba-{{ version }}.tar.gz
  sha256: e5d5a318dc65a101ef846d7fd93f3cf2f7942494019e8342e51238b360739125
  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 -vv
  skip: true  # [python_impl == 'pypy']
  skip: true  # [py<38 or py>311 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.41.0
    - numpy {{ numpy }}
    - tbb-devel 2021.8.0
    - _openmp_mutex 5.1        # [linux]
    - importlib_metadata  # [py<39]
  run:
    - python
    - importlib_metadata  # [py<39]
    - {{ pin_compatible('llvmlite', max_pin='x.x') }}
    # 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 >={{ numpy }},!=1.22.0,!=1.22.1,!=1.22.2,<1.26

  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
    # numba-rvsdg
    - numba-rvsdg 0.0.*      # [py==311]

test:
  requires:
    # Required to test optional Numba features
    - jinja2
    - cffi
    - scipy
    - ipython
    - ipykernel
    - pygments
    - pexpect
    - setuptools
    - pip
    - wheel
    - tbb >=2021.6,<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_url: https://numba.readthedocs.io/

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