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
20 changes: 20 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ ci:
- vulture
- vulture-docs
- yamlfix
- pyrefly
- pyrefly-docs

# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
Expand Down Expand Up @@ -374,3 +376,21 @@ repos:
types_or: [rst]
additional_dependencies: [uv==0.9.5]
stages: [pre-commit]

- id: pyrefly
name: pyrefly
stages: [pre-push]
entry: uv run --extra=dev pyrefly check
language: python
types_or: [python, toml]
pass_filenames: false
additional_dependencies: [uv==0.9.5]

- id: pyrefly-docs
name: pyrefly-docs
stages: [pre-push]
entry: uv run --extra=dev doccmd --no-write-to-file --example-workers 0 --language=python
--command="pyrefly check"
language: python
types_or: [markdown, rst]
additional_dependencies: [uv==0.9.5]
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ optional-dependencies.dev = [
"pre-commit==4.5.1",
"pylint[spelling]==4.0.4",
"pyproject-fmt==2.11.1",
"pyrefly==0.46.1",
"pyright==1.1.407",
"pyroma==5.0.1",
"pytest==9.0.2",
Expand Down
41 changes: 17 additions & 24 deletions src/vws_cli/options/credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,20 @@
"""

from collections.abc import Callable
from typing import Any

import click
from beartype import beartype


@beartype
def server_access_key_option(
command: Callable[..., None] | None = None,
) -> Callable[..., None]:
command: Callable[..., Any],
) -> Callable[..., Any]:
"""
An option decorator for the Vuforia server access key.
"""
click_option_function = click.option(
return click.option(
"--server-access-key",
type=str,
help=(
Expand All @@ -25,19 +26,17 @@ def server_access_key_option(
required=True,
envvar="VUFORIA_SERVER_ACCESS_KEY",
show_envvar=True,
)
assert command is not None
return click_option_function(command)
)(command)


@beartype
def server_secret_key_option(
command: Callable[..., None] | None = None,
) -> Callable[..., None]:
command: Callable[..., Any],
) -> Callable[..., Any]:
"""
An option decorator for the Vuforia server secret key.
"""
click_option_function = click.option(
return click.option(
"--server-secret-key",
type=str,
help=(
Expand All @@ -47,19 +46,17 @@ def server_secret_key_option(
required=True,
envvar="VUFORIA_SERVER_SECRET_KEY",
show_envvar=True,
)
assert command is not None
return click_option_function(command)
)(command)


@beartype
def client_access_key_option(
command: Callable[..., None] | None = None,
) -> Callable[..., None]:
command: Callable[..., Any],
) -> Callable[..., Any]:
"""
An option decorator for the Vuforia client access key.
"""
click_option_function = click.option(
return click.option(
"--client-access-key",
type=str,
help=(
Expand All @@ -69,19 +66,17 @@ def client_access_key_option(
required=True,
envvar="VUFORIA_CLIENT_ACCESS_KEY",
show_envvar=True,
)
assert command is not None
return click_option_function(command)
)(command)


@beartype
def client_secret_key_option(
command: Callable[..., None] | None = None,
) -> Callable[..., None]:
command: Callable[..., Any],
) -> Callable[..., Any]:
"""
An option decorator for the Vuforia client secret key.
"""
click_option_function = click.option(
return click.option(
"--client-secret-key",
type=str,
help=(
Expand All @@ -91,6 +86,4 @@ def client_secret_key_option(
required=True,
envvar="VUFORIA_CLIENT_SECRET_KEY",
show_envvar=True,
)
assert command is not None
return click_option_function(command)
)(command)
8 changes: 4 additions & 4 deletions src/vws_cli/options/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import click
from beartype import beartype

target_id_option: Callable[..., None] = click.option(
target_id_option: Callable[..., Any] = click.option(
"--target-id",
type=str,
help="The ID of a target in the Vuforia database.",
Expand All @@ -19,7 +19,7 @@


@beartype
def target_name_option(*, required: bool) -> Callable[..., None]:
def target_name_option(*, required: bool) -> Callable[..., Any]:
"""
An option decorator for choosing a target name.
"""
Expand Down Expand Up @@ -77,7 +77,7 @@ class ActiveFlagChoice(Enum):
def active_flag_option(
*,
allow_none: bool,
) -> Callable[..., None]:
) -> Callable[..., Any]:
"""
An option decorator for setting a target's active flag.
"""
Expand All @@ -98,7 +98,7 @@ def active_flag_option(
)


application_metadata_option: Callable[..., None] = click.option(
application_metadata_option: Callable[..., Any] = click.option(
"--application-metadata",
type=str,
required=False,
Expand Down