# Keep the version in sync with pydantic-feedstock because the latest version can be incompatible.
{% set name = "pydantic-core" %}
{% set version = "2.41.5" %}

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

source:
  url: https://pypi.org/packages/source/{{ name[0] }}/{{ name }}/{{ name.replace('-', '_')}}-{{ version }}.tar.gz
  sha256: 08daa51ea16ad373ffd5e7606252cc32f07bc72b28284b6bc9c6df804816476e

build:
  script:
    - {{ PYTHON }} -m pip install . -vv --no-deps --no-build-isolation
    - cargo-bundle-licenses --format yaml --output THIRDPARTY.yml
  number: 1
  skip: true  # [py<39]

requirements:
  build:
    - {{ stdlib('c') }}
    - {{ compiler("c") }}
    - {{ compiler("rust") }}
    - cargo-bundle-licenses
  host:
    - pip
    - python
    - maturin >=1.9.4,<2
  run:
    - python
    - typing-extensions >=4.14.1

#E   pytest.PytestUnknownMarkWarning: Unknown pytest.mark.thread_unsafe - is this a typo?
{% set ignored_tests = [
  "--ignore=tests/test_docstrings.py",
  "--ignore=tests/test_hypothesis.py",
  "--ignore=tests/validators/test_allow_partial.py",
  "--ignore=tests/validators/test_frozenset.py",
  "--ignore=tests/validators/test_list.py",
  "--ignore=tests/validators/test_set.py"
] %}
test:
  source_files:
    - tests
    - pyproject.toml
  imports:
    - pydantic_core
  commands:
    - pip check
    - python -c "from pydantic_core import PydanticUndefinedType"
    - pytest -v {{ ignored_tests | join(" ")}}
  requires:
    - pip
    - pytest
    - hypothesis
    - typing-inspection
    - dirty-equals
    - pytest-benchmark
    - pytest-timeout
    - pytest-mock

about:
  home: https://github.com/pydantic/pydantic-core
  dev_url: https://github.com/pydantic/pydantic-core
  doc_url: https://docs.pydantic.dev
  summary: Core validation logic for pydantic written in rust
  description: |
    This package provides the core functionality for pydantic validation and serialization.
  license: MIT
  license_family: MIT
  license_file:
    - LICENSE
    - THIRDPARTY.yml

extra:
  recipe-maintainers:
    - xhochy
    - samuelcolvin
    - adriangb
    - dmontagu
    - pavelzw
