Skip to content

Commit 58a545f

Browse files
authored
Packaging/remove-python-3_9-add-3_14 (#397)
2 parents 053d2c6 + 0f7830b commit 58a545f

File tree

11 files changed

+25
-35
lines changed

11 files changed

+25
-35
lines changed

.github/workflows/lint-and-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ jobs:
2222
fail-fast: false
2323
matrix:
2424
python-version:
25-
- "3.9"
2625
- "3.10"
2726
- "3.11"
2827
- "3.12"
2928
- "3.13"
29+
- "3.14"
3030

3131
# Steps represent a sequence of tasks that will be executed as part of the job
3232
steps:

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ repos:
3232
hooks:
3333
- id: pyupgrade
3434
args:
35-
- "--py39-plus"
35+
- "--py310-plus"
3636

3737
- repo: https://github.com/astral-sh/ruff-pre-commit
3838
rev: "v0.13.3"
3939
hooks:
4040
- id: ruff
4141
args:
4242
- --fix-only
43-
- --target-version=py39
43+
- --target-version=py310
4444

4545
- repo: https://github.com/pycqa/isort
4646
rev: 6.1.0
@@ -56,7 +56,7 @@ repos:
5656
hooks:
5757
- id: black
5858
args:
59-
- --target-version=py39
59+
- --target-version=py310
6060

6161
- repo: https://github.com/pycqa/flake8
6262
rev: 7.3.0

docs/configuration.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -399,9 +399,7 @@ At the end, into the RSS you will get:
399399
```
400400

401401
!!! note "Timezone dependencies"
402-
The timezones data depends on the Python version used to build:
403-
- for Python >= 3.9, it uses the standard library and ships [tzdata](https://pypi.org/project/tzdata/) only on Windows which do not provide such data
404-
- for Python < 3.9, [pytz](https://pypi.org/project/pytz/) is shipped.
402+
The timezones data relies on the standard library and ships [tzdata](https://pypi.org/project/tzdata/) only on Windows which do not provide such data.
405403

406404
----
407405

mkdocs_rss_plugin/integrations/theme_material_base.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
# ########## Libraries #############
55
# ##################################
66

7-
# standard library
8-
from typing import Optional
9-
107
# 3rd party
118
from mkdocs.config.defaults import MkDocsConfig
129
from mkdocs.plugins import get_plugin_logger
@@ -36,7 +33,7 @@
3633
class IntegrationMaterialThemeBase:
3734
# attributes
3835
IS_THEME_MATERIAL: bool = False
39-
IS_INSIDERS: Optional[bool] = False
36+
IS_INSIDERS: bool | None = False
4037

4138
def __init__(self, mkdocs_config: MkDocsConfig) -> None:
4239
"""Integration instantiation.
@@ -51,7 +48,7 @@ def __init__(self, mkdocs_config: MkDocsConfig) -> None:
5148
self.IS_INSIDERS = self.is_mkdocs_theme_material_insiders()
5249

5350
def is_mkdocs_theme_material(
54-
self, mkdocs_config: Optional[MkDocsConfig] = None
51+
self, mkdocs_config: MkDocsConfig | None = None
5552
) -> bool:
5653
"""Check if the theme set in mkdocs.yml is material or not.
5754
@@ -67,7 +64,7 @@ def is_mkdocs_theme_material(
6764
self.IS_THEME_MATERIAL = mkdocs_config.theme.name == "material"
6865
return self.IS_THEME_MATERIAL
6966

70-
def is_mkdocs_theme_material_insiders(self) -> Optional[bool]:
67+
def is_mkdocs_theme_material_insiders(self) -> bool | None:
7168
"""Check if the material theme is community or insiders edition.
7269
7370
Returns:

mkdocs_rss_plugin/integrations/theme_material_blog_plugin.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
# standard library
88
from functools import lru_cache
99
from pathlib import Path
10-
from typing import Optional
1110

1211
# 3rd party
1312
from mkdocs.config.defaults import MkDocsConfig
@@ -69,9 +68,7 @@ def __init__(self, mkdocs_config: MkDocsConfig, switch_force: bool = True) -> No
6968
"disabled in plugin's option in Mkdocs configuration."
7069
)
7170

72-
def is_blog_plugin_enabled_mkdocs(
73-
self, mkdocs_config: Optional[MkDocsConfig]
74-
) -> bool:
71+
def is_blog_plugin_enabled_mkdocs(self, mkdocs_config: MkDocsConfig | None) -> bool:
7572
"""Check if blog plugin is installed and enabled.
7673
7774
Args:

mkdocs_rss_plugin/integrations/theme_material_social_plugin.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import json
99
from hashlib import md5
1010
from pathlib import Path
11-
from typing import Optional
1211

1312
# 3rd party
1413
from mkdocs.config.defaults import MkDocsConfig
@@ -48,7 +47,7 @@ class IntegrationMaterialSocialCards(IntegrationMaterialThemeBase):
4847
IS_ENABLED: bool = True
4948
IS_SOCIAL_PLUGIN_ENABLED: bool = True
5049
IS_SOCIAL_PLUGIN_CARDS_ENABLED: bool = True
51-
CARDS_MANIFEST: Optional[dict] = None
50+
CARDS_MANIFEST: dict | None = None
5251

5352
def __init__(self, mkdocs_config: MkDocsConfig, switch_force: bool = True) -> None:
5453
"""Integration instantiation.
@@ -107,7 +106,7 @@ def __init__(self, mkdocs_config: MkDocsConfig, switch_force: bool = True) -> No
107106
self.site_description = mkdocs_config.site_description or ""
108107

109108
def is_social_plugin_enabled_mkdocs(
110-
self, mkdocs_config: Optional[MkDocsConfig] = None
109+
self, mkdocs_config: MkDocsConfig | None = None
111110
) -> bool:
112111
"""Check if social plugin is installed and enabled.
113112
@@ -184,7 +183,7 @@ def is_social_plugin_enabled_page(
184183
"cards", fallback_value
185184
)
186185

187-
def load_cache_cards_manifest(self) -> Optional[dict]:
186+
def load_cache_cards_manifest(self) -> dict | None:
188187
"""Load social cards manifest if the file exists.
189188
190189
Returns:
@@ -262,8 +261,8 @@ def get_social_cards_cache_dir(self, mkdocs_config: MkDocsConfig) -> Path:
262261
return self.social_cards_cache_dir
263262

264263
def get_social_card_build_path_for_page(
265-
self, mkdocs_page: MkdocsPageSubset, mkdocs_site_dir: Optional[str] = None
266-
) -> Optional[Path]:
264+
self, mkdocs_page: MkdocsPageSubset, mkdocs_site_dir: str | None = None
265+
) -> Path | None:
267266
"""Get social card path in Mkdocs build dir for a specific page.
268267
269268
Args:
@@ -305,7 +304,7 @@ def get_social_card_build_path_for_page(
305304

306305
def get_social_card_cache_path_for_page(
307306
self, mkdocs_page: MkdocsPageSubset
308-
) -> Optional[Path]:
307+
) -> Path | None:
309308
"""Get social card path in social plugin cache folder for a specific page.
310309
311310
Note:
@@ -377,7 +376,7 @@ def get_social_card_cache_path_for_page(
377376
def get_social_card_url_for_page(
378377
self,
379378
mkdocs_page: MkdocsPageSubset,
380-
mkdocs_site_url: Optional[str] = None,
379+
mkdocs_site_url: str | None = None,
381380
) -> str:
382381
"""Get social card URL for a specific page in documentation.
383382

mkdocs_rss_plugin/plugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from email.utils import format_datetime, formatdate
1313
from pathlib import Path
1414
from re import compile as re_compile
15-
from typing import Literal, Optional
15+
from typing import Literal
1616

1717
# 3rd party
1818
from jinja2 import Environment, FileSystemLoader, select_autoescape
@@ -265,7 +265,7 @@ def on_config(self, config: MkDocsConfig) -> MkDocsConfig:
265265
@event_priority(priority=-75)
266266
def on_page_content(
267267
self, html: str, page: Page, config: MkDocsConfig, files: Files
268-
) -> Optional[str]:
268+
) -> str | None:
269269
"""The page_content event is called after the Markdown text is rendered to HTML
270270
(but before being passed to a template) and can be used to alter the HTML
271271
body of the page.

mkdocs_rss_plugin/util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from functools import lru_cache
1212
from mimetypes import guess_type
1313
from pathlib import Path
14-
from typing import Any, Literal, Union
14+
from typing import Any, Literal
1515
from urllib.parse import urlencode, urlparse, urlunparse
1616

1717
# 3rd party
@@ -172,7 +172,7 @@ def build_url(
172172
url_parts[4] = urlencode(args_dict)
173173
return urlunparse(url_parts)
174174

175-
def get_value_from_dot_key(self, data: dict, dot_key: Union[str, bool]) -> Any:
175+
def get_value_from_dot_key(self, data: dict, dot_key: str | bool) -> Any:
176176
"""Retrieves a value from a dictionary using a dot notation key.
177177
178178
Args:

requirements/base.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ cachecontrol[filecache] >=0.14,<1
55
GitPython>=3.1.43,<3.2
66
mkdocs>=1.6.1,<2
77
requests>=2.31,<3
8-
tzdata==2024.* ; python_version >= "3.9" and sys_platform == "win32"
8+
tzdata==2024.* ; sys_platform == "win32"

setup.py

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

77
# standard library
88
from pathlib import Path
9-
from typing import Union
109

1110
# 3rd party
1211
from setuptools import find_packages, setup
@@ -26,7 +25,7 @@
2625
# ##################################
2726

2827

29-
def load_requirements(requirements_files: Union[Path, list[Path]]) -> list:
28+
def load_requirements(requirements_files: Path | list[Path]) -> list:
3029
"""Helper to load requirements list from a path or a list of paths.
3130
3231
Args:
@@ -79,7 +78,7 @@ def load_requirements(requirements_files: Union[Path, list[Path]]) -> list:
7978
# run
8079
entry_points={"mkdocs.plugins": ["rss = mkdocs_rss_plugin.plugin:GitRssPlugin"]},
8180
# dependencies
82-
python_requires=">=3.9, <4",
81+
python_requires=">=3.10, <4",
8382
extras_require={
8483
# tooling
8584
"dev": load_requirements(HERE / "requirements/development.txt"),
@@ -93,11 +92,11 @@ def load_requirements(requirements_files: Union[Path, list[Path]]) -> list:
9392
"Intended Audience :: Developers",
9493
"Intended Audience :: Information Technology",
9594
"Programming Language :: Python :: 3",
96-
"Programming Language :: Python :: 3.9",
9795
"Programming Language :: Python :: 3.10",
9896
"Programming Language :: Python :: 3.11",
9997
"Programming Language :: Python :: 3.12",
10098
"Programming Language :: Python :: 3.13",
99+
"Programming Language :: Python :: 3.14",
101100
"Programming Language :: Python :: Implementation :: CPython",
102101
"Development Status :: 5 - Production/Stable",
103102
"License :: OSI Approved :: MIT License",

0 commit comments

Comments
 (0)