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
12 changes: 8 additions & 4 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: |
Expand All @@ -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)"
Expand Down
2 changes: 1 addition & 1 deletion poetry.lock

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

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
21 changes: 21 additions & 0 deletions tests/cli/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading