Skip to content

Commit d6e9c14

Browse files
authored
Update dependencies (#306)
* Update dependencies * Fix coverage by migrating to Typer's built in CliRunner
1 parent 36df582 commit d6e9c14

6 files changed

Lines changed: 236 additions & 218 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: CI
33
on: [push, pull_request]
44

55
env:
6-
UV_VERSION: "0.8.8"
6+
UV_VERSION: "0.8.17"
77

88
jobs:
99
test:

.github/workflows/pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
branches: [main]
99

1010
env:
11-
UV_VERSION: "0.8.8"
11+
UV_VERSION: "0.8.17"
1212

1313
jobs:
1414
deploy:

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
FROM python:3.12-slim-bookworm AS python_builder
1212

1313
# Pin uv to a specific version to make container builds reproducible.
14-
ENV UV_VERSION=0.8.8
14+
ENV UV_VERSION=0.8.17
1515
ENV UV_PYTHON_DOWNLOADS=never
1616

1717
# Set ENV variables that make Python more friendly to running inside a container.

src/fact/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ def main(n: Annotated[int, Argument(min=0, help="The input n of fact(n)")]) -> N
1818

1919

2020
# Allow the script to be run standalone (useful during development).
21-
if __name__ == "__main__": # pragma: no branch
21+
if __name__ == "__main__": # pragma: no cover
2222
app()

tests/test_cli.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
1-
import subprocess
2-
import sys
1+
from typer.testing import CliRunner
2+
3+
from fact.cli import app
34

45

56
def test_main() -> None:
67
"""Test the main function of the CLI."""
78

8-
# Run the CLI command
9-
result = subprocess.run(
10-
[sys.executable, "-m", "fact.cli", "5"],
11-
capture_output=True,
12-
text=True,
13-
)
14-
15-
# Check the output
16-
assert result.returncode == 0
17-
assert "fact(5) = 120" in result.stdout
9+
runner = CliRunner()
10+
result = runner.invoke(app, ["5"])
11+
assert result.exit_code == 0
12+
assert "fact(5) = 120" in result.output

0 commit comments

Comments
 (0)