Files
python-flexparser/python-flexparser.spec
2024-08-20 09:00:24 -04:00

73 lines
1.8 KiB
RPMSpec
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
Name: python-flexparser
Version: 0.3.1
Release: %autorelease
Summary: Parsing made fun using typing
License: BSD-3-Clause
URL: https://github.com/hgrecco/flexparser
Source: %{pypi_source flexparser}
BuildArch: noarch
BuildRequires: python3-devel
# See requirements.test.txt. We list test dependencies manually since we do not
# want pytest-cov
# (https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters)
# and the other pytest plugins are spurious
# (https://github.com/hgrecco/flexparser/pull/10).
%global common_description %{expand:
The idea is quite simple. You write a class for every type of content (called
here ParsedStatement) you need to parse. Each class should have a from_string
constructor. We used extensively the typing module to make the output structure
easy to use and less error prone.}
%description %{common_description}
%package -n python3-flexparser
Summary: %{summary}
%description -n python3-flexparser %{common_description}
%prep
%autosetup -n flexparser-%{version}
%generate_buildrequires
%pyproject_buildrequires
%build
%pyproject_wheel
%install
%pyproject_install
%pyproject_save_files -l flexparser
# Upstream probably doesnt want to install flexparser.testsuite, but we dont
# know how to suggest a fix given “[BUG] options.packages.find.exclude not
# taking effect when include_package_data = True”,
# https://github.com/pypa/setuptools/issues/3260.
#
# Still, we dont want to install the test suite, so we just remove the files
# manually for now.
rm -rvf '%{buildroot}%{python3_sitelib}/flexparser/testsuite'
sed -r -i '/\/flexparser\/testsuite/d' %{pyproject_files}
%check
%pytest
%files -n python3-flexparser -f %{pyproject_files}
%doc README.rst
%doc CHANGES
%changelog
%autochangelog