diff options
| author | Árni Dagur <arni@dagur.eu> | 2022-07-17 22:47:05 +0200 |
|---|---|---|
| committer | Árni Dagur <arni@dagur.eu> | 2022-07-18 00:12:16 +0200 |
| commit | 3fcd327a63ae331e641565db0e178a9a64b4b0dd (patch) | |
| tree | a80e19fe3ba4097a89ebd3a58681faacfe68962e | |
| parent | 83a211f741fc7de635181af71f7074ccce852aa8 (diff) | |
Update Rust dependencies
| -rw-r--r-- | .github/workflows/ci.yml | 42 | ||||
| -rw-r--r-- | CHANGELOG.md | 8 | ||||
| -rw-r--r-- | Cargo.lock | 278 | ||||
| -rw-r--r-- | Cargo.toml | 4 | ||||
| -rw-r--r-- | README.md | 4 | ||||
| -rw-r--r-- | adblock/adblock.pyi | 4 | ||||
| -rw-r--r-- | src/lib.rs | 54 | ||||
| -rw-r--r-- | tests/test_redirect.py | 13 |
8 files changed, 217 insertions, 190 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0e88885..1beb8ae 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml | |||
| @@ -26,15 +26,19 @@ jobs: | |||
| 26 | command: fmt | 26 | command: fmt |
| 27 | args: -- --check | 27 | args: -- --check |
| 28 | 28 | ||
| 29 | - name: Lint with clippy | 29 | # Disabled because of https://github.com/rust-lang/rust-clippy/issues/8971 |
| 30 | uses: actions-rs/cargo@v1 | 30 | # - name: Lint with clippy |
| 31 | with: | 31 | # uses: actions-rs/cargo@v1 |
| 32 | command: clippy | 32 | # with: |
| 33 | args: --all-targets --all-features -- -D clippy::all | 33 | # command: clippy |
| 34 | # args: --all-targets --all-features -- -D clippy::all | ||
| 34 | 35 | ||
| 35 | - name: Lint with Black | 36 | - name: Lint with Black |
| 36 | run: pip install black && black --check . | 37 | run: pip install black && black --check . |
| 37 | 38 | ||
| 39 | - name: Lint with mypy | ||
| 40 | run: pip install mypy && mypy --non-interactive --install-types --ignore-missing-imports . | ||
| 41 | |||
| 38 | macos: | 42 | macos: |
| 39 | runs-on: macos-latest | 43 | runs-on: macos-latest |
| 40 | needs: lint | 44 | needs: lint |
| @@ -43,7 +47,7 @@ jobs: | |||
| 43 | 47 | ||
| 44 | - uses: actions/setup-python@v2 | 48 | - uses: actions/setup-python@v2 |
| 45 | with: | 49 | with: |
| 46 | python-version: 3.6 | 50 | python-version: 3.7 |
| 47 | 51 | ||
| 48 | - name: Install Rust toolchain | 52 | - name: Install Rust toolchain |
| 49 | uses: actions-rs/toolchain@v1 | 53 | uses: actions-rs/toolchain@v1 |
| @@ -68,7 +72,7 @@ jobs: | |||
| 68 | PYO3_CROSS_LIB_DIR: /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib | 72 | PYO3_CROSS_LIB_DIR: /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib |
| 69 | run: | | 73 | run: | |
| 70 | # Build wheels | 74 | # Build wheels |
| 71 | maturin build -i python --release --universal2 --out dist --no-sdist | 75 | maturin build -i python --release --universal2 --out dist |
| 72 | pip install adblock --no-index --find-links dist --force-reinstall | 76 | pip install adblock --no-index --find-links dist --force-reinstall |
| 73 | 77 | ||
| 74 | - name: Run PyTest | 78 | - name: Run PyTest |
| @@ -101,7 +105,7 @@ jobs: | |||
| 101 | 105 | ||
| 102 | - uses: actions/setup-python@v2 | 106 | - uses: actions/setup-python@v2 |
| 103 | with: | 107 | with: |
| 104 | python-version: 3.6 | 108 | python-version: 3.7 |
| 105 | architecture: ${{ matrix.platform.python-architecture }} | 109 | architecture: ${{ matrix.platform.python-architecture }} |
| 106 | 110 | ||
| 107 | - name: Install Rust toolchain | 111 | - name: Install Rust toolchain |
| @@ -117,7 +121,7 @@ jobs: | |||
| 117 | 121 | ||
| 118 | - name: Build wheels | 122 | - name: Build wheels |
| 119 | run: | | 123 | run: | |
| 120 | maturin build -i python --release --out dist --no-sdist --target ${{ matrix.platform.target }} | 124 | maturin build -i python --release --out dist --target ${{ matrix.platform.target }} |
| 121 | pip install adblock --no-index --find-links dist --force-reinstall | 125 | pip install adblock --no-index --find-links dist --force-reinstall |
| 122 | 126 | ||
| 123 | - name: Run PyTest | 127 | - name: Run PyTest |
| @@ -143,25 +147,25 @@ jobs: | |||
| 143 | platform: | 147 | platform: |
| 144 | [ | 148 | [ |
| 145 | { | 149 | { |
| 146 | toolchain: "1.49", | 150 | toolchain: "1.53", |
| 147 | manylinux: "2010", | 151 | manylinux: "2010", |
| 148 | target: "x86_64-unknown-linux-gnu", | 152 | target: "x86_64-unknown-linux-gnu", |
| 149 | arch: "x86_64", | 153 | arch: "x86_64", |
| 150 | python-version: "3.6" | 154 | python-version: "3.7" |
| 151 | }, | 155 | }, |
| 152 | { | 156 | { |
| 153 | toolchain: "nightly", | 157 | toolchain: "nightly", |
| 154 | manylinux: "2010", | 158 | manylinux: "2010", |
| 155 | target: "x86_64-unknown-linux-gnu", | 159 | target: "x86_64-unknown-linux-gnu", |
| 156 | arch: "x86_64", | 160 | arch: "x86_64", |
| 157 | python-version: "3.6" | 161 | python-version: "3.7" |
| 158 | }, | 162 | }, |
| 159 | { | 163 | { |
| 160 | toolchain: "stable", | 164 | toolchain: "stable", |
| 161 | manylinux: "2010", | 165 | manylinux: "2010", |
| 162 | target: "x86_64-unknown-linux-gnu", | 166 | target: "x86_64-unknown-linux-gnu", |
| 163 | arch: "x86_64", | 167 | arch: "x86_64", |
| 164 | python-version: "3.6" | 168 | python-version: "3.7" |
| 165 | }, | 169 | }, |
| 166 | { | 170 | { |
| 167 | toolchain: "stable", | 171 | toolchain: "stable", |
| @@ -169,7 +173,7 @@ jobs: | |||
| 169 | target: "x86_64-unknown-linux-gnu", | 173 | target: "x86_64-unknown-linux-gnu", |
| 170 | arch: "x86_64", | 174 | arch: "x86_64", |
| 171 | python-version: "3.10" | 175 | python-version: "3.10" |
| 172 | }, | 176 | } |
| 173 | ] | 177 | ] |
| 174 | steps: | 178 | steps: |
| 175 | - uses: actions/checkout@v2 | 179 | - uses: actions/checkout@v2 |
| @@ -184,7 +188,7 @@ jobs: | |||
| 184 | source ~/.cargo/env | 188 | source ~/.cargo/env |
| 185 | export PATH=/opt/python/cp38-cp38/bin:$PATH | 189 | export PATH=/opt/python/cp38-cp38/bin:$PATH |
| 186 | pip install maturin | 190 | pip install maturin |
| 187 | maturin build -i python --release --out dist --no-sdist --target ${{ matrix.platform.target }} --manylinux ${{ matrix.platform.manylinux }} | 191 | maturin build -i python --release --out dist --target ${{ matrix.platform.target }} --manylinux ${{ matrix.platform.manylinux }} |
| 188 | ' > build-wheel.sh | 192 | ' > build-wheel.sh |
| 189 | chmod +x build-wheel.sh | 193 | chmod +x build-wheel.sh |
| 190 | docker run --rm -v "$PWD":/io -w /io quay.io/pypa/manylinux${{ matrix.platform.manylinux }}_${{ matrix.platform.arch }} bash build-wheel.sh | 194 | docker run --rm -v "$PWD":/io -w /io quay.io/pypa/manylinux${{ matrix.platform.manylinux }}_${{ matrix.platform.arch }} bash build-wheel.sh |
| @@ -234,23 +238,23 @@ jobs: | |||
| 234 | 238 | ||
| 235 | - uses: actions/setup-python@v2 | 239 | - uses: actions/setup-python@v2 |
| 236 | with: | 240 | with: |
| 237 | python-version: 3.6 | 241 | python-version: 3.7 |
| 238 | 242 | ||
| 239 | - name: Build Wheels | 243 | - name: Build Wheels |
| 240 | run: | | 244 | run: | |
| 241 | echo 'curl -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable | 245 | echo 'curl -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable |
| 242 | source ~/.cargo/env | 246 | source ~/.cargo/env |
| 243 | rustup target add ${{ matrix.platform.target }} | 247 | rustup target add ${{ matrix.platform.target }} |
| 244 | maturin build -i python --release --out dist --no-sdist --target ${{ matrix.platform.target }} --manylinux ${{ matrix.platform.manylinux }} | 248 | maturin build -i python --release --out dist --target ${{ matrix.platform.target }} --manylinux ${{ matrix.platform.manylinux }} |
| 245 | ' > build-wheel.sh | 249 | ' > build-wheel.sh |
| 246 | chmod +x build-wheel.sh | 250 | chmod +x build-wheel.sh |
| 247 | docker run --rm -v "$PWD":/io -w /io messense/manylinux2014-cross:${{ matrix.platform.arch }} bash build-wheel.sh | 251 | docker run --rm -v "$PWD":/io -w /io messense/manylinux2014-cross:${{ matrix.platform.arch }} bash build-wheel.sh |
| 248 | 252 | ||
| 249 | - uses: uraimo/run-on-arch-action@v2.0.5 | 253 | - uses: uraimo/run-on-arch-action@v2.2.0 |
| 250 | name: Install built wheel | 254 | name: Install built wheel |
| 251 | with: | 255 | with: |
| 252 | arch: ${{ matrix.platform.arch }} | 256 | arch: ${{ matrix.platform.arch }} |
| 253 | distro: ubuntu18.04 | 257 | distro: ubuntu22.04 |
| 254 | # Mount the dist directory as /artifacts in the container | 258 | # Mount the dist directory as /artifacts in the container |
| 255 | dockerRunArgs: | | 259 | dockerRunArgs: | |
| 256 | --volume "${PWD}/dist:/artifacts" | 260 | --volume "${PWD}/dist:/artifacts" |
diff --git a/CHANGELOG.md b/CHANGELOG.md index 0bd65e4..8c596f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md | |||
| @@ -5,6 +5,14 @@ This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a Ch | |||
| 5 | 5 | ||
| 6 | ## Unreleased | 6 | ## Unreleased |
| 7 | --- | 7 | --- |
| 8 | ### Changes | ||
| 9 | * Update PyO3 dependency to `0.16`. | ||
| 10 | * Update upstream dependency to `0.5.6`. | ||
| 11 | |||
| 12 | ### Breaks | ||
| 13 | * Minimum Rust version is now `1.53`. | ||
| 14 | * Minimum Python version is now `3.7`. | ||
| 15 | |||
| 8 | 16 | ||
| 9 | ## 0.5.2 - (2022-03-01) | 17 | ## 0.5.2 - (2022-03-01) |
| 10 | --- | 18 | --- |
| @@ -4,9 +4,17 @@ version = 3 | |||
| 4 | 4 | ||
| 5 | [[package]] | 5 | [[package]] |
| 6 | name = "adblock" | 6 | name = "adblock" |
| 7 | version = "0.4.3" | 7 | version = "0.5.2" |
| 8 | dependencies = [ | ||
| 9 | "adblock 0.5.6", | ||
| 10 | "pyo3", | ||
| 11 | ] | ||
| 12 | |||
| 13 | [[package]] | ||
| 14 | name = "adblock" | ||
| 15 | version = "0.5.6" | ||
| 8 | source = "registry+https://github.com/rust-lang/crates.io-index" | 16 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 9 | checksum = "52bdd00675903fd86d5d3109bb7899387c85cab52f990d14481546cb9a7102bf" | 17 | checksum = "27785ef5b89bc88fd2def3e1ecfefdf5ec1583795b916667afd15b13058f8315" |
| 10 | dependencies = [ | 18 | dependencies = [ |
| 11 | "addr", | 19 | "addr", |
| 12 | "base64", | 20 | "base64", |
| @@ -26,14 +34,6 @@ dependencies = [ | |||
| 26 | ] | 34 | ] |
| 27 | 35 | ||
| 28 | [[package]] | 36 | [[package]] |
| 29 | name = "adblock" | ||
| 30 | version = "0.5.2" | ||
| 31 | dependencies = [ | ||
| 32 | "adblock 0.4.3", | ||
| 33 | "pyo3", | ||
| 34 | ] | ||
| 35 | |||
| 36 | [[package]] | ||
| 37 | name = "addr" | 37 | name = "addr" |
| 38 | version = "0.14.0" | 38 | version = "0.14.0" |
| 39 | source = "registry+https://github.com/rust-lang/crates.io-index" | 39 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| @@ -99,19 +99,17 @@ dependencies = [ | |||
| 99 | 99 | ||
| 100 | [[package]] | 100 | [[package]] |
| 101 | name = "either" | 101 | name = "either" |
| 102 | version = "1.6.1" | 102 | version = "1.7.0" |
| 103 | source = "registry+https://github.com/rust-lang/crates.io-index" | 103 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 104 | checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" | 104 | checksum = "3f107b87b6afc2a64fd13cac55fe06d6c8859f12d4b14cbcdd2c67d0976781be" |
| 105 | 105 | ||
| 106 | [[package]] | 106 | [[package]] |
| 107 | name = "flate2" | 107 | name = "flate2" |
| 108 | version = "1.0.22" | 108 | version = "1.0.24" |
| 109 | source = "registry+https://github.com/rust-lang/crates.io-index" | 109 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 110 | checksum = "1e6988e897c1c9c485f43b47a529cef42fde0547f9d8d41a7062518f1d8fc53f" | 110 | checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6" |
| 111 | dependencies = [ | 111 | dependencies = [ |
| 112 | "cfg-if", | ||
| 113 | "crc32fast", | 112 | "crc32fast", |
| 114 | "libc", | ||
| 115 | "miniz_oxide", | 113 | "miniz_oxide", |
| 116 | ] | 114 | ] |
| 117 | 115 | ||
| @@ -138,35 +136,9 @@ dependencies = [ | |||
| 138 | 136 | ||
| 139 | [[package]] | 137 | [[package]] |
| 140 | name = "indoc" | 138 | name = "indoc" |
| 141 | version = "0.3.6" | 139 | version = "1.0.6" |
| 142 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 143 | checksum = "47741a8bc60fb26eb8d6e0238bbb26d8575ff623fdc97b1a2c00c050b9684ed8" | ||
| 144 | dependencies = [ | ||
| 145 | "indoc-impl", | ||
| 146 | "proc-macro-hack", | ||
| 147 | ] | ||
| 148 | |||
| 149 | [[package]] | ||
| 150 | name = "indoc-impl" | ||
| 151 | version = "0.3.6" | ||
| 152 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 153 | checksum = "ce046d161f000fffde5f432a0d034d0341dc152643b2598ed5bfce44c4f3a8f0" | ||
| 154 | dependencies = [ | ||
| 155 | "proc-macro-hack", | ||
| 156 | "proc-macro2", | ||
| 157 | "quote", | ||
| 158 | "syn", | ||
| 159 | "unindent", | ||
| 160 | ] | ||
| 161 | |||
| 162 | [[package]] | ||
| 163 | name = "instant" | ||
| 164 | version = "0.1.12" | ||
| 165 | source = "registry+https://github.com/rust-lang/crates.io-index" | 140 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 166 | checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" | 141 | checksum = "05a0bd019339e5d968b37855180087b7b9d512c5046fbd244cf8c95687927d6e" |
| 167 | dependencies = [ | ||
| 168 | "cfg-if", | ||
| 169 | ] | ||
| 170 | 142 | ||
| 171 | [[package]] | 143 | [[package]] |
| 172 | name = "itertools" | 144 | name = "itertools" |
| @@ -179,16 +151,17 @@ dependencies = [ | |||
| 179 | 151 | ||
| 180 | [[package]] | 152 | [[package]] |
| 181 | name = "libc" | 153 | name = "libc" |
| 182 | version = "0.2.118" | 154 | version = "0.2.126" |
| 183 | source = "registry+https://github.com/rust-lang/crates.io-index" | 155 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 184 | checksum = "06e509672465a0504304aa87f9f176f2b2b716ed8fb105ebe5c02dc6dce96a94" | 156 | checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" |
| 185 | 157 | ||
| 186 | [[package]] | 158 | [[package]] |
| 187 | name = "lock_api" | 159 | name = "lock_api" |
| 188 | version = "0.4.6" | 160 | version = "0.4.7" |
| 189 | source = "registry+https://github.com/rust-lang/crates.io-index" | 161 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 190 | checksum = "88943dd7ef4a2e5a4bfa2753aaab3013e34ce2533d1996fb18ef591e315e2b3b" | 162 | checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" |
| 191 | dependencies = [ | 163 | dependencies = [ |
| 164 | "autocfg", | ||
| 192 | "scopeguard", | 165 | "scopeguard", |
| 193 | ] | 166 | ] |
| 194 | 167 | ||
| @@ -200,78 +173,62 @@ checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" | |||
| 200 | 173 | ||
| 201 | [[package]] | 174 | [[package]] |
| 202 | name = "memchr" | 175 | name = "memchr" |
| 203 | version = "2.4.1" | 176 | version = "2.5.0" |
| 204 | source = "registry+https://github.com/rust-lang/crates.io-index" | 177 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 205 | checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" | 178 | checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" |
| 206 | 179 | ||
| 207 | [[package]] | 180 | [[package]] |
| 208 | name = "miniz_oxide" | 181 | name = "miniz_oxide" |
| 209 | version = "0.4.4" | 182 | version = "0.5.3" |
| 210 | source = "registry+https://github.com/rust-lang/crates.io-index" | 183 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 211 | checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" | 184 | checksum = "6f5c75688da582b8ffc1f1799e9db273f32133c49e048f614d22ec3256773ccc" |
| 212 | dependencies = [ | 185 | dependencies = [ |
| 213 | "adler", | 186 | "adler", |
| 214 | "autocfg", | ||
| 215 | ] | 187 | ] |
| 216 | 188 | ||
| 217 | [[package]] | 189 | [[package]] |
| 218 | name = "num-traits" | 190 | name = "num-traits" |
| 219 | version = "0.2.14" | 191 | version = "0.2.15" |
| 220 | source = "registry+https://github.com/rust-lang/crates.io-index" | 192 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 221 | checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" | 193 | checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" |
| 222 | dependencies = [ | 194 | dependencies = [ |
| 223 | "autocfg", | 195 | "autocfg", |
| 224 | ] | 196 | ] |
| 225 | 197 | ||
| 226 | [[package]] | 198 | [[package]] |
| 227 | name = "once_cell" | 199 | name = "once_cell" |
| 228 | version = "1.9.0" | 200 | version = "1.13.0" |
| 229 | source = "registry+https://github.com/rust-lang/crates.io-index" | 201 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 230 | checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" | 202 | checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1" |
| 231 | 203 | ||
| 232 | [[package]] | 204 | [[package]] |
| 233 | name = "parking_lot" | 205 | name = "parking_lot" |
| 234 | version = "0.11.2" | 206 | version = "0.12.1" |
| 235 | source = "registry+https://github.com/rust-lang/crates.io-index" | 207 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 236 | checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" | 208 | checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" |
| 237 | dependencies = [ | 209 | dependencies = [ |
| 238 | "instant", | ||
| 239 | "lock_api", | 210 | "lock_api", |
| 240 | "parking_lot_core", | 211 | "parking_lot_core", |
| 241 | ] | 212 | ] |
| 242 | 213 | ||
| 243 | [[package]] | 214 | [[package]] |
| 244 | name = "parking_lot_core" | 215 | name = "parking_lot_core" |
| 245 | version = "0.8.5" | 216 | version = "0.9.3" |
| 246 | source = "registry+https://github.com/rust-lang/crates.io-index" | 217 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 247 | checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" | 218 | checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" |
| 248 | dependencies = [ | 219 | dependencies = [ |
| 249 | "cfg-if", | 220 | "cfg-if", |
| 250 | "instant", | ||
| 251 | "libc", | 221 | "libc", |
| 252 | "redox_syscall", | 222 | "redox_syscall", |
| 253 | "smallvec", | 223 | "smallvec", |
| 254 | "winapi", | 224 | "windows-sys", |
| 255 | ] | 225 | ] |
| 256 | 226 | ||
| 257 | [[package]] | 227 | [[package]] |
| 258 | name = "paste" | 228 | name = "paste" |
| 259 | version = "0.1.18" | 229 | version = "1.0.7" |
| 260 | source = "registry+https://github.com/rust-lang/crates.io-index" | 230 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 261 | checksum = "45ca20c77d80be666aef2b45486da86238fabe33e38306bd3118fe4af33fa880" | 231 | checksum = "0c520e05135d6e763148b6426a837e239041653ba7becd2e538c076c738025fc" |
| 262 | dependencies = [ | ||
| 263 | "paste-impl", | ||
| 264 | "proc-macro-hack", | ||
| 265 | ] | ||
| 266 | |||
| 267 | [[package]] | ||
| 268 | name = "paste-impl" | ||
| 269 | version = "0.1.18" | ||
| 270 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 271 | checksum = "d95a7db200b97ef370c8e6de0088252f7e0dfff7d047a28528e47456c0fc98b6" | ||
| 272 | dependencies = [ | ||
| 273 | "proc-macro-hack", | ||
| 274 | ] | ||
| 275 | 232 | ||
| 276 | [[package]] | 233 | [[package]] |
| 277 | name = "percent-encoding" | 234 | name = "percent-encoding" |
| @@ -280,25 +237,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
| 280 | checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" | 237 | checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" |
| 281 | 238 | ||
| 282 | [[package]] | 239 | [[package]] |
| 283 | name = "proc-macro-hack" | ||
| 284 | version = "0.5.19" | ||
| 285 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 286 | checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" | ||
| 287 | |||
| 288 | [[package]] | ||
| 289 | name = "proc-macro2" | 240 | name = "proc-macro2" |
| 290 | version = "1.0.36" | 241 | version = "1.0.40" |
| 291 | source = "registry+https://github.com/rust-lang/crates.io-index" | 242 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 292 | checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" | 243 | checksum = "dd96a1e8ed2596c337f8eae5f24924ec83f5ad5ab21ea8e455d3566c69fbcaf7" |
| 293 | dependencies = [ | 244 | dependencies = [ |
| 294 | "unicode-xid", | 245 | "unicode-ident", |
| 295 | ] | 246 | ] |
| 296 | 247 | ||
| 297 | [[package]] | 248 | [[package]] |
| 298 | name = "psl" | 249 | name = "psl" |
| 299 | version = "2.0.71" | 250 | version = "2.0.90" |
| 300 | source = "registry+https://github.com/rust-lang/crates.io-index" | 251 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 301 | checksum = "2f51974f40b58fd94008d3c88fa47cf1c7a58bd4e85deb0d4390bc156b0a9625" | 252 | checksum = "7e9c7d362659b525758d09e2a3ae965e371b347605e5fb2bc5bec5c2a1ecf41b" |
| 302 | dependencies = [ | 253 | dependencies = [ |
| 303 | "psl-types", | 254 | "psl-types", |
| 304 | ] | 255 | ] |
| @@ -311,35 +262,47 @@ checksum = "e8eda7c62d9ecaafdf8b62374c006de0adf61666ae96a96ba74a37134aa4e470" | |||
| 311 | 262 | ||
| 312 | [[package]] | 263 | [[package]] |
| 313 | name = "pyo3" | 264 | name = "pyo3" |
| 314 | version = "0.15.2" | 265 | version = "0.16.5" |
| 315 | source = "registry+https://github.com/rust-lang/crates.io-index" | 266 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 316 | checksum = "d41d50a7271e08c7c8a54cd24af5d62f73ee3a6f6a314215281ebdec421d5752" | 267 | checksum = "1e6302e85060011447471887705bb7838f14aba43fcb06957d823739a496b3dc" |
| 317 | dependencies = [ | 268 | dependencies = [ |
| 318 | "cfg-if", | 269 | "cfg-if", |
| 319 | "indoc", | 270 | "indoc", |
| 320 | "libc", | 271 | "libc", |
| 321 | "parking_lot", | 272 | "parking_lot", |
| 322 | "paste", | ||
| 323 | "pyo3-build-config", | 273 | "pyo3-build-config", |
| 274 | "pyo3-ffi", | ||
| 324 | "pyo3-macros", | 275 | "pyo3-macros", |
| 325 | "unindent", | 276 | "unindent", |
| 326 | ] | 277 | ] |
| 327 | 278 | ||
| 328 | [[package]] | 279 | [[package]] |
| 329 | name = "pyo3-build-config" | 280 | name = "pyo3-build-config" |
| 330 | version = "0.15.2" | 281 | version = "0.16.5" |
| 331 | source = "registry+https://github.com/rust-lang/crates.io-index" | 282 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 332 | checksum = "779239fc40b8e18bc8416d3a37d280ca9b9fb04bda54b98037bb6748595c2410" | 283 | checksum = "b5b65b546c35d8a3b1b2f0ddbac7c6a569d759f357f2b9df884f5d6b719152c8" |
| 333 | dependencies = [ | 284 | dependencies = [ |
| 334 | "once_cell", | 285 | "once_cell", |
| 286 | "target-lexicon", | ||
| 287 | ] | ||
| 288 | |||
| 289 | [[package]] | ||
| 290 | name = "pyo3-ffi" | ||
| 291 | version = "0.16.5" | ||
| 292 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 293 | checksum = "c275a07127c1aca33031a563e384ffdd485aee34ef131116fcd58e3430d1742b" | ||
| 294 | dependencies = [ | ||
| 295 | "libc", | ||
| 296 | "pyo3-build-config", | ||
| 335 | ] | 297 | ] |
| 336 | 298 | ||
| 337 | [[package]] | 299 | [[package]] |
| 338 | name = "pyo3-macros" | 300 | name = "pyo3-macros" |
| 339 | version = "0.15.2" | 301 | version = "0.16.5" |
| 340 | source = "registry+https://github.com/rust-lang/crates.io-index" | 302 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 341 | checksum = "00b247e8c664be87998d8628e86f282c25066165f1f8dda66100c48202fdb93a" | 303 | checksum = "284fc4485bfbcc9850a6d661d627783f18d19c2ab55880b021671c4ba83e90f7" |
| 342 | dependencies = [ | 304 | dependencies = [ |
| 305 | "proc-macro2", | ||
| 343 | "pyo3-macros-backend", | 306 | "pyo3-macros-backend", |
| 344 | "quote", | 307 | "quote", |
| 345 | "syn", | 308 | "syn", |
| @@ -347,39 +310,38 @@ dependencies = [ | |||
| 347 | 310 | ||
| 348 | [[package]] | 311 | [[package]] |
| 349 | name = "pyo3-macros-backend" | 312 | name = "pyo3-macros-backend" |
| 350 | version = "0.15.2" | 313 | version = "0.16.5" |
| 351 | source = "registry+https://github.com/rust-lang/crates.io-index" | 314 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 352 | checksum = "5a8c2812c412e00e641d99eeb79dd478317d981d938aa60325dfa7157b607095" | 315 | checksum = "53bda0f58f73f5c5429693c96ed57f7abdb38fdfc28ae06da4101a257adb7faf" |
| 353 | dependencies = [ | 316 | dependencies = [ |
| 354 | "proc-macro2", | 317 | "proc-macro2", |
| 355 | "pyo3-build-config", | ||
| 356 | "quote", | 318 | "quote", |
| 357 | "syn", | 319 | "syn", |
| 358 | ] | 320 | ] |
| 359 | 321 | ||
| 360 | [[package]] | 322 | [[package]] |
| 361 | name = "quote" | 323 | name = "quote" |
| 362 | version = "1.0.15" | 324 | version = "1.0.20" |
| 363 | source = "registry+https://github.com/rust-lang/crates.io-index" | 325 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 364 | checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145" | 326 | checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804" |
| 365 | dependencies = [ | 327 | dependencies = [ |
| 366 | "proc-macro2", | 328 | "proc-macro2", |
| 367 | ] | 329 | ] |
| 368 | 330 | ||
| 369 | [[package]] | 331 | [[package]] |
| 370 | name = "redox_syscall" | 332 | name = "redox_syscall" |
| 371 | version = "0.2.10" | 333 | version = "0.2.13" |
| 372 | source = "registry+https://github.com/rust-lang/crates.io-index" | 334 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 373 | checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" | 335 | checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" |
| 374 | dependencies = [ | 336 | dependencies = [ |
| 375 | "bitflags", | 337 | "bitflags", |
| 376 | ] | 338 | ] |
| 377 | 339 | ||
| 378 | [[package]] | 340 | [[package]] |
| 379 | name = "regex" | 341 | name = "regex" |
| 380 | version = "1.5.4" | 342 | version = "1.6.0" |
| 381 | source = "registry+https://github.com/rust-lang/crates.io-index" | 343 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 382 | checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" | 344 | checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" |
| 383 | dependencies = [ | 345 | dependencies = [ |
| 384 | "aho-corasick", | 346 | "aho-corasick", |
| 385 | "memchr", | 347 | "memchr", |
| @@ -388,18 +350,19 @@ dependencies = [ | |||
| 388 | 350 | ||
| 389 | [[package]] | 351 | [[package]] |
| 390 | name = "regex-syntax" | 352 | name = "regex-syntax" |
| 391 | version = "0.6.25" | 353 | version = "0.6.27" |
| 392 | source = "registry+https://github.com/rust-lang/crates.io-index" | 354 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 393 | checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" | 355 | checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" |
| 394 | 356 | ||
| 395 | [[package]] | 357 | [[package]] |
| 396 | name = "rmp" | 358 | name = "rmp" |
| 397 | version = "0.8.10" | 359 | version = "0.8.11" |
| 398 | source = "registry+https://github.com/rust-lang/crates.io-index" | 360 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 399 | checksum = "4f55e5fa1446c4d5dd1f5daeed2a4fe193071771a2636274d0d7a3b082aa7ad6" | 361 | checksum = "44519172358fd6d58656c86ab8e7fbc9e1490c3e8f14d35ed78ca0dd07403c9f" |
| 400 | dependencies = [ | 362 | dependencies = [ |
| 401 | "byteorder", | 363 | "byteorder", |
| 402 | "num-traits", | 364 | "num-traits", |
| 365 | "paste", | ||
| 403 | ] | 366 | ] |
| 404 | 367 | ||
| 405 | [[package]] | 368 | [[package]] |
| @@ -438,18 +401,18 @@ checksum = "58f57ca1d128a43733fd71d583e837b1f22239a37ebea09cde11d8d9a9080f47" | |||
| 438 | 401 | ||
| 439 | [[package]] | 402 | [[package]] |
| 440 | name = "serde" | 403 | name = "serde" |
| 441 | version = "1.0.136" | 404 | version = "1.0.139" |
| 442 | source = "registry+https://github.com/rust-lang/crates.io-index" | 405 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 443 | checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" | 406 | checksum = "0171ebb889e45aa68b44aee0859b3eede84c6f5f5c228e6f140c0b2a0a46cad6" |
| 444 | dependencies = [ | 407 | dependencies = [ |
| 445 | "serde_derive", | 408 | "serde_derive", |
| 446 | ] | 409 | ] |
| 447 | 410 | ||
| 448 | [[package]] | 411 | [[package]] |
| 449 | name = "serde_derive" | 412 | name = "serde_derive" |
| 450 | version = "1.0.136" | 413 | version = "1.0.139" |
| 451 | source = "registry+https://github.com/rust-lang/crates.io-index" | 414 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 452 | checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" | 415 | checksum = "dc1d3230c1de7932af58ad8ffbe1d784bd55efd5a9d84ac24f69c72d83543dfb" |
| 453 | dependencies = [ | 416 | dependencies = [ |
| 454 | "proc-macro2", | 417 | "proc-macro2", |
| 455 | "quote", | 418 | "quote", |
| @@ -458,26 +421,32 @@ dependencies = [ | |||
| 458 | 421 | ||
| 459 | [[package]] | 422 | [[package]] |
| 460 | name = "smallvec" | 423 | name = "smallvec" |
| 461 | version = "1.8.0" | 424 | version = "1.9.0" |
| 462 | source = "registry+https://github.com/rust-lang/crates.io-index" | 425 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 463 | checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" | 426 | checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" |
| 464 | 427 | ||
| 465 | [[package]] | 428 | [[package]] |
| 466 | name = "syn" | 429 | name = "syn" |
| 467 | version = "1.0.86" | 430 | version = "1.0.98" |
| 468 | source = "registry+https://github.com/rust-lang/crates.io-index" | 431 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 469 | checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b" | 432 | checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd" |
| 470 | dependencies = [ | 433 | dependencies = [ |
| 471 | "proc-macro2", | 434 | "proc-macro2", |
| 472 | "quote", | 435 | "quote", |
| 473 | "unicode-xid", | 436 | "unicode-ident", |
| 474 | ] | 437 | ] |
| 475 | 438 | ||
| 476 | [[package]] | 439 | [[package]] |
| 440 | name = "target-lexicon" | ||
| 441 | version = "0.12.4" | ||
| 442 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 443 | checksum = "c02424087780c9b71cc96799eaeddff35af2bc513278cda5c99fc1f5d026d3c1" | ||
| 444 | |||
| 445 | [[package]] | ||
| 477 | name = "tinyvec" | 446 | name = "tinyvec" |
| 478 | version = "1.5.1" | 447 | version = "1.6.0" |
| 479 | source = "registry+https://github.com/rust-lang/crates.io-index" | 448 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 480 | checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2" | 449 | checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" |
| 481 | dependencies = [ | 450 | dependencies = [ |
| 482 | "tinyvec_macros", | 451 | "tinyvec_macros", |
| 483 | ] | 452 | ] |
| @@ -506,30 +475,30 @@ checksum = "eeba86d422ce181a719445e51872fa30f1f7413b62becb52e95ec91aa262d85c" | |||
| 506 | 475 | ||
| 507 | [[package]] | 476 | [[package]] |
| 508 | name = "unicode-bidi" | 477 | name = "unicode-bidi" |
| 509 | version = "0.3.7" | 478 | version = "0.3.8" |
| 479 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 480 | checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" | ||
| 481 | |||
| 482 | [[package]] | ||
| 483 | name = "unicode-ident" | ||
| 484 | version = "1.0.2" | ||
| 510 | source = "registry+https://github.com/rust-lang/crates.io-index" | 485 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 511 | checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" | 486 | checksum = "15c61ba63f9235225a22310255a29b806b907c9b8c964bcbd0a2c70f3f2deea7" |
| 512 | 487 | ||
| 513 | [[package]] | 488 | [[package]] |
| 514 | name = "unicode-normalization" | 489 | name = "unicode-normalization" |
| 515 | version = "0.1.19" | 490 | version = "0.1.21" |
| 516 | source = "registry+https://github.com/rust-lang/crates.io-index" | 491 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 517 | checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" | 492 | checksum = "854cbdc4f7bc6ae19c820d44abdc3277ac3e1b2b93db20a636825d9322fb60e6" |
| 518 | dependencies = [ | 493 | dependencies = [ |
| 519 | "tinyvec", | 494 | "tinyvec", |
| 520 | ] | 495 | ] |
| 521 | 496 | ||
| 522 | [[package]] | 497 | [[package]] |
| 523 | name = "unicode-xid" | ||
| 524 | version = "0.2.2" | ||
| 525 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 526 | checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" | ||
| 527 | |||
| 528 | [[package]] | ||
| 529 | name = "unindent" | 498 | name = "unindent" |
| 530 | version = "0.1.7" | 499 | version = "0.1.9" |
| 531 | source = "registry+https://github.com/rust-lang/crates.io-index" | 500 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 532 | checksum = "f14ee04d9415b52b3aeab06258a3f07093182b88ba0f9b8d203f211a7a7d41c7" | 501 | checksum = "52fee519a3e570f7df377a06a1a7775cdbfb7aa460be7e08de2b1f0e69973a44" |
| 533 | 502 | ||
| 534 | [[package]] | 503 | [[package]] |
| 535 | name = "url" | 504 | name = "url" |
| @@ -544,23 +513,44 @@ dependencies = [ | |||
| 544 | ] | 513 | ] |
| 545 | 514 | ||
| 546 | [[package]] | 515 | [[package]] |
| 547 | name = "winapi" | 516 | name = "windows-sys" |
| 548 | version = "0.3.9" | 517 | version = "0.36.1" |
| 549 | source = "registry+https://github.com/rust-lang/crates.io-index" | 518 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 550 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" | 519 | checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" |
| 551 | dependencies = [ | 520 | dependencies = [ |
| 552 | "winapi-i686-pc-windows-gnu", | 521 | "windows_aarch64_msvc", |
| 553 | "winapi-x86_64-pc-windows-gnu", | 522 | "windows_i686_gnu", |
| 523 | "windows_i686_msvc", | ||
| 524 | "windows_x86_64_gnu", | ||
| 525 | "windows_x86_64_msvc", | ||
| 554 | ] | 526 | ] |
| 555 | 527 | ||
| 556 | [[package]] | 528 | [[package]] |
| 557 | name = "winapi-i686-pc-windows-gnu" | 529 | name = "windows_aarch64_msvc" |
| 558 | version = "0.4.0" | 530 | version = "0.36.1" |
| 531 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 532 | checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" | ||
| 533 | |||
| 534 | [[package]] | ||
| 535 | name = "windows_i686_gnu" | ||
| 536 | version = "0.36.1" | ||
| 537 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 538 | checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" | ||
| 539 | |||
| 540 | [[package]] | ||
| 541 | name = "windows_i686_msvc" | ||
| 542 | version = "0.36.1" | ||
| 543 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 544 | checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" | ||
| 545 | |||
| 546 | [[package]] | ||
| 547 | name = "windows_x86_64_gnu" | ||
| 548 | version = "0.36.1" | ||
| 559 | source = "registry+https://github.com/rust-lang/crates.io-index" | 549 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 560 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" | 550 | checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" |
| 561 | 551 | ||
| 562 | [[package]] | 552 | [[package]] |
| 563 | name = "winapi-x86_64-pc-windows-gnu" | 553 | name = "windows_x86_64_msvc" |
| 564 | version = "0.4.0" | 554 | version = "0.36.1" |
| 565 | source = "registry+https://github.com/rust-lang/crates.io-index" | 555 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 566 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" | 556 | checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" |
| @@ -22,8 +22,8 @@ requires-python = ">=3.6" | |||
| 22 | debug = true | 22 | debug = true |
| 23 | 23 | ||
| 24 | [dependencies] | 24 | [dependencies] |
| 25 | adblock = { version = "=0.4.3", default-features = false, features = ["full-regex-handling", "embedded-domain-resolver"] } | 25 | adblock = { version = "=0.5.6", default-features = false, features = ["full-regex-handling", "embedded-domain-resolver"] } |
| 26 | pyo3 = { version = "0.15", features = ["abi3-py36", "extension-module"] } | 26 | pyo3 = { version = "0.16", features = ["abi3-py37", "extension-module"] } |
| 27 | 27 | ||
| 28 | [lib] | 28 | [lib] |
| 29 | name = "adblock" | 29 | name = "adblock" |
| @@ -8,8 +8,8 @@ Python wrapper for Brave's adblocking library, which is written in Rust. | |||
| 8 | 8 | ||
| 9 | | Build Dependency | Versions | Arch Linux | Url | | 9 | | Build Dependency | Versions | Arch Linux | Url | |
| 10 | | ---------------- | -------- | ---------- | ------------------------------- | | 10 | | ---------------- | -------- | ---------- | ------------------------------- | |
| 11 | | Python | `>=3.6` | `python` | - | | 11 | | Python | `>=3.7` | `python` | - | |
| 12 | | Rust | `>=1.49` | `rust` | - | | 12 | | Rust | `>=1.53` | `rust` | - | |
| 13 | | Maturin | `>=0.10` | `maturin` | https://github.com/PyO3/maturin | | 13 | | Maturin | `>=0.10` | `maturin` | https://github.com/PyO3/maturin | |
| 14 | 14 | ||
| 15 | #### PEP 517 | 15 | #### PEP 517 |
diff --git a/adblock/adblock.pyi b/adblock/adblock.pyi index 9fae1da..544a30d 100644 --- a/adblock/adblock.pyi +++ b/adblock/adblock.pyi | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | from typing import Optional, Dict, List, Set | 1 | from typing import Optional, Dict, List, Set |
| 2 | 2 | ||
| 3 | __version__: str | ||
| 4 | |||
| 3 | class AdblockException(Exception): | 5 | class AdblockException(Exception): |
| 4 | pass | 6 | pass |
| 5 | 7 | ||
| @@ -58,6 +60,7 @@ class FilterSet: | |||
| 58 | filter_list: str, | 60 | filter_list: str, |
| 59 | format: str = "standard", | 61 | format: str = "standard", |
| 60 | include_redirect_urls: bool = False, | 62 | include_redirect_urls: bool = False, |
| 63 | rule_types: str = "all", | ||
| 61 | ) -> None: | 64 | ) -> None: |
| 62 | pass | 65 | pass |
| 63 | def add_filters( | 66 | def add_filters( |
| @@ -65,6 +68,7 @@ class FilterSet: | |||
| 65 | filters: List[str], | 68 | filters: List[str], |
| 66 | format: str = "standard", | 69 | format: str = "standard", |
| 67 | include_redirect_urls: bool = False, | 70 | include_redirect_urls: bool = False, |
| 71 | rule_types: str = "all", | ||
| 68 | ) -> None: | 72 | ) -> None: |
| 69 | pass | 73 | pass |
| 70 | 74 | ||
| @@ -16,8 +16,7 @@ use adblock::blocker::{BlockerError as RustBlockerError, Redirection}; | |||
| 16 | use adblock::cosmetic_filter_cache::UrlSpecificResources as RustUrlSpecificResources; | 16 | use adblock::cosmetic_filter_cache::UrlSpecificResources as RustUrlSpecificResources; |
| 17 | use adblock::engine::Engine as RustEngine; | 17 | use adblock::engine::Engine as RustEngine; |
| 18 | use adblock::lists::FilterSet as RustFilterSet; | 18 | use adblock::lists::FilterSet as RustFilterSet; |
| 19 | use adblock::lists::{FilterFormat, ParseOptions}; | 19 | use adblock::lists::{FilterFormat, ParseOptions, RuleTypes}; |
| 20 | use pyo3::class::PyObjectProtocol; | ||
| 21 | use pyo3::create_exception; | 20 | use pyo3::create_exception; |
| 22 | use pyo3::exceptions::PyException; | 21 | use pyo3::exceptions::PyException; |
| 23 | use pyo3::prelude::*; | 22 | use pyo3::prelude::*; |
| @@ -145,8 +144,8 @@ impl From<RustBlockerResult> for BlockerResult { | |||
| 145 | } | 144 | } |
| 146 | } | 145 | } |
| 147 | 146 | ||
| 148 | #[pyproto] | 147 | #[pymethods] |
| 149 | impl PyObjectProtocol for BlockerResult { | 148 | impl BlockerResult { |
| 150 | fn __repr__(&self) -> PyResult<String> { | 149 | fn __repr__(&self) -> PyResult<String> { |
| 151 | Ok(format!( | 150 | Ok(format!( |
| 152 | "BlockerResult(matched={}, important={}, redirect={}, exception={}, filter={}, error={})", | 151 | "BlockerResult(matched={}, important={}, redirect={}, exception={}, filter={}, error={})", |
| @@ -231,7 +230,18 @@ fn filter_format_from_string(filter_format: &str) -> PyResult<FilterFormat> { | |||
| 231 | match filter_format { | 230 | match filter_format { |
| 232 | "standard" => Ok(FilterFormat::Standard), | 231 | "standard" => Ok(FilterFormat::Standard), |
| 233 | "hosts" => Ok(FilterFormat::Hosts), | 232 | "hosts" => Ok(FilterFormat::Hosts), |
| 234 | _ => Err(PyErr::new::<AdblockException, _>("Invalid format value")), | 233 | _ => Err(PyErr::new::<AdblockException, _>( |
| 234 | "Invalid FilterFormat value", | ||
| 235 | )), | ||
| 236 | } | ||
| 237 | } | ||
| 238 | |||
| 239 | fn rule_types_from_string(rule_types: &str) -> PyResult<RuleTypes> { | ||
| 240 | match rule_types { | ||
| 241 | "all" => Ok(RuleTypes::All), | ||
| 242 | "networkonly" => Ok(RuleTypes::NetworkOnly), | ||
| 243 | "cosmeticonly" => Ok(RuleTypes::CosmeticOnly), | ||
| 244 | _ => Err(PyErr::new::<AdblockException, _>("Invalid RuleTypes value")), | ||
| 235 | } | 245 | } |
| 236 | } | 246 | } |
| 237 | 247 | ||
| @@ -269,20 +279,28 @@ impl FilterSet { | |||
| 269 | /// | 279 | /// |
| 270 | /// The format is a string containing either "standard" (ABP/uBO-style) | 280 | /// The format is a string containing either "standard" (ABP/uBO-style) |
| 271 | /// or "hosts". | 281 | /// or "hosts". |
| 272 | #[pyo3(text_signature = "($self, filter_list, format, include_redirect_urls)")] | 282 | #[pyo3(text_signature = "($self, filter_list, format, include_redirect_urls, rule_types)")] |
| 273 | #[args(filter_list, format = "\"standard\"", include_redirect_urls = "false")] | 283 | #[args( |
| 284 | filter_list, | ||
| 285 | format = "\"standard\"", | ||
| 286 | include_redirect_urls = "false", | ||
| 287 | rule_types = "\"all\"" | ||
| 288 | )] | ||
| 274 | pub fn add_filter_list( | 289 | pub fn add_filter_list( |
| 275 | &mut self, | 290 | &mut self, |
| 276 | filter_list: &str, | 291 | filter_list: &str, |
| 277 | format: &str, | 292 | format: &str, |
| 278 | include_redirect_urls: bool, | 293 | include_redirect_urls: bool, |
| 294 | rule_types: &str, | ||
| 279 | ) -> PyResult<()> { | 295 | ) -> PyResult<()> { |
| 280 | let filter_format = filter_format_from_string(format)?; | 296 | let filter_format = filter_format_from_string(format)?; |
| 297 | let rule_types = rule_types_from_string(rule_types)?; | ||
| 281 | self.filter_set.add_filter_list( | 298 | self.filter_set.add_filter_list( |
| 282 | filter_list, | 299 | filter_list, |
| 283 | ParseOptions { | 300 | ParseOptions { |
| 284 | format: filter_format, | 301 | format: filter_format, |
| 285 | include_redirect_urls, | 302 | include_redirect_urls, |
| 303 | rule_types, | ||
| 286 | }, | 304 | }, |
| 287 | ); | 305 | ); |
| 288 | Ok(()) | 306 | Ok(()) |
| @@ -293,28 +311,33 @@ impl FilterSet { | |||
| 293 | /// | 311 | /// |
| 294 | /// The format is a string containing either "standard" (ABP/uBO-style) | 312 | /// The format is a string containing either "standard" (ABP/uBO-style) |
| 295 | /// or "hosts". | 313 | /// or "hosts". |
| 296 | #[pyo3(text_signature = "($self, filters, format, include_redirect_urls)")] | 314 | #[pyo3(text_signature = "($self, filters, format, include_redirect_urls, rule_types)")] |
| 297 | #[args(filters, format = "\"standard\"", include_redirect_urls = "false")] | 315 | #[args( |
| 316 | filters, | ||
| 317 | format = "\"standard\"", | ||
| 318 | include_redirect_urls = "false", | ||
| 319 | rule_types = "\"all\"" | ||
| 320 | )] | ||
| 298 | pub fn add_filters( | 321 | pub fn add_filters( |
| 299 | &mut self, | 322 | &mut self, |
| 300 | filters: Vec<String>, | 323 | filters: Vec<String>, |
| 301 | format: &str, | 324 | format: &str, |
| 302 | include_redirect_urls: bool, | 325 | include_redirect_urls: bool, |
| 326 | rule_types: &str, | ||
| 303 | ) -> PyResult<()> { | 327 | ) -> PyResult<()> { |
| 304 | let filter_format = filter_format_from_string(format)?; | 328 | let filter_format = filter_format_from_string(format)?; |
| 329 | let rule_types = rule_types_from_string(rule_types)?; | ||
| 305 | self.filter_set.add_filters( | 330 | self.filter_set.add_filters( |
| 306 | &filters, | 331 | &filters, |
| 307 | ParseOptions { | 332 | ParseOptions { |
| 308 | format: filter_format, | 333 | format: filter_format, |
| 309 | include_redirect_urls, | 334 | include_redirect_urls, |
| 335 | rule_types, | ||
| 310 | }, | 336 | }, |
| 311 | ); | 337 | ); |
| 312 | Ok(()) | 338 | Ok(()) |
| 313 | } | 339 | } |
| 314 | } | ||
| 315 | 340 | ||
| 316 | #[pyproto] | ||
| 317 | impl PyObjectProtocol for FilterSet { | ||
| 318 | fn __repr__(&self) -> PyResult<String> { | 341 | fn __repr__(&self) -> PyResult<String> { |
| 319 | Ok(format!("FilterSet(debug={})", self.debug.diy_python_repr())) | 342 | Ok(format!("FilterSet(debug={})", self.debug.diy_python_repr())) |
| 320 | } | 343 | } |
| @@ -361,8 +384,8 @@ impl From<RustUrlSpecificResources> for UrlSpecificResources { | |||
| 361 | } | 384 | } |
| 362 | } | 385 | } |
| 363 | 386 | ||
| 364 | #[pyproto] | 387 | #[pymethods] |
| 365 | impl PyObjectProtocol for UrlSpecificResources { | 388 | impl UrlSpecificResources { |
| 366 | fn __repr__(&self) -> PyResult<String> { | 389 | fn __repr__(&self) -> PyResult<String> { |
| 367 | Ok(format!( | 390 | Ok(format!( |
| 368 | "UrlSpecificResources<{} hide selectors, {} style selectors, {} exceptions, injected_javascript={}, generichide={}>", | 391 | "UrlSpecificResources<{} hide selectors, {} style selectors, {} exceptions, injected_javascript={}, generichide={}>", |
| @@ -662,10 +685,7 @@ impl Engine { | |||
| 662 | .engine | 685 | .engine |
| 663 | .hidden_class_id_selectors(&classes, &ids, &exceptions)) | 686 | .hidden_class_id_selectors(&classes, &ids, &exceptions)) |
| 664 | } | 687 | } |
| 665 | } | ||
| 666 | 688 | ||
| 667 | #[pyproto] | ||
| 668 | impl PyObjectProtocol for Engine { | ||
| 669 | fn __repr__(&self) -> PyResult<String> { | 689 | fn __repr__(&self) -> PyResult<String> { |
| 670 | Ok(format!( | 690 | Ok(format!( |
| 671 | "Engine<optimize={}>", | 691 | "Engine<optimize={}>", |
diff --git a/tests/test_redirect.py b/tests/test_redirect.py index cca3a91..7782df8 100644 --- a/tests/test_redirect.py +++ b/tests/test_redirect.py | |||
| @@ -35,11 +35,11 @@ def test_redirect_url_is_not_recognized_without_include_redirect_urls(): | |||
| 35 | def test_redirect_url_exception(): | 35 | def test_redirect_url_exception(): |
| 36 | # https://github.com/brave/adblock-rust/blob/b7f29af8c0a0d000201d8d769b6a0b25a9dd4e89/src/blocker.rs#L1314 | 36 | # https://github.com/brave/adblock-rust/blob/b7f29af8c0a0d000201d8d769b6a0b25a9dd4e89/src/blocker.rs#L1314 |
| 37 | filter_set = adblock.FilterSet(debug=True) | 37 | filter_set = adblock.FilterSet(debug=True) |
| 38 | filter_set.add_filter_list( | 38 | filter_set.add_filters( |
| 39 | """ | 39 | [ |
| 40 | ||imdb-video.media-imdb.com$media,redirect-url=http://xyz.com | 40 | "||imdb-video.media-imdb.com$media,redirect-url=http://xyz.com", |
| 41 | @@||imdb-video.media-imdb.com^$domain=imdb.com | 41 | "@@||imdb-video.media-imdb.com^$domain=imdb.com", |
| 42 | """, | 42 | ], |
| 43 | include_redirect_urls=True, | 43 | include_redirect_urls=True, |
| 44 | ) | 44 | ) |
| 45 | 45 | ||
| @@ -50,10 +50,11 @@ def test_redirect_url_exception(): | |||
| 50 | "https://www.imdb.com/video/13", | 50 | "https://www.imdb.com/video/13", |
| 51 | "media", | 51 | "media", |
| 52 | ) | 52 | ) |
| 53 | assert res.error is None | ||
| 53 | assert res.matched is False | 54 | assert res.matched is False |
| 54 | assert res.redirect == "http://xyz.com" | 55 | assert res.redirect == "http://xyz.com" |
| 55 | assert res.redirect_type == "url" | 56 | assert res.redirect_type == "url" |
| 56 | assert res.exception == "@@||imdb-video.media-imdb.com^$domain=imdb.com" | 57 | assert res.exception is None |
| 57 | 58 | ||
| 58 | 59 | ||
| 59 | def test_redirect_with_custom_resource(): | 60 | def test_redirect_with_custom_resource(): |
