Merge pull request #20231 from netbox-community/19889-drop-old-pythons
Some checks failed
CI / build (20.x, 3.12) (push) Has been cancelled
CodeQL / Analyze (${{ matrix.language }}) (none, actions) (push) Has been cancelled
CodeQL / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Has been cancelled
CodeQL / Analyze (${{ matrix.language }}) (none, python) (push) Has been cancelled

Closes #19889: Drop support for Python 3.10 & 3.11
This commit is contained in:
bctiemann
2025-09-05 11:21:10 -04:00
committed by GitHub
10 changed files with 15 additions and 27 deletions

View File

@@ -31,9 +31,9 @@ VERSION = RELEASE.full_version # Retained for backward compatibility
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Validate Python version
if sys.version_info < (3, 10):
if sys.version_info < (3, 12):
raise RuntimeError(
f"NetBox requires Python 3.10 or later. (Currently installed: Python {platform.python_version()})"
f"NetBox requires Python 3.12 or later. (Currently installed: Python {platform.python_version()})"
)
#

View File

@@ -20,9 +20,4 @@ def datetime_from_timestamp(value):
"""
Convert an ISO 8601 or RFC 3339 timestamp to a datetime object.
"""
# Work around UTC issue for Python < 3.11; see
# https://docs.python.org/3/library/datetime.html#datetime.datetime.fromisoformat
# TODO: Remove this once Python 3.10 is no longer supported
if type(value) is str and value.endswith('Z'):
value = f'{value[:-1]}+00:00'
return datetime.datetime.fromisoformat(value)