diff --git a/css-parsing-tests-c5749e5.tar.gz b/css-parsing-tests-c5749e5.tar.gz new file mode 100644 index 0000000..c7f2695 Binary files /dev/null and b/css-parsing-tests-c5749e5.tar.gz differ diff --git a/export-git-snapshot.sh b/export-git-snapshot.sh new file mode 100755 index 0000000..73b45f9 --- /dev/null +++ b/export-git-snapshot.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +PROJECT=css-parsing-tests +REPO=git@github.com:SimonSapin/css-parsing-tests.git + +githash=$1 +if [ -z "$githash" ]; then + echo "usage: $0 GITHASH" + exit 1 +fi + +shorthash=${githash:0:8} +outputfile="${PROJECT}"-$shorthash.tar.gz + +rm -rf "${PROJECT}"-temp +git clone "${REPO}" "${PROJECT}"-temp +cd "${PROJECT}"-temp + git archive --prefix="${PROJECT}"-$shorthash/ --format=tar ${githash} \ + | gzip --stdout > ../$outputfile +cd .. +rm -rf "${PROJECT}"-temp +echo "exported source code in $outputfile" diff --git a/python-tinycss2-disable-flake8-isort-for-pytest.patch b/python-tinycss2-disable-flake8-isort-for-pytest.patch new file mode 100644 index 0000000..d7a114b --- /dev/null +++ b/python-tinycss2-disable-flake8-isort-for-pytest.patch @@ -0,0 +1,35 @@ +diff --git a/pyproject.toml b/pyproject.toml +index 41535ed..30dbcd4 100644 +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -32,7 +32,7 @@ classifiers = [ + + [tool.flit.metadata.requires-extra] + doc = ['sphinx', 'sphinx_rtd_theme'] +-test = ['pytest', 'pytest-cov', 'pytest-flake8', 'pytest-isort', 'coverage[toml]'] ++test = ['pytest', 'pytest-cov', 'coverage[toml]'] + + [tool.flit.metadata.urls] + Documentation = 'https://tinycss2.readthedocs.io/' +@@ -44,7 +44,7 @@ Donation = 'https://opencollective.com/courtbouillon' + exclude = ['.*'] + + [tool.pytest.ini_options] +-addopts = '--isort --flake8 --cov' ++addopts = '--cov' + norecursedirs = ['tests/css-parsing-tests'] + + [tool.coverage.run] +diff --git a/setup.py b/setup.py +index 8e8a09c..8901670 100644 +--- a/setup.py ++++ b/setup.py +@@ -16,8 +16,6 @@ extras_require = \ + {'doc': ['sphinx', 'sphinx_rtd_theme'], + 'test': ['pytest', + 'pytest-cov', +- 'pytest-flake8', +- 'pytest-isort', + 'coverage[toml]']} + + setup(name='tinycss2', diff --git a/python-tinycss2.spec b/python-tinycss2.spec new file mode 100644 index 0000000..ceca245 --- /dev/null +++ b/python-tinycss2.spec @@ -0,0 +1,67 @@ +%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 diff --git a/python-tinycss2.yaml b/python-tinycss2.yaml new file mode 100644 index 0000000..60bbdc2 --- /dev/null +++ b/python-tinycss2.yaml @@ -0,0 +1,4 @@ +version_control: pypi +src_repo: tinycss2 +tag_prefix: ^ +seperator: . diff --git a/tinycss2-1.1.0.tar.gz b/tinycss2-1.1.0.tar.gz new file mode 100644 index 0000000..853dd33 Binary files /dev/null and b/tinycss2-1.1.0.tar.gz differ