Skip to content

Commit

Permalink
Fix the fromutctimestamp warning on 3.12.
Browse files Browse the repository at this point in the history
Drop old versions, as generally we build docs using a recent
version.
  • Loading branch information
Julian committed Jan 5, 2024
1 parent 366266f commit a31057b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def _session(fn):
return _session


@session(python=["3.8", "3.9", "3.10", "3.11", "3.12", "pypy3"])
@session(python=["3.11", "3.12"])
def tests(session):
session.install("pytest", ROOT)
session.run("pytest", *session.posargs, PACKAGE)
Expand Down
5 changes: 1 addition & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ name = "sphinx_json_schema_spec"
description = "Sphinx support for the JSON Schema specifications"
readme = "README.rst"
license = {text = "MIT"}
requires-python = ">=3.8"
requires-python = ">=3.11"
keywords = ["json schema", "jsonschema", "data validation", "sphinx", "json"]
authors = [
{email = "Julian+sphinx-json-schema-spec@GrayVines.com"},
Expand All @@ -22,9 +22,6 @@ classifiers = [
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
Expand Down
10 changes: 3 additions & 7 deletions sphinx_json_schema_spec/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,13 @@
Sphinx support for interlinking to the JSON Schema specifications.
"""
from contextlib import suppress
from datetime import datetime
from datetime import UTC, datetime
from importlib import metadata
from pathlib import Path
from urllib.parse import urljoin
import ssl
import urllib.request

try:
from importlib import metadata
except ImportError:
import importlib_metadata as metadata # type: ignore

from docutils import nodes
from lxml import html

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

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

Expand Down

0 comments on commit a31057b

Please sign in to comment.