Skip to content

Commit 8dbd3fb

Browse files
Merge pull request #336 from VWS-Python/py39
Switch to Python 3.9 as a minimum requirement
2 parents 99c8052 + e87c6ed commit 8dbd3fb

File tree

12 files changed

+36
-18
lines changed

12 files changed

+36
-18
lines changed

admin/homebrew/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
Tools for creating Homebrew recipes.
33
"""
44

5+
from __future__ import annotations
6+
57
import subprocess
68
from pathlib import Path
79

docs/source/conf.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
# pylint: disable=invalid-name
88

9+
from __future__ import annotations
10+
911
import datetime
1012
from typing import Tuple
1113

@@ -60,7 +62,7 @@
6062
htmlhelp_basename = 'VWSCLIdoc'
6163
autoclass_content = 'init'
6264
intersphinx_mapping = {
63-
'python': ('https://docs.python.org/3.8', None),
65+
'python': ('https://docs.python.org/3.9', None),
6466
}
6567
nitpicky = True
6668
warning_is_error = True

docs/source/install.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Installation
44
With ``pip``
55
~~~~~~~~~~~~
66

7-
Requires Python 3.8+.
7+
Requires Python 3.9+.
88

99
.. code:: sh
1010

docs/source/release-process.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ Outcomes
66

77
* A new ``git`` tag available to install.
88
* A new package on PyPI.
9+
* A new Homebrew recipe available to install.
910

1011
Prerequisites
1112
~~~~~~~~~~~~~
1213

13-
* ``python3`` on your ``PATH`` set to Python 3.8+.
14+
* ``python3`` on your ``PATH`` set to Python 3.9+.
1415
* ``virtualenv``.
1516
* Push access to this repository.
1617
* Trust that ``master`` is ready and high enough quality for release.

setup.cfg

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ license_file = LICENSE
121121
classifiers =
122122
Operating System :: POSIX
123123
Environment :: Web Environment
124-
Programming Language :: Python :: 3.8
124+
Programming Language :: Python :: 3.9
125+
125126
License :: OSI Approved :: MIT License
126127
Development Status :: 5 - Production/Stable
127128
url = https://github.com/VWS-Python/vws-cli

setup.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
Setup script for VWS CLI.
33
"""
44

5+
from __future__ import annotations
6+
57
from pathlib import Path
68

79
from setuptools import setup

src/vws_cli/commands.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22
``click`` commands the VWS CLI.
33
"""
44

5+
from __future__ import annotations
6+
57
import dataclasses
68
import io
79
import sys
810
from http import HTTPStatus
911
from pathlib import Path
10-
from typing import Any, Callable, Dict, Optional, Tuple
12+
from typing import Any, Callable, Dict, Tuple
1113

1214
import click
1315
import wrapt
@@ -358,7 +360,7 @@ def add_target(
358360
image_file_path: Path,
359361
active_flag_choice: ActiveFlagChoice,
360362
base_vws_url: str,
361-
application_metadata: Optional[str] = None,
363+
application_metadata: str | None = None,
362364
) -> None:
363365
"""
364366
Add a target.
@@ -407,12 +409,12 @@ def update_target(
407409
server_access_key: str,
408410
server_secret_key: str,
409411
target_id: str,
410-
image_file_path: Optional[Path],
412+
image_file_path: Path | None,
411413
base_vws_url: str,
412-
name: Optional[str] = None,
413-
application_metadata: Optional[str] = None,
414-
active_flag_choice: Optional[ActiveFlagChoice] = None,
415-
width: Optional[float] = None,
414+
name: str | None = None,
415+
application_metadata: str | None = None,
416+
active_flag_choice: ActiveFlagChoice | None = None,
417+
width: float | None = None,
416418
) -> None:
417419
"""
418420
Update a target.

src/vws_cli/options/targets.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import functools
88
from enum import Enum
9-
from typing import Callable, Optional, Union
9+
from typing import Callable
1010

1111
import click
1212
import click_pathlib
@@ -122,9 +122,9 @@ class ActiveFlagChoice(Enum):
122122

123123
def _active_flag_choice_callback(
124124
ctx: click.core.Context,
125-
param: Union[click.core.Option, click.core.Parameter],
126-
value: Optional[str],
127-
) -> Optional[ActiveFlagChoice]:
125+
param: click.core.Option | click.core.Parameter,
126+
value: str | None,
127+
) -> ActiveFlagChoice | None:
128128
"""
129129
Use as a callback for active flag options.
130130
"""

src/vws_cli/query.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22
A CLI for the Vuforia Cloud Recognition Service API.
33
"""
44

5+
from __future__ import annotations
6+
57
import dataclasses
68
import io
79
import sys
810
from pathlib import Path
9-
from typing import Any, Callable, Dict, Tuple, Union
11+
from typing import Any, Callable, Dict, Tuple
1012

1113
import click
1214
import click_pathlib
@@ -33,7 +35,7 @@
3335

3436

3537
@wrapt.decorator
36-
def handle_vwq_exceptions( # noqa:E501 pylint:disable=too-many-branches,too-many-statements
38+
def handle_vwq_exceptions(
3739
wrapped: Callable[..., str],
3840
instance: Any,
3941
args: Tuple,
@@ -117,7 +119,7 @@ def max_num_results_option(
117119

118120
def include_target_data_callback(
119121
ctx: click.core.Context,
120-
param: Union[click.core.Option, click.core.Parameter],
122+
param: click.core.Option | click.core.Parameter,
121123
value: str,
122124
) -> CloudRecoIncludeTargetData:
123125
"""

tests/test_help.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
Tests for the VWS CLI help.
33
"""
44

5+
from __future__ import annotations
6+
57
import os
68
from pathlib import Path
79

tests/test_query.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
Test for the Cloud Reco Service commands.
33
"""
44

5+
from __future__ import annotations
6+
57
import io
68
import uuid
79
from pathlib import Path

tests/test_query_errors.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
Tests for how errors from the Cloud Reco Service are handled by the CLI.
33
"""
44

5+
from __future__ import annotations
6+
57
import io
68
import uuid
79
from pathlib import Path

0 commit comments

Comments
 (0)