Skip to content

Commit a31057b

Browse files
committed
Fix the fromutctimestamp warning on 3.12.
Drop old versions, as generally we build docs using a recent version.
1 parent 366266f commit a31057b

File tree

3 files changed

+5
-12
lines changed

3 files changed

+5
-12
lines changed

noxfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def _session(fn):
2121
return _session
2222

2323

24-
@session(python=["3.8", "3.9", "3.10", "3.11", "3.12", "pypy3"])
24+
@session(python=["3.11", "3.12"])
2525
def tests(session):
2626
session.install("pytest", ROOT)
2727
session.run("pytest", *session.posargs, PACKAGE)

pyproject.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ name = "sphinx_json_schema_spec"
1010
description = "Sphinx support for the JSON Schema specifications"
1111
readme = "README.rst"
1212
license = {text = "MIT"}
13-
requires-python = ">=3.8"
13+
requires-python = ">=3.11"
1414
keywords = ["json schema", "jsonschema", "data validation", "sphinx", "json"]
1515
authors = [
1616
{email = "[email protected]"},
@@ -22,9 +22,6 @@ classifiers = [
2222
"License :: OSI Approved :: MIT License",
2323
"Operating System :: OS Independent",
2424
"Programming Language :: Python",
25-
"Programming Language :: Python :: 3.8",
26-
"Programming Language :: Python :: 3.9",
27-
"Programming Language :: Python :: 3.10",
2825
"Programming Language :: Python :: 3.11",
2926
"Programming Language :: Python :: 3.12",
3027
"Programming Language :: Python :: Implementation :: CPython",

sphinx_json_schema_spec/__init__.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,13 @@
22
Sphinx support for interlinking to the JSON Schema specifications.
33
"""
44
from contextlib import suppress
5-
from datetime import datetime
5+
from datetime import UTC, datetime
6+
from importlib import metadata
67
from pathlib import Path
78
from urllib.parse import urljoin
89
import ssl
910
import urllib.request
1011

11-
try:
12-
from importlib import metadata
13-
except ImportError:
14-
import importlib_metadata as metadata # type: ignore
15-
1612
from docutils import nodes
1713
from lxml import html
1814

@@ -76,7 +72,7 @@ def fetch_or_load(cache_path, url):
7672
headers = {"User-Agent": f"sphinx-json-schema-spec v{version}"}
7773

7874
with suppress(FileNotFoundError):
79-
modified = datetime.utcfromtimestamp(cache_path.stat().st_mtime)
75+
modified = datetime.fromtimestamp(cache_path.stat().st_mtime, UTC)
8076
date = modified.strftime("%a, %d %b %Y %I:%M:%S UTC")
8177
headers["If-Modified-Since"] = date
8278

0 commit comments

Comments
 (0)