File python-yarl.spec of Package python-yarl

#
# spec file for package python-yarl
#
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


Name:           python-yarl
Version:        1.22.0
Release:        0
Summary:        Yet another URL library
License:        Apache-2.0
URL:            https://github.com/aio-libs/yarl
Source:         https://files.pythonhosted.org/packages/source/y/yarl/yarl-%{version}.tar.gz
BuildRequires:  python-rpm-macros
BuildRequires:  %{python_module pip}
BuildRequires:  %{python_module expandvars}
BuildRequires:  %{python_module setuptools}
BuildRequires:  %{python_module Cython}
# Needs pytest >= 8.4.2 (not in 16.0)
BuildRequires:  fdupes
Requires:	python-idna >= 2.0
Requires:	python-multidict >= 4.0
Requires:	python-propcache >= 0.2.1

%python_subpackages

%description
yarl
====

The module provides handy URL class for URL parsing and changing.

.. image:: https://github.com/aio-libs/yarl/workflows/CI/badge.svg
   :target: https://github.com/aio-libs/yarl/actions?query=workflow%3ACI
   :align: right

.. image:: https://codecov.io/gh/aio-libs/yarl/graph/badge.svg?flag=pytest
   :target: https://app.codecov.io/gh/aio-libs/yarl?flags[]=pytest
   :alt: Codecov coverage for the pytest-driven measurements

.. image:: https://img.shields.io/endpoint?url=https://codspeed.io/badge.json
   :target: https://codspeed.io/aio-libs/yarl

.. image:: https://badge.fury.io/py/yarl.svg
   :target: https://badge.fury.io/py/yarl

.. image:: https://readthedocs.org/projects/yarl/badge/?version=latest
   :target: https://yarl.aio-libs.org

.. image:: https://img.shields.io/pypi/pyversions/yarl.svg
   :target: https://pypi.python.org/pypi/yarl

.. image:: https://img.shields.io/matrix/aio-libs:matrix.org?label=Discuss%20on%20Matrix%20at%20%23aio-libs%3Amatrix.org&logo=matrix&server_fqdn=matrix.org&style=flat
   :target: https://matrix.to/#/%23aio-libs:matrix.org
   :alt: Matrix Room — #aio-libs:matrix.org

.. image:: https://img.shields.io/matrix/aio-libs-space:matrix.org?label=Discuss%20on%20Matrix%20at%20%23aio-libs-space%3Amatrix.org&logo=matrix&server_fqdn=matrix.org&style=flat
   :target: https://matrix.to/#/%23aio-libs-space:matrix.org
   :alt: Matrix Space — #aio-libs-space:matrix.org

%prep
%autosetup -p1 -n yarl-%{version}

# Cython < 3.1 doesn't support freethreading.  If there is more than one
# version installed, we disable freethreading on all builds if it
# is unsupported on any of them.
rm -f .no_freethreading
%python_exec -c 'import sys, Cython; from packaging.version import Version; sys.exit(0 if Version(Cython.__version__) >= Version("3.1") else 1)' || touch .no_freethreading
if test -e ".no_freethreading"; then
	sed -i '/freethreading_compatible = /d' pyproject.toml
fi

%build
%pyproject_wheel

%install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitearch}

%files %{python_files}
%license LICENSE NOTICE
%{python_sitearch}/yarl
%{python_sitearch}/yarl-%{version}.dist-info

%changelog
openSUSE Build Service is sponsored by