urlpattern 0.1.10__tar.gz → 0.2.0__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.
- urlpattern-0.2.0/.vscode/settings.json +12 -0
- {urlpattern-0.1.10 → urlpattern-0.2.0}/Cargo.lock +16 -16
- {urlpattern-0.1.10 → urlpattern-0.2.0}/Cargo.toml +3 -3
- {urlpattern-0.1.10 → urlpattern-0.2.0}/PKG-INFO +2 -2
- {urlpattern-0.1.10 → urlpattern-0.2.0}/README.md +1 -1
- {urlpattern-0.1.10 → urlpattern-0.2.0}/src/lib.rs +6 -0
- {urlpattern-0.1.10 → urlpattern-0.2.0}/tests/test_lib.py +1 -1
- {urlpattern-0.1.10 → urlpattern-0.2.0}/tests/urlpatterntestdata.json +36 -0
- {urlpattern-0.1.10 → urlpattern-0.2.0}/urlpattern.pyi +2 -0
- urlpattern-0.1.10/.vscode/settings.json +0 -8
- {urlpattern-0.1.10 → urlpattern-0.2.0}/.devcontainer/devcontainer.json +0 -0
- {urlpattern-0.1.10 → urlpattern-0.2.0}/.github/dependabot.yml +0 -0
- {urlpattern-0.1.10 → urlpattern-0.2.0}/.github/workflows/CI.yml +0 -0
- {urlpattern-0.1.10 → urlpattern-0.2.0}/.gitignore +0 -0
- {urlpattern-0.1.10 → urlpattern-0.2.0}/.vscode/extensions.json +0 -0
- {urlpattern-0.1.10 → urlpattern-0.2.0}/LICENSE +0 -0
- {urlpattern-0.1.10 → urlpattern-0.2.0}/pyproject.toml +0 -0
- {urlpattern-0.1.10 → urlpattern-0.2.0}/tests/__init__.py +0 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"python.defaultInterpreterPath": "${workspaceFolder}/.venv",
|
|
3
|
+
"python.testing.pytestArgs": [
|
|
4
|
+
"tests"
|
|
5
|
+
],
|
|
6
|
+
"python.testing.unittestEnabled": false,
|
|
7
|
+
"python.testing.pytestEnabled": true,
|
|
8
|
+
"[python]": {
|
|
9
|
+
"editor.formatOnSave": true,
|
|
10
|
+
"editor.defaultFormatter": "charliermarsh.ruff"
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -141,9 +141,9 @@ dependencies = [
|
|
|
141
141
|
|
|
142
142
|
[[package]]
|
|
143
143
|
name = "libc"
|
|
144
|
-
version = "0.2.
|
|
144
|
+
version = "0.2.183"
|
|
145
145
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
146
|
-
checksum = "
|
|
146
|
+
checksum = "b5b646652bf6661599e1da8901b3b9522896f01e736bad5f723fe7a3a27f899d"
|
|
147
147
|
|
|
148
148
|
[[package]]
|
|
149
149
|
name = "litemap"
|
|
@@ -159,9 +159,9 @@ checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79"
|
|
|
159
159
|
|
|
160
160
|
[[package]]
|
|
161
161
|
name = "once_cell"
|
|
162
|
-
version = "1.21.
|
|
162
|
+
version = "1.21.4"
|
|
163
163
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
164
|
-
checksum = "
|
|
164
|
+
checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
|
|
165
165
|
|
|
166
166
|
[[package]]
|
|
167
167
|
name = "percent-encoding"
|
|
@@ -251,19 +251,11 @@ dependencies = [
|
|
|
251
251
|
"syn",
|
|
252
252
|
]
|
|
253
253
|
|
|
254
|
-
[[package]]
|
|
255
|
-
name = "python-urlpattern"
|
|
256
|
-
version = "0.1.10"
|
|
257
|
-
dependencies = [
|
|
258
|
-
"pyo3",
|
|
259
|
-
"urlpattern",
|
|
260
|
-
]
|
|
261
|
-
|
|
262
254
|
[[package]]
|
|
263
255
|
name = "quote"
|
|
264
|
-
version = "1.0.
|
|
256
|
+
version = "1.0.45"
|
|
265
257
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
266
|
-
checksum = "
|
|
258
|
+
checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924"
|
|
267
259
|
dependencies = [
|
|
268
260
|
"proc-macro2",
|
|
269
261
|
]
|
|
@@ -293,9 +285,9 @@ dependencies = [
|
|
|
293
285
|
|
|
294
286
|
[[package]]
|
|
295
287
|
name = "regex-syntax"
|
|
296
|
-
version = "0.8.
|
|
288
|
+
version = "0.8.10"
|
|
297
289
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
298
|
-
checksum = "
|
|
290
|
+
checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a"
|
|
299
291
|
|
|
300
292
|
[[package]]
|
|
301
293
|
name = "serde"
|
|
@@ -395,6 +387,14 @@ dependencies = [
|
|
|
395
387
|
"serde",
|
|
396
388
|
]
|
|
397
389
|
|
|
390
|
+
[[package]]
|
|
391
|
+
name = "urlpattern"
|
|
392
|
+
version = "0.2.0"
|
|
393
|
+
dependencies = [
|
|
394
|
+
"pyo3",
|
|
395
|
+
"urlpattern 0.6.0",
|
|
396
|
+
]
|
|
397
|
+
|
|
398
398
|
[[package]]
|
|
399
399
|
name = "urlpattern"
|
|
400
400
|
version = "0.6.0"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[package]
|
|
2
|
-
name = "
|
|
3
|
-
version = "0.
|
|
2
|
+
name = "urlpattern"
|
|
3
|
+
version = "0.2.0"
|
|
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."
|
|
@@ -16,4 +16,4 @@ crate-type = ["cdylib"]
|
|
|
16
16
|
|
|
17
17
|
[dependencies]
|
|
18
18
|
pyo3 = "0.28.2"
|
|
19
|
-
|
|
19
|
+
deno-urlpattern = { version = "0.6.0", package = "urlpattern" }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: urlpattern
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Classifier: Development Status :: 4 - Beta
|
|
5
5
|
Classifier: Intended Audience :: Developers
|
|
6
6
|
Classifier: License :: OSI Approved :: MIT License
|
|
@@ -30,7 +30,7 @@ Project-URL: Homepage, https://github.com/urlpattern/python-urlpattern
|
|
|
30
30
|
Project-URL: Issues, https://github.com/urlpattern/python-urlpattern/issues
|
|
31
31
|
Project-URL: Repository, https://github.com/urlpattern/python-urlpattern.git
|
|
32
32
|
|
|
33
|
-
#
|
|
33
|
+
# urlpattern
|
|
34
34
|
|
|
35
35
|
[](https://pypi.org/project/urlpattern/)
|
|
36
36
|
[](https://pypi.org/project/urlpattern/)
|
|
@@ -76,6 +76,7 @@ impl UrlPattern {
|
|
|
76
76
|
dict.set_item("pathname", self.0.pathname()).unwrap();
|
|
77
77
|
dict.set_item("search", self.0.search()).unwrap();
|
|
78
78
|
dict.set_item("hash", self.0.hash()).unwrap();
|
|
79
|
+
dict.set_item("hasRegExpGroups", self.0.has_regexp_groups()).unwrap();
|
|
79
80
|
format!("URLPattern({})", dict)
|
|
80
81
|
}
|
|
81
82
|
|
|
@@ -194,6 +195,11 @@ impl UrlPattern {
|
|
|
194
195
|
pub fn get_hash(&self) -> PyResult<&str> {
|
|
195
196
|
Ok(self.0.hash())
|
|
196
197
|
}
|
|
198
|
+
|
|
199
|
+
#[getter]
|
|
200
|
+
pub fn get_hasRegExpGroups(&self) -> PyResult<bool> {
|
|
201
|
+
Ok(self.0.has_regexp_groups())
|
|
202
|
+
}
|
|
197
203
|
}
|
|
198
204
|
|
|
199
205
|
#[derive(FromPyObject)]
|
|
@@ -19,7 +19,7 @@ urlpatterntestdata = json.loads(
|
|
|
19
19
|
|
|
20
20
|
@pytest.mark.parametrize("entry", urlpatterntestdata)
|
|
21
21
|
def test(entry):
|
|
22
|
-
if entry["pattern"] == [{"pathname": "*{}**?"}]:
|
|
22
|
+
if entry["pattern"] == [{"pathname": "*{}**?"}] or entry["pattern"] == ["((?R)):"]:
|
|
23
23
|
pytest.skip("unsupported in the implementation")
|
|
24
24
|
|
|
25
25
|
if entry.get("expected_obj") == "error":
|
|
@@ -3118,5 +3118,41 @@
|
|
|
3118
3118
|
"expected_match": {
|
|
3119
3119
|
"hostname": { "input": "localhost", "groups": { "domain" : "localhost"} }
|
|
3120
3120
|
}
|
|
3121
|
+
},
|
|
3122
|
+
{
|
|
3123
|
+
"pattern": ["((?R)):"],
|
|
3124
|
+
"expected_obj": "error"
|
|
3125
|
+
},
|
|
3126
|
+
{
|
|
3127
|
+
"pattern": ["(\\H):"],
|
|
3128
|
+
"expected_obj": "error"
|
|
3129
|
+
},
|
|
3130
|
+
{
|
|
3131
|
+
"pattern": [
|
|
3132
|
+
{"pathname": "/:foo((?<x>a))"}
|
|
3133
|
+
],
|
|
3134
|
+
"inputs": [
|
|
3135
|
+
{"pathname": "/a"}
|
|
3136
|
+
],
|
|
3137
|
+
"expected_match": {
|
|
3138
|
+
"pathname": {
|
|
3139
|
+
"input": "/a",
|
|
3140
|
+
"groups": {"foo": "a"}
|
|
3141
|
+
}
|
|
3142
|
+
}
|
|
3143
|
+
},
|
|
3144
|
+
{
|
|
3145
|
+
"pattern": [
|
|
3146
|
+
{"pathname": "/foo/(bar(?<x>baz))"}
|
|
3147
|
+
],
|
|
3148
|
+
"inputs": [
|
|
3149
|
+
{"pathname": "/foo/barbaz"}
|
|
3150
|
+
],
|
|
3151
|
+
"expected_match": {
|
|
3152
|
+
"pathname": {
|
|
3153
|
+
"input": "/foo/barbaz",
|
|
3154
|
+
"groups": {"0": "barbaz"}
|
|
3155
|
+
}
|
|
3156
|
+
}
|
|
3121
3157
|
}
|
|
3122
3158
|
]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|