diff --git a/admin/homebrew/__init__.py b/admin/homebrew/__init__.py index c4406394..b0e757a9 100644 --- a/admin/homebrew/__init__.py +++ b/admin/homebrew/__init__.py @@ -2,6 +2,8 @@ Tools for creating Homebrew recipes. """ +from __future__ import annotations + import subprocess from pathlib import Path diff --git a/docs/source/conf.py b/docs/source/conf.py index cc1a4a81..4a4be18c 100755 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -6,6 +6,8 @@ # pylint: disable=invalid-name +from __future__ import annotations + import datetime from typing import Tuple @@ -60,7 +62,7 @@ htmlhelp_basename = 'VWSCLIdoc' autoclass_content = 'init' intersphinx_mapping = { - 'python': ('https://docs.python.org/3.8', None), + 'python': ('https://docs.python.org/3.9', None), } nitpicky = True warning_is_error = True diff --git a/docs/source/install.rst b/docs/source/install.rst index 9f2bb0b4..f684b090 100644 --- a/docs/source/install.rst +++ b/docs/source/install.rst @@ -4,7 +4,7 @@ Installation With ``pip`` ~~~~~~~~~~~~ -Requires Python 3.8+. +Requires Python 3.9+. .. code:: sh diff --git a/docs/source/release-process.rst b/docs/source/release-process.rst index 1c3b38da..0f5dced4 100644 --- a/docs/source/release-process.rst +++ b/docs/source/release-process.rst @@ -6,11 +6,12 @@ Outcomes * A new ``git`` tag available to install. * A new package on PyPI. +* A new Homebrew recipe available to install. Prerequisites ~~~~~~~~~~~~~ -* ``python3`` on your ``PATH`` set to Python 3.8+. +* ``python3`` on your ``PATH`` set to Python 3.9+. * ``virtualenv``. * Push access to this repository. * Trust that ``master`` is ready and high enough quality for release. diff --git a/setup.cfg b/setup.cfg index a1b1467b..995f506f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -121,7 +121,8 @@ license_file = LICENSE classifiers = Operating System :: POSIX Environment :: Web Environment - Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + License :: OSI Approved :: MIT License Development Status :: 5 - Production/Stable url = https://github.com/VWS-Python/vws-cli diff --git a/setup.py b/setup.py index a1a0a153..8f737712 100644 --- a/setup.py +++ b/setup.py @@ -2,6 +2,8 @@ Setup script for VWS CLI. """ +from __future__ import annotations + from pathlib import Path from setuptools import setup diff --git a/src/vws_cli/commands.py b/src/vws_cli/commands.py index 979b618c..b21f0def 100644 --- a/src/vws_cli/commands.py +++ b/src/vws_cli/commands.py @@ -2,12 +2,14 @@ ``click`` commands the VWS CLI. """ +from __future__ import annotations + import dataclasses import io import sys from http import HTTPStatus from pathlib import Path -from typing import Any, Callable, Dict, Optional, Tuple +from typing import Any, Callable, Dict, Tuple import click import wrapt @@ -358,7 +360,7 @@ def add_target( image_file_path: Path, active_flag_choice: ActiveFlagChoice, base_vws_url: str, - application_metadata: Optional[str] = None, + application_metadata: str | None = None, ) -> None: """ Add a target. @@ -407,12 +409,12 @@ def update_target( server_access_key: str, server_secret_key: str, target_id: str, - image_file_path: Optional[Path], + image_file_path: Path | None, base_vws_url: str, - name: Optional[str] = None, - application_metadata: Optional[str] = None, - active_flag_choice: Optional[ActiveFlagChoice] = None, - width: Optional[float] = None, + name: str | None = None, + application_metadata: str | None = None, + active_flag_choice: ActiveFlagChoice | None = None, + width: float | None = None, ) -> None: """ Update a target. diff --git a/src/vws_cli/options/targets.py b/src/vws_cli/options/targets.py index c83fcb99..38263175 100644 --- a/src/vws_cli/options/targets.py +++ b/src/vws_cli/options/targets.py @@ -6,7 +6,7 @@ import functools from enum import Enum -from typing import Callable, Optional, Union +from typing import Callable import click import click_pathlib @@ -122,9 +122,9 @@ class ActiveFlagChoice(Enum): def _active_flag_choice_callback( ctx: click.core.Context, - param: Union[click.core.Option, click.core.Parameter], - value: Optional[str], -) -> Optional[ActiveFlagChoice]: + param: click.core.Option | click.core.Parameter, + value: str | None, +) -> ActiveFlagChoice | None: """ Use as a callback for active flag options. """ diff --git a/src/vws_cli/query.py b/src/vws_cli/query.py index fa9e0c92..c7af2c12 100644 --- a/src/vws_cli/query.py +++ b/src/vws_cli/query.py @@ -2,11 +2,13 @@ A CLI for the Vuforia Cloud Recognition Service API. """ +from __future__ import annotations + import dataclasses import io import sys from pathlib import Path -from typing import Any, Callable, Dict, Tuple, Union +from typing import Any, Callable, Dict, Tuple import click import click_pathlib @@ -33,7 +35,7 @@ @wrapt.decorator -def handle_vwq_exceptions( # noqa:E501 pylint:disable=too-many-branches,too-many-statements +def handle_vwq_exceptions( wrapped: Callable[..., str], instance: Any, args: Tuple, @@ -117,7 +119,7 @@ def max_num_results_option( def include_target_data_callback( ctx: click.core.Context, - param: Union[click.core.Option, click.core.Parameter], + param: click.core.Option | click.core.Parameter, value: str, ) -> CloudRecoIncludeTargetData: """ diff --git a/tests/test_help.py b/tests/test_help.py index 980dfd84..1bafcb3b 100644 --- a/tests/test_help.py +++ b/tests/test_help.py @@ -2,6 +2,8 @@ Tests for the VWS CLI help. """ +from __future__ import annotations + import os from pathlib import Path diff --git a/tests/test_query.py b/tests/test_query.py index 4475e8e5..4cecb88e 100644 --- a/tests/test_query.py +++ b/tests/test_query.py @@ -2,6 +2,8 @@ Test for the Cloud Reco Service commands. """ +from __future__ import annotations + import io import uuid from pathlib import Path diff --git a/tests/test_query_errors.py b/tests/test_query_errors.py index 0b161915..1dc9ef4a 100644 --- a/tests/test_query_errors.py +++ b/tests/test_query_errors.py @@ -2,6 +2,8 @@ Tests for how errors from the Cloud Reco Service are handled by the CLI. """ +from __future__ import annotations + import io import uuid from pathlib import Path