Skip to content

Commit

Permalink
Add Support for Python 3.12 (#367)
Browse files Browse the repository at this point in the history
* build: ⬆️ Update project to support py3.12

* docs: 📝 Add changelog snippet

* build: 📌 Pin djang-debug-toolbar to less than 4.4.

This fixes the index_together error thrown in CI.

* docs: 📝 Change snippet to added and reword message.

* refactor: Add remaining updates from py3.12 cookie

* build: ⬆️ Change python to less than 3.13

* ci: 💚 Change python version to 3.11 for tests with 2.0.0
  • Loading branch information
jdrew82 authored Aug 30, 2024
1 parent 29794f1 commit a23625a
Show file tree
Hide file tree
Showing 7 changed files with 1,773 additions and 1,450 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,14 @@ jobs:
strategy:
fail-fast: true
matrix:
python-version: ["3.8", "3.11"]
python-version: ["3.8", "3.12"]
db-backend: ["postgresql"]
nautobot-version: ["stable"]
include:
- python-version: "3.11"
db-backend: "postgresql"
nautobot-version: "2.0.0"
# - python-version: "3.11"
# - python-version: "3.12"
# db-backend: "mysql"
# nautobot-version: "stable"
runs-on: "ubuntu-22.04"
Expand Down Expand Up @@ -195,7 +195,7 @@ jobs:
- name: "Set up Python"
uses: "actions/setup-python@v5"
with:
python-version: "3.11"
python-version: "3.12"
- name: "Install Python Packages"
run: "pip install poetry"
- name: "Set env"
Expand Down Expand Up @@ -230,7 +230,7 @@ jobs:
- name: "Set up Python"
uses: "actions/setup-python@v5"
with:
python-version: "3.11"
python-version: "3.12"
- name: "Install Python Packages"
run: "pip install poetry"
- name: "Set env"
Expand Down
1 change: 1 addition & 0 deletions changes/367.added
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added support for Python 3.12.
8 changes: 4 additions & 4 deletions development/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
# -------------------------------------------------------------------------------------
# !!! USE CAUTION WHEN MODIFYING LINES BELOW

# Accepts a desired Nautobot version as build argument, default to 2.0.0
ARG NAUTOBOT_VER="2.0.0"
# Accepts a desired Nautobot version as build argument, default to 2.3.0
ARG NAUTOBOT_VER="2.3.0"

# Accepts a desired Python version as build argument, default to 3.11
ARG PYTHON_VER="3.11"
# Accepts a desired Python version as build argument, default to 3.12
ARG PYTHON_VER="3.12"

# Retrieve published development image of Nautobot base which should include most CI dependencies
FROM ghcr.io/nautobot/nautobot-dev:${NAUTOBOT_VER}-py${PYTHON_VER}
Expand Down
4 changes: 2 additions & 2 deletions invoke.example.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
nautobot_device_lifecycle_mgmt:
project_name: "nautobot-device-lifecycle-mgmt"
nautobot_ver: "2.0.0"
nautobot_ver: "2.3.0"
local: false
python_ver: "3.11"
python_ver: "3.12"
compose_dir: "development"
compose_files:
- "docker-compose.base.yml"
Expand Down
4 changes: 2 additions & 2 deletions invoke.mysql.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
nautobot_device_lifecycle_mgmt:
project_name: "nautobot-device-lifecycle-mgmt"
nautobot_ver: "2.0.0"
nautobot_ver: "2.3.0"
local: false
python_ver: "3.11"
python_ver: "3.12"
compose_dir: "development"
compose_files:
- "docker-compose.base.yml"
Expand Down
3,193 changes: 1,757 additions & 1,436 deletions poetry.lock

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
packages = [
{ include = "nautobot_device_lifecycle_mgmt" },
Expand All @@ -27,15 +28,15 @@ include = [
]

[tool.poetry.dependencies]
python = ">=3.8,<3.12"
python = ">=3.8,<3.13"
# Used for local development
pycountry = "^22.3.5"
matplotlib = "^3.3.4"
nautobot = "^2.0.0"

[tool.poetry.group.dev.dependencies]
coverage = "*"
django-debug-toolbar = "*"
django-debug-toolbar = "<4.4"
invoke = "*"
ipython = "*"
pylint = "*"
Expand Down

0 comments on commit a23625a

Please sign in to comment.