{% set version = "4.23.0" %}

# handle undefined PYTHON in `noarch: generic` outputs
{% if PYTHON is not defined %}{% set PYTHON = "$PYTHON" %}{% endif %}

package:
  name: jsonschema
  version: {{ version }}

source:
  url: https://pypi.org/packages/source/j/jsonschema/jsonschema-{{ version }}.tar.gz
  sha256: d71497fef26351a33265337fa77ffeb82423f3ea21283cd9467bb03999266bc4

build:
  number: 1
  noarch: python
  script:
    - {{ PYTHON }} -m pip install . --no-deps -vv --no-build-isolation --disable-pip-version-check
  entry_points:
    - jsonschema = jsonschema.cli:main

requirements:
  host:
    - hatch-fancy-pypi-readme
    - hatch-vcs
    - hatchling
    - pip
    - python {{ python_min }}
  run:
    - attrs >=22.2.0
    - importlib_resources >=1.4.0
    - jsonschema-specifications >=2023.03.6
    - pkgutil-resolve-name >=1.3.10
    - python >={{ python_min }}
    - referencing >=0.28.4
    - rpds-py >=0.7.1
test:
  requires:
    - pip
    - python {{ python_min }}
  imports:
    - jsonschema
  commands:
    - pip check
    - jsonschema --version
    - jsonschema --help
    - jsonschema --version | grep {{ version.replace(".", "\.") }}  # [unix]

outputs:
  - name: jsonschema
  - name: jsonschema-with-format
    build:
      noarch: generic
    requirements:
      run:
        - {{ pin_subpackage('jsonschema', max_pin='x.x.x') }}
        - fqdn
        - idna
        - isoduration
        - jsonpointer >1.13
        - rfc3339-validator
        - rfc3987
        - uri-template
        - webcolors >=24.6.0
    test:
      requires:
        - pip
      imports:
        - jsonschema
      commands:
        - pip check

  - name: jsonschema-with-format-nongpl
    build:
      noarch: generic
    requirements:
      run:
        - {{ pin_subpackage('jsonschema', max_pin='x.x.x') }}
        - fqdn
        - idna
        - isoduration
        - jsonpointer >1.13
        - rfc3339-validator
        - rfc3986-validator >0.1.0
        - uri-template
        - webcolors >=24.6.0
    test:
      requires:
        - pip
      imports:
        - jsonschema
      commands:
        - pip check

  - name: jsonschema-with-all
    build:
      noarch: generic
    requirements:
      run:
        - {{ pin_subpackage('jsonschema-with-format-nongpl', max_pin='x.x.x') }}
        - {{ pin_subpackage('jsonschema-with-format', max_pin='x.x.x') }}
    test:
      files:
        - start_test.py
      source_files:
        - json
      requires:
        - flask
        - pip
        - pytest-cov
      imports:
        - jsonschema
      commands:
        - pip check
        # additional pytest args are set in start_test.py
        - python start_test.py --cov-fail-under=94 -k "not WrappedReferencingError_hashability"

about:
  home: https://github.com/python-jsonschema/jsonschema
  license: MIT
  license_file: COPYING
  summary: An implementation of JSON Schema validation for Python
  doc_url: https://python-jsonschema.readthedocs.org
  doc_source_url: https://github.com/python-jsonschema/jsonschema/blob/v{{ version }}/docs/index.rst
  dev_url: https://github.com/python-jsonschema/jsonschema

extra:
  feedstock-name: jsonschema
  recipe-maintainers:
    - minrk
    - ocefpaf
    - nehaljwani
    - bollwyvl
