Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to Python 3.9 as a minimum requirement #336

Merged
merged 6 commits into from
Jan 27, 2021
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
2 changes: 2 additions & 0 deletions admin/homebrew/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Tools for creating Homebrew recipes.
"""

from __future__ import annotations

import subprocess
from pathlib import Path

Expand Down
4 changes: 3 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

# pylint: disable=invalid-name

from __future__ import annotations

import datetime
from typing import Tuple

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/source/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Installation
With ``pip``
~~~~~~~~~~~~

Requires Python 3.8+.
Requires Python 3.9+.

.. code:: sh

Expand Down
3 changes: 2 additions & 1 deletion docs/source/release-process.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Setup script for VWS CLI.
"""

from __future__ import annotations

from pathlib import Path

from setuptools import setup
Expand Down
16 changes: 9 additions & 7 deletions src/vws_cli/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions src/vws_cli/options/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
"""
Expand Down
8 changes: 5 additions & 3 deletions src/vws_cli/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down Expand Up @@ -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:
"""
Expand Down
2 changes: 2 additions & 0 deletions tests/test_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Tests for the VWS CLI help.
"""

from __future__ import annotations

import os
from pathlib import Path

Expand Down
2 changes: 2 additions & 0 deletions tests/test_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Test for the Cloud Reco Service commands.
"""

from __future__ import annotations

import io
import uuid
from pathlib import Path
Expand Down
2 changes: 2 additions & 0 deletions tests/test_query_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down