%global srcname tinycss2 %global py3_prefix python%{python3_pkgversion} Name: python-%{srcname} Version: 1.1.0 Release: 1 Summary: Low-level CSS parser for Python License: BSD URL: https://pypi.python.org/pypi/%{srcname}/ Source0: %pypi_source Source1: export-git-snapshot.sh Source2: css-parsing-tests-c5749e5.tar.gz Patch0: %{name}-disable-flake8-isort-for-pytest.patch BuildArch: noarch BuildRequires: gzip BuildRequires: tar BuildRequires: %{py3_prefix}-devel BuildRequires: %{py3_prefix}-pytest BuildRequires: %{py3_prefix}-pytest-cov BuildRequires: %{py3_prefix}-pytest-runner BuildRequires: %{py3_prefix}-setuptools BuildRequires: %{py3_prefix}-webencodings >= 0.4 BuildRequires: %{py3_prefix}-tomli %description tinycss2 is a modern, low-level CSS parser for Python. tinycss2 is a rewrite of tinycss with a simpler API, based on the more recent CSS Syntax Level 3 specification. %package -n %{py3_prefix}-%{srcname} Summary: Low-level CSS parser for Python 3 Requires: %{py3_prefix}-webencodings >= 0.4 %{?python_provide:%python_provide %{py3_prefix}-%{srcname}} %description -n %{py3_prefix}-%{srcname} tinycss2 is a modern, low-level CSS parser for Python. tinycss2 is a rewrite of tinycss with a simpler API, based on the more recent CSS Syntax Level 3 specification. %prep %autosetup -n %{srcname}-%{version} tar xf "%{SOURCE2}" cp -a css-parsing-tests-???????/* tests/css-parsing-tests/ %build %py3_build %install %py3_install %check %{__python3} -m pytest -v # remove files which are only required for unit tests (including test.pyc/.pyo) rm -rf %{buildroot}%{python3_sitelib}/%{srcname}/css-parsing-tests rm -rf %{buildroot}%{python3_sitelib}/%{srcname}/test.py rm -rf %{buildroot}%{python3_sitelib}/%{srcname}/__pycache__/test.*.py? %files -n %{py3_prefix}-%{srcname} %license LICENSE %doc README.rst %{python3_sitelib}/%{srcname}/ %{python3_sitelib}/%{srcname}-%{version}-py%{python3_version}.egg-info %changelog * Mon Jun 27 2022 lin zhang - 1.1.0-1 - initial package