From bbecbe66aa1fbbf371fb41f0a76a57c4493d2c31 Mon Sep 17 00:00:00 2001 From: Giovanni Barillari Date: Thu, 30 May 2024 01:21:57 +0200 Subject: [PATCH 1/5] Update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6ca41b0c..c89bed1d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![Emmett](https://deneb.spaces.amira.io/emmett/artwork/logo-bwb-xb-xl.png) +![Emmett](https://emmett.sh/static/img/logo-bwb-xb-xl.png) Emmett is a full-stack Python web framework designed with simplicity in mind. From 34cde1954aef070ad08c823cce23f8eae150ab8d Mon Sep 17 00:00:00 2001 From: Giovanni Barillari Date: Thu, 30 May 2024 01:22:07 +0200 Subject: [PATCH 2/5] Update image targets in docs --- docs/debug_and_logging.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/debug_and_logging.md b/docs/debug_and_logging.md index 39dea78c..782f1bea 100644 --- a/docs/debug_and_logging.md +++ b/docs/debug_and_logging.md @@ -12,7 +12,7 @@ Debugger When you run your application with the built-in development server or set your `App.debug` attribute to `True`, Emmett will use its internal debugger when an exception occurs to show you some useful information. What does that look like? -![debugger](https://deneb.spaces.amira.io/emmett/docs/debug.png) +![debugger](https://emmett.sh/static/screens/debug.png) The debug page contains three sections: @@ -24,14 +24,14 @@ The difference between the two tracebacks is straightforward: the first is filte The third section of the debugger page is called *frames* and inspecting it can tell you a lot about what happened during an exception. -![debugger](https://deneb.spaces.amira.io/emmett/docs/debug_frames.png) +![debugger](https://emmett.sh/static/screens/debug_frames.png) As you can see, for every step of the full traceback, Emmett collects – when is possible – all the variables' contents and reports them as shown in the above screen. > – OK, dude. What happens when I have an error in a template? > – *the debugger catches them too.* -![debugger](https://deneb.spaces.amira.io/emmett/docs/debug_template.png) +![debugger](https://emmett.sh/static/screens/debug_template.png) The debugger will also try to display the line that generated the exception in templates, complete with the error type. Still, when you forget a `pass` in a template file, it can be impossible to show you the statement that was not *passed*. From da44ea28402cee37fd9bb00441ac24b2caa619dc Mon Sep 17 00:00:00 2001 From: Giovanni Barillari Date: Thu, 30 May 2024 01:26:21 +0200 Subject: [PATCH 3/5] Bump version to 2.5.11 --- emmett/__version__.py | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/emmett/__version__.py b/emmett/__version__.py index 3cab68db..29768434 100644 --- a/emmett/__version__.py +++ b/emmett/__version__.py @@ -1 +1 @@ -__version__ = "2.5.10" +__version__ = "2.5.11" diff --git a/pyproject.toml b/pyproject.toml index c4d72d67..0e14fed4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ name = "emmett" [tool.poetry] name = "emmett" -version = "2.5.10" +version = "2.5.11" description = "The web framework for inventors" authors = ["Giovanni Barillari "] license = "BSD-3-Clause" From fccfc9cd00e69ef957c8797010dbf2c9501c79a5 Mon Sep 17 00:00:00 2001 From: Giovanni Barillari Date: Thu, 30 May 2024 01:26:59 +0200 Subject: [PATCH 4/5] Bump granian to 1.4.x --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 0e14fed4..d9c7dd27 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,7 +47,7 @@ emmett = "emmett.cli:main" [tool.poetry.dependencies] python = "^3.8" click = ">=6.0" -granian = "~1.3.1" +granian = "~1.4.1" emmett-crypto = "^0.6" pendulum = "~3.0.0" pyDAL = "17.3" From 0b2bc6444071345a9e5731d16fff3dbd787db1ed Mon Sep 17 00:00:00 2001 From: Giovanni Barillari Date: Thu, 30 May 2024 01:37:13 +0200 Subject: [PATCH 5/5] Update server-related code for Granian 1.4.x --- emmett/_reloader.py | 2 ++ emmett/cli.py | 11 ++++++++++- emmett/server.py | 5 ++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/emmett/_reloader.py b/emmett/_reloader.py index dcaf34d0..f3edd2f0 100644 --- a/emmett/_reloader.py +++ b/emmett/_reloader.py @@ -155,6 +155,7 @@ def run_with_reloader( port, loop='auto', log_level=None, + log_access=False, threads=1, threading_mode="workers", ssl_certfile: Optional[str] = None, @@ -177,6 +178,7 @@ def run_with_reloader( kwargs={ "loop": loop, "log_level": log_level, + "log_access": log_access, "threads": threads, "threading_mode": threading_mode, "ssl_certfile": ssl_certfile, diff --git a/emmett/cli.py b/emmett/cli.py index 2e9590ca..dd1f2eba 100644 --- a/emmett/cli.py +++ b/emmett/cli.py @@ -291,6 +291,7 @@ def develop_command( port, loop=loop, log_level='debug', + log_access=True, threads=1, threading_mode="workers", ssl_certfile=ssl_certfile, @@ -326,9 +327,15 @@ def develop_command( @click.option( '--log-level', type=click.Choice(LOG_LEVELS.keys()), default='info', help='Logging level.') +@click.option( + '--access-log/--no-access-log', is_flag=True, default=False, + help='Enable access log.') @click.option( '--backlog', type=int, default=2048, help='Maximum number of connections to hold in backlog') +@click.option( + '--backpressure', type=int, + help='Maximum number of requests to process concurrently (per worker)') @click.option( '--ssl-certfile', type=str, default=None, help='SSL certificate file') @click.option( @@ -336,7 +343,7 @@ def develop_command( @pass_script_info def serve_command( info, host, port, workers, threads, threading_mode, interface, ws, loop, opt, - log_level, backlog, ssl_certfile, ssl_keyfile + log_level, access_log, backlog, backpressure, ssl_certfile, ssl_keyfile ): app_target = info._get_import_name() sgi_run( @@ -347,10 +354,12 @@ def serve_command( loop=loop, loop_opt=opt, log_level=log_level, + log_access=access_log, workers=workers, threads=threads, threading_mode=threading_mode, backlog=backlog, + backpressure=backpressure, enable_websockets=ws, ssl_certfile=ssl_certfile, ssl_keyfile=ssl_keyfile, diff --git a/emmett/server.py b/emmett/server.py index 468942fa..b59f4435 100644 --- a/emmett/server.py +++ b/emmett/server.py @@ -22,10 +22,12 @@ def run( loop='auto', loop_opt=False, log_level=None, + log_access=False, workers=1, threads=1, threading_mode='workers', backlog=1024, + backpressure=None, enable_websockets=True, ssl_certfile: Optional[str] = None, ssl_keyfile: Optional[str] = None @@ -38,13 +40,14 @@ def run( interface=interface, workers=workers, threads=threads, - pthreads=threads, threading_mode=threading_mode, loop=loop, loop_opt=loop_opt, websockets=enable_websockets, backlog=backlog, + backpressure=backpressure, log_level=log_level, + log_access=log_access, ssl_cert=ssl_certfile, ssl_key=ssl_keyfile )