urlpattern 0.1.8__tar.gz → 0.1.10__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
- # This file is autogenerated by maturin v1.11.5
1
+ # This file is autogenerated by maturin v1.12.3
2
2
  # To update, run
3
3
  #
4
- # maturin generate-ci --pytest github
4
+ # maturin generate-ci github
5
5
  #
6
6
  name: CI
7
7
 
@@ -53,31 +53,6 @@ jobs:
53
53
  with:
54
54
  name: wheels-linux-${{ matrix.platform.target }}
55
55
  path: dist
56
- - name: pytest
57
- if: ${{ startsWith(matrix.platform.target, 'x86_64') }}
58
- shell: bash
59
- run: |
60
- set -e
61
- python3 -m venv .venv
62
- source .venv/bin/activate
63
- pip install urlpattern --find-links dist --force-reinstall
64
- pip install pytest
65
- pytest
66
- - name: pytest
67
- if: ${{ !startsWith(matrix.platform.target, 'x86') && matrix.platform.target != 'ppc64' }}
68
- uses: uraimo/run-on-arch-action@v2
69
- with:
70
- arch: ${{ matrix.platform.target }}
71
- distro: ubuntu22.04
72
- githubToken: ${{ github.token }}
73
- install: |
74
- apt-get update
75
- apt-get install -y --no-install-recommends python3 python3-pip
76
- pip3 install -U pip pytest
77
- run: |
78
- set -e
79
- pip3 install urlpattern --find-links dist --force-reinstall
80
- pytest
81
56
 
82
57
  musllinux:
83
58
  runs-on: ${{ matrix.platform.runner }}
@@ -109,36 +84,6 @@ jobs:
109
84
  with:
110
85
  name: wheels-musllinux-${{ matrix.platform.target }}
111
86
  path: dist
112
- - name: pytest
113
- if: ${{ startsWith(matrix.platform.target, 'x86_64') }}
114
- uses: addnab/docker-run-action@v3
115
- with:
116
- image: alpine:latest
117
- options: -v ${{ github.workspace }}:/io -w /io
118
- run: |
119
- set -e
120
- apk add py3-pip py3-virtualenv
121
- python3 -m virtualenv .venv
122
- source .venv/bin/activate
123
- pip install urlpattern --no-index --find-links dist --force-reinstall
124
- pip install pytest
125
- pytest
126
- - name: pytest
127
- if: ${{ !startsWith(matrix.platform.target, 'x86') }}
128
- uses: uraimo/run-on-arch-action@v2
129
- with:
130
- arch: ${{ matrix.platform.target }}
131
- distro: alpine_latest
132
- githubToken: ${{ github.token }}
133
- install: |
134
- apk add py3-virtualenv
135
- run: |
136
- set -e
137
- python3 -m virtualenv .venv
138
- source .venv/bin/activate
139
- pip install pytest
140
- pip install urlpattern --find-links dist --force-reinstall
141
- pytest
142
87
 
143
88
  windows:
144
89
  runs-on: ${{ matrix.platform.runner }}
@@ -171,15 +116,6 @@ jobs:
171
116
  with:
172
117
  name: wheels-windows-${{ matrix.platform.target }}
173
118
  path: dist
174
- - name: pytest
175
- shell: bash
176
- run: |
177
- set -e
178
- python3 -m venv .venv
179
- source .venv/Scripts/activate
180
- pip install urlpattern --find-links dist --force-reinstall
181
- pip install pytest
182
- pytest
183
119
 
184
120
  macos:
185
121
  runs-on: ${{ matrix.platform.runner }}
@@ -206,14 +142,6 @@ jobs:
206
142
  with:
207
143
  name: wheels-macos-${{ matrix.platform.target }}
208
144
  path: dist
209
- - name: pytest
210
- run: |
211
- set -e
212
- python3 -m venv .venv
213
- source .venv/bin/activate
214
- pip install urlpattern --find-links dist --force-reinstall
215
- pip install pytest
216
- pytest
217
145
 
218
146
  sdist:
219
147
  runs-on: ubuntu-latest
@@ -11,12 +11,6 @@ dependencies = [
11
11
  "memchr",
12
12
  ]
13
13
 
14
- [[package]]
15
- name = "autocfg"
16
- version = "1.5.0"
17
- source = "registry+https://github.com/rust-lang/crates.io-index"
18
- checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
19
-
20
14
  [[package]]
21
15
  name = "displaydoc"
22
16
  version = "0.2.5"
@@ -145,20 +139,11 @@ dependencies = [
145
139
  "icu_properties",
146
140
  ]
147
141
 
148
- [[package]]
149
- name = "indoc"
150
- version = "2.0.7"
151
- source = "registry+https://github.com/rust-lang/crates.io-index"
152
- checksum = "79cf5c93f93228cf8efb3ba362535fb11199ac548a09ce117c9b1adc3030d706"
153
- dependencies = [
154
- "rustversion",
155
- ]
156
-
157
142
  [[package]]
158
143
  name = "libc"
159
- version = "0.2.180"
144
+ version = "0.2.182"
160
145
  source = "registry+https://github.com/rust-lang/crates.io-index"
161
- checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc"
146
+ checksum = "6800badb6cb2082ffd7b6a67e6125bb39f18782f793520caee8cb8846be06112"
162
147
 
163
148
  [[package]]
164
149
  name = "litemap"
@@ -168,18 +153,9 @@ checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77"
168
153
 
169
154
  [[package]]
170
155
  name = "memchr"
171
- version = "2.7.6"
156
+ version = "2.8.0"
172
157
  source = "registry+https://github.com/rust-lang/crates.io-index"
173
- checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273"
174
-
175
- [[package]]
176
- name = "memoffset"
177
- version = "0.9.1"
178
- source = "registry+https://github.com/rust-lang/crates.io-index"
179
- checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a"
180
- dependencies = [
181
- "autocfg",
182
- ]
158
+ checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79"
183
159
 
184
160
  [[package]]
185
161
  name = "once_cell"
@@ -195,9 +171,9 @@ checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220"
195
171
 
196
172
  [[package]]
197
173
  name = "portable-atomic"
198
- version = "1.13.0"
174
+ version = "1.13.1"
199
175
  source = "registry+https://github.com/rust-lang/crates.io-index"
200
- checksum = "f89776e4d69bb58bc6993e99ffa1d11f228b839984854c7daeb5d37f87cbe950"
176
+ checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49"
201
177
 
202
178
  [[package]]
203
179
  name = "potential_utf"
