diff --git a/_service b/_service index 02841b3..48400fe 100644 --- a/_service +++ b/_service @@ -1,4 +1,9 @@ + + python-adblock + xz + true + diff --git a/cargo_config b/cargo_config new file mode 100644 index 0000000..6fb4ff4 --- /dev/null +++ b/cargo_config @@ -0,0 +1,5 @@ +[source.crates-io] +replace-with = "vendored-sources" + +[source.vendored-sources] +directory = "vendor" \ No newline at end of file diff --git a/python-adblock-maturin-0-14-compat.patch b/python-adblock-maturin-0-14-compat.patch new file mode 100644 index 0000000..064a74b --- /dev/null +++ b/python-adblock-maturin-0-14-compat.patch @@ -0,0 +1,47 @@ +diff -ru python-adblock-0.6.0/Cargo.toml python-adblock/Cargo.toml +--- python-adblock-0.6.0/Cargo.toml 2022-07-18 00:57:45.000000000 +0200 ++++ python-adblock/Cargo.toml 2023-03-28 09:56:10.191554072 +0200 +@@ -9,15 +9,6 @@ + homepage = "https://github.com/ArniDagur/python-adblock" + repository = "https://github.com/ArniDagur/python-adblock" + +-[package.metadata.maturin] +-classifier = [ +- "Programming Language :: Python", +- "Programming Language :: Rust", +- "License :: OSI Approved :: MIT License", +- "License :: OSI Approved :: Apache Software License", +-] +-requires-python = ">=3.7" +- + [profile.release] + debug = true + +diff -ru python-adblock-0.6.0/pyproject.toml python-adblock/pyproject.toml +--- python-adblock-0.6.0/pyproject.toml 2022-07-18 00:57:45.000000000 +0200 ++++ python-adblock/pyproject.toml 2023-03-28 09:56:06.079472470 +0200 +@@ -15,3 +15,12 @@ + [build-system] + requires = ["maturin>=0.12,<0.13"] + build-backend = "maturin" ++ ++[package.metadata.maturin] ++classifier = [ ++ "Programming Language :: Python", ++ "Programming Language :: Rust", ++ "License :: OSI Approved :: MIT License", ++ "License :: OSI Approved :: Apache Software License", ++] ++requires-python = ">=3.7" +diff -ru python-adblock-0.6.0/tests/test_metadata.py python-adblock/tests/test_metadata.py +--- python-adblock-0.6.0/tests/test_metadata.py 2022-07-18 00:57:45.000000000 +0200 ++++ python-adblock/tests/test_metadata.py 2023-03-28 10:07:26.104151881 +0200 +@@ -57,7 +57,7 @@ + Make sure that the Python interpreter we're running this test suite on + falls into the required Python range. + """ +- with open("Cargo.toml", encoding="utf-8") as f: ++ with open("pyproject.toml", encoding="utf-8") as f: + cargo_toml = toml.loads(f.read()) + + required_python = cargo_toml["package"]["metadata"]["maturin"]["requires-python"] diff --git a/python-adblock.changes b/python-adblock.changes index 66c37e0..a6ea998 100644 --- a/python-adblock.changes +++ b/python-adblock.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Tue Mar 28 08:09:55 UTC 2023 - Mia Herkt + +- Update vendor tarball +- Add python-adblock-maturin-0-14-compat.patch + Allow building with newer maturin, which is pedantic about + PEP 621 + ------------------------------------------------------------------- Sun Jul 24 16:35:11 UTC 2022 - Mia Herkt diff --git a/python-adblock.spec b/python-adblock.spec index 321fd6c..542c1e3 100644 --- a/python-adblock.spec +++ b/python-adblock.spec @@ -1,7 +1,7 @@ # # spec file for package python-adblock # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,6 @@ %define skip_python36 1 -%{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-adblock Version: 0.6.0 Release: 0 @@ -26,6 +25,9 @@ License: Apache-2.0 OR MIT URL: https://pypi.org/project/adblock/ Source: https://github.com/ArniDagur/python-adblock/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz Source1: vendor.tar.xz +Source2: cargo_config +# PATCH-FIX-OPENSUSE allow building with newer maturin, which is pedantic about PEP 621 +Patch0: python-adblock-maturin-0-14-compat.patch BuildRequires: %{python_module maturin} BuildRequires: %{python_module pip} BuildRequires: %{python_module pytest} @@ -41,11 +43,11 @@ ExclusiveArch: %{rust_arches} Python wrapper for Brave's adblocking library. %prep -%setup -q +%autosetup -a1 -p1 # build flavor-specific versions -- otherwise wheels will not work sed -i 's/"abi3-py37", //' Cargo.toml - -tar xf %{SOURCE1} +mkdir .cargo +cp %{SOURCE2} .cargo/config %build %pyproject_wheel diff --git a/vendor.tar.xz b/vendor.tar.xz index f9af0aa..8edcbef 100644 --- a/vendor.tar.xz +++ b/vendor.tar.xz @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fff6bf96ec40e98000f8008e8857780600e8d540fb0e548ff67abf9e743e3cb1 -size 13142976 +oid sha256:dd57f3f9310be89f2abe8c1db1caa87cc454dd6149b6e1b0cbb16a1a8f29e85e +size 12972884