# Typer feedstock (single output)
#
# This recipe used to build a multi-output "typer-split" package from three PyPI
# sdists: typer-slim, typer-cli, and typer. Upstream deprecated that split starting
# in 0.22.x: typer-slim is now a migration shim toward the full typer package, and
# current releases (e.g. 0.25.x) no longer publish separate typer-slim / typer-cli
# source distributions. The installable project is the single PyPI package "typer"
# (repo: https://github.com/fastapi/typer) with runtime deps declared in pyproject.
#
# Conda users who previously installed typer-slim, typer-slim-standard, or typer-cli
# should depend on typer instead; those subpackage names are no longer produced here.

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

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

source:
  url: https://pypi.org/packages/source/t/{{ name }}/{{ name }}-{{ version }}.tar.gz
  sha256: 9616eb8853a09ffeabab1698952f33c6f29ffdbceb4eaeecf571880e8d7664cc

build:
  number: 0
  skip: true  # [py<310]
  entry_points:
    - typer = typer.cli:main
  script: {{ PYTHON }} -m pip install . -vv --no-deps --no-build-isolation

requirements:
  host:
    - pip
    - python
    - setuptools
    - wheel
    - python-build
    - pdm-backend
  run:
    - python
    - click >=8.2.1
    - shellingham >=1.3.0
    - rich >=13.8.0
    - annotated-doc >=0.0.2

{% 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]
# Rich layout / print() expectations differ when tests run under conda-build + coverage
{% set deselect_tests = deselect_tests + " --deselect=tests/test_tracebacks.py::test_rich_exceptions_dont_truncate_code_on_wide_terminal" %}
{% set deselect_tests = deselect_tests + " --deselect=tests/test_tutorial/test_printing/test_tutorial001.py::test_cli" %}
{% set deselect_tests = deselect_tests + " --deselect=tests/test_tutorial/test_printing/test_tutorial002.py::test_cli" %}
# Windows: Rich wraps the invalid-path error across panel lines, so the substring "does not exist"
# is not contiguous in stdout; upstream test_not_exists assumes it is (test_path/test_tutorial002.py).
{% set deselect_tests = deselect_tests + " --deselect=tests/test_tutorial/test_parameter_types/test_path/test_tutorial002.py::test_not_exists[tutorial002_py310]" %}  # [win]
{% set deselect_tests = deselect_tests + " --deselect=tests/test_tutorial/test_parameter_types/test_path/test_tutorial002.py::test_not_exists[tutorial002_an_py310]" %}  # [win]

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

about:
  home: https://github.com/fastapi/typer
  license: MIT
  license_family: MIT
  license_file: 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 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/fastapi/typer

extra:
  recipe-maintainers:
    - dfornika
    - bollwyvl
