c92a5e4
%global pypi_name elementpath
c92a5e4
Name:           python-%{pypi_name}
0457301
Version:        4.1.5
2136a36
Release:        %autorelease
c92a5e4
Summary:        XPath 1.0/2.0 parsers and selectors for ElementTree and lxml
c92a5e4
c92a5e4
License:        MIT
c92a5e4
URL:            https://github.com/sissaschool/elementpath
a2e5d02
Source0:        %{url}/archive/v%{version}/elementpath-%{version}.tar.gz
a2e5d02
c92a5e4
BuildArch:      noarch
c92a5e4
BuildRequires:  pyproject-rpm-macros
c92a5e4
c92a5e4
# Circular test dependency on xmlschema and self
e0ea63c
%bcond_without tests
c92a5e4
%if %{with tests}
c92a5e4
BuildRequires:  glibc-langpack-en
c92a5e4
%endif
c92a5e4
c92a5e4
%global _description %{expand:
8b3d8c5
The proposal of this package is to provide XPath 1.0, 2.0 and 3.0 selectors for
c92a5e4
Python's ElementTree XML data structures, both for the standard ElementTree
c92a5e4
library and for the lxml.etree library.
c92a5e4
c92a5e4
For lxml.etree this package can be useful for providing XPath 2.0 selectors,
c92a5e4
because lxml.etree already has it's own implementation of XPath 1.0.}
c92a5e4
c92a5e4
%description %_description
c92a5e4
c92a5e4
c92a5e4
%package -n     python3-%{pypi_name}
c92a5e4
Summary:        %{summary}
c92a5e4
%{?python_provide:%python_provide python3-%{pypi_name}}
c92a5e4
c92a5e4
%description -n python3-%{pypi_name}  %_description
c92a5e4
c92a5e4
c92a5e4
%prep
473fad9
%autosetup -p1 -n %{pypi_name}-%{version}
0457301
# Remove an upstream workaround for the mypy tests
0457301
# https://github.com/sissaschool/elementpath/commit/3431f6d907bda73512edbe1d68507f675b234384
0457301
# Upstream has been notified: https://github.com/sissaschool/elementpath/issues/64#issuecomment-1696519082
0457301
sed -i '/lxml-stubs/d' tox.ini
f3d8eb6
c92a5e4
%generate_buildrequires
c92a5e4
%if %{with tests}
c92a5e4
%pyproject_buildrequires -t
c92a5e4
%else
c92a5e4
%pyproject_buildrequires
c92a5e4
%endif
c92a5e4
c92a5e4
%build
c92a5e4
%pyproject_wheel
c92a5e4
c92a5e4
%install
c92a5e4
%pyproject_install
c92a5e4
c92a5e4
%if %{with tests}
c92a5e4
%check
c92a5e4
# The C.utf-8 locale fails with some stra├če related tests
c92a5e4
# We could use a German locale, but English works fine
c92a5e4
export LANG=en_US.utf-8
c92a5e4
%tox
c92a5e4
%endif
c92a5e4
c92a5e4
%files -n python3-%{pypi_name}
c92a5e4
%license LICENSE
c92a5e4
%doc README.rst
c92a5e4
%{python3_sitelib}/%{pypi_name}/
c92a5e4
%{python3_sitelib}/%{pypi_name}-%{version}.dist-info/
c92a5e4
c92a5e4
c92a5e4
%changelog
2136a36
%autochangelog