Skip to content

Commit 45d7fd7

Browse files
committed
refactor: bump the lower version boundary for Cyclopts to 4.0.0
1 parent 6110af1 commit 45d7fd7

3 files changed

Lines changed: 14 additions & 7 deletions

File tree

changelog.d/+d589724c.changed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Bump the lower version boundary for Cyclopts to 4.0.0.

template/pyproject.toml.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ dynamic = [
5555
{%- with dependencies = [] %}
5656
{%- if cli == 'click' %}{% do dependencies.append('click>=8.2') %}
5757
{%- elif cli == 'typer' %}{% do dependencies.append('typer>=0.16') %}
58-
{%- elif cli == 'cyclopts' %}{% do dependencies.append('cyclopts>=3.22.3') %}{% endif %}
58+
{%- elif cli == 'cyclopts' %}{% do dependencies.append('cyclopts>=4') %}{% endif %}
5959
{%- if dependencies %}
6060
dependencies = [
6161
{%- for dependency in dependencies | sort %}

template/tests/{% if cli == 'cyclopts' %}test_cli.py{% endif %}.jinja

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,27 @@ from {{ package_name }}.cli import app
1010

1111
def test_app() -> None:
1212
"""Test the main program."""
13-
result = app([])
14-
assert result is None
13+
with pytest.raises(SystemExit) as excinfo:
14+
app([])
15+
16+
assert excinfo.value.code == 0
1517

1618

1719
@pytest.mark.parametrize("option", ["--help", "-h"])
1820
def test_show_help(option: str) -> None:
1921
"""Test the help option of the command-line interface."""
20-
result = app([option])
21-
assert result is None
22+
with pytest.raises(SystemExit) as excinfo:
23+
app([option])
24+
25+
assert excinfo.value.code == 0
2226

2327

2428
def test_show_version(capsys: pytest.CaptureFixture[str]) -> None:
2529
"""Test the version option of the command-line interface."""
26-
result = app(["--version"])
27-
assert result is None
30+
with pytest.raises(SystemExit) as excinfo:
31+
app(["--version"])
32+
33+
assert excinfo.value.code == 0
2834

2935
captured = capsys.readouterr()
3036
assert __version__ in captured.out

0 commit comments

Comments
 (0)