@@ -219,35 +195,32 @@ dependencies = [
219
195
 
220
196
  [[package]]
221
197
  name = "pyo3"
222
- version = "0.27.2"
198
+ version = "0.28.2"
223
199
  source = "registry+https://github.com/rust-lang/crates.io-index"
224
- checksum = "ab53c047fcd1a1d2a8820fe84f05d6be69e9526be40cb03b73f86b6b03e6d87d"
200
+ checksum = "cf85e27e86080aafd5a22eae58a162e133a589551542b3e5cee4beb27e54f8e1"
225
201
  dependencies = [
226
- "indoc",
227
202
  "libc",
228
- "memoffset",
229
203
  "once_cell",
230
204
  "portable-atomic",
231
205
  "pyo3-build-config",
232
206
  "pyo3-ffi",
233
207
  "pyo3-macros",
234
- "unindent",
235
208
  ]
236
209
 
237
210
  [[package]]
238
211
  name = "pyo3-build-config"
239
- version = "0.27.2"
212
+ version = "0.28.2"
240
213
  source = "registry+https://github.com/rust-lang/crates.io-index"
241
- checksum = "b455933107de8642b4487ed26d912c2d899dec6114884214a0b3bb3be9261ea6"
214
+ checksum = "8bf94ee265674bf76c09fa430b0e99c26e319c945d96ca0d5a8215f31bf81cf7"
242
215
  dependencies = [
243
216
  "target-lexicon",
244
217
  ]
245
218
 
246
219
  [[package]]
247
220
  name = "pyo3-ffi"
248
- version = "0.27.2"
221
+ version = "0.28.2"
249
222
  source = "registry+https://github.com/rust-lang/crates.io-index"
250
- checksum = "1c85c9cbfaddf651b1221594209aed57e9e5cff63c4d11d1feead529b872a089"
223
+ checksum = "491aa5fc66d8059dd44a75f4580a2962c1862a1c2945359db36f6c2818b748dc"
251
224
  dependencies = [
252
225
  "libc",
253
226
  "pyo3-build-config",
@@ -255,9 +228,9 @@ dependencies = [
255
228
 
256
229
  [[package]]
257
230
  name = "pyo3-macros"
258
- version = "0.27.2"
231
+ version = "0.28.2"
259
232
  source = "registry+https://github.com/rust-lang/crates.io-index"
260
- checksum = "0a5b10c9bf9888125d917fb4d2ca2d25c8df94c7ab5a52e13313a07e050a3b02"
233
+ checksum = "f5d671734e9d7a43449f8480f8b38115df67bef8d21f76837fa75ee7aaa5e52e"
261
234
  dependencies = [
262
235
  "proc-macro2",
263
236
  "pyo3-macros-backend",
@@ -267,9 +240,9 @@ dependencies = [
267
240
 
268
241
  [[package]]
269
242
  name = "pyo3-macros-backend"
270
- version = "0.27.2"
243
+ version = "0.28.2"
271
244
  source = "registry+https://github.com/rust-lang/crates.io-index"
272
- checksum = "03b51720d314836e53327f5871d4c0cfb4fb37cc2c4a11cc71907a86342c40f9"
245
+ checksum = "22faaa1ce6c430a1f71658760497291065e6450d7b5dc2bcf254d49f66ee700a"
273
246
  dependencies = [
274
247
  "heck",
275
248
  "proc-macro2",
@@ -280,7 +253,7 @@ dependencies = [
280
253
 
281
254
  [[package]]
282
255
  name = "python-urlpattern"
283
- version = "0.1.8"
256
+ version = "0.1.10"
284
257
  dependencies = [
285
258
  "pyo3",
286
259
  "urlpattern",
@@ -297,9 +270,9 @@ dependencies = [
297
270
 
298
271
  [[package]]
299
272
  name = "regex"
300
- version = "1.12.2"
273
+ version = "1.12.3"
301
274
  source = "registry+https://github.com/rust-lang/crates.io-index"
302
- checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4"
275
+ checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276"
303
276
  dependencies = [
304
277
  "aho-corasick",
305
278
  "memchr",
@@ -309,9 +282,9 @@ dependencies = [
309
282
 
310
283
  [[package]]
311
284
  name = "regex-automata"
312
- version = "0.4.13"
285
+ version = "0.4.14"
313
286
  source = "registry+https://github.com/rust-lang/crates.io-index"
314
- checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c"
287
+ checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f"
315
288
  dependencies = [
316
289
  "aho-corasick",
317
290
  "memchr",
@@ -320,15 +293,9 @@ dependencies = [
320
293
 
321
294
  [[package]]
322
295
  name = "regex-syntax"
323
- version = "0.8.8"
296
+ version = "0.8.9"
324
297
  source = "registry+https://github.com/rust-lang/crates.io-index"
325
- checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58"
326
-
327
- [[package]]
328
- name = "rustversion"
329
- version = "1.0.22"
330
- source = "registry+https://github.com/rust-lang/crates.io-index"
331
- checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
298
+ checksum = "a96887878f22d7bad8a3b6dc5b7440e0ada9a245242924394987b21cf2210a4c"
332
299
 
333
300
  [[package]]
334
301
  name = "serde"
@@ -374,9 +341,9 @@ checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596"
374
341
 
375
342
  [[package]]
376
343
  name = "syn"
377
- version = "2.0.114"
344
+ version = "2.0.117"
378
345
  source = "registry+https://github.com/rust-lang/crates.io-index"
379
- checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a"
346
+ checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99"
380
347
  dependencies = [
381
348
  "proc-macro2",
382
349
  "quote",
@@ -396,9 +363,9 @@ dependencies = [
396
363
 
397
364
  [[package]]
398
365
  name = "target-lexicon"
399
- version = "0.13.4"
366
+ version = "0.13.5"
400
367
  source = "registry+https://github.com/rust-lang/crates.io-index"
401
- checksum = "b1dd07eb858a2067e2f3c7155d54e929265c264e6f37efe3ee7a8d1b5a1dd0ba"
368
+ checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca"
402
369
 
403
370
  [[package]]
404
371
  name = "tinystr"
@@ -412,15 +379,9 @@ dependencies = [
412
379
 
413
380
  [[package]]
414
381
  name = "unicode-ident"
415
- version = "1.0.22"
416
- source = "registry+https://github.com/rust-lang/crates.io-index"
417
- checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5"
418
-
419
- [[package]]
420
- name = "unindent"
421
- version = "0.2.4"
382
+ version = "1.0.24"
422
383
  source = "registry+https://github.com/rust-lang/crates.io-index"
423
- checksum = "7264e107f553ccae879d21fbea1d6724ac785e8c3bfc762137959b5802826ef3"
384
+ checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
424
385
 
425
386
  [[package]]
426
387
  name = "url"
@@ -436,9 +397,9 @@ dependencies = [
436
397
 
437
398
  [[package]]
438
399
  name = "urlpattern"
439
- version = "0.5.2"
400
+ version = "0.6.0"
440
401
  source = "registry+https://github.com/rust-lang/crates.io-index"
441
- checksum = "37ffe0983283c841b6c6e9f116833a0061cc690c0eb67994d65bbdfa5cd3f24e"
402
+ checksum = "df16f50ef4cc145211879a3867ba757076b25dfee812040dcb0658bd9ae7904b"
442
403
  dependencies = [
443
404
  "icu_properties",
444
405
  "regex",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "python-urlpattern"
3
- version = "0.1.8"
3
+ version = "0.1.10"
4
4
  authors = ["방성범 (Bang Seongbeom) <bangseongbeom@gmail.com>"]
5
5
  edition = "2024"
6
6
  description = "An implementation of the URL Pattern Standard for Python written in Rust."
@@ -15,5 +15,5 @@ readme = "README.md"
15
15
  crate-type = ["cdylib"]
16
16
 
17
17
  [dependencies]
18
- pyo3 = "0.27.2"
19
- deno_urlpattern = { package = "urlpattern", version = "0.5.2" }
18
+ pyo3 = "0.28.2"
19
+ deno_urlpattern = { package = "urlpattern", version = "0.6.0" }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: urlpattern
3
- Version: 0.1.8
3
+ Version: 0.1.10
4
4
  Classifier: Development Status :: 4 - Beta
5
5
  Classifier: Intended Audience :: Developers
6
6
  Classifier: License :: OSI Approved :: MIT License
@@ -94,9 +94,12 @@ print(result["pathname"]["groups"]["id"]) # output: 4163
94
94
  ```py
95
95
  from urlpattern import URLPattern
96
96
 
97
- pattern = URLPattern({"pathname": "/admin/*"}, "https://example.com")
98
- print(pattern.test({"pathname": "/admin/main/"}, "https://example.com")) # output: True
99
- print(pattern.test("/admin/main/", "https://example.com")) # output: True
97
+ pattern = URLPattern("b", "https://example.com/a/")
98
+ print(pattern.test("a/b", "https://example.com/")) # output: True
99
+ print(pattern.test("b", "https://example.com/a/")) # output: True
100
+ print(
101
+ pattern.test({"pathname": "b", "baseURL": "https://example.com/a/"})
102
+ ) # output: True
100
103
  ```
101
104
 
102
105
  ### `ignoreCase`
@@ -62,9 +62,12 @@ print(result["pathname"]["groups"]["id"]) # output: 4163
62
62
  ```py
63
63
  from urlpattern import URLPattern
64
64
 
65
- pattern = URLPattern({"pathname": "/admin/*"}, "https://example.com")
66
- print(pattern.test({"pathname": "/admin/main/"}, "https://example.com")) # output: True
67
- print(pattern.test("/admin/main/", "https://example.com")) # output: True
65
+ pattern = URLPattern("b", "https://example.com/a/")
66
+ print(pattern.test("a/b", "https://example.com/")) # output: True
67
+ print(pattern.test("b", "https://example.com/a/")) # output: True
68
+ print(
69
+ pattern.test({"pathname": "b", "baseURL": "https://example.com/a/"})
70
+ ) # output: True
68
71
  ```
69
72
 
70
73
  ### `ignoreCase`
@@ -1,5 +1,6 @@
1
1
  #![allow(non_snake_case)]
2
2
 
3
+ use std::borrow::Cow;
3
4
  use std::collections::HashMap;
4
5
 
5
6
  use pyo3::{
@@ -201,13 +202,13 @@ pub enum UrlPatternInput<'py> {
201
202
  Init(Bound<'py, PyDict>),
202
203
  }
203
204
 
204
- impl<'py> TryFrom<UrlPatternInput<'py>> for deno_urlpattern::quirks::StringOrInit {
205
+ impl<'py> TryFrom<UrlPatternInput<'py>> for deno_urlpattern::quirks::StringOrInit<'static> {
205
206
  type Error = pyo3::PyErr;
206
207
 
207
208
  fn try_from(input: UrlPatternInput<'py>) -> Result<Self, Self::Error> {
208
209
  Ok(match input {
209
210
  UrlPatternInput::String(pattern) => {
210
- deno_urlpattern::quirks::StringOrInit::String(pattern)
211
+ deno_urlpattern::quirks::StringOrInit::String(Cow::Owned(pattern))
211
212
  }
212
213
  UrlPatternInput::Init(init) => deno_urlpattern::quirks::StringOrInit::Init(
213
214
  deno_urlpattern::quirks::UrlPatternInit {
@@ -254,7 +255,10 @@ impl<'py> TryFrom<UrlPatternInput<'py>> for deno_urlpattern::quirks::StringOrIni
254
255
  }
255
256
 
256
257
  pub struct UrlPatternResult {
257
- pub inputs: (deno_urlpattern::quirks::StringOrInit, Option<String>),
258
+ pub inputs: (
259
+ deno_urlpattern::quirks::StringOrInit<'static>,
260
+ Option<String>,
261
+ ),
258
262
  pub protocol: UrlPatternComponentResult,
259
263
  pub username: UrlPatternComponentResult,
260
264
  pub password: UrlPatternComponentResult,
@@ -278,7 +282,7 @@ impl<'py> IntoPyObject<'py> for UrlPatternResult {
278
282
 
279
283
  match string_or_init {
280
284
  deno_urlpattern::quirks::StringOrInit::String(string) => {
281
- list.append(string).unwrap();
285
+ list.append(string.into_owned()).unwrap();
282
286
  }
283
287
  deno_urlpattern::quirks::StringOrInit::Init(init) => {
284
288
  let init_dict = PyDict::new(py);
@@ -353,7 +357,7 @@ impl From<deno_urlpattern::Error> for Error {
353
357
  }
354
358
 
355
359
  /// A Python module implemented in Rust.
356
- #[pymodule(gil_used = false)]
360
+ #[pymodule]
357
361
  mod urlpattern {
358
362
  #[pymodule_export]
359
363
  use super::UrlPattern;
File without changes
File without changes
File without changes
File without changes