{% set version = "6.29.3" %}

{% set migrating = false %}

# note: make sure host python and test python don't match
# to provoke possible cross-version noarch issues
{% set host_python = "3.8" %}

package:
  name: ipykernel
  version: {{ version }}

source:
  url: https://pypi.io/packages/source/i/ipykernel/ipykernel-{{ version }}.tar.gz
  sha256: e14c250d1f9ea3989490225cc1a542781b095a18a19447fcf2b5eaf7d0ac5bd2

build:
  number: 0
  noarch: python
  script:
    - {{ PYTHON }} -m pip install . -vv --no-deps --no-build-isolation
    - {{ PYTHON }} -m ipykernel install --sys-prefix
    # TODO: this may be needed/desirable at some point
    # - cd {{ RECIPE_DIR }} && {{ PYTHON }} fix_kernelspec.py
  script_env:
    - MIGRATING={{ migrating }}

requirements:
  host:
    - hatchling >=1.4
    - pip
    - python {{ host_python }}
    # minimum needed to intall kernelspec
    - comm >=0.1.1
    - debugpy >=1.6.5
    - ipython >=7.23.1
    - jupyter_client >=6.1.12
    - packaging
    - psutil
  run:
    - __{{ noarch_platform }}
    {% if noarch_platform == "osx" %}
    - appnope
    {% endif %}
    - jupyter_core >=4.12,!=5.0.*
    - matplotlib-inline >=0.1
    - nest-asyncio
    - python >={{ host_python }}
    - pyzmq >=24
    - tornado >=6.1
    - traitlets >=5.4.0
    # reused from host
    - packaging
    - psutil
    - comm >=0.1.1
    - debugpy >=1.6.5
    - ipython >=7.23.1
    - jupyter_client >=6.1.12

test:
  source_files:
    - tests
  requires:
    - curio  # [not win]
    - flaky
    - numpy
    - pip
    - pytest >=7.0
    - pytest-asyncio >=0.23.5
    - pytest-cov
    - pytest-timeout
    - python !={{ host_python }}
    {% if not migrating %}
    - ipyparallel
    - matplotlib-base
    {% endif %}

  imports:
    - ipykernel
  commands:
    - pip check
    - jupyter kernelspec list

about:
  home: https://ipython.org
  license: BSD-3-Clause
  license_family: BSD
  license_file: LICENSE
  summary: IPython Kernel for Jupyter
  description: |
    A powerful interactive Python shell and a Jupyter kernel to work with
    Python code in Jupyter notebooks and other interactive frontends.
  dev_url: https://github.com/ipython/ipykernel
  doc_url: https://ipython.readthedocs.io
  doc_source_url: https://github.com/ipython/ipykernel/blob/master/docs/index.rst

extra:
  recipe-maintainers:
    - blink1073
    - bollwyvl
    - Carreau
    - jakirkham
    - minrk
    - ocefpaf
    - pelson
    - davidbrochart
