{% set version = "1.0.0" %}

{% set build_number = 0 %}

# nbconvert depends on pandoc which is difficult to build for some platforms (e.g. linux-ppc64le)
# To ensure nbclassic is always installable we make two variants of nbclassic
#   * odd build numbers depend on nbconvert and are favoured by the solver
#   * even build numbers depend on nbconvert-core and are used as a fallback
{% if nbconvert_variant is not defined %}
{% set nbconvert_variant = "nbconvert" %}
{% endif %}

package:
  name: nbclassic
  version: {{ version }}

source:
  url: https://pypi.io/packages/source/n/nbclassic/nbclassic-{{ version }}.tar.gz
  sha256: 0ae11eb2319455d805596bf320336cda9554b41d99ab9a3c31bf8180bffa30e3

build:
  number: {{ build_number * 2 + (nbconvert_variant == "nbconvert") }}
  noarch: python
  script: {{ PYTHON }} -m pip install . --no-deps --ignore-installed --no-cache-dir -vvv
  entry_points:
    - jupyter-nbclassic = nbclassic.notebookapp:main
    - jupyter-nbclassic-bundlerextension = nbclassic.bundler.bundlerextensions:main
    - jupyter-nbclassic-extension = nbclassic.nbextensions:main
    - jupyter-nbclassic-serverextension = nbclassic.serverextensions:main

requirements:
  host:
    - jupyter-packaging >=0.9,<1
    - jupyter_server
    - python >=3.7
    - babel
    - pip
  run:
    - argon2-cffi
    - ipykernel
    - ipython_genutils
    - jinja2
    - jupyter_client >=6.1.1
    - jupyter_core >=4.6.1
    - jupyter_server >=1.8
    - {{ nbconvert_variant }} >=5
    - nbformat
    - nest-asyncio >=1.5
    - notebook-shim >=0.2.3
    - prometheus_client
    - python >=3.7
    - pyzmq >=17
    - send2trash >=1.8.0
    - terminado >=0.8.3
    - tornado >=6.1
    - traitlets >=4.2.1

test:
  imports:
    - nbclassic
  requires:
    - pip
  commands:
    - pip check
    - jupyter nbclassic --help
    - jupyter nbclassic-extension --help
    - jupyter nbclassic-serverextension --help
    - jupyter nbclassic-bundlerextension --help
    - jupyter server extension list
    - jupyter server extension list 1>server_extensions 2>&1
    - cat server_extensions | grep -iE "nbclassic.*enabled"
    - cat server_extensions | grep -iE "nbclassic.*OK"
    # #27: is this expected?
    # - cat server_extensions | grep -iE "notebook_shim.*enabled"
    # - cat server_extensions | grep -iE "notebook_shim.*OK"
  downstreams:
    - jupyterlab
    - jupyterlab_server
    # breaks with some =cuda* stuff in condabuild, maybe mambabuild
    # - notebook

about:
  home: http://github.com/jupyterlab/nbclassic
  license: BSD-3-Clause
  license_file: LICENSE
  summary: A web-based notebook environment for interactive computing
  dev_url: https://github.com/jupyter/nbclassic
  doc_url: https://jupyter-notebook.readthedocs.io
  description: |
    The Jupyter NbClassic is a web application that allows you to create and
    share documents that contain live code, equations, visualizations, and
    explanatory text. The NbClassic has support for multiple programming
    languages, sharing, and interactive widgets.

extra:
  recipe-maintainers:
    - jasongrout
    - afshin
    - jtpio
    - bollwyvl
