From a71c7fc1f8b7f76c8bfa190c08923fff0a40747c Mon Sep 17 00:00:00 2001 From: Felix Schwarz Date: Sat, 16 Dec 2017 19:23:19 +0100 Subject: [PATCH] Initial import (#1526200) --- .gitignore | 1 + README.md | 3 - ...css2-disable-flake8-isort-for-pytest.patch | 13 ++ python-tinycss2.spec | 125 ++++++++++++++++++ sources | 1 + 5 files changed, 140 insertions(+), 3 deletions(-) create mode 100644 .gitignore delete mode 100644 README.md create mode 100644 python-tinycss2-disable-flake8-isort-for-pytest.patch create mode 100644 python-tinycss2.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0727398 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/tinycss2-0.6.1.tar.gz diff --git a/README.md b/README.md deleted file mode 100644 index 0628368..0000000 --- a/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# python-tinycss2 - -The python-tinycss2 package \ No newline at end of file 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..5d7286d --- /dev/null +++ b/python-tinycss2-disable-flake8-isort-for-pytest.patch @@ -0,0 +1,13 @@ +diff --git a/setup.cfg b/setup.cfg +index ae602ff..a6452e5 100644 +--- a/setup.cfg ++++ b/setup.cfg +@@ -5,7 +5,7 @@ test = pytest + universal = 1 + + [tool:pytest] +-addopts = --cov=tinycss2 --flake8 --isort tinycss2/test.py ++addopts = --cov=tinycss2 tinycss2/test.py + norecursedirs = dist .cache .git build *.egg-info .eggs venv + + [egg_info] diff --git a/python-tinycss2.spec b/python-tinycss2.spec new file mode 100644 index 0000000..a99c58b --- /dev/null +++ b/python-tinycss2.spec @@ -0,0 +1,125 @@ + +%global srcname tinycss2 + +%if 0%{?fedora} +%bcond_without python3 +%else +%bcond_with python3 +%endif + +%global py2_prefix python2 +%global py3_prefix python%{python3_pkgversion} + + +Name: python-%{srcname} +Version: 0.6.1 +Release: 2%{?dist} +Summary: Low-level CSS parser for Python + +License: BSD +URL: https://pypi.python.org/pypi/%{srcname}/ +Source0: https://files.pythonhosted.org/packages/source/t/%{srcname}/%{srcname}-%{version}.tar.gz +# Fedora does not ship pytest's flake8/isort modules +Patch0: %{name}-disable-flake8-isort-for-pytest.patch + +BuildArch: noarch +BuildRequires: %{py2_prefix}-devel +BuildRequires: %{py2_prefix}-pytest +BuildRequires: %{py2_prefix}-pytest-cov +# required to run the tests +BuildRequires: %{py2_prefix}-webencodings >= 0.4 +%if %{with python3} +BuildRequires: %{py3_prefix}-devel +BuildRequires: %{py3_prefix}-pytest +BuildRequires: %{py3_prefix}-pytest-cov +# required for testing +BuildRequires: %{py3_prefix}-webencodings >= 0.4 +%endif # with python3 + +%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 %{py2_prefix}-%{srcname} +Summary: Low-level CSS parser for Python 2 +Group: Development/Libraries +Requires: python2-webencodings >= 0.4 +%{?python_provide:%python_provide %{py2_prefix}-%{srcname}} + +%description -n %{py2_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. + + + +%if %{with python3} +%package -n %{py3_prefix}-%{srcname} +Summary: Low-level CSS parser for Python 3 +Group: Development/Libraries +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. +%endif # with python3 + + +%prep +%autosetup -n %{srcname}-%{version} + + +%build +%py2_build +%if %{with python3} +%py3_build +%endif # with python3 + + +%install +%py2_install +%if %{with python3} +%py3_install +%endif # with python3 + + +%check +%{__python2} -m pytest -v +# remove files which are only required for unit tests (including test.pyc/.pyo) +rm -rf %{buildroot}%{python2_sitelib}/%{srcname}/css-parsing-tests +rm -rf %{buildroot}%{python2_sitelib}/%{srcname}/test.py* +%if %{with python3} +%{__python3} -m pytest -v +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? +%endif # with python3 + + +%files -n %{py2_prefix}-%{srcname} +%license LICENSE +%doc CHANGES README.rst +%{python2_sitelib}/%{srcname}/ +%{python2_sitelib}/%{srcname}-%{version}-py?.?.egg-info/ + +%if %{with python3} +%files -n %{py3_prefix}-%{srcname} +%license LICENSE +%doc CHANGES README.rst +%{python3_sitelib}/%{srcname}/ +%{python3_sitelib}/%{srcname}-%{version}-py?.?.egg-info/ +%endif # with python3 + + +%changelog +* Sat Dec 16 2017 Felix Schwarz 0.6.1-2 +- remove also generated bytecode for test.py in Python 3 +- more specific files specification + +* Tue Dec 12 2017 Felix Schwarz 0.6.1-1 +- initial package + diff --git a/sources b/sources new file mode 100644 index 0000000..cee967a --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (tinycss2-0.6.1.tar.gz) = fa064bbb06d641a497a3c1eb35118bbf8ca8c4d32fbd3d8c64bb10d6cdab24387e77cd4c3277a957f23de2bd527a407836245f4387d7f880958858bd9cc7ab89