muffin 0.100.1__tar.gz → 0.102.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.
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: muffin
3
- Version: 0.100.1
3
+ Version: 0.102.0
4
4
  Summary: Muffin is a fast, simple and asyncronous web-framework for Python 3 (asyncio, trio, curio)
5
5
  Home-page: https://github.com/klen/muffin
6
6
  License: MIT
7
7
  Keywords: asgi,web,web framework,asyncio,trio,curio
8
8
  Author: Kirill Klenov
9
9
  Author-email: horneds@gmail.com
10
- Requires-Python: >=3.8,<4.0
10
+ Requires-Python: >=3.9,<4.0
11
11
  Classifier: Development Status :: 5 - Production/Stable
12
12
  Classifier: Framework :: AsyncIO
13
13
  Classifier: Framework :: Trio
@@ -15,14 +15,14 @@ Classifier: Intended Audience :: Developers
15
15
  Classifier: License :: OSI Approved :: MIT License
16
16
  Classifier: Programming Language :: Python
17
17
  Classifier: Programming Language :: Python :: 3
18
- Classifier: Programming Language :: Python :: 3.8
19
18
  Classifier: Programming Language :: Python :: 3.9
20
19
  Classifier: Programming Language :: Python :: 3.10
21
20
  Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
22
  Classifier: Programming Language :: Python :: Implementation :: PyPy
23
23
  Classifier: Topic :: Internet :: WWW/HTTP
24
24
  Provides-Extra: standard
25
- Requires-Dist: asgi-tools (>=0,<1)
25
+ Requires-Dist: asgi-tools (>=1,<2)
26
26
  Requires-Dist: gunicorn (>=20.1.0,<21.0.0) ; extra == "standard"
27
27
  Requires-Dist: modconfig (>=1,<2)
28
28
  Requires-Dist: ujson
@@ -22,7 +22,7 @@ if TYPE_CHECKING:
22
22
  from .types import TVShellCtx
23
23
 
24
24
  VERSION = metadata.version("muffin")
25
- PARAM_RE = re.compile(r"^\s+:param (\w+): (.+)$", re.M)
25
+ PARAM_RE = re.compile(r"^\s+:param (\w+): (.+)$", re.MULTILINE)
26
26
 
27
27
 
28
28
  class Manager:
@@ -70,7 +70,7 @@ class Manager:
70
70
  )
71
71
 
72
72
  self.subparsers = self.parser.add_subparsers(dest="subparser")
73
- self.commands: Dict[str, Callable] = {} # noqa: FA100
73
+ self.commands: Dict[str, Callable] = {}
74
74
 
75
75
  self.shell(
76
76
  getattr(
@@ -64,6 +64,14 @@ class BasePlugin(ABC):
64
64
  """Human readable representation."""
65
65
  return f"<muffin.Plugin: { self.name }>"
66
66
 
67
+ async def __aenter__(self):
68
+ if self.startup is not None:
69
+ await self.startup()
70
+
71
+ async def __aexit__(self, exc_type, exc, tb):
72
+ if self.shutdown is not None:
73
+ await self.shutdown()
74
+
67
75
  @property
68
76
  def app(self) -> Application:
69
77
  """Get the application."""
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "muffin"
3
- version = "0.100.1"
3
+ version = "0.102.0"
4
4
  description = "Muffin is a fast, simple and asyncronous web-framework for Python 3 (asyncio, trio, curio)"
5
5
  readme = "README.rst"
6
6
  license = "MIT"
@@ -12,10 +12,10 @@ classifiers = [
12
12
  "License :: OSI Approved :: MIT License",
13
13
  "Programming Language :: Python",
14
14
  "Programming Language :: Python :: 3",
15
- "Programming Language :: Python :: 3.8",
16
15
  "Programming Language :: Python :: 3.9",
17
16
  "Programming Language :: Python :: 3.10",
18
17
  "Programming Language :: Python :: 3.11",
18
+ "Programming Language :: Python :: 3.12",
19
19
  "Programming Language :: Python :: Implementation :: PyPy",
20
20
  "Topic :: Internet :: WWW/HTTP",
21
21
  "Framework :: AsyncIO",
@@ -30,8 +30,8 @@ packages = [{ include = "muffin" }]
30
30
  changelog = "https://raw.githubusercontent.com/klen/muffin/master/CHANGELOG.md"
31
31
 
32
32
  [tool.poetry.dependencies]
33
- python = "^3.8"
34
- asgi-tools = "^0"
33
+ python = "^3.9"
34
+ asgi-tools = "^1"
35
35
  modconfig = "^1"
36
36
  ujson = "*"
37
37
 
@@ -77,24 +77,26 @@ ignore_missing_imports = true
77
77
 
78
78
  [tool.ruff]
79
79
  line-length = 100
80
- target-version = "py38"
80
+ target-version = "py39"
81
81
  exclude = [".venv", "docs", "example"]
82
+
83
+ [tool.ruff.lint]
82
84
  select = ["ALL"]
83
85
  ignore = ["D", "UP", "ANN", "DJ", "EM", "RSE", "SLF", "RET", "S101", "PLR2004", "N804", "COM"]
84
86
 
85
- [tool.ruff.per-file-ignores]
87
+ [tool.ruff.lint.per-file-ignores]
86
88
  "tests/*" = ["ARG", "TRY", "F", "PGH", "PLR", "PLW", "PTH", "SIM", "RET504", "T20"]
87
89
 
88
90
  [tool.black]
89
91
  line-length = 100
90
- target-version = ["py38", "py39", "py310", "py311"]
92
+ target-version = ["py39", "py310", "py311", "py312"]
91
93
  preview = true
92
94
 
93
95
  [tool.tox]
94
96
  legacy_tox_ini = """
95
97
  [tox]
96
98
  isolated_build = true
97
- envlist = py38,py39,py310,py311,pypy310
99
+ envlist = py39,py310,py311,py312,pypy310
98
100
 
99
101
  [testenv]
100
102
  allowlist_externals = poetry
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes