Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.13'
python-version: '3.14'
- name: version
run: sed -i "s/__version__ = '.*'/__version__ = '$VERSION'/g" aiocli/__init__.py
- name: deps
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest ]
python-version: [ '3.10', '3.11', '3.12', '3.13' ]
python-version: [ '3.10', '3.11', '3.12', '3.13', '3.14' ]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
Expand Down
8 changes: 7 additions & 1 deletion Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ FROM docker.io/continuumio/miniconda3:latest AS miniconda3

WORKDIR /app

RUN conda install -y --download-only "python=3.12" && \
RUN conda install -y --download-only "python=3.13" && \
conda install -y --download-only "python=3.12" && \
conda install -y --download-only "python=3.11" && \
conda install -y --download-only "python=3.10"

Expand All @@ -11,6 +12,11 @@ COPY . ./
ENTRYPOINT ["python3"]
CMD ["run-script"]

FROM miniconda3 AS py313

RUN conda install -y "python=3.13"
RUN --mount=type=cache,target=/root/.cache/pip python3 run-script dev-install

FROM miniconda3 AS py312

RUN conda install -y "python=3.12"
Expand Down
20 changes: 18 additions & 2 deletions aiocli/commander.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import asyncio
import signal
import sys
from asyncio import all_tasks, gather, get_event_loop
from asyncio import (
all_tasks,
gather,
get_event_loop,
get_running_loop,
new_event_loop,
set_event_loop,
)
from asyncio.events import AbstractEventLoop
from typing import Any, Callable, List, Optional, Set, Union

Expand Down Expand Up @@ -140,7 +147,16 @@ def run_app(
override_return: Optional[bool] = None,
) -> Any:
def wrapper(*args, **kwargs) -> Optional[int]: # type: ignore
loop_ = loop or get_event_loop()
try:
# Try to get the currently running event loop (Python ≥3.10 preferred API).
# In Python 3.14+, get_event_loop() no longer creates a default loop automatically.
# If no loop is running yet, this raises RuntimeError — we handle that below.
loop_ = loop or get_running_loop()
except RuntimeError:
# No event loop exists in the current thread (Python 3.14+ behavior).
# Create and set a new loop to preserve backward compatibility with Python ≤3.13.
loop_ = new_event_loop()
set_event_loop(loop_)

app_ = app if isinstance(app, Application) else app()

Expand Down
12 changes: 7 additions & 5 deletions aiocli/commander_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -726,11 +726,13 @@ async def _resolve_or_retrieve_from_cache_dependency(self, of: str, annotation:

async def _execute_command_handler(self, handler: CommandHandler, kwargs: Dict[str, Any]) -> Any:
self._log(
msg='Executing command handler with: {0}.'.format(
', '.join(['{0}={1}'.format(key, val) for key, val in kwargs.items()])
)
if kwargs
else 'Executing command handler.',
msg=(
'Executing command handler with: {0}.'.format(
', '.join(['{0}={1}'.format(key, val) for key, val in kwargs.items()])
)
if kwargs
else 'Executing command handler.'
),
)
return await resolve_function(handler, **kwargs)

Expand Down
4 changes: 2 additions & 2 deletions compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ services:
dockerfile: Containerfile
# target: py310
# target: py311
target: py312
# target: py312
# image: ghcr.io/aiopy/python-aiocli:py310-${VERSION:-latest}
# image: ghcr.io/aiopy/python-aiocli:py311-${VERSION:-latest}
image: ghcr.io/aiopy/python-aiocli:py312-${VERSION:-latest}
image: ghcr.io/aiopy/python-aiocli:py314-${VERSION:-latest}
volumes:
- .:/app
27 changes: 27 additions & 0 deletions docs_src/docs/en/release-notes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
## CHANGELOG

### **1.11.x**

* Drop Python 3.9 support.
* Bump dev deps.

### **1.10.x**

* Drop Python 3.8 support.
* Add Python 3.13 support.

### **1.9.x**

* Drop Python 3.7 support.
* Add Python 3.12 support.

### **1.8.x**

* Add more controls over the original input and app output.

### **1.7.x**

* Improve commands and app help usage.
* Lazy loading of the App and State instances.
* Improve command hooks.
* Add after middlware hook.
* Colorize help usage.

### **1.6.x**

* Add State.
Expand Down
359 changes: 240 additions & 119 deletions docs_src/generated/en/404.html

Large diffs are not rendered by default.

429 changes: 265 additions & 164 deletions docs_src/generated/en/advanced/exception_handler/index.html

Large diffs are not rendered by default.

439 changes: 270 additions & 169 deletions docs_src/generated/en/advanced/hooks/index.html

Large diffs are not rendered by default.

433 changes: 267 additions & 166 deletions docs_src/generated/en/advanced/middleware/index.html

Large diffs are not rendered by default.

453 changes: 277 additions & 176 deletions docs_src/generated/en/advanced/serverless_support/index.html

Large diffs are not rendered by default.

425 changes: 263 additions & 162 deletions docs_src/generated/en/advanced/state/index.html

Large diffs are not rendered by default.

429 changes: 265 additions & 164 deletions docs_src/generated/en/advanced/test_support/index.html

Large diffs are not rendered by default.

29 changes: 0 additions & 29 deletions docs_src/generated/en/assets/javascripts/bundle.a6c66575.min.js

This file was deleted.

This file was deleted.

16 changes: 16 additions & 0 deletions docs_src/generated/en/assets/javascripts/bundle.f55a23d4.min.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading