# Copyright (C) 2023 Maxwell G # Copyright (C) Fedora Project Authors # SPDX-License-Identifier: MIT # License text: https://spdx.org/licenses/MIT %bcond tests 1 Name: python-pydantic-core Version: 2.6.3 Release: 1%{?dist} Summary: Core validation logic for pydantic written in rust License: MIT URL: https://github.com/pydantic/pydantic-core Source: %{url}/archive/v%{version}/pydantic-core-%{version}.tar.gz BuildRequires: python3-devel BuildRequires: rust-packaging BuildRequires: tomcli >= 0.3.0 %if %{with tests} BuildRequires: %{py3_dist dirty-equals} BuildRequires: %{py3_dist hypothesis} BuildRequires: %{py3_dist pytest} BuildRequires: %{py3_dist pytest-mock} BuildRequires: %{py3_dist pytz} %endif %global _description %{expand: The pydantic-core project provides the core validation logic for pydantic written in Rust.} %description %_description %package -n python3-pydantic-core Summary: %{summary} # (MIT OR Apache-2.0) AND Unicode-DFS-2016 # Apache-2.0 # Apache-2.0 OR BSL-1.0 # Apache-2.0 OR MIT # MIT # MIT OR Apache-2.0 (duplicate) # MIT OR Apache-2.0 OR Zlib # Unlicense OR MIT # Zlib OR Apache-2.0 OR MIT (duplicate) License: %{shrink: (MIT OR Apache-2.0) AND Unicode-DFS-2016 AND Apache-2.0 AND (Apache-2.0 OR BSL-1.0) AND MIT AND (MIT OR Apache-2.0 OR zlib) AND (Unlicense OR MIT) } %description -n python3-pydantic-core %_description %prep %autosetup -p1 -n pydantic-core-%{version} # Delete pytest adopts. We don't care about benchmarking or coverage. tomcli-set pyproject.toml del 'tool.pytest.ini_options.addopts' # Remove pytest timeout config. pytest-timeout is not needed for downstream tests. tomcli-set pyproject.toml del 'tool.pytest.ini_options.timeout' %cargo_prep # Remove Windows-only dependencies tomcli-set Cargo.toml del 'dependencies.python3-dll-a' tomcli-set Cargo.toml lists delitem 'dependencies.pyo3.features' 'generate-import-lib' # Do not strip binaries. We want useful debuginfo. tomcli-set Cargo.toml del 'profile.release.strip' %generate_buildrequires %pyproject_buildrequires %cargo_generate_buildrequires %build %cargo_license_summary %{cargo_license} > LICENSES.dependencies export RUSTFLAGS="%{build_rustflags}" %pyproject_wheel %install %pyproject_install %pyproject_save_files pydantic_core %check %pyproject_check_import %if %{with tests} %pytest --ignore=tests/benchmarks %endif %files -n python3-pydantic-core -f %{pyproject_files} %doc README.md %license LICENSE LICENSES.dependencies %changelog * Mon Jun 05 2023 Maxwell G - Initial package