diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 5779b6b6..2057777a 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -49,8 +49,11 @@ jobs: path: .coverage pytest-lowest: - name: Lowest dependencies + name: Lowest dependencies on Python ${{ matrix.python }} runs-on: ubuntu-latest + strategy: + matrix: + python: ["3.11", "3.12", "3.13", "3.14"] steps: - name: โคต๏ธ Check out code from GitHub uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 @@ -60,11 +63,11 @@ jobs: run: pipx install poetry - name: ๐Ÿ— Set up uv run: pipx install uv - - name: ๐Ÿ— Set up Python ${{ env.DEFAULT_PYTHON }} + - name: ๐Ÿ— Set up Python ${{ matrix.python }} id: python uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: - python-version: ${{ env.DEFAULT_PYTHON }} + python-version: ${{ matrix.python }} cache: "poetry" - name: ๐Ÿ— Install workflow dependencies run: | @@ -76,7 +79,8 @@ jobs: # dependencies move down to the lowest versions pyproject.toml allows. # Without --upgrade, uv keeps the newer versions already installed. # Only wheels (except for this project itself), so a version that only - # installs with a compiler at hand does not pass as supported. + # installs with a compiler at hand does not pass as supported. On newer + # Python versions, those are the first versions with wheels for them. - name: ๐Ÿ— Downgrade to the lowest allowed dependencies run: >- uv pip install --python "$(poetry env info --executable)" diff --git a/poetry.lock b/poetry.lock index d0438f07..d92fb1e4 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1779,4 +1779,4 @@ cli = ["rich", "typer"] [metadata] lock-version = "2.1" python-versions = ">=3.11" -content-hash = "366cd86862176e8706602dd292ebe3e63af80701c3532ca81ea49946fd2f8de5" +content-hash = "9bc1a54c3d028b1315973ac9e052817c4c71072856f203e590aa20ebeed882b8" diff --git a/pyproject.toml b/pyproject.toml index 0f7d2b83..ea5f9731 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,13 +35,13 @@ dynamic = ["dependencies"] packages = [{ include = "tailscale", from = "src" }] dependencies = [ 'aiohttp (>=3.8.3)', - 'mashumaro (>=3.10)', + 'mashumaro (>=3.17)', 'orjson (>=3.9.8)', 'yarl (>=1.8.2)', ] [project.optional-dependencies] -cli = ["rich>=14.0.0", "typer>=0.15.1"] +cli = ["rich>=14.0.0", "typer>=0.15.4"] [project.scripts] tailscale-api = "tailscale._cli:main" diff --git a/tests/cli/test_cli.py b/tests/cli/test_cli.py index 94c2b713..6cc365b4 100644 --- a/tests/cli/test_cli.py +++ b/tests/cli/test_cli.py @@ -1307,3 +1307,24 @@ def test_dump_log_commands( def test_tracebacks_leave_out_locals() -> None: """Tracebacks of the CLI do not show the locals, which hold credentials.""" assert cli.pretty_exceptions_show_locals is False + + +def _command_paths() -> list[list[str]]: + """Return the path to every command of the CLI, like ["dns", "split"].""" + group = get_command(cli) + assert isinstance(group, TyperGroup) + paths: list[list[str]] = [] + for name, command in sorted(group.commands.items()): + if isinstance(command, TyperGroup): + paths.extend([name, sub_name] for sub_name in sorted(command.commands)) + else: + paths.append([name]) + return paths + + +@pytest.mark.parametrize("path", _command_paths(), ids=" ".join) +def test_command_help(runner: CliRunner, path: list[str]) -> None: + """Every command shows its help, which breaks with mismatched Typer and Click.""" + result = runner.invoke(cli, [*path, "--help"]) + assert result.exit_code == 0, result.output + assert "Usage:" in result.output