{% set version = "4.17.3" %}

package:
  name: jsonschema-meta
  version: {{ version }}

source:
  url: https://pypi.io/packages/source/j/jsonschema/jsonschema-{{ version }}.tar.gz
  sha256: 0f864437ab8b6076ba6707453ef8f98a6a0d512a80e93f8abdb676f737ecb60d

build:
  noarch: python
  number: 0

requirements:
  host:
    - python >=3.7
  run:
    - python >=3.7

outputs:
  - name: jsonschema
    build:
      noarch: python
      script: {{ PYTHON }} -m pip install . --no-deps -vv
      entry_points:
        - jsonschema = jsonschema.cli:main
    requirements:
      host:
        - python >=3.7
        - pip
        - setuptools-scm
      run:
        - attrs >=17.4.0
        # TODO: upstream, importlib-* are conditional to <3.8/9, but probably not worth the non-noarch builds
        - importlib-metadata
        - importlib_resources >=1.4.0
        - pkgutil-resolve-name >=1.3.10
        - pyrsistent !=0.17.0,!=0.17.1,!=0.17.2,>=0.14.0
        - python >=3.7
        - typing_extensions
    test:
      requires:
        - pip
      imports:
        - jsonschema
      commands:
        - pip check
        - jsonschema --version
        - jsonschema --help
        - jsonschema --version | grep {{ version.replace(".", "\.") }}  # [unix]

  - name: jsonschema-with-format
    build:
      noarch: python
    requirements:
      host:
        - python >=3.7
      run:
        - {{ pin_subpackage('jsonschema') }}
        - fqdn
        - idna
        - isoduration
        - jsonpointer >1.13
        - rfc3339-validator
        - rfc3987
        - uri-template
        - webcolors >=1.11
    test:
      requires:
        - pip
      imports:
        - jsonschema
      commands:
        - pip check

  - name: jsonschema-with-format-nongpl
    build:
      noarch: python
    requirements:
      host:
        - python >=3.7
      run:
        - {{ pin_subpackage('jsonschema') }}
        - fqdn
        - idna
        - isoduration
        - jsonpointer >1.13
        - rfc3339-validator
        - rfc3986-validator >0.1.0
        - uri-template
        - webcolors >=1.11
    test:
      requires:
        - pip
      imports:
        - jsonschema
      commands:
        - pip check

  - name: jsonschema-with-all
    build:
      noarch: python
    requirements:
      host:
        - python >=3.7
      run:
        - {{ pin_subpackage('jsonschema-with-format-nongpl') }}
        - {{ pin_subpackage('jsonschema-with-format') }}
    test:
      files:
        - start_test.py
      source_files:
        - json
      requires:
        - pip
        - pytest-cov
        - flask
      imports:
        - jsonschema
      commands:
        - pip check
        # additional pytest args are set in start_test.py
        - python start_test.py --cov-fail-under=97

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
