From ec9da881348406e270c829c67829dbe3ed0cf992 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Mon, 8 Sep 2025 15:36:12 -0400 Subject: [PATCH] Closes #19095: Introduce support for Python 3.13 & 3.14 --- .github/ISSUE_TEMPLATE/02-bug_report.yaml | 2 ++ .github/workflows/ci.yml | 2 +- docs/installation/3-netbox.md | 2 +- docs/installation/index.md | 2 +- docs/installation/upgrading.md | 5 +++-- docs/plugins/development/index.md | 8 ++++---- pyproject.toml | 4 +++- 7 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/02-bug_report.yaml b/.github/ISSUE_TEMPLATE/02-bug_report.yaml index 2a70c13b9..de92b3b8d 100644 --- a/.github/ISSUE_TEMPLATE/02-bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/02-bug_report.yaml @@ -36,6 +36,8 @@ body: description: What version of Python are you currently running? options: - "3.12" + - "3.13" + - "3.14" validations: required: true - type: textarea diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a7bf43fe2..2fbc48d5a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,7 @@ jobs: NETBOX_CONFIGURATION: netbox.configuration_testing strategy: matrix: - python-version: ['3.12'] + python-version: ['3.12', '3.13', '3.14'] node-version: ['20.x'] services: redis: diff --git a/docs/installation/3-netbox.md b/docs/installation/3-netbox.md index 1b4633610..c192a3094 100644 --- a/docs/installation/3-netbox.md +++ b/docs/installation/3-netbox.md @@ -238,7 +238,7 @@ sudo /opt/netbox/upgrade.sh Note that **Python 3.12 or later is required** for NetBox v4.5 and later releases. If the default Python installation on your server is set to a lesser version, pass the path to the supported installation as an environment variable named `PYTHON`. (Note that the environment variable must be passed _after_ the `sudo` command.) ```no-highlight -sudo PYTHON=/usr/bin/python3.10 /opt/netbox/upgrade.sh +sudo PYTHON=/usr/bin/python3.12 /opt/netbox/upgrade.sh ``` !!! note diff --git a/docs/installation/index.md b/docs/installation/index.md index 08146ea2a..73bf1220c 100644 --- a/docs/installation/index.md +++ b/docs/installation/index.md @@ -27,7 +27,7 @@ The following sections detail how to set up a new instance of NetBox: | Dependency | Supported Versions | |------------|--------------------| -| Python | 3.12+ | +| Python | 3.12, 3.13, 3.14 | | PostgreSQL | 14+ | | Redis | 4.0+ | diff --git a/docs/installation/upgrading.md b/docs/installation/upgrading.md index cf0a16754..ce5282b04 100644 --- a/docs/installation/upgrading.md +++ b/docs/installation/upgrading.md @@ -19,7 +19,7 @@ NetBox requires the following dependencies: | Dependency | Supported Versions | |------------|--------------------| -| Python | 3.10, 3.11, 3.12 | +| Python | 3.12, 3.13, 3.14 | | PostgreSQL | 14+ | | Redis | 4.0+ | @@ -27,6 +27,7 @@ NetBox requires the following dependencies: | NetBox Version | Python min | Python max | PostgreSQL min | Redis min | Documentation | |:--------------:|:----------:|:----------:|:--------------:|:---------:|:-----------------------------------------------------------------------------------------:| +| 4.5 | 3.12 | 3.14 | 14 | 4.0 | [Link](https://github.com/netbox-community/netbox/blob/v4.5.0/docs/installation/index.md) | | 4.4 | 3.10 | 3.12 | 14 | 4.0 | [Link](https://github.com/netbox-community/netbox/blob/v4.4.0/docs/installation/index.md) | | 4.3 | 3.10 | 3.12 | 14 | 4.0 | [Link](https://github.com/netbox-community/netbox/blob/v4.3.0/docs/installation/index.md) | | 4.2 | 3.10 | 3.12 | 13 | 4.0 | [Link](https://github.com/netbox-community/netbox/blob/v4.2.0/docs/installation/index.md) | @@ -130,7 +131,7 @@ sudo ./upgrade.sh If the default version of Python is not at least 3.10, you'll need to pass the path to a supported Python version as an environment variable when calling the upgrade script. For example: ```no-highlight - sudo PYTHON=/usr/bin/python3.10 ./upgrade.sh + sudo PYTHON=/usr/bin/python3.12 ./upgrade.sh ``` !!! note diff --git a/docs/plugins/development/index.md b/docs/plugins/development/index.md index 56bde5e41..df8876391 100644 --- a/docs/plugins/development/index.md +++ b/docs/plugins/development/index.md @@ -173,12 +173,12 @@ classifiers=[ 'Intended Audience :: Developers', 'Natural Language :: English', "Programming Language :: Python :: 3 :: Only", - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: 3.12', + 'Programming Language :: Python :: 3.13', + 'Programming Language :: Python :: 3.14', ] -requires-python = ">=3.10.0" +requires-python = ">=3.12.0" ``` @@ -195,7 +195,7 @@ python3 -m venv ~/.virtualenvs/my_plugin You can make NetBox available within this environment by creating a path file pointing to its location. This will add NetBox to the Python path upon activation. (Be sure to adjust the command below to specify your actual virtual environment path, Python version, and NetBox installation.) ```shell -echo /opt/netbox/netbox > $VENV/lib/python3.10/site-packages/netbox.pth +echo /opt/netbox/netbox > $VENV/lib/python3.12/site-packages/netbox.pth ``` ## Development Installation diff --git a/pyproject.toml b/pyproject.toml index 8d44db59f..bd84e8bb6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,6 +16,8 @@ classifiers = [ "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", ] [project.urls] @@ -26,7 +28,7 @@ Issues = "https://github.com/netbox-community/netbox/issues" [tool.black] line-length = 120 -target_version = ['py312'] +target_version = ['py312', 'py313', 'py314'] skip-string-normalization = true [tool.isort]