urlpattern 0.1.0__tar.gz → 0.1.2__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.
@@ -0,0 +1,24 @@
1
+ // For format details, see https://aka.ms/devcontainer.json. For config options, see the
2
+ // README at: https://github.com/devcontainers/templates/tree/main/src/python
3
+ {
4
+ "name": "Python 3",
5
+ // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6
+ "image": "mcr.microsoft.com/devcontainers/python:1-3.12-bullseye",
7
+
8
+ // Features to add to the dev container. More info: https://containers.dev/features.
9
+ "features": {
10
+ "ghcr.io/devcontainers/features/rust:1": {}
11
+ },
12
+
13
+ // Use 'forwardPorts' to make a list of ports inside the container available locally.
14
+ // "forwardPorts": [],
15
+
16
+ // Use 'postCreateCommand' to run commands after the container is created.
17
+ "postCreateCommand": "pip3 install --user maturin pytest && python3 -m venv .venv"
18
+
19
+ // Configure tool-specific properties.
20
+ // "customizations": {},
21
+
22
+ // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
23
+ // "remoteUser": "root"
24
+ }
@@ -0,0 +1,12 @@
1
+ # To get started with Dependabot version updates, you'll need to specify which
2
+ # package ecosystems to update and where the package manifests are located.
3
+ # Please see the documentation for more information:
4
+ # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5
+ # https://containers.dev/guide/dependabot
6
+
7
+ version: 2
8
+ updates:
9
+ - package-ecosystem: "devcontainers"
10
+ directory: "/"
11
+ schedule:
12
+ interval: weekly
@@ -0,0 +1,13 @@
1
+ {
2
+ "python.testing.pytestArgs": [
3
+ "tests"
4
+ ],
5
+ "python.testing.unittestEnabled": false,
6
+ "python.testing.pytestEnabled": true,
7
+ "python.analysis.typeCheckingMode": "basic",
8
+ "python.analysis.autoImportCompletions": true,
9
+ "python.analysis.inlayHints.callArgumentNames": "partial",
10
+ "python.analysis.inlayHints.functionReturnTypes": true,
11
+ "python.analysis.inlayHints.pytestParameters": true,
12
+ "python.analysis.inlayHints.variableTypes": true
13
+ }
@@ -186,7 +186,7 @@ dependencies = [
186
186
 
187
187
  [[package]]
188
188
  name = "python-urlpattern"
189
- version = "0.1.0"
189
+ version = "0.1.2"
190
190
  dependencies = [
191
191
  "pyo3",
192
192
  "regex",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "python-urlpattern"
3
- version = "0.1.0"
3
+ version = "0.1.2"
4
4
  authors = ["방성범 (Bang Seongbeom) <bangseongbeom@gmail.com>"]
5
5
  edition = "2021"
6
6
  description = "An implementation of the URL Pattern Standard for Python written in Rust"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: urlpattern
3
- Version: 0.1.0
3
+ Version: 0.1.2
4
4
  Classifier: Development Status :: 4 - Beta
5
5
  Classifier: Intended Audience :: Developers
6
6
  Classifier: License :: OSI Approved :: MIT License
@@ -17,7 +17,7 @@ Classifier: Programming Language :: Python :: Implementation :: CPython
17
17
  Classifier: Programming Language :: Python :: Implementation :: PyPy
18
18
  Classifier: Topic :: Internet :: WWW/HTTP
19
19
  Classifier: Typing :: Typed
20
- License-File: LICENSE.txt
20
+ License-File: LICENSE
21
21
  Summary: An implementation of the URL Pattern Standard for Python written in Rust
22
22
  Keywords: urlpattern
23
23
  Author: 방성범 (Bang Seongbeom) <bangseongbeom@gmail.com>
@@ -31,6 +31,11 @@ Project-URL: Issues, https://github.com/urlpattern/python-urlpattern/issues
31
31
 
32
32
  # URL Pattern
33
33
 
34
+ [![PyPI - Version](https://img.shields.io/pypi/v/urlpattern)](https://pypi.org/project/urlpattern/)
35
+ [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/urlpattern)](https://pypi.org/project/urlpattern/)
36
+ [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
37
+ [![CI](https://github.com/urlpattern/python-urlpattern/actions/workflows/CI.yml/badge.svg)](https://github.com/urlpattern/python-urlpattern/actions)
38
+
34
39
  An implementation of [the URL Pattern Standard](https://urlpattern.spec.whatwg.org/) for Python written in Rust
35
40
 
36
41
  This is a thin wrapper of [denoland/rust-urlpattern](https://github.com/denoland/rust-urlpattern) with [PyO3](https://github.com/PyO3/pyo3) + [Maturin](https://github.com/PyO3/maturin).
@@ -54,7 +59,6 @@ py -m pip install urlpattern
54
59
  ```py
55
60
  from urlpattern import URLPattern
56
61
 
57
-
58
62
  pattern = URLPattern("https://example.com/*")
59
63
  print(pattern.test("https://example.com/foo/bar")) # output: True
60
64
 
@@ -64,6 +68,3 @@ print(result["pathname"]["groups"]["foo"]) # output: abc
64
68
  print(result["pathname"]["groups"]["bar"]) # output: def
65
69
  ```
66
70
 
67
- ## License
68
-
69
- [MIT License](/LICENSE)
@@ -1,5 +1,10 @@
1
1
  # URL Pattern
2
2
 
3
+ [![PyPI - Version](https://img.shields.io/pypi/v/urlpattern)](https://pypi.org/project/urlpattern/)
4
+ [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/urlpattern)](https://pypi.org/project/urlpattern/)
5
+ [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
6
+ [![CI](https://github.com/urlpattern/python-urlpattern/actions/workflows/CI.yml/badge.svg)](https://github.com/urlpattern/python-urlpattern/actions)
7
+
3
8
  An implementation of [the URL Pattern Standard](https://urlpattern.spec.whatwg.org/) for Python written in Rust
4
9
 
5
10
  This is a thin wrapper of [denoland/rust-urlpattern](https://github.com/denoland/rust-urlpattern) with [PyO3](https://github.com/PyO3/pyo3) + [Maturin](https://github.com/PyO3/maturin).
@@ -23,7 +28,6 @@ py -m pip install urlpattern
23
28
  ```py
24
29
  from urlpattern import URLPattern
25
30
 
26
-
27
31
  pattern = URLPattern("https://example.com/*")
28
32
  print(pattern.test("https://example.com/foo/bar")) # output: True
29
33
 
@@ -32,7 +36,3 @@ result = pattern.exec("/abc/def", "https://test.example")
32
36
  print(result["pathname"]["groups"]["foo"]) # output: abc
33
37
  print(result["pathname"]["groups"]["bar"]) # output: def
34
38
  ```
35
-
36
- ## License
37
-
38
- [MIT License](/LICENSE)
@@ -72,4 +72,5 @@ def test(entry):
72
72
  continue
73
73
 
74
74
  else:
75
+ assert result
75
76
  assert result[key] == entry["expected_match"][key]
@@ -4,12 +4,12 @@ URLPatternInput: TypeAlias = str | URLPatternInit
4
4
 
5
5
  class URLPattern:
6
6
  @overload
7
- def __init__(input: URLPatternInput, baseURL: str): ...
7
+ def __init__(self, input: URLPatternInput, baseURL: str): ...
8
8
  @overload
9
- def __init__(input: URLPatternInput = {}): ...
10
- def test(input: URLPatternInput = {}, baseURL: str | None = None) -> bool: ...
9
+ def __init__(self, input: URLPatternInput = {}): ...
10
+ def test(self, input: URLPatternInput = {}, baseURL: str | None = None) -> bool: ...
11
11
  def exec(
12
- input: URLPatternInput = {}, baseURL: str | None = None
12
+ self, input: URLPatternInput = {}, baseURL: str | None = None
13
13
  ) -> URLPatternResult | None: ...
14
14
  @property
15
15
  def protocol(self) -> str: ...
@@ -28,7 +28,7 @@ class URLPattern:
28
28
  @property
29
29
  def hash(self) -> str: ...
30
30
 
31
- class URLPatternInit(TypedDict):
31
+ class URLPatternInit(TypedDict, total=False):
32
32
  protocol: str
33
33
  username: str
34
34
  password: str
@@ -1,7 +0,0 @@
1
- {
2
- "python.testing.pytestArgs": [
3
- "tests"
4
- ],
5
- "python.testing.unittestEnabled": false,
6
- "python.testing.pytestEnabled": true
7
- }
File without changes
File without changes
File without changes