diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fe1f4e14c..511378a14 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -147,7 +147,7 @@ jobs: platform: [ { - toolchain: "1.53", + toolchain: "1.56", manylinux: "2014", target: "x86_64-unknown-linux-gnu", arch: "x86_64", diff --git a/CHANGELOG.md b/CHANGELOG.md index 90616340f..5e4a85725 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a Ch ## Unreleased --- +### Changes +* Update PyO3 dependency to `0.28`. + +### Breaks +* Minimum Rust version is now `1.56`. ## 0.6.0 - (2022-07-17) --- diff --git a/Cargo.lock b/Cargo.lock index 999805e46..4dd2f85bd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "adblock" @@ -123,6 +123,12 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + [[package]] name = "idna" version = "0.2.3" @@ -134,12 +140,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indoc" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05a0bd019339e5d968b37855180087b7b9d512c5046fbd244cf8c95687927d6e" - [[package]] name = "itertools" version = "0.10.3" @@ -155,16 +155,6 @@ version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" -[[package]] -name = "lock_api" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" -dependencies = [ - "autocfg", - "scopeguard", -] - [[package]] name = "matches" version = "0.1.9" @@ -197,32 +187,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1" - -[[package]] -name = "parking_lot" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.3" +version = "1.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-sys", -] +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" [[package]] name = "paste" @@ -236,11 +203,17 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +[[package]] +name = "portable-atomic" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49" + [[package]] name = "proc-macro2" -version = "1.0.40" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd96a1e8ed2596c337f8eae5f24924ec83f5ad5ab21ea8e455d3566c69fbcaf7" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" dependencies = [ "unicode-ident", ] @@ -262,35 +235,32 @@ checksum = "e8eda7c62d9ecaafdf8b62374c006de0adf61666ae96a96ba74a37134aa4e470" [[package]] name = "pyo3" -version = "0.16.5" +version = "0.28.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e6302e85060011447471887705bb7838f14aba43fcb06957d823739a496b3dc" +checksum = "91fd8e38a3b50ed1167fb981cd6fd60147e091784c427b8f7183a7ee32c31c12" dependencies = [ - "cfg-if", - "indoc", "libc", - "parking_lot", + "once_cell", + "portable-atomic", "pyo3-build-config", "pyo3-ffi", "pyo3-macros", - "unindent", ] [[package]] name = "pyo3-build-config" -version = "0.16.5" +version = "0.28.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b65b546c35d8a3b1b2f0ddbac7c6a569d759f357f2b9df884f5d6b719152c8" +checksum = "e368e7ddfdeb98c9bca7f8383be1648fd84ab466bf2bc015e94008db6d35611e" dependencies = [ - "once_cell", "target-lexicon", ] [[package]] name = "pyo3-ffi" -version = "0.16.5" +version = "0.28.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c275a07127c1aca33031a563e384ffdd485aee34ef131116fcd58e3430d1742b" +checksum = "7f29e10af80b1f7ccaf7f69eace800a03ecd13e883acfacc1e5d0988605f651e" dependencies = [ "libc", "pyo3-build-config", @@ -298,45 +268,38 @@ dependencies = [ [[package]] name = "pyo3-macros" -version = "0.16.5" +version = "0.28.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "284fc4485bfbcc9850a6d661d627783f18d19c2ab55880b021671c4ba83e90f7" +checksum = "df6e520eff47c45997d2fc7dd8214b25dd1310918bbb2642156ef66a67f29813" dependencies = [ "proc-macro2", "pyo3-macros-backend", "quote", - "syn", + "syn 2.0.117", ] [[package]] name = "pyo3-macros-backend" -version = "0.16.5" +version = "0.28.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53bda0f58f73f5c5429693c96ed57f7abdb38fdfc28ae06da4101a257adb7faf" +checksum = "c4cdc218d835738f81c2338f822078af45b4afdf8b2e33cbb5916f108b813acb" dependencies = [ + "heck", "proc-macro2", + "pyo3-build-config", "quote", - "syn", + "syn 2.0.117", ] [[package]] name = "quote" -version = "1.0.20" +version = "1.0.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804" +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" dependencies = [ "proc-macro2", ] -[[package]] -name = "redox_syscall" -version = "0.2.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" -dependencies = [ - "bitflags", -] - [[package]] name = "regex" version = "1.6.0" @@ -387,12 +350,6 @@ dependencies = [ "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" @@ -416,20 +373,25 @@ checksum = "dc1d3230c1de7932af58ad8ffbe1d784bd55efd5a9d84ac24f69c72d83543dfb" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.98", ] [[package]] -name = "smallvec" -version = "1.9.0" +name = "syn" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" +checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] [[package]] name = "syn" -version = "1.0.98" +version = "2.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" dependencies = [ "proc-macro2", "quote", @@ -438,9 +400,9 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.4" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c02424087780c9b71cc96799eaeddff35af2bc513278cda5c99fc1f5d026d3c1" +checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca" [[package]] name = "tinyvec" @@ -494,12 +456,6 @@ dependencies = [ "tinyvec", ] -[[package]] -name = "unindent" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52fee519a3e570f7df377a06a1a7775cdbfb7aa460be7e08de2b1f0e69973a44" - [[package]] name = "url" version = "2.2.2" @@ -511,46 +467,3 @@ dependencies = [ "matches", "percent-encoding", ] - -[[package]] -name = "windows-sys" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" -dependencies = [ - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" - -[[package]] -name = "windows_i686_gnu" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" - -[[package]] -name = "windows_i686_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" diff --git a/Cargo.toml b/Cargo.toml index dc2f5f982..2e1248b04 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ debug = true [dependencies] adblock = { version = "=0.5.6", default-features = false, features = ["full-regex-handling", "embedded-domain-resolver"] } -pyo3 = { version = "0.16", features = ["abi3-py37", "extension-module"] } +pyo3 = { version = "0.28", features = ["abi3-py37", "extension-module"] } [lib] name = "adblock" diff --git a/README.md b/README.md index ee9343195..50872984b 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Python wrapper for Brave's adblocking library, which is written in Rust. | Build Dependency | Versions | Arch Linux | Url | | ---------------- | -------- | ---------- | ------------------------------- | | Python | `>=3.7` | `python` | - | -| Rust | `>=1.53` | `rust` | - | +| Rust | `>=1.56` | `rust` | - | | Maturin | `>=0.10` | `maturin` | https://github.com/PyO3/maturin | #### PEP 517 diff --git a/adblock/adblock.pyi b/adblock/adblock.pyi index 6c4398f0b..5a8802629 100644 --- a/adblock/adblock.pyi +++ b/adblock/adblock.pyi @@ -55,6 +55,7 @@ class UrlSpecificResources: class FilterSet: def __init__(self, debug: bool = False) -> None: pass + def add_filter_list( self, filter_list: str, @@ -63,6 +64,7 @@ class FilterSet: rule_types: str = "all", ) -> None: pass + def add_filters( self, filters: List[str], @@ -75,10 +77,12 @@ class FilterSet: class Engine: def __init__(self, filter_set: FilterSet, optimize: bool = True) -> None: pass + def check_network_urls( self, url: str, source_url: str, request_type: str ) -> BlockerResult: pass + def check_network_urls_with_hostnames( self, url: str, @@ -88,6 +92,7 @@ class Engine: third_party_request: Optional[bool], ) -> BlockerResult: pass + def check_network_urls_with_hostnames_subset( self, url: str, @@ -99,24 +104,34 @@ class Engine: force_check_exceptions: bool, ) -> BlockerResult: pass + def serialize(self) -> bytes: pass + def serialize_to_file(self, file: str) -> None: pass + def deserialize(self, serialized: bytes) -> None: pass + def deserialize_from_file(self, file: str) -> None: pass + def filter_exists(self, filter: str) -> bool: pass + def use_tags(self, tags: List[str]) -> None: pass + def enable_tags(self, tags: List[str]) -> None: pass + def disable_tags(self, tags: List[str]) -> None: pass + def tag_exists(self, tag: str) -> bool: pass + def add_resource( self, name: str, @@ -125,8 +140,10 @@ class Engine: aliases: Optional[List[str]] = None, ) -> bool: pass + def url_cosmetic_resources(self, url: str) -> UrlSpecificResources: pass + def hidden_class_id_selectors( self, classes: List[str], ids: List[str], exceptions: Set[str] ) -> List[str]: diff --git a/src/lib.rs b/src/lib.rs index e8797d298..d588247d3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -11,19 +11,19 @@ deprecated )] -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::FilterSet as RustFilterSet; -use adblock::lists::{FilterFormat, ParseOptions, RuleTypes}; +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::FilterSet as RustFilterSet; +use ::adblock::lists::{FilterFormat, ParseOptions, RuleTypes}; use pyo3::create_exception; use pyo3::exceptions::PyException; use pyo3::prelude::*; use pyo3::types::PyBytes; use pyo3::PyErr; -use adblock::resources::{ +use ::adblock::resources::{ AddResourceError as RustAddResourceError, MimeType, Resource, ResourceType, }; use std::collections::HashMap; @@ -35,7 +35,7 @@ use std::io::{Read, Write}; /// Brave's adblocking library in Python! #[pymodule] -fn adblock(py: Python<'_>, m: &PyModule) -> PyResult<()> { +fn adblock<'py>(py: Python<'py>, m: Bound<'py, PyModule>) -> PyResult<()> { m.add("__version__", env!("CARGO_PKG_VERSION"))?; m.add_class::()?; m.add_class::()?; @@ -251,8 +251,7 @@ fn rule_types_from_string(rule_types: &str) -> PyResult { /// allow optimizations, all rules must be available when the Engine is first /// created. FilterSet allows assembling a compound list from multiple /// different sources before compiling the rules into an Engine. -#[pyclass] -#[pyo3(text_signature = "($self, debug)")] +#[pyclass(from_py_object)] #[derive(Clone)] pub struct FilterSet { filter_set: RustFilterSet, @@ -266,7 +265,7 @@ impl FilterSet { /// the more compact internal representation. If enabled, this information /// will be passed to the corresponding Engine. #[new] - #[args(debug = false)] + #[pyo3(signature = (debug=false))] pub fn new(debug: bool) -> Self { Self { filter_set: RustFilterSet::new(debug), @@ -279,13 +278,12 @@ impl FilterSet { /// /// The format is a string containing either "standard" (ABP/uBO-style) /// or "hosts". - #[pyo3(text_signature = "($self, filter_list, format, include_redirect_urls, rule_types)")] - #[args( + #[pyo3(signature = ( filter_list, - format = "\"standard\"", - include_redirect_urls = "false", - rule_types = "\"all\"" - )] + format = "standard", + include_redirect_urls = false, + rule_types = "all" + ))] pub fn add_filter_list( &mut self, filter_list: &str, @@ -311,13 +309,12 @@ impl FilterSet { /// /// The format is a string containing either "standard" (ABP/uBO-style) /// or "hosts". - #[pyo3(text_signature = "($self, filters, format, include_redirect_urls, rule_types)")] - #[args( + #[pyo3(signature = ( filters, - format = "\"standard\"", - include_redirect_urls = "false", - rule_types = "\"all\"" - )] + format = "standard", + include_redirect_urls = false, + rule_types = "all" + ))] pub fn add_filters( &mut self, filters: Vec, @@ -418,7 +415,6 @@ impl UrlSpecificResources { /// /// [1]: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/webRequest/ResourceType #[pyclass] -#[pyo3(text_signature = "($self, filter_set, optimize)")] pub struct Engine { engine: RustEngine, optimize: bool, @@ -428,7 +424,7 @@ pub struct Engine { impl Engine { /// Create a new adblocking engine #[new] - #[args(filter_set, optimize = true)] + #[pyo3(signature = (filter_set, optimize = true))] pub fn new(filter_set: FilterSet, optimize: bool) -> Self { let engine = RustEngine::from_filter_set(filter_set.filter_set, optimize); Self { engine, optimize } @@ -442,7 +438,6 @@ impl Engine { /// * `url` - The URL of the request to check /// * `source_url` - The URL from where the request is made /// * `request_type` - The resource type that the request points to - #[pyo3(text_signature = "($self, url, source_url, request_type)")] pub fn check_network_urls( &self, url: &str, @@ -465,9 +460,13 @@ impl Engine { /// * `third_party_request` - Is the given request to a third-party? Here, /// `None` can be given and the engine will figure it out based on the /// `hostname` and `source_hostname`. - #[pyo3( - text_signature = "($self, url, hostname, source_hostname, requsest_type, third_party_request)" - )] + #[pyo3(signature = ( + url, + hostname, + source_hostname, + request_type, + third_party_request, + ))] pub fn check_network_urls_with_hostnames( &self, url: &str, @@ -499,11 +498,16 @@ impl Engine { /// * `previously_matched_rule` - Return a match as long as there are no /// exceptions /// * `force_check_exceptions` - Check exceptions even if no other rule matches - #[pyo3( - text_signature = "($self, url, hostname, source_hostname, request_type, \ - third_party_request, previously_matched_rule, force_check_exceptions)" - )] #[allow(clippy::too_many_arguments)] + #[pyo3(signature = ( + url, + hostname, + source_hostname, + request_type, + third_party_request, + previously_matched_rule, + force_check_exceptions + ))] pub fn check_network_urls_with_hostnames_subset( &self, url: &str, @@ -534,7 +538,12 @@ impl Engine { /// Use `"template"` if wanting to specify a template resource type. /// * `content`: The resource data, encoded using standard base64 configuration /// * `aliases`: List of aliases for the resource - #[pyo3(text_signature = "($self, name, content_type, content, aliases)")] + #[pyo3(signature = ( + name, + content_type, + content, + aliases=None, + ))] pub fn add_resource( &mut self, name: &str, @@ -569,8 +578,7 @@ impl Engine { /// Serialize this blocking engine to bytes. They can then be deserialized /// using `deserialize()` to get the same engine again. - #[pyo3(text_signature = "($self)")] - pub fn serialize<'p>(&mut self, py: Python<'p>) -> PyResult<&'p PyBytes> { + pub fn serialize<'p>(&mut self, py: Python<'p>) -> PyResult> { let bytes = self.serialize_inner()?; let py_bytes = PyBytes::new(py, &bytes); Ok(py_bytes) @@ -590,7 +598,6 @@ impl Engine { /// Serialize this blocking engine to a file. The file can then be /// deserialized using `deserialize_from_file()` to get the same engine /// again. - #[pyo3(text_signature = "($self, file)")] pub fn serialize_to_file(&mut self, file: &str) -> PyResult<()> { let data = self.serialize_inner()?; let mut fd = fs::OpenOptions::new() @@ -603,7 +610,6 @@ impl Engine { } /// Deserialize a blocking engine from bytes produced with `serialize()`. - #[pyo3(text_signature = "($self, serialized)")] pub fn deserialize(&mut self, serialized: &[u8]) -> PyResult<()> { let result = self.engine.deserialize(serialized); match result { @@ -617,7 +623,6 @@ impl Engine { /// Deserialize a blocking engine from file produced with /// `serialize_to_file()`. - #[pyo3(text_signature = "($self, file)")] pub fn deserialize_from_file(&mut self, file: &str) -> PyResult<()> { let mut fd = fs::File::open(file)?; let mut data: Vec = Vec::new(); @@ -626,7 +631,6 @@ impl Engine { } /// Checks if the given filter exists in the blocking engine. - #[pyo3(text_signature = "($self, filter)")] pub fn filter_exists(&self, filter: &str) -> bool { self.engine.filter_exists(filter) } @@ -635,8 +639,8 @@ impl Engine { /// /// Tags can be used to cheaply enable or disable network rules with a /// corresponding $tag option. - #[pyo3(text_signature = "($self, tags)")] - pub fn use_tags(&mut self, tags: Vec<&str>) { + pub fn use_tags(&mut self, tags: Vec) { + let tags = tags.iter().map(String::as_str).collect::>(); self.engine.use_tags(&tags); } @@ -645,8 +649,8 @@ impl Engine { /// /// Tags can be used to cheaply enable or disable network rules with a /// corresponding $tag option. - #[pyo3(text_signature = "($self, tags)")] - pub fn enable_tags(&mut self, tags: Vec<&str>) { + pub fn enable_tags(&mut self, tags: Vec) { + let tags = tags.iter().map(String::as_str).collect::>(); self.engine.enable_tags(&tags); } @@ -655,8 +659,8 @@ impl Engine { /// /// Tags can be used to cheaply enable or disable network rules with a /// corresponding $tag option. - #[pyo3(text_signature = "($self, tags)")] - pub fn disable_tags(&mut self, tags: Vec<&str>) { + pub fn disable_tags(&mut self, tags: Vec) { + let tags = tags.iter().map(String::as_str).collect::>(); self.engine.disable_tags(&tags); } @@ -664,7 +668,6 @@ impl Engine { /// /// Tags can be used to cheaply enable or disable network rules with a /// corresponding $tag option. - #[pyo3(text_signature = "($self, tag)")] pub fn tag_exists(&self, tag: &str) -> bool { self.engine.tag_exists(tag) } @@ -673,7 +676,6 @@ impl Engine { /// url. Once this has been called, all CSS ids and classes on a /// page should be passed to hidden_class_id_selectors to obtain any /// stylesheets consisting of generic rules. - #[pyo3(text_signature = "($self, url)")] pub fn url_cosmetic_resources(&self, url: &str) -> UrlSpecificResources { self.engine.url_cosmetic_resources(url).into() } @@ -685,7 +687,6 @@ impl Engine { /// are not excepted. /// /// Exceptions should be passed directly from UrlSpecificResources. - #[pyo3(text_signature = "($self, classes, ids, exceptions)")] pub fn hidden_class_id_selectors( &self, classes: Vec,