muffin 1.0.1__tar.gz → 1.1.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,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: muffin
3
- Version: 1.0.1
3
+ Version: 1.1.0
4
4
  Summary: Muffin is a fast, simple and asyncronous web-framework for Python 3 (asyncio, trio, curio)
5
5
  License: MIT
6
6
  Keywords: asgi,web,web framework,asyncio,trio,curio
@@ -55,6 +55,8 @@ Description-Content-Type: text/x-rst
55
55
 
56
56
  ----------
57
57
 
58
+ .. _description:
59
+
58
60
  Why Muffin?
59
61
  -----------
60
62
 
@@ -69,6 +71,8 @@ Key Features
69
71
  - Multiple response types: text, HTML, JSON, streams, files, SSE, WebSockets
70
72
  - First-class plugin system for templating, databases, auth, and more
71
73
 
74
+ .. _installation:
75
+
72
76
  Installation
73
77
  ------------
74
78
 
@@ -97,6 +101,8 @@ These packages will be installed automatically:
97
101
  .. _ASGI-Tools: https://klen.github.io/asgi-tools/
98
102
  .. _Modconfig: https://pypi.org/project/modconfig/
99
103
 
104
+ .. _quickstart:
105
+
100
106
  Quickstart
101
107
  ----------
102
108
 
@@ -121,6 +127,8 @@ Save this as `example.py` and run:
121
127
 
122
128
  Visit http://localhost:8000 or http://localhost:8000/hello/username in your browser.
123
129
 
130
+ .. _plugins:
131
+
124
132
  Plugins
125
133
  -------
126
134
 
@@ -141,11 +149,15 @@ Muffin has a rich ecosystem of plugins:
141
149
 
142
150
  See each repo for usage and installation instructions.
143
151
 
152
+ .. _benchmarks:
153
+
144
154
  Benchmarks
145
155
  ----------
146
156
 
147
157
  Performance comparisons are available at: http://klen.github.io/py-frameworks-bench/
148
158
 
159
+ .. _links:
160
+
149
161
  Bug tracker
150
162
  -----------
151
163
 
@@ -21,6 +21,8 @@
21
21
 
22
22
  ----------
23
23
 
24
+ .. _description:
25
+
24
26
  Why Muffin?
25
27
  -----------
26
28
 
@@ -35,6 +37,8 @@ Key Features
35
37
  - Multiple response types: text, HTML, JSON, streams, files, SSE, WebSockets
36
38
  - First-class plugin system for templating, databases, auth, and more
37
39
 
40
+ .. _installation:
41
+
38
42
  Installation
39
43
  ------------
40
44
 
@@ -63,6 +67,8 @@ These packages will be installed automatically:
63
67
  .. _ASGI-Tools: https://klen.github.io/asgi-tools/
64
68
  .. _Modconfig: https://pypi.org/project/modconfig/
65
69
 
70
+ .. _quickstart:
71
+
66
72
  Quickstart
67
73
  ----------
68
74
 
@@ -87,6 +93,8 @@ Save this as `example.py` and run:
87
93
 
88
94
  Visit http://localhost:8000 or http://localhost:8000/hello/username in your browser.
89
95
 
96
+ .. _plugins:
97
+
90
98
  Plugins
91
99
  -------
92
100
 
@@ -107,11 +115,15 @@ Muffin has a rich ecosystem of plugins:
107
115
 
108
116
  See each repo for usage and installation instructions.
109
117
 
118
+ .. _benchmarks:
119
+
110
120
  Benchmarks
111
121
  ----------
112
122
 
113
123
  Performance comparisons are available at: http://klen.github.io/py-frameworks-bench/
114
124
 
125
+ .. _links:
126
+
115
127
  Bug tracker
116
128
  -----------
117
129
 
@@ -57,9 +57,7 @@ class Manager:
57
57
  def __init__(self, app: "Application"):
58
58
  """Initialize the manager."""
59
59
  self.app = app
60
- self.parser = argparse.ArgumentParser(
61
- description="Manage %s" % app.cfg.name.capitalize(),
62
- )
60
+ self.parser = argparse.ArgumentParser(description="Manage %s" % app.cfg.name.capitalize())
63
61
 
64
62
  if len(AIOLIBS) > 1:
65
63
  self.parser.add_argument(
@@ -141,7 +139,7 @@ class Manager:
141
139
  def __call__(self, fn=None, *, lifespan=False): # noqa: C901
142
140
  """Register a command."""
143
141
 
144
- def wrapper(fn): # noqa: PLR0912, C901
142
+ def wrapper(fn): # noqa: C901, PLR0912
145
143
  if not inspect.iscoroutinefunction(fn) and lifespan:
146
144
  raise AsyncRequiredError(fn)
147
145
 
@@ -155,7 +153,9 @@ class Manager:
155
153
  self.app.logger.warning("Command %s already registered", command_name)
156
154
  return fn
157
155
 
158
- parser = self.subparsers.add_parser(command_name, description=description)
156
+ parser = self.subparsers.add_parser(
157
+ command_name, description=description, help=description
158
+ )
159
159
  sig = inspect.signature(fn)
160
160
  docs = dict(PARAM_RE.findall(fn.__doc__ or ""))
161
161
 
@@ -281,8 +281,13 @@ def cli():
281
281
  try:
282
282
  app = import_app(args_.app)
283
283
  app.logger.info("Application is loaded: %s", app.cfg.name)
284
- app.manage.run(*subargs_, prog="muffin %s" % args_.app)
285
284
 
285
+ except ImportError:
286
+ logging.exception("Failed to import application")
287
+ return sys.exit(1)
288
+
289
+ try:
290
+ app.manage.run(*subargs_, prog="muffin %s" % args_.app)
286
291
  except Exception:
287
292
  logging.exception("Command failed")
288
293
  return sys.exit(1)
@@ -290,4 +295,4 @@ def cli():
290
295
  sys.exit(0)
291
296
 
292
297
 
293
- # ruff: noqa: T100
298
+ # ruff: noqa: T100, LOG015
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "muffin"
3
- version = "1.0.1"
3
+ version = "1.1.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"
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