Skip to content

Commit c82da33

Browse files
authored
Merge pull request #139 from python-ellar/ci_errors
fix: CI Errors and added support for Py3.13
2 parents 5b2c98e + 95332b3 commit c82da33

File tree

9 files changed

+38
-27
lines changed

9 files changed

+38
-27
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- name: Set up Python
1414
uses: actions/setup-python@v5
1515
with:
16-
python-version: 3.8
16+
python-version: '3.12'
1717
- name: Install Flit
1818
run: pip install flit
1919
- name: Install Dependencies

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Set up Python
1515
uses: actions/setup-python@v5
1616
with:
17-
python-version: 3.8
17+
python-version: '3.12'
1818
- name: Install Flit
1919
run: pip install flit
2020
- name: Install Dependencies

.github/workflows/test_full.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
strategy:
1212
matrix:
13-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
13+
python-version: ['3.10', '3.11', '3.12', '3.13']
1414

1515
steps:
1616
- uses: actions/checkout@v4
@@ -32,7 +32,7 @@ jobs:
3232
- name: Set up Python
3333
uses: actions/setup-python@v5
3434
with:
35-
python-version: 3.8
35+
python-version: '3.12'
3636
- name: Install Flit
3737
run: pip install flit
3838
- name: Install Dependencies

ellar_cli/click/argument.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def __init__(
2323
self.hidden = hidden
2424

2525
# overridden to customize the automatic formatting of metavars
26-
def make_metavar(self) -> str:
26+
def make_metavar(self, *args: t.Any) -> str:
2727
if self.metavar is not None:
2828
return self.metavar
2929
var = "" if self.required else "["
@@ -47,7 +47,7 @@ def _write_opts(opts: t.Any) -> str:
4747
if any_slashes:
4848
# TODO: test
4949
any_prefix_is_slash[:] = [True]
50-
rv += ": " + self.make_metavar()
50+
rv += ": " + self.make_metavar(ctx)
5151
return rv
5252

5353
rv = [_write_opts(self.opts)]

ellar_cli/manage_commands/runserver.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
LIFESPAN,
1515
LOG_LEVELS,
1616
LOGGING_CONFIG,
17-
LOOP_SETUPS,
17+
LOOP_FACTORIES,
1818
SSL_PROTOCOL_VERSION,
1919
WS_PROTOCOLS,
2020
)
@@ -33,7 +33,7 @@
3333
WS_CHOICES = eClick.Choice(list(WS_PROTOCOLS.keys()))
3434

3535
LIFESPAN_CHOICES = eClick.Choice(list(LIFESPAN.keys()))
36-
LOOP_CHOICES = eClick.Choice([key for key in LOOP_SETUPS.keys() if key != "none"])
36+
LOOP_CHOICES = eClick.Choice([key for key in LOOP_FACTORIES.keys() if key != "none"])
3737
INTERFACE_CHOICES = eClick.Choice(INTERFACES)
3838

3939

@@ -101,7 +101,7 @@
101101
"--loop",
102102
type=LOOP_CHOICES,
103103
default="auto",
104-
help="Event loop implementation.",
104+
help="Event loop factory implementation.",
105105
show_default=True,
106106
)
107107
@eClick.option(

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ dependencies = [
4343
# exclude 0.11.2 and 0.11.3 due to https://github.com/sdispater/tomlkit/issues/225
4444
"tomlkit >=0.11.1,<1.0.0,!=0.11.2,!=0.11.3",
4545
"ellar >= 0.8.1",
46-
"uvicorn[standard] == 0.34.2",
47-
"click >= 8.1.7",
46+
"uvicorn[standard] == 0.37.0",
47+
"click >= 8.1.8",
4848
]
4949

5050
[project.scripts]

tests/click/test_app_context_group.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def invoke_without_app_context():
1919
def test_app_group_is_of_type_application_context_group():
2020
assert isinstance(app_group, AppContextGroup)
2121
assert len(app_group.commands) == 1
22-
assert "app-group" in app.commands
22+
assert "app" in app.commands
2323

2424

2525
def test_invoke_without_app_context_fails(cli_runner):

tests/click/test_command_args_printing.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
output_1 = """Usage: args-print <arg1> [<arg2>] [OPTIONS]
55
66
ARGUMENTS:
7-
arg1: <arg1> Arg1 description [required]
8-
arg2: [<arg2>] Arg2 description
7+
arg1: <arg1> Arg1 description [default: Sentinel.UNSET; required]
8+
arg2: [<arg2>] Arg2 description [default: Sentinel.UNSET]
99
1010
[OPTIONS]:
1111
--help Show this message and exit.
@@ -14,8 +14,8 @@
1414
output_2 = """Usage: args-print-no-description <arg1> [<arg2>] [OPTIONS]
1515
1616
ARGUMENTS:
17-
arg1: <arg1> [required]
18-
arg2: [<arg2>]
17+
arg1: <arg1> [default: Sentinel.UNSET; required]
18+
arg2: [<arg2>] [default: Sentinel.UNSET]
1919
2020
[OPTIONS]:
2121
--help Show this message and exit.

tests/test_ellar_cli_service.py

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,24 @@
1212
)
1313
from ellar_cli.service.pyproject import PY_PROJECT_TOML
1414

15-
good_app_info = (
16-
b"Usage: good_app.py [OPTIONS] COMMAND [ARGS]...\n\n "
17-
b"Ellar, ASGI Python Web framework\n\nOptions:\n --project TEXT "
18-
b"Run Specific Command on a specific project [default:\n "
19-
b"default]\n -v, --version Show the version and exit.\n --help "
20-
b"Show this message and exit.\n\nCommands:\n create-module - Scaffolds Ellar Application Module -\n "
21-
b"failing-1\n failing-2\n failing-3\n runserver - "
22-
b"Starts Uvicorn Server -\n working\n"
23-
)
15+
good_app_info = """Usage: good_app.py [OPTIONS] COMMAND [ARGS]...
16+
17+
Ellar, ASGI Python Web framework
18+
19+
Options:
20+
--project TEXT Run Specific Command on a specific project [default:
21+
default]
22+
-v, --version Show the version and exit.
23+
--help Show this message and exit.
24+
25+
Commands:
26+
create-module - Scaffolds Ellar Application Module -
27+
failing-1
28+
failing-2
29+
failing-3
30+
runserver - Starts Uvicorn Server -
31+
working
32+
"""
2433

2534

2635
def test_import_project_meta_returns_default_when_py_project_is_none(tmp_path):
@@ -194,9 +203,11 @@ def test_version_works(write_empty_py_project, process_runner):
194203

195204

196205
def test_apps_good_app_cli_works(change_os_dir):
197-
result = subprocess.run(["python", "apps/good_app.py"], stdout=subprocess.PIPE)
206+
result = subprocess.run(
207+
["python", "apps/good_app.py", "--help"], stdout=subprocess.PIPE
208+
)
198209
assert result.returncode == 0
199-
assert result.stdout == good_app_info
210+
assert result.stdout.decode("utf-8") == good_app_info
200211

201212

202213
def test_apps_good_app_working_command(change_os_dir):

0 commit comments

Comments
 (0)