http-router 4.1.2__tar.gz → 5.0.8__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.
Files changed (21) hide show
  1. {http-router-4.1.2 → http_router-5.0.8}/PKG-INFO +5 -5
  2. {http-router-4.1.2 → http_router-5.0.8}/README.rst +1 -1
  3. {http-router-4.1.2 → http_router-5.0.8}/http_router/router.py +7 -10
  4. {http-router-4.1.2 → http_router-5.0.8}/http_router/routes.py +2 -2
  5. {http-router-4.1.2 → http_router-5.0.8}/http_router/utils.py +3 -3
  6. {http-router-4.1.2 → http_router-5.0.8}/http_router.egg-info/PKG-INFO +5 -5
  7. {http-router-4.1.2 → http_router-5.0.8}/http_router.egg-info/requires.txt +1 -3
  8. {http-router-4.1.2 → http_router-5.0.8}/pyproject.toml +6 -6
  9. {http-router-4.1.2 → http_router-5.0.8}/http_router/__init__.py +0 -0
  10. {http-router-4.1.2 → http_router-5.0.8}/http_router/exceptions.py +0 -0
  11. {http-router-4.1.2 → http_router-5.0.8}/http_router/py.typed +0 -0
  12. {http-router-4.1.2 → http_router-5.0.8}/http_router/router.pxd +0 -0
  13. {http-router-4.1.2 → http_router-5.0.8}/http_router/router.pyx +0 -0
  14. {http-router-4.1.2 → http_router-5.0.8}/http_router/routes.pxd +0 -0
  15. {http-router-4.1.2 → http_router-5.0.8}/http_router/routes.pyx +0 -0
  16. {http-router-4.1.2 → http_router-5.0.8}/http_router/types.py +0 -0
  17. {http-router-4.1.2 → http_router-5.0.8}/http_router.egg-info/SOURCES.txt +0 -0
  18. {http-router-4.1.2 → http_router-5.0.8}/http_router.egg-info/dependency_links.txt +0 -0
  19. {http-router-4.1.2 → http_router-5.0.8}/http_router.egg-info/top_level.txt +0 -0
  20. {http-router-4.1.2 → http_router-5.0.8}/setup.cfg +0 -0
  21. {http-router-4.1.2 → http_router-5.0.8}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: http-router
3
- Version: 4.1.2
3
+ Version: 5.0.8
4
4
  Summary: A simple router system for HTTP applications
5
5
  Author-email: Kirill Klenov <horneds@gmail.com>
6
6
  License: MIT License
@@ -13,15 +13,15 @@ Classifier: Intended Audience :: Developers
13
13
  Classifier: License :: OSI Approved :: MIT License
14
14
  Classifier: Programming Language :: Python
15
15
  Classifier: Programming Language :: Python :: 3
16
- Classifier: Programming Language :: Python :: 3.8
17
16
  Classifier: Programming Language :: Python :: 3.9
18
17
  Classifier: Programming Language :: Python :: 3.10
19
18
  Classifier: Programming Language :: Python :: 3.11
20
19
  Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
21
  Classifier: Programming Language :: Python :: Implementation :: PyPy
22
22
  Classifier: Programming Language :: Cython
23
23
  Classifier: Topic :: Internet :: WWW/HTTP
24
- Requires-Python: >=3.8
24
+ Requires-Python: >=3.9
25
25
  Description-Content-Type: text/x-rst
26
26
  Provides-Extra: tests
27
27
  Requires-Dist: ruff; extra == "tests"
@@ -30,8 +30,8 @@ Requires-Dist: pytest-benchmark; extra == "tests"
30
30
  Requires-Dist: pytest-mypy; implementation_name == "cpython" and extra == "tests"
31
31
  Provides-Extra: dev
32
32
  Requires-Dist: bump2version; extra == "dev"
33
- Requires-Dist: refurb; python_version >= "3.9" and extra == "dev"
34
33
  Requires-Dist: tox; extra == "dev"
34
+ Requires-Dist: pre-commit; extra == "dev"
35
35
 
36
36
  HTTP Router
37
37
  ###########
@@ -67,7 +67,7 @@ The main goal of the library to bind targets to http routes and match them.
67
67
  Requirements
68
68
  =============
69
69
 
70
- - python 3.8, 3.9, 3.10, 3.11, 3.12, pypy3
70
+ - python 3.9, 3.10, 3.11, 3.12, 3.13, pypy3
71
71
 
72
72
 
73
73
  .. _installation:
@@ -32,7 +32,7 @@ The main goal of the library to bind targets to http routes and match them.
32
32
  Requirements
33
33
  =============
34
34
 
35
- - python 3.8, 3.9, 3.10, 3.11, 3.12, pypy3
35
+ - python 3.9, 3.10, 3.11, 3.12, 3.13, pypy3
36
36
 
37
37
 
38
38
  .. _installation:
@@ -7,10 +7,7 @@ from typing import (
7
7
  Any,
8
8
  Callable,
9
9
  ClassVar,
10
- DefaultDict,
11
- List,
12
10
  Optional,
13
- Type,
14
11
  )
15
12
 
16
13
  from .exceptions import InvalidMethodError, NotFoundError, RouterError
@@ -23,9 +20,9 @@ if TYPE_CHECKING:
23
20
  class Router:
24
21
  """Route HTTP queries."""
25
22
 
26
- NotFoundError: ClassVar[Type[Exception]] = NotFoundError
27
- RouterError: ClassVar[Type[Exception]] = RouterError
28
- InvalidMethodError: ClassVar[Type[Exception]] = InvalidMethodError
23
+ NotFoundError: ClassVar[type[Exception]] = NotFoundError
24
+ RouterError: ClassVar[type[Exception]] = RouterError
25
+ InvalidMethodError: ClassVar[type[Exception]] = InvalidMethodError
29
26
 
30
27
  def __init__(
31
28
  self,
@@ -44,8 +41,8 @@ class Router:
44
41
  self.trim_last_slash = trim_last_slash
45
42
  self.validator = validator or (lambda _: True)
46
43
  self.converter = converter or (lambda v: v)
47
- self.plain: DefaultDict[str, List[Route]] = defaultdict(list)
48
- self.dynamic: List[Route] = []
44
+ self.plain: defaultdict[str, list[Route]] = defaultdict(list)
45
+ self.dynamic: list[Route] = []
49
46
 
50
47
  def __call__(self, path: str, method: str = "GET") -> RouteMatch:
51
48
  """Found a target for the given path and method."""
@@ -90,7 +87,7 @@ class Router:
90
87
  *paths: TPath,
91
88
  methods: Optional[TMethodsArg] = None,
92
89
  **opts,
93
- ) -> List[Route]:
90
+ ) -> list[Route]:
94
91
  """Bind a target to self."""
95
92
  if opts:
96
93
  target = partial(target, **opts)
@@ -150,7 +147,7 @@ class Router:
150
147
 
151
148
  return wrapper
152
149
 
153
- def routes(self) -> List[Route]:
150
+ def routes(self) -> list[Route]:
154
151
  """Get a list of self routes."""
155
152
  return sorted(
156
153
  self.dynamic + [r for routes in self.plain.values() for r in routes],
@@ -1,6 +1,6 @@
1
1
  from __future__ import annotations
2
2
 
3
- from typing import TYPE_CHECKING, Any, Callable, Dict, Mapping, Optional, Pattern, cast
3
+ from typing import TYPE_CHECKING, Any, Callable, Mapping, Optional, Pattern, cast
4
4
  from urllib.parse import unquote
5
5
 
6
6
  from .router import Router
@@ -69,7 +69,7 @@ class DynamicRoute(Route):
69
69
  methods: Optional[TMethods] = None,
70
70
  target: Any = None,
71
71
  pattern: Optional[Pattern] = None,
72
- params: Optional[Dict] = None,
72
+ params: Optional[dict] = None,
73
73
  ):
74
74
  if pattern is None:
75
75
  path, pattern, params = parse_path(path)
@@ -1,7 +1,7 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  import re
4
- from typing import TYPE_CHECKING, Dict, Optional, Pattern, Tuple
4
+ from typing import TYPE_CHECKING, Optional, Pattern
5
5
  from uuid import UUID
6
6
 
7
7
  if TYPE_CHECKING:
@@ -24,13 +24,13 @@ VAR_TYPES = {
24
24
  }
25
25
 
26
26
 
27
- def parse_path(path: TPath) -> Tuple[str, Optional[Pattern], Dict[str, Callable]]:
27
+ def parse_path(path: TPath) -> tuple[str, Optional[Pattern], dict[str, Callable]]:
28
28
  """Prepare the given path to regexp it."""
29
29
  if isinstance(path, Pattern):
30
30
  return path.pattern, path, {}
31
31
 
32
32
  src, regex, path = path.strip(" "), "^", ""
33
- params: Dict[str, Callable] = {}
33
+ params: dict[str, Callable] = {}
34
34
  idx, cur, group = 0, 0, None
35
35
  while cur < len(src):
36
36
  sym = src[cur]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: http-router
3
- Version: 4.1.2
3
+ Version: 5.0.8
4
4
  Summary: A simple router system for HTTP applications
5
5
  Author-email: Kirill Klenov <horneds@gmail.com>
6
6
  License: MIT License
@@ -13,15 +13,15 @@ Classifier: Intended Audience :: Developers
13
13
  Classifier: License :: OSI Approved :: MIT License
