commit 4b17b18cc71cb5fe5c53c05c2a3906f935debfc5 Author: tigro Date: Sat Jan 4 20:58:19 2025 +0300 import python-pydantic-core-2.23.4-2.el10 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ba83584 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/pydantic-core-2.23.4.tar.gz diff --git a/.python-pydantic-core.metadata b/.python-pydantic-core.metadata new file mode 100644 index 0000000..ffe1169 --- /dev/null +++ b/.python-pydantic-core.metadata @@ -0,0 +1 @@ +3397a6bde9a155cf4ff21e3ad410195f09000543 SOURCES/pydantic-core-2.23.4.tar.gz diff --git a/SOURCES/0001-Downstream-only-allow-an-older-version-of-idna.patch b/SOURCES/0001-Downstream-only-allow-an-older-version-of-idna.patch new file mode 100644 index 0000000..9c9de3e --- /dev/null +++ b/SOURCES/0001-Downstream-only-allow-an-older-version-of-idna.patch @@ -0,0 +1,26 @@ +From e304730b3d9004238b04555504a05b12b39d692d Mon Sep 17 00:00:00 2001 +From: "Benjamin A. Beasley" +Date: Sun, 8 Sep 2024 10:05:18 -0400 +Subject: [PATCH] Downstream-only: allow an older version of idna + +The many new dependencies of idna 1.x mean it will take some time to update. +--- + Cargo.toml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Cargo.toml b/Cargo.toml +index 8cc5be11..287ebcb3 100644 +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -41,7 +41,7 @@ smallvec = "1.13.2" + ahash = "0.8.10" + url = "2.5.0" + # idna is already required by url, added here to be explicit +-idna = "1.0.2" ++idna = ">=0.5.0, <2" + base64 = "0.22.1" + num-bigint = "0.4.6" + python3-dll-a = "0.2.10" +-- +2.46.0 + diff --git a/SPECS/python-pydantic-core.spec b/SPECS/python-pydantic-core.spec new file mode 100644 index 0000000..24287b5 --- /dev/null +++ b/SPECS/python-pydantic-core.spec @@ -0,0 +1,201 @@ +# Copyright (C) 2023 Maxwell G +# Copyright (C) Fedora Project Authors +# SPDX-License-Identifier: MIT +# License text: https://spdx.org/licenses/MIT + +%bcond tests 1 +# Optional integration tests (no effect if tests are disabled) +%bcond numpy_tests 1 +%bcond pandas_tests 1 + +Name: python-pydantic-core +Version: 2.23.4 +Release: 2%{?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 + +# Downstream-only: allow an older version of idna +# +# The many new dependencies of idna 1.x mean it will take some time to update. +Patch: 0001-Downstream-only-allow-an-older-version-of-idna.patch + +BuildRequires: python3-devel +BuildRequires: rust-packaging +BuildRequires: tomcli >= 0.3.0 +%if %{with tests} +BuildRequires: %{py3_dist dirty-equals} +%if %{with numpy_tests} +BuildRequires: %{py3_dist numpy} +%endif +BuildRequires: %{py3_dist hypothesis} +%if %{with pandas_tests} +%ifnarch %{ix86} +BuildRequires: %{py3_dist pandas} +%endif +%endif +BuildRequires: %{py3_dist pytest} +BuildRequires: %{py3_dist pytest-mock} +BuildRequires: %{py3_dist pytz} +%endif + +# The Python extension module now gets a SONAME of lib_pydantic_core.so; we +# must ensure it is not used to generate automatic Provides. See: +# Rust 1.81+ implicitly / automatically sets soname on cdylib targets +# https://bugzilla.redhat.com/show_bug.cgi?id=2314879 +# https://docs.fedoraproject.org/en-US/packaging-guidelines/AutoProvidesAndRequiresFiltering/#_filtering_provides_and_requires_after_scanning +%global __provides_exclude ^lib_pydantic_core\\.so.*$ + +%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 OR BSL-1.0 +# Apache-2.0 OR MIT +# BSD-2-Clause OR 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 (BSD-2-Clause OR Apache-2.0 OR MIT) + 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} + +# Remove unused Cargo config that contains buildflags for Darwin +rm -v .cargo/config.toml + +# 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} +%if v"0%{?python3_version}" >= v"3.13" +# the tested output of test_string.py::test_invalid_regex[python-re] has changed in Python 3.13 +deselect='--deselect tests/validators/test_string.py::test_invalid_regex[python-re]' +%endif +%pytest --ignore=tests/benchmarks ${deselect-} -rs +%endif + + +%files -n python3-pydantic-core -f %{pyproject_files} +%doc README.md +%license LICENSE LICENSES.dependencies + + +%changelog +* Sat Jan 04 2025 Arkady L. Shane - 2.23.4-2 +- Rebuilt for MSVSphere 10 + +* Thu Sep 26 2024 Benjamin A. Beasley - 2.23.4-2 +- Fix automatic provides on Python extension due to SONAME + +* Wed Sep 18 2024 Benjamin A. Beasley - 2.23.4-1 +- Update to 2.23.4 + +* Tue Sep 10 2024 Benjamin A. Beasley - 2.23.3-1 +- Update to 2.23.3 + +* Fri Jul 19 2024 Fedora Release Engineering - 2.20.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Sat Jul 06 2024 Benjamin A. Beasley - 2.20.1-1 +- Update to 2.20.1 + +* Tue Jun 25 2024 Benjamin A. Beasley - 2.20.0-1 +- Update to 2.20.0 + +* Sat Jun 15 2024 Benjamin A. Beasley - 2.18.4-3 +- Rebuilt with rust-jiter 0.4.2 + +* Fri Jun 07 2024 Python Maint - 2.18.4-2 +- Rebuilt for Python 3.13 + +* Wed Jun 05 2024 Benjamin A. Beasley - 2.18.4-1 +- Update to 2.18.4 + +* Wed May 29 2024 Benjamin A. Beasley - 2.18.3-1 +- Update to 2.18.3 + +* Fri May 24 2024 Benjamin A. Beasley - 2.18.2-2 +- Rebuild with Rust 1.78 to fix incomplete debuginfo and backtraces + +* Wed Apr 24 2024 Benjamin A. Beasley - 2.18.2-1 +- Update to 2.18.2 + +* Sat Apr 13 2024 Benjamin A. Beasley - 2.18.1-1 +- Update to 2.18.1 + +* Sat Feb 24 2024 Benjamin A. Beasley - 2.16.3-1 +- Update to 2.16.3. + +* Mon Feb 05 2024 Benjamin A. Beasley - 2.16.2-1 +- Update to 2.16.2. + +* Fri Jan 26 2024 Fedora Release Engineering - 2.14.6-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Mon Jan 22 2024 Fedora Release Engineering - 2.14.6-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Sat Dec 23 2023 Maxwell G - 2.14.6-1 +- Update to 2.14.6. + +* Sat Nov 25 2023 Maxwell G - 2.14.5-1 +- Update to 2.14.5. + +* Fri Sep 29 2023 Maxwell G - 2.10.1-1 +- Update to 2.10.1. + +* Mon Jun 05 2023 Maxwell G - 2.6.3-1 +- Initial package. Closes rhbz#2238117.