Initial package (close RHBZ#2247275)

This commit is contained in:
Benjamin A. Beasley
2023-12-31 12:26:55 -05:00
parent 8296e4a194
commit 372f8ee25a
3 changed files with 70 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
/flexparser-0.2.tar.gz
+68
View File
@@ -0,0 +1,68 @@
Name: python-flexparser
Version: 0.2
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
%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}
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters
sed -r -i 's/^([[:blank:]]*)("pytest-cov")/\1# \2/' pyproject.toml
%generate_buildrequires
%pyproject_buildrequires -x test
%build
%pyproject_wheel
%install
%pyproject_install
%pyproject_save_files 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
+1
View File
@@ -0,0 +1 @@
SHA512 (flexparser-0.2.tar.gz) = 4df743e27064c4bfbc29f93da17e5e2451095e83f80f00de00271a4c703213fe322f70e194fece6e44e6d1386f052a544e69f9778097ea05e702ea36afbafabc