14
14
  Classifier: Programming Language :: Python
15
15
  Classifier: Programming Language :: Python :: 3
16
- Classifier: Programming Language :: Python :: 3.8
17
16
  Classifier: Programming Language :: Python :: 3.9
18
17
  Classifier: Programming Language :: Python :: 3.10
19
18
  Classifier: Programming Language :: Python :: 3.11
20
19
  Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
21
  Classifier: Programming Language :: Python :: Implementation :: PyPy
22
22
  Classifier: Programming Language :: Cython
23
23
  Classifier: Topic :: Internet :: WWW/HTTP
24
- Requires-Python: >=3.8
24
+ Requires-Python: >=3.9
25
25
  Description-Content-Type: text/x-rst
26
26
  Provides-Extra: tests
27
27
  Requires-Dist: ruff; extra == "tests"
@@ -30,8 +30,8 @@ Requires-Dist: pytest-benchmark; extra == "tests"
30
30
  Requires-Dist: pytest-mypy; implementation_name == "cpython" and extra == "tests"
31
31
  Provides-Extra: dev
32
32
  Requires-Dist: bump2version; extra == "dev"
33
- Requires-Dist: refurb; python_version >= "3.9" and extra == "dev"
34
33
  Requires-Dist: tox; extra == "dev"
34
+ Requires-Dist: pre-commit; extra == "dev"
35
35
 
36
36
  HTTP Router
37
37
  ###########
@@ -67,7 +67,7 @@ The main goal of the library to bind targets to http routes and match them.
67
67
  Requirements
68
68
  =============
69
69
 
70
- - python 3.8, 3.9, 3.10, 3.11, 3.12, pypy3
70
+ - python 3.9, 3.10, 3.11, 3.12, 3.13, pypy3
71
71
 
72
72
 
73
73
  .. _installation:
@@ -2,9 +2,7 @@
2
2
  [dev]
3
3
  bump2version
4
4
  tox
5
-
6
- [dev:python_version >= "3.9"]
7
- refurb
5
+ pre-commit
8
6
 
9
7
  [tests]
10
8
  ruff
@@ -3,10 +3,10 @@ requires = ["setuptools", "wheel", "Cython"]
3
3
 
4
4
  [project]
5
5
  name = "http-router"
6
- version = "4.1.2"
6
+ version = "5.0.8"
7
7
  description = "A simple router system for HTTP applications"
8
8
  readme = "README.rst"
9
- requires-python = ">=3.8"
9
+ requires-python = ">=3.9"
10
10
  license = { "text" = "MIT License" }
11
11
  authors = [{ name = "Kirill Klenov", email = "horneds@gmail.com" }]
12
12
  keywords = ["http", "router", "web", "framework"]
@@ -16,11 +16,11 @@ classifiers = [
16
16
  "License :: OSI Approved :: MIT License",
17
17
  "Programming Language :: Python",
18
18
  "Programming Language :: Python :: 3",
19
- "Programming Language :: Python :: 3.8",
20
19
  "Programming Language :: Python :: 3.9",
21
20
  "Programming Language :: Python :: 3.10",
22
21
  "Programming Language :: Python :: 3.11",
23
22
  "Programming Language :: Python :: 3.12",
23
+ "Programming Language :: Python :: 3.13",
24
24
  "Programming Language :: Python :: Implementation :: PyPy",
25
25
  "Programming Language :: Cython",
26
26
  "Topic :: Internet :: WWW/HTTP",
@@ -33,7 +33,7 @@ documentation = "https://github.com/klen/http-router"
33
33
 
34
34
  [project.optional-dependencies]
35
35
  tests = ["ruff", "pytest", "pytest-benchmark", "pytest-mypy; implementation_name == 'cpython'"]
36
- dev = ["bump2version", "refurb; python_version >= '3.9'", "tox"]
36
+ dev = ["bump2version", "tox", "pre-commit"]
37
37
 
38
38
  [tool.setuptools]
39
39
  packages = ['http_router']
@@ -54,7 +54,7 @@ packages = ["http_router"]
54
54
  [tool.tox]
55
55
  legacy_tox_ini = """
56
56
  [tox]
57
- envlist = py38,py39,py310,py311,py312,pypy310
57
+ envlist = py39,py310,py311,py312,py313,pypy310
58
58
 
59
59
  [testenv]
60
60
  deps = -e .[tests]
@@ -70,7 +70,7 @@ commands =
70
70
  [tool.ruff]
71
71
  fix = false
72
72
  line-length = 100
73
- target-version = "py38"
73
+ target-version = "py39"
74
74
  exclude = [".venv", "docs", "examples"]
75
75
 
76
76
  [tool.ruff.lint]
File without changes
File without changes