{% set name = "notebook" %}
{% set version = "7.0.8" %}

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

source:
  url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/notebook-{{ version }}.tar.gz
  sha256: 3957ecd956056b0014677afc76d3bb44c2d2f29649f87b24d13606ff1d18938f

build:
  number: 1
  skip: true  # [py<38 or s390x]
  entry_points:
    - jupyter-notebook = notebook.app:main
  # The menu file is either v1 or v2.
  # Avoid linking to not overwrite menu file in pkgs directory.
  no_link:
    - 'Menu/{{ name }}_menu.json'

requirements:
  host:
    - python
    - hatchling >=1.11
    - hatch-jupyter-builder >=0.5
    - jupyterlab >=4.0.2,<4.1
    - pip
  run:
    - python
    - jupyter_server >=2.4.0,<3
    - jupyterlab >=4.0.2,<4.1
    - jupyterlab_server >=2.22.1,<3
    - notebook-shim >=0.2,<0.3
    - tornado >=6.2.0

app:
  entry: jupyter-notebook                        # [not osx]
  entry: open ${PREFIX}/bin/jupyter_mac.command  # [osx]
  icon: jupyter.png
  summary: Jupyter Notebook
  type: web
  cli_opts:
    - name: port
      args: --port %s
      default: 8080
      summary: Server port ...

test:
  requires:
    - pip
    - ripgrep
  commands:
    - python -m pip check
    - jupyter notebook -h
    - jupyter-notebook -h
    - jupyter labextension list
    - jupyter labextension list 1>labextensions 2>&1
    - cat labextensions | rg "@jupyter-notebook/lab-extension.*OK"  # [not win]
    - type labextensions | rg "@jupyter-notebook/lab-extension.*ok"  # [win]
  imports:
    - notebook

about:
  home: https://jupyter.org
  license: BSD-3-Clause
  license_family: BSD
  license_file: 
    - LICENSE
    - notebook/labextension/static/third-party-licenses.json
    - notebook/static/third-party-licenses.json
  summary: A web-based notebook environment for interactive computing
  description: |
    The Jupyter notebook is a web-based notebook environment for interactive computing.
  dev_url: https://github.com/jupyter/notebook
  doc_url: https://jupyter-notebook.readthedocs.io

extra:
  recipe-maintainers:
    - SylvainCorlay
    - jakirkham
    - minrk
    - pelson
    - gnestor
    - takluyver
    - lresende
    - bollwyvl
