{% set name = "typer" %}
{% set version = "0.20.0" %}

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

source:
  - url: https://pypi.org/packages/source/{{ name[0] }}/{{ name }}-slim/{{ name }}_slim-{{ version }}.tar.gz
    sha256: 9fc6607b3c6c20f5c33ea9590cbeb17848667c51feee27d9e314a579ab07d1a3
    folder: typer-slim
  - url: https://pypi.org/packages/source/{{ name[0] }}/{{ name }}-cli/{{ name }}_cli-{{ version }}.tar.gz
    sha256: af928da59aed5770f50e4c0f135f70ebf798d5bd00586d86d4c3015a5718a021
    folder: typer-cli
  - url: https://pypi.org/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz
    sha256: 1aaf6494031793e4876fb0bacfa6a912b551cf43c1e63c800df8b1a866720c37
    folder: typer

build:
  number: 1
  skip: true  # [py<38]

requirements:
  host:
    - pip
    - python
  run:
    - python

outputs:
  - name: typer-slim
    script: build-typer.sh  # [not win]
    script: bld-typer.bat   # [win]
    requirements:
      host:
        - pip
        - python
        - python-build
        - pdm-backend
      run:
        - python
        - click >=8.0.0
        - typing_extensions >=3.7.4.3
      run_constrained:
        # Prevent co-installation with mismatched typer or typer-cli
        - typer {{ version }}.*
        - typer-cli {{ version }}.*
        - rich >=10.11.0
        - shellingham >=1.3.0
    test:
      requires:
        - pip
      commands:
        - pip check

  - name: typer-slim-standard
    requirements:
      host:
        - pip
        - python
      run:
        - python
        - shellingham
        - rich
        - {{ pin_subpackage("typer-slim", exact=True) }}
      run_constrained:
        # Prevent co-installation with mismatched typer or typer-cli
        - typer {{ version }}.*
        - typer-cli {{ version }}.*
    test:
      requires:
        - pip
      commands:
        - pip check

  - name: typer
    script: build-typer.sh  # [not win]
    script: bld-typer.bat   # [win]
    build:
      entry_points:
        - typer = typer.cli:main
    requirements:
      host:
        - pip
        - python
        - python-build
        - pdm-backend
      run:
        - python
        - {{ pin_subpackage("typer-slim-standard", exact=True) }}
      run_constrained:
        # Prevent co-installation with mismatched typer-slim or typer-cli
        - typer-slim {{ version }}.*
        - typer-cli {{ version }}.*

    {% set deselect_tests = "" %}
    # TypeError: argument of type 'NoneType' is not iterable
    {% set deselect_tests = deselect_tests + " --deselect=tests/test_tutorial/test_exceptions/test_tutorial003.py::test_traceback_rich_pretty_short_disable" %}  # [win]

    test:
      source_files:
        - typer/tests
        - typer/docs_src
      imports:
        - typer
      requires:
        - pip
        - pytest
        - coverage  
      commands:
        - pip check
        - typer --version
        - typer --help
        # Typer needs coverage to adequately run the tests 
        - cd typer && coverage run --source=typer --branch -m pytest -vv --color=yes --tb=long -k "not ((multiple_values and main) or completion or invalid_score)" {{ deselect_tests }}

  - name: typer-cli
    script: build-typer.sh  # [not win]
    script: bld-typer.bat   # [win]
    requirements:
      host:
        - pip
        - python
        - pdm-backend
        - python-build
      run:
        - python
        - {{ pin_subpackage("typer", exact=True) }}
      run_constrained:
        # Prevent co-installation with mismatched typer-slim
        - typer-slim {{ version }}.*
    test:
      requires:
        - pip
      commands:
        - pip check
        - typer --version
        - typer --help

about:
  home: https://github.com/tiangolo/typer
  license: MIT
  license_family: MIT
  license_file: typer/LICENSE
  summary: A library for building CLI applications

  description: |
    Typer is library for building CLI applications that users will love using and developers will love creating. Based on Python 3.6+ type hints.

    The key features are:

    Intuitive to write: Great editor support. Completion everywhere. Less time debugging. Designed to be easy to use and learn. Less time reading docs.
    Easy to use: It's easy to use for the final users. Automatic help, and automatic completion for all shells.
    Short: Minimize code duplication. Multiple features from each parameter declaration. Fewer bugs.
    Start simple: The simplest example adds only 2 lines of code to your app: 1 import, 1 function call.
    Grow large: Grow in complexity as much as you want, create arbitrarily complex trees of commands and groups of subcommands, with options and arguments.

  doc_url: https://typer.tiangolo.com
  dev_url: https://github.com/tiangolo/typer

extra:
  recipe-maintainers:
    - dfornika
    - bollwyvl
