## START: Set by rpmautospec ## (rpmautospec version 0.7.3) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 3; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec %bcond tests 1 # Dependencies for some extras are not (yet?) in EPEL10 %bcond pendulum %{undefined el10} %bcond phonenumbers %{undefined el10} %bcond pycountry %{undefined el10} %global forgeurl https://github.com/pydantic/pydantic-extra-types Name: python-pydantic-extra-types Version: 2.10.4 %forgemeta Release: %autorelease Summary: Extra types for Pydantic License: MIT URL: %{forgeurl} Source: %{forgesource} BuildArch: noarch BuildRequires: python3-devel BuildRequires: tomcli %if %{with tests} BuildRequires: %{py3_dist dirty-equals} BuildRequires: %{py3_dist pytest} # We patched this out of the “all” extra, but it is still a test dependency. BuildRequires: %{py3_dist pytz} %endif %if %{with pendulum} && %{with phonenumbers} && %{with pycountry} %global all_extra 1 %else # This doesn’t have its own extra – it is only brought in through the “all” # extra – but it is still required for import-checking # pydantic_extra_types.mongo_object_id and for the test # tests/test_mongo_object_id.py, so we depend on it manually. BuildRequires: %{py3_dist pymongo} %endif %global _description %{expand: A place for pydantic types that probably shouldn't exist in the main pydantic library.} # this is here to fix vim's syntax highlighting %description %_description %package -n python3-pydantic-extra-types Summary: %{summary} %description -n python3-pydantic-extra-types %_description %prep %autosetup %{forgesetupargs} -p1 # Since they will not be used, and https://pypi.org/project/tzdata/ is not # packaged, because it "is intended to be a fallback for systems that do not # have system time zone data installed (or don’t have it installed in a # standard location)", we patch out the tzdata and pytz dependencies: tomcli set pyproject.toml lists delitem --type regex --no-first \ project.optional-dependencies.all '(tzdata|pytz)\b.*' %generate_buildrequires %{pyproject_buildrequires \ %{?all_extra:-x all} \ %{?with_phonenumbers:-x phonenumbers} \ %{?with_pycountry:-x pycountry} \ -x semver \ -x python_ulid \ %{?with_pendulum:-x pendulum} \ } %build %pyproject_wheel %install %pyproject_install %pyproject_save_files -l pydantic_extra_types %check %{pyproject_check_import \ %{?!with_pendulum:-e pydantic_extra_types.pendulum_dt} \ %{?!with_phonenumbers:-e pydantic_extra_types.phone_numbers} \ %{?!with_pycountry:-e pydantic_extra_types.country} \ %{?!with_pycountry:-e pydantic_extra_types.currency_code} \ %{?!with_pycountry:-e pydantic_extra_types.language_code} \ %{?!with_pycountry:-e pydantic_extra_types.script_code} \ %{nil}} %if %{with tests} %if %{without pendulum} ignore="${ignore-} --ignore=tests/test_pendulum_dt.py" %endif %if %{without phonenumbers} ignore="${ignore-} --ignore=tests/test_phone_numbers.py" ignore="${ignore-} --ignore=tests/test_phone_numbers_validator.py" %endif %if %{without pycountry} ignore="${ignore-} --ignore=tests/test_country_code.py" ignore="${ignore-} --ignore=tests/test_currency_code.py" ignore="${ignore-} --ignore=tests/test_language_codes.py" ignore="${ignore-} --ignore=tests/test_scripts.py" %endif %if %{without pendulum} || %{without phonenumbers} || %{without pycountry} ignore="${ignore-} --ignore=tests/test_json_schema.py" %endif %pytest -Wdefault ${ignore-} -v %endif %files -n python3-pydantic-extra-types -f %{pyproject_files} %doc README.md %pyproject_extras_subpkg -n python3-pydantic-extra-types semver python_ulid %if 0%{?all_extra} %pyproject_extras_subpkg -n python3-pydantic-extra-types all %endif %if %{with pendulum} %pyproject_extras_subpkg -n python3-pydantic-extra-types pendulum %endif %if %{with phonenumbers} %pyproject_extras_subpkg -n python3-pydantic-extra-types phonenumbers %endif %if %{with pycountry} %pyproject_extras_subpkg -n python3-pydantic-extra-types pycountry %endif %changelog ## START: Generated by rpmautospec * Thu May 22 2025 Benjamin A. Beasley - 2.10.4-3 - Let hatchling handle the license file automatically * Thu May 22 2025 Benjamin A. Beasley - 2.10.4-2 - Add build conditionals for several extras - This allows branching to EPEL10 without some optional dependencies * Mon Apr 28 2025 Benjamin A. Beasley - 2.10.4-1 - Update to 2.10.4 (close RHBZ#2362451) * Sat Apr 19 2025 Benjamin A. Beasley - 2.10.3-3 - F41+: Drop conditionals for F40, which has nearly reached end-of-life * Tue Mar 11 2025 Benjamin A. Beasley - 2.10.3-1 - Update to 2.10.3. Fixes rhbz#2350978. * Sat Jan 18 2025 Fedora Release Engineering - 2.10.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild * Wed Jan 15 2025 Benjamin A. Beasley - 2.10.2-1 - Update to 2.10.2. Fixes rhbz#2338374. * Thu Dec 19 2024 Benjamin A. Beasley - 2.10.1-1 - Update to 2.10.1. Fixes rhbz#2330807. * Mon Oct 21 2024 Benjamin A. Beasley - 2.10.0-2 - Another patch for python-ulid 3.0.0 (fix RHBZ#2320153) * Wed Oct 16 2024 Benjamin A. Beasley - 2.10.0-1 - Update to 2.10.0 (close RHBZ#2319061) * Sun Oct 13 2024 Benjamin A. Beasley - 2.9.0-5 - Allow python-ulid 3.0 * Wed Sep 11 2024 Benjamin A. Beasley - 2.9.0-4 - Adjust test_json_schema() for Pydantic 2.9 * Fri Aug 16 2024 Benjamin A. Beasley - 2.9.0-3 - Add a direct BuildRequires on pytz for the tests * Fri Jul 19 2024 Fedora Release Engineering - 2.9.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild * Fri Jul 05 2024 Benjamin A. Beasley - 2.9.0-1 - Update to 2.9.0. Fixes rhbz#2295691. - Add missing extras metapackages * Sat Jun 29 2024 Python Maint - 2.8.2-2 - Rebuilt for Python 3.13 * Sun Jun 16 2024 Benjamin A. Beasley - 2.8.2-1 - Update to 2.8.2. Fixes rhbz#2292564. * Fri Jun 14 2024 Benjamin A. Beasley - 2.8.1-1 - Update to 2.8.1. Fixes rhbz#2292384. * Tue Jun 04 2024 Benjamin A. Beasley - 2.8.0-1 - Update to 2.8.0. Fixes rhbz#2290380. * Tue Apr 23 2024 Benjamin A. Beasley - 2.7.0-1 - Update to 2.7.0. Fixes rhbz#2276774. * Sat Mar 2 2024 Maxwell G - 2.6.0-1 - Update to 2.6.0. Fixes rhbz#2267402. * Tue Feb 13 2024 Maxwell G - 2.5.0-1 - Update to 2.5.0. Fixes rhbz#2261943. * Wed Jan 31 2024 Benjamin A. Beasley - 2.4.1-1 - Update to 2.4.1 * Fri Jan 26 2024 Fedora Release Engineering - 2.1.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Mon Jan 22 2024 Fedora Release Engineering - 2.1.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Tue Sep 12 2023 Maxwell G - 2.1.0-1 - Initial package. Closes rhbz#2249133. ## END: Generated by rpmautospec