Skip to content

Commit

Permalink
Warnings on free-threaded
Browse files Browse the repository at this point in the history
  • Loading branch information
gi0baro committed Feb 2, 2025
1 parent 25bb3a6 commit ddc800a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions granian/server/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,10 @@ def serve(
'Number of workers will now fallback to 1.'
)

if self.interface != Interfaces.WSGI and self.blocking_threads > 1:
logger.error('Blocking threads > 1 is not supported on ASGI and RSGI')
raise ConfigurationError('blocking_threads')

if self.websockets:
if self.interface == Interfaces.WSGI:
logger.info('Websockets are not supported on WSGI, ignoring')
Expand Down
2 changes: 2 additions & 0 deletions granian/server/mt.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,8 @@ def serve(
target_loader: Optional[Callable[..., Callable[..., Any]]] = None,
wrap_loader: bool = True,
):
logger.warning('free-threaded Python support is experimental!')

if self.reload_on_changes:
logger.error('The changes reloader is not supported on the free-threaded build')
raise ConfigurationError('reload')
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ extend-ignore = [
'S110', # except pass is fine
]
flake8-quotes = { inline-quotes = 'single', multiline-quotes = 'double' }
mccabe = { max-complexity = 15 }
mccabe = { max-complexity = 16 }

[tool.ruff.format]
quote-style = 'single'
Expand Down

0 comments on commit ddc800a

Please sign in to comment.