[packages/python3-tinycss2] Up to 1.4.0
arekm
arekm at pld-linux.org
Sat May 3 23:21:19 CEST 2025
commit ec9425b1d542620f3f39f0d61826ce1263752135
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Sat May 3 23:21:10 2025 +0200
Up to 1.4.0
disable-flake8-isort-for-pytest.patch | 35 ------------
disable-missing-data-tests.patch | 102 ----------------------------------
no-cov.patch | 10 ----
python3-tinycss2.spec | 24 +++-----
4 files changed, 8 insertions(+), 163 deletions(-)
---
diff --git a/python3-tinycss2.spec b/python3-tinycss2.spec
index 7b517a1..004ddcf 100644
--- a/python3-tinycss2.spec
+++ b/python3-tinycss2.spec
@@ -6,19 +6,17 @@
Summary: Low-level CSS parser for Python
Summary(pl.UTF-8): Niskopoziomowy parser CSS dla Pythona
Name: python3-tinycss2
-Version: 1.1.0
-Release: 8
+Version: 1.4.0
+Release: 1
License: BSD
Group: Libraries/Python
#Source0Download: https://pypi.org/simple/tinycss2/
Source0: https://files.pythonhosted.org/packages/source/t/tinycss2/tinycss2-%{version}.tar.gz
-# Source0-md5: 7caf513c4e87fc2449dcfbf407a8416f
-Patch0: disable-flake8-isort-for-pytest.patch
-Patch1: disable-missing-data-tests.patch
-Patch2: no-cov.patch
+# Source0-md5: de6bd20b47354352c2b2344c842385c7
URL: https://pypi.org/project/tinycss2/
+BuildRequires: python3-build
+BuildRequires: python3-installer
BuildRequires: python3-modules >= 1:3.6
-BuildRequires: python3-setuptools
%if %{with tests}
BuildRequires: python3-pytest
BuildRequires: python3-pytest-cov
@@ -57,15 +55,9 @@ Dokumentacja API modułu Pythona tinycss2.
%prep
%setup -q -n tinycss2-%{version}
-%patch -P 0 -p1
-%patch -P 1 -p1
-%patch -P 2 -p1
-
-# for pythonegg dependencies
-%{__sed} -i -e 's/distutils.core/setuptools/' setup.py
%build
-%py3_build
+%py3_build_pyproject
%if %{with tests}
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
@@ -81,7 +73,7 @@ PYTHONPATH=$(pwd)/.. \
%install
rm -rf $RPM_BUILD_ROOT
-%py3_install
+%py3_install_pyproject
%clean
rm -rf $RPM_BUILD_ROOT
@@ -90,7 +82,7 @@ rm -rf $RPM_BUILD_ROOT
%defattr(644,root,root,755)
%doc LICENSE README.rst
%{py3_sitescriptdir}/tinycss2
-%{py3_sitescriptdir}/tinycss2-%{version}-py*.egg-info
+%{py3_sitescriptdir}/tinycss2-%{version}.dist-info
%if %{with doc}
%files apidocs
diff --git a/disable-flake8-isort-for-pytest.patch b/disable-flake8-isort-for-pytest.patch
deleted file mode 100644
index d7a114b..0000000
--- a/disable-flake8-isort-for-pytest.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-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/disable-missing-data-tests.patch b/disable-missing-data-tests.patch
deleted file mode 100644
index 667a461..0000000
--- a/disable-missing-data-tests.patch
+++ /dev/null
@@ -1,102 +0,0 @@
---- tinycss2-1.1.0/tests/test_tinycss2.py~ 2020-10-08 09:28:34.000000000 +0200
-+++ tinycss2-1.1.0/tests/test_tinycss2.py 2021-09-05 23:24:47.645579634 +0200
-@@ -80,99 +80,9 @@
- return list(zip(json_data[::2], json_data[1::2]))
-
-
--def json_test(filename=None):
-- def decorator(function):
-- filename_ = filename or function.__name__.split('_', 1)[-1] + '.json'
--
-- @pytest.mark.parametrize(('css', 'expected'), load_json(filename_))
-- def test(css, expected):
-- value = to_json(function(css))
-- if value != expected: # pragma: no cover
-- pprint.pprint(value)
-- assert value == expected
-- return test
-- return decorator
--
--
- SKIP = dict(skip_comments=True, skip_whitespace=True)
-
-
-- at json_test()
--def test_component_value_list(input):
-- return parse_component_value_list(input, skip_comments=True)
--
--
-- at json_test()
--def test_one_component_value(input):
-- return parse_one_component_value(input, skip_comments=True)
--
--
-- at json_test()
--def test_declaration_list(input):
-- return parse_declaration_list(input, **SKIP)
--
--
-- at json_test()
--def test_one_declaration(input):
-- return parse_one_declaration(input, skip_comments=True)
--
--
-- at json_test()
--def test_stylesheet(input):
-- return parse_stylesheet(input, **SKIP)
--
--
-- at json_test()
--def test_rule_list(input):
-- return parse_rule_list(input, **SKIP)
--
--
-- at json_test()
--def test_one_rule(input):
-- return parse_one_rule(input, skip_comments=True)
--
--
-- at json_test()
--def test_color3(input):
-- return parse_color(input)
--
--
-- at json_test(filename='An+B.json')
--def test_nth(input):
-- return parse_nth(input)
--
--
--# Do not use @pytest.mark.parametrize because it is slow with that many values.
--def test_color3_hsl():
-- for css, expected in load_json('color3_hsl.json'):
-- assert to_json(parse_color(css)) == expected
--
--
--def test_color3_keywords():
-- for css, expected in load_json('color3_keywords.json'):
-- result = parse_color(css)
-- if result is not None:
-- r, g, b, a = result
-- result = [r * 255, g * 255, b * 255, a]
-- assert result == expected
--
--
-- at json_test()
--def test_stylesheet_bytes(kwargs):
-- kwargs['css_bytes'] = kwargs['css_bytes'].encode('latin1')
-- kwargs.pop('comment', None)
-- if kwargs.get('environment_encoding'):
-- kwargs['environment_encoding'] = lookup(kwargs['environment_encoding'])
-- kwargs.update(SKIP)
-- return parse_stylesheet_bytes(**kwargs)
--
--
-- at json_test(filename='component_value_list.json')
--def test_serialization(css):
-- parsed = parse_component_value_list(css, skip_comments=True)
-- return parse_component_value_list(serialize(parsed), skip_comments=True)
--
--
- def test_skip():
- source = '''
- /* foo */
diff --git a/no-cov.patch b/no-cov.patch
deleted file mode 100644
index d4c4fa6..0000000
--- a/no-cov.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- tinycss2-1.1.0/pyproject.toml~ 2022-04-01 22:22:20.000000000 +0200
-+++ tinycss2-1.1.0/pyproject.toml 2022-04-01 22:23:35.249327438 +0200
-@@ -44,7 +44,6 @@
- exclude = ['.*']
-
- [tool.pytest.ini_options]
--addopts = '--cov'
- norecursedirs = ['tests/css-parsing-tests']
-
- [tool.coverage.run]
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python3-tinycss2.git/commitdiff/ec9425b1d542620f3f39f0d61826ce1263752135
More information about the pld-cvs-commit
mailing list