Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-adblock for openSUSE:Factory checked in at 2022-06-16 18:20:49 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-adblock (Old) and /work/SRC/openSUSE:Factory/.python-adblock.new.1548 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-adblock" Thu Jun 16 18:20:49 2022 rev:6 rq:982852 version:0.5.2 Changes: -------- --- /work/SRC/openSUSE:Factory/python-adblock/python-adblock.changes 2022-02-02 22:45:02.802054375 +0100 +++ /work/SRC/openSUSE:Factory/.python-adblock.new.1548/python-adblock.changes 2022-06-16 18:22:10.340247217 +0200 @@ -1,0 +2,7 @@ +Wed Jun 15 14:07:33 UTC 2022 - Mia Herkt <m...@0x0.st> + +- Update to 0.5.2 + * Include complete redirect rule feature + (gh#ArniDagur/python-adblock#59) + +------------------------------------------------------------------- Old: ---- python-adblock-0.5.1.tar.gz New: ---- python-adblock-0.5.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-adblock.spec ++++++ --- /var/tmp/diff_new_pack.wv4aR3/_old 2022-06-16 18:22:11.364248673 +0200 +++ /var/tmp/diff_new_pack.wv4aR3/_new 2022-06-16 18:22:11.368248679 +0200 @@ -18,7 +18,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-adblock -Version: 0.5.1 +Version: 0.5.2 Release: 0 Summary: Brave's adblock library in Python License: Apache-2.0 OR MIT @@ -29,6 +29,7 @@ BuildRequires: %{python_module pip} BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module toml} BuildRequires: cargo-packaging BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -39,7 +40,7 @@ Python wrapper for Brave's adblocking library. %prep -%setup -q +%setup -q -n adblock-%{version} # build flavor-specific versions -- otherwise py3.9 wheel will not work sed -i 's/"abi3-py36", //' Cargo.toml ++++++ python-adblock-0.5.1.tar.gz -> python-adblock-0.5.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-adblock-0.5.1/.github/workflows/ci.yml new/adblock-0.5.2/.github/workflows/ci.yml --- old/python-adblock-0.5.1/.github/workflows/ci.yml 2021-12-03 20:53:02.000000000 +0100 +++ new/adblock-0.5.2/.github/workflows/ci.yml 2022-03-01 13:55:59.000000000 +0100 @@ -143,7 +143,7 @@ platform: [ { - toolchain: "1.45", + toolchain: "1.49", manylinux: "2010", target: "x86_64-unknown-linux-gnu", arch: "x86_64", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-adblock-0.5.1/.gitignore new/adblock-0.5.2/.gitignore --- old/python-adblock-0.5.1/.gitignore 2021-12-03 20:53:02.000000000 +0100 +++ new/adblock-0.5.2/.gitignore 2022-03-01 13:55:59.000000000 +0100 @@ -128,6 +128,9 @@ # Rope project settings .ropeproject +# pycharm project settings +.idea + # mypy .mypy_cache/ .dmypy.json diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-adblock-0.5.1/CHANGELOG.md new/adblock-0.5.2/CHANGELOG.md --- old/python-adblock-0.5.1/CHANGELOG.md 2021-12-03 20:53:02.000000000 +0100 +++ new/adblock-0.5.2/CHANGELOG.md 2022-03-01 13:56:00.000000000 +0100 @@ -6,6 +6,10 @@ ## Unreleased --- +## 0.5.2 - (2022-03-01) +--- +* Include complete redirect rule feature ([#59](https://github.com/ArniDagur/python-adblock/pull/59)). Thanks @x0day! + ## 0.5.1 - (2021-06-26) --- ### Fixes diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-adblock-0.5.1/Cargo.lock new/adblock-0.5.2/Cargo.lock --- old/python-adblock-0.5.1/Cargo.lock 2021-12-03 20:53:02.000000000 +0100 +++ new/adblock-0.5.2/Cargo.lock 1970-01-01 01:00:00.000000000 +0100 @@ -1,557 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "adblock" -version = "0.3.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13df3d8a7e24ea2cc711b82a047ef2b9f743aa6580bea2552fcec68f0289603c" -dependencies = [ - "addr", - "base64", - "bitflags", - "flate2", - "idna", - "itertools", - "once_cell", - "percent-encoding", - "regex", - "rmp-serde", - "seahash", - "serde", - "twoway", - "url", -] - -[[package]] -name = "adblock" -version = "0.5.1" -dependencies = [ - "adblock 0.3.13", - "pyo3", -] - -[[package]] -name = "addr" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c54ccac949a2afafdfc889e15c753bbc6ee8783e026bbe3d057b00b13907db70" -dependencies = [ - "psl", - "psl-types", -] - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "aho-corasick" -version = "0.7.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" -dependencies = [ - "memchr", -] - -[[package]] -name = "autocfg" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" - -[[package]] -name = "base64" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" - -[[package]] -name = "bitflags" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" - -[[package]] -name = "byteorder" -version = "1.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "crc32fast" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "either" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" - -[[package]] -name = "flate2" -version = "1.0.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd3aec53de10fe96d7d8c565eb17f2c687bb5518a2ec453b5b1252964526abe0" -dependencies = [ - "cfg-if", - "crc32fast", - "libc", - "miniz_oxide", -] - -[[package]] -name = "form_urlencoded" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" -dependencies = [ - "matches", - "percent-encoding", -] - -[[package]] -name = "idna" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89829a5d69c23d348314a7ac337fe39173b61149a9864deabd260983aed48c21" -dependencies = [ - "matches", - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "indoc" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47741a8bc60fb26eb8d6e0238bbb26d8575ff623fdc97b1a2c00c050b9684ed8" -dependencies = [ - "indoc-impl", - "proc-macro-hack", -] - -[[package]] -name = "indoc-impl" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce046d161f000fffde5f432a0d034d0341dc152643b2598ed5bfce44c4f3a8f0" -dependencies = [ - "proc-macro-hack", - "proc-macro2", - "quote", - "syn", - "unindent", -] - -[[package]] -name = "instant" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61124eeebbd69b8190558df225adf7e4caafce0d743919e5d6b19652314ec5ec" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "itertools" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" -dependencies = [ - "either", -] - -[[package]] -name = "libc" -version = "0.2.93" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9385f66bf6105b241aa65a61cb923ef20efc665cb9f9bb50ac2f0c4b7f378d41" - -[[package]] -name = "lock_api" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3c91c24eae6777794bb1997ad98bbb87daf92890acab859f7eaa4320333176" -dependencies = [ - "scopeguard", -] - -[[package]] -name = "matches" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" - -[[package]] -name = "memchr" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16bd47d9e329435e309c58469fe0791c2d0d1ba96ec0954152a5ae2b04387dc" - -[[package]] -name = "miniz_oxide" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" -dependencies = [ - "adler", - "autocfg", -] - -[[package]] -name = "num-traits" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" - -[[package]] -name = "parking_lot" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb" -dependencies = [ - "instant", - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7a782938e745763fe6907fc6ba86946d72f49fe7e21de074e08128a99fb018" -dependencies = [ - "cfg-if", - "instant", - "libc", - "redox_syscall", - "smallvec", - "winapi", -] - -[[package]] -name = "paste" -version = "0.1.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45ca20c77d80be666aef2b45486da86238fabe33e38306bd3118fe4af33fa880" -dependencies = [ - "paste-impl", - "proc-macro-hack", -] - -[[package]] -name = "paste-impl" -version = "0.1.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d95a7db200b97ef370c8e6de0088252f7e0dfff7d047a28528e47456c0fc98b6" -dependencies = [ - "proc-macro-hack", -] - -[[package]] -name = "percent-encoding" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" - -[[package]] -name = "proc-macro-hack" -version = "0.5.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" - -[[package]] -name = "proc-macro2" -version = "1.0.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a152013215dca273577e18d2bf00fa862b89b24169fb78c4c95aeb07992c9cec" -dependencies = [ - "unicode-xid", -] - -[[package]] -name = "psl" -version = "2.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0cbbbcd909251c04efa3c0dda636f26a9e5b91734d5ce119212528b8ba32d55" -dependencies = [ - "psl-types", -] - -[[package]] -name = "psl-types" -version = "2.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66b398073e7cdd6f05934389a8f5961e3aabfa66675b6f440df4e2c793d51a4f" - -[[package]] -name = "pyo3" -version = "0.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cf01dbf1c05af0a14c7779ed6f3aa9deac9c3419606ac9de537a2d649005720" -dependencies = [ - "cfg-if", - "indoc", - "libc", - "parking_lot", - "paste", - "pyo3-build-config", - "pyo3-macros", - "unindent", -] - -[[package]] -name = "pyo3-build-config" -version = "0.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbf9e4d128bfbddc898ad3409900080d8d5095c379632fbbfbb9c8cfb1fb852b" -dependencies = [ - "once_cell", -] - -[[package]] -name = "pyo3-macros" -version = "0.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67701eb32b1f9a9722b4bc54b548ff9d7ebfded011c12daece7b9063be1fd755" -dependencies = [ - "pyo3-macros-backend", - "quote", - "syn", -] - -[[package]] -name = "pyo3-macros-backend" -version = "0.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f44f09e825ee49a105f2c7b23ebee50886a9aee0746f4dd5a704138a64b0218a" -dependencies = [ - "proc-macro2", - "pyo3-build-config", - "quote", - "syn", -] - -[[package]] -name = "quote" -version = "1.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "redox_syscall" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94341e4e44e24f6b591b59e47a8a027df12e008d73fd5672dbea9cc22f4507d9" -dependencies = [ - "bitflags", -] - -[[package]] -name = "regex" -version = "1.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.6.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" - -[[package]] -name = "rmp" -version = "0.8.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f55e5fa1446c4d5dd1f5daeed2a4fe193071771a2636274d0d7a3b082aa7ad6" -dependencies = [ - "byteorder", - "num-traits", -] - -[[package]] -name = "rmp-serde" -version = "0.13.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "011e1d58446e9fa3af7cdc1fb91295b10621d3ac4cb3a85cc86385ee9ca50cd3" -dependencies = [ - "byteorder", - "rmp", - "serde", -] - -[[package]] -name = "scopeguard" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" - -[[package]] -name = "seahash" -version = "3.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58f57ca1d128a43733fd71d583e837b1f22239a37ebea09cde11d8d9a9080f47" - -[[package]] -name = "serde" -version = "1.0.125" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "558dc50e1a5a5fa7112ca2ce4effcb321b0300c0d4ccf0776a9f60cd89031171" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.125" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b093b7a2bb58203b5da3056c05b4ec1fed827dcfdb37347a8841695263b3d06d" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "smallvec" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" - -[[package]] -name = "syn" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48fe99c6bd8b1cc636890bcc071842de909d902c81ac7dab53ba33c421ab8ffb" -dependencies = [ - "proc-macro2", - "quote", - "unicode-xid", -] - -[[package]] -name = "tinyvec" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b5220f05bb7de7f3f53c7c065e1199b3172696fe2db9f9c4d8ad9b4ee74c342" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" - -[[package]] -name = "twoway" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b40075910de3a912adbd80b5d8bad6ad10a23eeb1f5bf9d4006839e899ba5bc" -dependencies = [ - "memchr", - "unchecked-index", -] - -[[package]] -name = "unchecked-index" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeba86d422ce181a719445e51872fa30f1f7413b62becb52e95ec91aa262d85c" - -[[package]] -name = "unicode-bidi" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeb8be209bb1c96b7c177c7420d26e04eccacb0eeae6b980e35fcb74678107e0" -dependencies = [ - "matches", -] - -[[package]] -name = "unicode-normalization" -version = "0.1.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07fbfce1c8a97d547e8b5334978438d9d6ec8c20e38f56d4a4374d181493eaef" -dependencies = [ - "tinyvec", -] - -[[package]] -name = "unicode-xid" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" - -[[package]] -name = "unindent" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f14ee04d9415b52b3aeab06258a3f07093182b88ba0f9b8d203f211a7a7d41c7" - -[[package]] -name = "url" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ccd964113622c8e9322cfac19eb1004a07e636c545f325da085d5cdde6f1f8b" -dependencies = [ - "form_urlencoded", - "idna", - "matches", - "percent-encoding", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-adblock-0.5.1/Cargo.toml new/adblock-0.5.2/Cargo.toml --- old/python-adblock-0.5.1/Cargo.toml 2021-12-03 20:53:02.000000000 +0100 +++ new/adblock-0.5.2/Cargo.toml 1970-01-01 01:00:00.000000000 +0100 @@ -1,7 +1,7 @@ [package] publish = false name = "adblock" -version = "0.5.1" +version = "0.5.2" edition = "2018" authors = ["??rni Dagur <a...@dagur.eu>"] license = "MIT OR Apache-2.0" @@ -22,7 +22,7 @@ debug = true [dependencies] -adblock = { version = "=0.3.13", default-features = false, features = ["full-regex-handling", "embedded-domain-resolver"] } +adblock = { version = "=0.4.3", default-features = false, features = ["full-regex-handling", "embedded-domain-resolver"] } pyo3 = { version = "0.15", features = ["abi3-py36", "extension-module"] } [lib] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-adblock-0.5.1/PKG-INFO new/adblock-0.5.2/PKG-INFO --- old/python-adblock-0.5.1/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 +++ new/adblock-0.5.2/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 @@ -0,0 +1,79 @@ +Metadata-Version: 2.1 +Name: adblock +Version: 0.5.2 +Classifier: Programming Language :: Python +Classifier: Programming Language :: Rust +Classifier: License :: OSI Approved :: MIT License +Classifier: License :: OSI Approved :: Apache Software License +Home-Page: https://github.com/ArniDagur/python-adblock +Author: ??rni Dagur <a...@dagur.eu> +Author-email: ??rni Dagur <a...@dagur.eu> +License: MIT OR Apache-2.0 +Requires-Python: >=3.6 +Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM +Project-URL: Source Code, https://github.com/ArniDagur/python-adblock + +# python-adblock + +Python wrapper for Brave's adblocking library, which is written in Rust. + +### Building from source + +#### Build dependencies + +| Build Dependency | Versions | Arch Linux | Url | +| ---------------- | -------- | ---------- | ------------------------------- | +| Python | `>=3.6` | `python` | - | +| Rust | `>=1.49` | `rust` | - | +| Maturin | `>=0.10` | `maturin` | https://github.com/PyO3/maturin | + +#### PEP 517 + +The `python-adblock` library is [PEP 517](https://www.python.org/dev/peps/pep-0517/) compatible, so you can build and install it from source, simply by running + +``` +pip install . +``` + +from the root of this directory. + +#### Wheels + +To create a wheel for this library, run the following command + +``` +maturin build --release --no-sdist --out dist/ +``` + +the result can be found in the `dist/` directory. + +### Developing + +I use Poetry for development. To create and enter a virtual environment, do + +``` +poetry install +poetry shell +``` + +then, to install the `adblock` module into the virtual environment, do + +``` +maturin develop +``` + +### Documentation + +Rust documentation for the latest `master` branch can be found at https://arnidagur.github.io/python-adblock/docs/adblock/index.html. + +### License + +This project is licensed under either of + +- Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or + http://www.apache.org/licenses/LICENSE-2.0) +- MIT license ([LICENSE-MIT](LICENSE-MIT) or + http://opensource.org/licenses/MIT) + +at your option. + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-adblock-0.5.1/README.md new/adblock-0.5.2/README.md --- old/python-adblock-0.5.1/README.md 2021-12-03 20:53:02.000000000 +0100 +++ new/adblock-0.5.2/README.md 2022-03-01 13:56:00.000000000 +0100 @@ -9,7 +9,7 @@ | Build Dependency | Versions | Arch Linux | Url | | ---------------- | -------- | ---------- | ------------------------------- | | Python | `>=3.6` | `python` | - | -| Rust | `>=1.45` | `rust` | - | +| Rust | `>=1.49` | `rust` | - | | Maturin | `>=0.10` | `maturin` | https://github.com/PyO3/maturin | #### PEP 517 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-adblock-0.5.1/adblock/__init__.py new/adblock-0.5.2/adblock/__init__.py --- old/python-adblock-0.5.1/adblock/__init__.py 2021-12-03 20:53:02.000000000 +0100 +++ new/adblock-0.5.2/adblock/__init__.py 2022-03-01 13:56:00.000000000 +0100 @@ -11,6 +11,9 @@ OptimizedFilterExistence, BadFilterAddUnsupported, FilterExists, + AddResourceException, + InvalidUtf8ContentError, + InvalidBase64ContentError, ) @@ -26,4 +29,7 @@ "OptimizedFilterExistence", "BadFilterAddUnsupported", "FilterExists", + "AddResourceException", + "InvalidUtf8ContentError", + "InvalidBase64ContentError", ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-adblock-0.5.1/adblock/adblock.pyi new/adblock-0.5.2/adblock/adblock.pyi --- old/python-adblock-0.5.1/adblock/adblock.pyi 2021-12-03 20:53:02.000000000 +0100 +++ new/adblock-0.5.2/adblock/adblock.pyi 2022-03-01 13:56:00.000000000 +0100 @@ -21,10 +21,20 @@ class FilterExists(BlockerException): pass +class AddResourceException(AdblockException): + pass + +class InvalidUtf8ContentError(AddResourceException): + pass + +class InvalidBase64ContentError(AddResourceException): + pass + class BlockerResult: matched: bool explicit_cancel: bool important: bool + redirect_type: Optional[str] redirect: Optional[str] exception: Optional[str] filter: Optional[str] @@ -43,9 +53,19 @@ class FilterSet: def __init__(self, debug: bool = False) -> None: pass - def add_filter_list(self, filter_list: str, format: str = "standard") -> None: + def add_filter_list( + self, + filter_list: str, + format: str = "standard", + include_redirect_urls: bool = False, + ) -> None: pass - def add_filters(self, filters: List[str], format: str = "standard") -> None: + def add_filters( + self, + filters: List[str], + format: str = "standard", + include_redirect_urls: bool = False, + ) -> None: pass class Engine: @@ -93,6 +113,8 @@ pass def tag_exists(self, tag: str) -> bool: pass + def add_resource(self, name: str, content_type: str, content: str) -> bool: + pass def url_cosmetic_resources(self, url: str) -> UrlSpecificResources: pass def hidden_class_id_selectors( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-adblock-0.5.1/pyproject.toml new/adblock-0.5.2/pyproject.toml --- old/python-adblock-0.5.1/pyproject.toml 2021-12-03 20:53:02.000000000 +0100 +++ new/adblock-0.5.2/pyproject.toml 2022-03-01 13:56:00.000000000 +0100 @@ -13,5 +13,5 @@ toml = "*" [build-system] -requires = ["maturin"] -build-backend = "maturin" \ No newline at end of file +requires = ["maturin>=0.12,<0.13"] +build-backend = "maturin" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-adblock-0.5.1/src/lib.rs new/adblock-0.5.2/src/lib.rs --- old/python-adblock-0.5.1/src/lib.rs 2021-12-03 20:53:02.000000000 +0100 +++ new/adblock-0.5.2/src/lib.rs 2022-03-01 13:56:00.000000000 +0100 @@ -11,12 +11,12 @@ deprecated )] -use adblock::blocker::BlockerError as RustBlockerError; use adblock::blocker::BlockerResult as RustBlockerResult; +use adblock::blocker::{BlockerError as RustBlockerError, Redirection}; use adblock::cosmetic_filter_cache::UrlSpecificResources as RustUrlSpecificResources; use adblock::engine::Engine as RustEngine; -use adblock::lists::FilterFormat; use adblock::lists::FilterSet as RustFilterSet; +use adblock::lists::{FilterFormat, ParseOptions}; use pyo3::class::PyObjectProtocol; use pyo3::create_exception; use pyo3::exceptions::PyException; @@ -24,6 +24,9 @@ use pyo3::types::PyBytes; use pyo3::PyErr; +use adblock::resources::{ + AddResourceError as RustAddResourceError, MimeType, Resource, ResourceType, +}; use std::collections::HashMap; use std::collections::HashSet; use std::error::Error; @@ -55,6 +58,18 @@ py.get_type::<BadFilterAddUnsupported>(), )?; m.add("FilterExists", py.get_type::<FilterExists>())?; + m.add( + "AddResourceException", + py.get_type::<AddResourceException>(), + )?; + m.add( + "InvalidBase64ContentError", + py.get_type::<InvalidBase64ContentError>(), + )?; + m.add( + "InvalidUtf8ContentError", + py.get_type::<InvalidUtf8ContentError>(), + )?; Ok(()) } @@ -80,6 +95,13 @@ /// /// [1]: https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#redirect #[pyo3(get)] + pub redirect_type: Option<String>, + /// Exception is not `None` when the blocker matched on an exception rule. + /// Effectively this means that there was a match, but the request should + /// not be blocked. It is a non-empty string if the blocker was initialized + /// from a list of rules with debugging enabled, otherwise the original + /// string representation is discarded to reduce memory use. + #[pyo3(get)] pub redirect: Option<String>, /// Exception is not `None` when the blocker matched on an exception rule. /// Effectively this means that there was a match, but the request should @@ -102,13 +124,23 @@ impl From<RustBlockerResult> for BlockerResult { fn from(br: RustBlockerResult) -> Self { + let (redirect, redirect_type) = if let Some(resource) = br.redirect { + match resource { + Redirection::Resource(resource) => (Some(resource), Some("resource".to_string())), + Redirection::Url(url) => (Some(url), Some("url".to_string())), + } + } else { + (None, None) + }; + Self { matched: br.matched, important: br.important, - redirect: br.redirect, exception: br.exception, filter: br.filter, error: br.error, + redirect_type, + redirect, } } } @@ -161,6 +193,9 @@ create_exception!(adblock, AdblockException, PyException); create_exception!(adblock, BlockerException, AdblockException); +create_exception!(adblock, AddResourceException, AdblockException); +create_exception!(adblock, InvalidBase64ContentError, AddResourceException); +create_exception!(adblock, InvalidUtf8ContentError, AddResourceException); create_exception!(adblock, SerializationError, BlockerException); create_exception!(adblock, DeserializationError, BlockerException); create_exception!(adblock, OptimizedFilterExistence, BlockerException); @@ -234,11 +269,22 @@ /// /// The format is a string containing either "standard" (ABP/uBO-style) /// or "hosts". - #[pyo3(text_signature = "($self, filter_list, format)")] - #[args(filter_list, format = "\"standard\"")] - pub fn add_filter_list(&mut self, filter_list: &str, format: &str) -> PyResult<()> { + #[pyo3(text_signature = "($self, filter_list, format, include_redirect_urls)")] + #[args(filter_list, format = "\"standard\"", include_redirect_urls = "false")] + pub fn add_filter_list( + &mut self, + filter_list: &str, + format: &str, + include_redirect_urls: bool, + ) -> PyResult<()> { let filter_format = filter_format_from_string(format)?; - self.filter_set.add_filter_list(filter_list, filter_format); + self.filter_set.add_filter_list( + filter_list, + ParseOptions { + format: filter_format, + include_redirect_urls, + }, + ); Ok(()) } @@ -247,11 +293,22 @@ /// /// The format is a string containing either "standard" (ABP/uBO-style) /// or "hosts". - #[pyo3(text_signature = "($self, filters, format)")] - #[args(filters, format = "\"standard\"")] - pub fn add_filters(&mut self, filters: Vec<String>, format: &str) -> PyResult<()> { + #[pyo3(text_signature = "($self, filters, format, include_redirect_urls)")] + #[args(filters, format = "\"standard\"", include_redirect_urls = "false")] + pub fn add_filters( + &mut self, + filters: Vec<String>, + format: &str, + include_redirect_urls: bool, + ) -> PyResult<()> { let filter_format = filter_format_from_string(format)?; - self.filter_set.add_filters(&filters, filter_format); + self.filter_set.add_filters( + &filters, + ParseOptions { + format: filter_format, + include_redirect_urls, + }, + ); Ok(()) } } @@ -446,6 +503,36 @@ blocker_result.into() } + /// Sets this engine's resources to additionally include `resource`. + /// + /// # Arguments + /// * `name`: Represents the primary name of the resource, often a filename + /// * `content_type`: How to interpret the resource data within `content` + /// * `content`: The resource data, encoded using standard base64 configuration + #[pyo3(text_signature = "($self, name, content_type, content)")] + pub fn add_resource(&mut self, name: &str, content_type: &str, content: &str) -> PyResult<()> { + let result = self.engine.add_resource(Resource { + name: name.to_string(), + aliases: vec![], + kind: ResourceType::Mime(MimeType::from(std::borrow::Cow::from( + content_type.to_string(), + ))), + content: content.to_string(), + }); + + match result { + Ok(_) => Ok(()), + Err(err) => match err { + RustAddResourceError::InvalidBase64Content => Err( + InvalidBase64ContentError::new_err("invalid base64 content".to_string()), + ), + RustAddResourceError::InvalidUtf8Content => Err(InvalidUtf8ContentError::new_err( + "invalid utf content".to_string(), + )), + }, + } + } + /// Serialize this blocking engine to bytes. They can then be deserialized /// using `deserialize()` to get the same engine again. #[pyo3(text_signature = "($self)")] @@ -456,7 +543,7 @@ } fn serialize_inner(&mut self) -> PyResult<Vec<u8>> { - let result = self.engine.serialize(); + let result = self.engine.serialize_raw(); match result { Ok(x) => Ok(x), Err(error) => { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-adblock-0.5.1/tests/test_exceptions.py new/adblock-0.5.2/tests/test_exceptions.py --- old/python-adblock-0.5.1/tests/test_exceptions.py 2021-12-03 20:53:02.000000000 +0100 +++ new/adblock-0.5.2/tests/test_exceptions.py 2022-03-01 13:56:00.000000000 +0100 @@ -1,11 +1,35 @@ import adblock +import pytest def test_correct_baseclasses(): assert issubclass(adblock.AdblockException, Exception) assert issubclass(adblock.BlockerException, adblock.AdblockException) + assert issubclass(adblock.AddResourceException, adblock.AdblockException) + assert issubclass(adblock.InvalidUtf8ContentError, adblock.AddResourceException) + assert issubclass(adblock.InvalidBase64ContentError, adblock.AddResourceException) assert issubclass(adblock.SerializationError, adblock.BlockerException) assert issubclass(adblock.DeserializationError, adblock.BlockerException) assert issubclass(adblock.OptimizedFilterExistence, adblock.BlockerException) assert issubclass(adblock.BadFilterAddUnsupported, adblock.BlockerException) assert issubclass(adblock.FilterExists, adblock.BlockerException) + + +def test_add_resource_error(): + filter_set = adblock.FilterSet() + engine = adblock.Engine(filter_set=filter_set) + + with pytest.raises(adblock.InvalidBase64ContentError) as exc: + engine.add_resource(name="aa", content_type="image/jpeg", content="111") + assert "invalid base64 content" in str(exc.value) + + with pytest.raises(adblock.InvalidUtf8ContentError) as exc: + # // Ensure any text contents are also valid utf8 + # MimeType::ApplicationJavascript | MimeType::TextPlain | MimeType::TextHtml => { + # let _ = String::from_utf8(decoded)?; + # } + # xOO6ww== => base64.b64encode('??????'.encode('gbk')) + engine.add_resource( + name="aa", content_type="application/javascript", content="xOO6ww==" + ) + assert "invalid utf content" in str(exc.value) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-adblock-0.5.1/tests/test_redirect.py new/adblock-0.5.2/tests/test_redirect.py --- old/python-adblock-0.5.1/tests/test_redirect.py 1970-01-01 01:00:00.000000000 +0100 +++ new/adblock-0.5.2/tests/test_redirect.py 2022-03-01 13:56:01.000000000 +0100 @@ -0,0 +1,77 @@ +import adblock + + +def test_redirect_worked_as_excepted_with_include_redirect_urls(): + # https://github.com/brave/adblock-rust/blob/b7f29af8c0a0d000201d8d769b6a0b25a9dd4e89/src/blocker.rs#L1242 + filter_set = adblock.FilterSet() + filter_set.add_filter_list( + "||foo.com$important,redirect-url=http://xyz.com", include_redirect_urls=True + ) + + engine = adblock.Engine(filter_set=filter_set) + + res = engine.check_network_urls("https://foo.com", "https://foo.com", "script") + assert res.matched is True + assert res.important is True + assert res.redirect_type == "url" + assert res.redirect == "http://xyz.com" + + +def test_redirect_url_is_not_recognized_without_include_redirect_urls(): + # https://github.com/brave/adblock-rust/blob/b7f29af8c0a0d000201d8d769b6a0b25a9dd4e89/src/blocker.rs#L1267 + filter_set2 = adblock.FilterSet() + filter_set2.add_filter_list( + "||foo.com$important,redirect-url=http://xyz.com", include_redirect_urls=False + ) + + engine2 = adblock.Engine(filter_set=filter_set2) + + res = engine2.check_network_urls("https://foo.com", "https://foo.com", "script") + assert res.matched is False + assert res.redirect is None + assert res.redirect_type is None + + +def test_redirect_url_exception(): + # https://github.com/brave/adblock-rust/blob/b7f29af8c0a0d000201d8d769b6a0b25a9dd4e89/src/blocker.rs#L1314 + filter_set = adblock.FilterSet(debug=True) + filter_set.add_filter_list( + """ + ||imdb-video.media-imdb.com$media,redirect-url=http://xyz.com + @@||imdb-video.media-imdb.com^$domain=imdb.com + """, + include_redirect_urls=True, + ) + + engine2 = adblock.Engine(filter_set=filter_set, optimize=False) + + res = engine2.check_network_urls( + "https://imdb-video.media-imdb.com/kBOeI88k1o23eNAi", + "https://www.imdb.com/video/13", + "media", + ) + assert res.matched is False + assert res.redirect == "http://xyz.com" + assert res.redirect_type == "url" + assert res.exception == "@@||imdb-video.media-imdb.com^$domain=imdb.com" + + +def test_redirect_with_custom_resource(): + filters = adblock.FilterSet() + filters.add_filter_list("-advertisement-$redirect=test\n") + + engine = adblock.Engine(filter_set=filters) + engine.add_resource( + name="test", content_type="application/javascript", content="YWxlcnQoMSk=" + ) + + result = engine.check_network_urls( + url="http://example.com/-advertisement-icon.", + source_url="example.com", + request_type="image", + ) + + assert result.matched + assert not result.exception + assert not result.important + assert result.redirect == "data:application/javascript;base64,YWxlcnQoMSk=" ++++++ vendor.tar.xz ++++++ /work/SRC/openSUSE:Factory/python-adblock/vendor.tar.xz /work/SRC/openSUSE:Factory/.python-adblock.new.1548/vendor.tar.xz differ: char 26, line 1