From 81996c702a471024370be0e5b4e577a93eb585a7 Mon Sep 17 00:00:00 2001 From: Maciej Bieniek Date: Tue, 24 Oct 2023 15:18:56 +0000 Subject: [PATCH] Bump minimum Python version to 3.10 (#261) * Bump minimum Python version to 3.10 * Fix lint errors * Bump version --- .github/workflows/test.yml | 1 - accuweather/utils.py | 4 ++-- pyproject.toml | 4 ++-- setup.py | 6 +++--- tox.ini | 5 ++--- 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a8ddc1e..ef96cac 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,7 +12,6 @@ jobs: strategy: matrix: python-version: - - "3.9" - "3.10" - "3.11" - "3.12" diff --git a/accuweather/utils.py b/accuweather/utils.py index 046dcc8..a7f22dc 100644 --- a/accuweather/utils.py +++ b/accuweather/utils.py @@ -16,8 +16,8 @@ def valid_coordinates(latitude: float | None, longitude: float | None) -> bool: """Return True if coordinates are valid.""" if ( - isinstance(latitude, (int, float)) - and isinstance(longitude, (int, float)) + isinstance(latitude, int | float) + and isinstance(longitude, int | float) and abs(latitude) <= MAX_LATITUDE and abs(longitude) <= MAX_LONGITUDE ): diff --git a/pyproject.toml b/pyproject.toml index 5bd5241..403dfba 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ asyncio_mode = "strict" [tool.mypy] -python_version = "3.9" +python_version = "3.10" show_error_codes = true follow_imports = "silent" ignore_missing_imports = true @@ -22,7 +22,7 @@ warn_unused_ignores = true warn_unreachable = true [tool.ruff] -target-version = "py39" +target-version = "py310" select = [ "A", # flake8-builtins diff --git a/setup.py b/setup.py index ed1544a..3a15508 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ PROJECT_DIR = Path(__file__).parent.resolve() README_FILE = PROJECT_DIR / "README.md" -VERSION = "1.0.0" +VERSION = "2.0.0" with open("requirements.txt", encoding="utf-8") as file: requirements = file.read().splitlines() @@ -22,7 +22,7 @@ license="Apache-2.0 License", packages=["accuweather"], package_data={"accuweather": ["py.typed"]}, - python_requires=">=3.9", + python_requires=">=3.10", install_requires=requirements, classifiers=[ "Development Status :: 5 - Production/Stable", @@ -30,9 +30,9 @@ "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3 :: Only", "Typing :: Typed", ], diff --git a/tox.ini b/tox.ini index bbf1a34..37fe81f 100644 --- a/tox.ini +++ b/tox.ini @@ -1,11 +1,10 @@ [tox] -envlist = py39, py310, py311, py312, lint, typing, coverage +envlist = py310, py311, py312, lint, typing, coverage skip_missing_interpreters = True [gh-actions] python = - 3.9: py39, lint, typing, coverage - 3.10: py310 + 3.10: py310, lint, typing, coverage 3.11: py311 3.12: py312