summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
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
commit3fcd327a63ae331e641565db0e178a9a64b4b0dd (patch)
treea80e19fe3ba4097a89ebd3a58681faacfe68962e
parent83a211f741fc7de635181af71f7074ccce852aa8 (diff)
Update Rust dependencies
-rw-r--r--.github/workflows/ci.yml42
-rw-r--r--CHANGELOG.md8
-rw-r--r--Cargo.lock278
-rw-r--r--Cargo.toml4
-rw-r--r--README.md4
-rw-r--r--adblock/adblock.pyi4
-rw-r--r--src/lib.rs54
-rw-r--r--tests/test_redirect.py13
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---
diff --git a/Cargo.lock b/Cargo.lock
index 28c063d..cc2596a 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -4,9 +4,17 @@ version = 3
4 4
5[[package]] 5[[package]]
6name = "adblock" 6name = "adblock"
7version = "0.4.3" 7version = "0.5.2"
8dependencies = [
9 "adblock 0.5.6",
10 "pyo3",
11]
12
13[[package]]
14name = "adblock"
15version = "0.5.6"
8source = "registry+https://github.com/rust-lang/crates.io-index" 16source = "registry+https://github.com/rust-lang/crates.io-index"
9checksum = "52bdd00675903fd86d5d3109bb7899387c85cab52f990d14481546cb9a7102bf" 17checksum = "27785ef5b89bc88fd2def3e1ecfefdf5ec1583795b916667afd15b13058f8315"
10dependencies = [ 18dependencies = [
11 "addr", 19 "addr",
12 "base64", 20 "base64",
@@ -26,14 +34,6 @@ dependencies = [
26] 34]
27 35
28[[package]] 36[[package]]
29name = "adblock"
30version = "0.5.2"
31dependencies = [
32 "adblock 0.4.3",
33 "pyo3",
34]
35
36[[package]]
37name = "addr" 37name = "addr"
38version = "0.14.0" 38version = "0.14.0"
39source = "registry+https://github.com/rust-lang/crates.io-index" 39source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -99,19 +99,17 @@ dependencies = [
99 99
100[[package]] 100[[package]]
101name = "either" 101name = "either"
102version = "1.6.1" 102version = "1.7.0"
103source = "registry+https://github.com/rust-lang/crates.io-index" 103source = "registry+https://github.com/rust-lang/crates.io-index"
104checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" 104checksum = "3f107b87b6afc2a64fd13cac55fe06d6c8859f12d4b14cbcdd2c67d0976781be"
105 105
106[[package]] 106[[package]]
107name = "flate2" 107name = "flate2"
108version = "1.0.22" 108version = "1.0.24"
109source = "registry+https://github.com/rust-lang/crates.io-index" 109source = "registry+https://github.com/rust-lang/crates.io-index"
110checksum = "1e6988e897c1c9c485f43b47a529cef42fde0547f9d8d41a7062518f1d8fc53f" 110checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6"
111dependencies = [ 111dependencies = [
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]]
140name = "indoc" 138name = "indoc"
141version = "0.3.6" 139version = "1.0.6"
142source = "registry+https://github.com/rust-lang/crates.io-index"
143checksum = "47741a8bc60fb26eb8d6e0238bbb26d8575ff623fdc97b1a2c00c050b9684ed8"
144dependencies = [
145 "indoc-impl",
146 "proc-macro-hack",
147]
148
149[[package]]
150name = "indoc-impl"
151version = "0.3.6"
152source = "registry+https://github.com/rust-lang/crates.io-index"
153checksum = "ce046d161f000fffde5f432a0d034d0341dc152643b2598ed5bfce44c4f3a8f0"
154dependencies = [
155 "proc-macro-hack",
156 "proc-macro2",
157 "quote",
158 "syn",
159 "unindent",
160]
161
162[[package]]
163name = "instant"
164version = "0.1.12"
165source = "registry+https://github.com/rust-lang/crates.io-index" 140source = "registry+https://github.com/rust-lang/crates.io-index"
166checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" 141checksum = "05a0bd019339e5d968b37855180087b7b9d512c5046fbd244cf8c95687927d6e"
167dependencies = [
168 "cfg-if",
169]
170 142
171[[package]] 143[[package]]
172name = "itertools" 144name = "itertools"
@@ -179,16 +151,17 @@ dependencies = [
179 151
180[[package]] 152[[package]]
181name = "libc" 153name = "libc"
182version = "0.2.118" 154version = "0.2.126"
183source = "registry+https://github.com/rust-lang/crates.io-index" 155source = "registry+https://github.com/rust-lang/crates.io-index"
184checksum = "06e509672465a0504304aa87f9f176f2b2b716ed8fb105ebe5c02dc6dce96a94" 156checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836"
185 157
186[[package]] 158[[package]]
187name = "lock_api" 159name = "lock_api"
188version = "0.4.6" 160version = "0.4.7"
189source = "registry+https://github.com/rust-lang/crates.io-index" 161source = "registry+https://github.com/rust-lang/crates.io-index"
190checksum = "88943dd7ef4a2e5a4bfa2753aaab3013e34ce2533d1996fb18ef591e315e2b3b" 162checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53"
191dependencies = [ 163dependencies = [
164 "autocfg",
192 "scopeguard", 165 "scopeguard",
193] 166]
194 167
@@ -200,78 +173,62 @@ checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f"
200 173
201[[package]] 174[[package]]
202name = "memchr" 175name = "memchr"
203version = "2.4.1" 176version = "2.5.0"
204source = "registry+https://github.com/rust-lang/crates.io-index" 177source = "registry+https://github.com/rust-lang/crates.io-index"
205checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" 178checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
206 179
207[[package]] 180[[package]]
208name = "miniz_oxide" 181name = "miniz_oxide"
209version = "0.4.4" 182version = "0.5.3"
210source = "registry+https://github.com/rust-lang/crates.io-index" 183source = "registry+https://github.com/rust-lang/crates.io-index"
211checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" 184checksum = "6f5c75688da582b8ffc1f1799e9db273f32133c49e048f614d22ec3256773ccc"
212dependencies = [ 185dependencies = [
213 "adler", 186 "adler",
214 "autocfg",
215] 187]
216 188
217[[package]] 189[[package]]
218name = "num-traits" 190name = "num-traits"
219version = "0.2.14" 191version = "0.2.15"
220source = "registry+https://github.com/rust-lang/crates.io-index" 192source = "registry+https://github.com/rust-lang/crates.io-index"
221checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" 193checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd"
222dependencies = [ 194dependencies = [
223 "autocfg", 195 "autocfg",
224] 196]
225 197
226[[package]] 198[[package]]
227name = "once_cell" 199name = "once_cell"
228version = "1.9.0" 200version = "1.13.0"
229source = "registry+https://github.com/rust-lang/crates.io-index" 201source = "registry+https://github.com/rust-lang/crates.io-index"
230checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" 202checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1"
231 203
232[[package]] 204[[package]]
233name = "parking_lot" 205name = "parking_lot"
234version = "0.11.2" 206version = "0.12.1"
235source = "registry+https://github.com/rust-lang/crates.io-index" 207source = "registry+https://github.com/rust-lang/crates.io-index"
236checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" 208checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f"
237dependencies = [ 209dependencies = [
238 "instant",
239 "lock_api", 210 "lock_api",
240 "parking_lot_core", 211 "parking_lot_core",
241] 212]
242 213
243[[package]] 214[[package]]
244name = "parking_lot_core" 215name = "parking_lot_core"
245version = "0.8.5" 216version = "0.9.3"
246source = "registry+https://github.com/rust-lang/crates.io-index" 217source = "registry+https://github.com/rust-lang/crates.io-index"
247checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" 218checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929"
248dependencies = [ 219dependencies = [
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]]
258name = "paste" 228name = "paste"
259version = "0.1.18" 229version = "1.0.7"
260source = "registry+https://github.com/rust-lang/crates.io-index" 230source = "registry+https://github.com/rust-lang/crates.io-index"
261checksum = "45ca20c77d80be666aef2b45486da86238fabe33e38306bd3118fe4af33fa880" 231checksum = "0c520e05135d6e763148b6426a837e239041653ba7becd2e538c076c738025fc"
262dependencies = [
263 "paste-impl",
264 "proc-macro-hack",
265]
266
267[[package]]
268name = "paste-impl"
269version = "0.1.18"
270source = "registry+https://github.com/rust-lang/crates.io-index"
271checksum = "d95a7db200b97ef370c8e6de0088252f7e0dfff7d047a28528e47456c0fc98b6"
272dependencies = [
273 "proc-macro-hack",
274]
275 232
276[[package]] 233[[package]]
277name = "percent-encoding" 234name = "percent-encoding"
@@ -280,25 +237,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
280checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" 237checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e"
281 238
282[[package]] 239[[package]]
283name = "proc-macro-hack"
284version = "0.5.19"
285source = "registry+https://github.com/rust-lang/crates.io-index"
286checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5"
287
288[[package]]
289name = "proc-macro2" 240name = "proc-macro2"
290version = "1.0.36" 241version = "1.0.40"
291source = "registry+https://github.com/rust-lang/crates.io-index" 242source = "registry+https://github.com/rust-lang/crates.io-index"
292checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" 243checksum = "dd96a1e8ed2596c337f8eae5f24924ec83f5ad5ab21ea8e455d3566c69fbcaf7"
293dependencies = [ 244dependencies = [
294 "unicode-xid", 245 "unicode-ident",
295] 246]
296 247
297[[package]] 248[[package]]
298name = "psl" 249name = "psl"
299version = "2.0.71" 250version = "2.0.90"
300source = "registry+https://github.com/rust-lang/crates.io-index" 251source = "registry+https://github.com/rust-lang/crates.io-index"
301checksum = "2f51974f40b58fd94008d3c88fa47cf1c7a58bd4e85deb0d4390bc156b0a9625" 252checksum = "7e9c7d362659b525758d09e2a3ae965e371b347605e5fb2bc5bec5c2a1ecf41b"
302dependencies = [ 253dependencies = [
303 "psl-types", 254 "psl-types",
304] 255]
@@ -311,35 +262,47 @@ checksum = "e8eda7c62d9ecaafdf8b62374c006de0adf61666ae96a96ba74a37134aa4e470"
311 262
312[[package]] 263[[package]]
313name = "pyo3" 264name = "pyo3"
314version = "0.15.2" 265version = "0.16.5"
315source = "registry+https://github.com/rust-lang/crates.io-index" 266source = "registry+https://github.com/rust-lang/crates.io-index"
316checksum = "d41d50a7271e08c7c8a54cd24af5d62f73ee3a6f6a314215281ebdec421d5752" 267checksum = "1e6302e85060011447471887705bb7838f14aba43fcb06957d823739a496b3dc"
317dependencies = [ 268dependencies = [
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]]
329name = "pyo3-build-config" 280name = "pyo3-build-config"
330version = "0.15.2" 281version = "0.16.5"
331source = "registry+https://github.com/rust-lang/crates.io-index" 282source = "registry+https://github.com/rust-lang/crates.io-index"
332checksum = "779239fc40b8e18bc8416d3a37d280ca9b9fb04bda54b98037bb6748595c2410" 283checksum = "b5b65b546c35d8a3b1b2f0ddbac7c6a569d759f357f2b9df884f5d6b719152c8"
333dependencies = [ 284dependencies = [
334 "once_cell", 285 "once_cell",
286 "target-lexicon",
287]
288
289[[package]]
290name = "pyo3-ffi"
291version = "0.16.5"
292source = "registry+https://github.com/rust-lang/crates.io-index"
293checksum = "c275a07127c1aca33031a563e384ffdd485aee34ef131116fcd58e3430d1742b"
294dependencies = [
295 "libc",
296 "pyo3-build-config",
335] 297]
336 298
337[[package]] 299[[package]]
338name = "pyo3-macros" 300name = "pyo3-macros"
339version = "0.15.2" 301version = "0.16.5"
340source = "registry+https://github.com/rust-lang/crates.io-index" 302source = "registry+https://github.com/rust-lang/crates.io-index"
341checksum = "00b247e8c664be87998d8628e86f282c25066165f1f8dda66100c48202fdb93a" 303checksum = "284fc4485bfbcc9850a6d661d627783f18d19c2ab55880b021671c4ba83e90f7"
342dependencies = [ 304dependencies = [
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]]
349name = "pyo3-macros-backend" 312name = "pyo3-macros-backend"
350version = "0.15.2" 313version = "0.16.5"
351source = "registry+https://github.com/rust-lang/crates.io-index" 314source = "registry+https://github.com/rust-lang/crates.io-index"
352checksum = "5a8c2812c412e00e641d99eeb79dd478317d981d938aa60325dfa7157b607095" 315checksum = "53bda0f58f73f5c5429693c96ed57f7abdb38fdfc28ae06da4101a257adb7faf"
353dependencies = [ 316dependencies = [
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]]
361name = "quote" 323name = "quote"
362version = "1.0.15" 324version = "1.0.20"
363source = "registry+https://github.com/rust-lang/crates.io-index" 325source = "registry+https://github.com/rust-lang/crates.io-index"
364checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145" 326checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804"
365dependencies = [ 327dependencies = [
366 "proc-macro2", 328 "proc-macro2",
367] 329]
368 330
369[[package]] 331[[package]]
370name = "redox_syscall" 332name = "redox_syscall"
371version = "0.2.10" 333version = "0.2.13"
372source = "registry+https://github.com/rust-lang/crates.io-index" 334source = "registry+https://github.com/rust-lang/crates.io-index"
373checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" 335checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42"
374dependencies = [ 336dependencies = [
375 "bitflags", 337 "bitflags",
376] 338]
377 339
378[[package]] 340[[package]]
379name = "regex" 341name = "regex"
380version = "1.5.4" 342version = "1.6.0"
381source = "registry+https://github.com/rust-lang/crates.io-index" 343source = "registry+https://github.com/rust-lang/crates.io-index"
382checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" 344checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b"
383dependencies = [ 345dependencies = [
384 "aho-corasick", 346 "aho-corasick",
385 "memchr", 347 "memchr",
@@ -388,18 +350,19 @@ dependencies = [
388 350
389[[package]] 351[[package]]
390name = "regex-syntax" 352name = "regex-syntax"
391version = "0.6.25" 353version = "0.6.27"
392source = "registry+https://github.com/rust-lang/crates.io-index" 354source = "registry+https://github.com/rust-lang/crates.io-index"
393checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" 355checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244"
394 356
395[[package]] 357[[package]]
396name = "rmp" 358name = "rmp"
397version = "0.8.10" 359version = "0.8.11"
398source = "registry+https://github.com/rust-lang/crates.io-index" 360source = "registry+https://github.com/rust-lang/crates.io-index"
399checksum = "4f55e5fa1446c4d5dd1f5daeed2a4fe193071771a2636274d0d7a3b082aa7ad6" 361checksum = "44519172358fd6d58656c86ab8e7fbc9e1490c3e8f14d35ed78ca0dd07403c9f"
400dependencies = [ 362dependencies = [
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]]
440name = "serde" 403name = "serde"
441version = "1.0.136" 404version = "1.0.139"
442source = "registry+https://github.com/rust-lang/crates.io-index" 405source = "registry+https://github.com/rust-lang/crates.io-index"
443checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" 406checksum = "0171ebb889e45aa68b44aee0859b3eede84c6f5f5c228e6f140c0b2a0a46cad6"
444dependencies = [ 407dependencies = [
445 "serde_derive", 408 "serde_derive",
446] 409]
447 410
448[[package]] 411[[package]]
449name = "serde_derive" 412name = "serde_derive"
450version = "1.0.136" 413version = "1.0.139"
451source = "registry+https://github.com/rust-lang/crates.io-index" 414source = "registry+https://github.com/rust-lang/crates.io-index"
452checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" 415checksum = "dc1d3230c1de7932af58ad8ffbe1d784bd55efd5a9d84ac24f69c72d83543dfb"
453dependencies = [ 416dependencies = [
454 "proc-macro2", 417 "proc-macro2",
455 "quote", 418 "quote",
@@ -458,26 +421,32 @@ dependencies = [
458 421
459[[package]] 422[[package]]
460name = "smallvec" 423name = "smallvec"
461version = "1.8.0" 424version = "1.9.0"
462source = "registry+https://github.com/rust-lang/crates.io-index" 425source = "registry+https://github.com/rust-lang/crates.io-index"
463checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" 426checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1"
464 427
465[[package]] 428[[package]]
466name = "syn" 429name = "syn"
467version = "1.0.86" 430version = "1.0.98"
468source = "registry+https://github.com/rust-lang/crates.io-index" 431source = "registry+https://github.com/rust-lang/crates.io-index"
469checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b" 432checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd"
470dependencies = [ 433dependencies = [
471 "proc-macro2", 434 "proc-macro2",
472 "quote", 435 "quote",
473 "unicode-xid", 436 "unicode-ident",
474] 437]
475 438
476[[package]] 439[[package]]
440name = "target-lexicon"
441version = "0.12.4"
442source = "registry+https://github.com/rust-lang/crates.io-index"
443checksum = "c02424087780c9b71cc96799eaeddff35af2bc513278cda5c99fc1f5d026d3c1"
444
445[[package]]
477name = "tinyvec" 446name = "tinyvec"
478version = "1.5.1" 447version = "1.6.0"
479source = "registry+https://github.com/rust-lang/crates.io-index" 448source = "registry+https://github.com/rust-lang/crates.io-index"
480checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2" 449checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50"
481dependencies = [ 450dependencies = [
482 "tinyvec_macros", 451 "tinyvec_macros",
483] 452]
@@ -506,30 +475,30 @@ checksum = "eeba86d422ce181a719445e51872fa30f1f7413b62becb52e95ec91aa262d85c"
506 475
507[[package]] 476[[package]]
508name = "unicode-bidi" 477name = "unicode-bidi"
509version = "0.3.7" 478version = "0.3.8"
479source = "registry+https://github.com/rust-lang/crates.io-index"
480checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992"
481
482[[package]]
483name = "unicode-ident"
484version = "1.0.2"
510source = "registry+https://github.com/rust-lang/crates.io-index" 485source = "registry+https://github.com/rust-lang/crates.io-index"
511checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" 486checksum = "15c61ba63f9235225a22310255a29b806b907c9b8c964bcbd0a2c70f3f2deea7"
512 487
513[[package]] 488[[package]]
514name = "unicode-normalization" 489name = "unicode-normalization"
515version = "0.1.19" 490version = "0.1.21"
516source = "registry+https://github.com/rust-lang/crates.io-index" 491source = "registry+https://github.com/rust-lang/crates.io-index"
517checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" 492checksum = "854cbdc4f7bc6ae19c820d44abdc3277ac3e1b2b93db20a636825d9322fb60e6"
518dependencies = [ 493dependencies = [
519 "tinyvec", 494 "tinyvec",
520] 495]
521 496
522[[package]] 497[[package]]
523name = "unicode-xid"
524version = "0.2.2"
525source = "registry+https://github.com/rust-lang/crates.io-index"
526checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
527
528[[package]]
529name = "unindent" 498name = "unindent"
530version = "0.1.7" 499version = "0.1.9"
531source = "registry+https://github.com/rust-lang/crates.io-index" 500source = "registry+https://github.com/rust-lang/crates.io-index"
532checksum = "f14ee04d9415b52b3aeab06258a3f07093182b88ba0f9b8d203f211a7a7d41c7" 501checksum = "52fee519a3e570f7df377a06a1a7775cdbfb7aa460be7e08de2b1f0e69973a44"
533 502
534[[package]] 503[[package]]
535name = "url" 504name = "url"
@@ -544,23 +513,44 @@ dependencies = [
544] 513]
545 514
546[[package]] 515[[package]]
547name = "winapi" 516name = "windows-sys"
548version = "0.3.9" 517version = "0.36.1"
549source = "registry+https://github.com/rust-lang/crates.io-index" 518source = "registry+https://github.com/rust-lang/crates.io-index"
550checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 519checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2"
551dependencies = [ 520dependencies = [
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]]
557name = "winapi-i686-pc-windows-gnu" 529name = "windows_aarch64_msvc"
558version = "0.4.0" 530version = "0.36.1"
531source = "registry+https://github.com/rust-lang/crates.io-index"
532checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47"
533
534[[package]]
535name = "windows_i686_gnu"
536version = "0.36.1"
537source = "registry+https://github.com/rust-lang/crates.io-index"
538checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6"
539
540[[package]]
541name = "windows_i686_msvc"
542version = "0.36.1"
543source = "registry+https://github.com/rust-lang/crates.io-index"
544checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024"
545
546[[package]]
547name = "windows_x86_64_gnu"
548version = "0.36.1"
559source = "registry+https://github.com/rust-lang/crates.io-index" 549source = "registry+https://github.com/rust-lang/crates.io-index"
560checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 550checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1"
561 551
562[[package]] 552[[package]]
563name = "winapi-x86_64-pc-windows-gnu" 553name = "windows_x86_64_msvc"
564version = "0.4.0" 554version = "0.36.1"
565source = "registry+https://github.com/rust-lang/crates.io-index" 555source = "registry+https://github.com/rust-lang/crates.io-index"
566checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 556checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680"
diff --git a/Cargo.toml b/Cargo.toml
index 73d41e8..bf51c19 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -22,8 +22,8 @@ requires-python = ">=3.6"
22debug = true 22debug = true
23 23
24[dependencies] 24[dependencies]
25adblock = { version = "=0.4.3", default-features = false, features = ["full-regex-handling", "embedded-domain-resolver"] } 25adblock = { version = "=0.5.6", default-features = false, features = ["full-regex-handling", "embedded-domain-resolver"] }
26pyo3 = { version = "0.15", features = ["abi3-py36", "extension-module"] } 26pyo3 = { version = "0.16", features = ["abi3-py37", "extension-module"] }
27 27
28[lib] 28[lib]
29name = "adblock" 29name = "adblock"
diff --git a/README.md b/README.md
index 24be803..ee93431 100644
--- a/README.md
+++ b/README.md
@@ -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 @@
1from typing import Optional, Dict, List, Set 1from typing import Optional, Dict, List, Set
2 2
3__version__: str
4
3class AdblockException(Exception): 5class 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
diff --git a/src/lib.rs b/src/lib.rs
index 9117254..2d60293 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -16,8 +16,7 @@ use adblock::blocker::{BlockerError as RustBlockerError, Redirection};
16use adblock::cosmetic_filter_cache::UrlSpecificResources as RustUrlSpecificResources; 16use adblock::cosmetic_filter_cache::UrlSpecificResources as RustUrlSpecificResources;
17use adblock::engine::Engine as RustEngine; 17use adblock::engine::Engine as RustEngine;
18use adblock::lists::FilterSet as RustFilterSet; 18use adblock::lists::FilterSet as RustFilterSet;
19use adblock::lists::{FilterFormat, ParseOptions}; 19use adblock::lists::{FilterFormat, ParseOptions, RuleTypes};
20use pyo3::class::PyObjectProtocol;
21use pyo3::create_exception; 20use pyo3::create_exception;
22use pyo3::exceptions::PyException; 21use pyo3::exceptions::PyException;
23use pyo3::prelude::*; 22use pyo3::prelude::*;
@@ -145,8 +144,8 @@ impl From<RustBlockerResult> for BlockerResult {
145 } 144 }
146} 145}
147 146
148#[pyproto] 147#[pymethods]
149impl PyObjectProtocol for BlockerResult { 148impl 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
239fn 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]
317impl 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]
365impl PyObjectProtocol for UrlSpecificResources { 388impl 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]
668impl 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():
35def test_redirect_url_exception(): 35def 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
59def test_redirect_with_custom_resource(): 60def test_redirect_with_custom_resource():