Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to Python 3.12 #1026

Merged
merged 7 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"

- name: System Python Information
uses: twisted/python-info-action@v1
Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"

- name: System Python Information
uses: twisted/python-info-action@v1
Expand Down Expand Up @@ -130,7 +130,7 @@ jobs:
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"

- name: System Python Information
uses: twisted/python-info-action@v1
Expand Down Expand Up @@ -177,7 +177,7 @@ jobs:
# - name: Install Python
# uses: actions/setup-python@v5
# with:
# python-version: "3.11"
# python-version: "3.12"

# - name: System Python Information
# uses: twisted/python-info-action@v1
Expand Down Expand Up @@ -223,7 +223,7 @@ jobs:
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"

- name: System Python Information
uses: twisted/python-info-action@v1
Expand Down Expand Up @@ -268,7 +268,7 @@ jobs:
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"

- name: System Python Information
uses: twisted/python-info-action@v1
Expand Down Expand Up @@ -297,13 +297,13 @@ jobs:
strategy:
matrix:
os: ["ubuntu-latest"]
python-version: ["3.11"] # Versions to test with coverage
python-version: ["3.12"] # Versions to test with coverage
tox-prefix: ["coverage"]
optional: [false]
include:
# Test Python 3.12 beta but allow it to fail
# Test Python beta but allow it to fail
- os: "ubuntu-latest"
python-version: "3.12.0-beta.4"
python-version: "3.13.0-alpha.3"
optional: true
tox-prefix: "test"

Expand Down Expand Up @@ -402,7 +402,7 @@ jobs:
- uses: "actions/setup-python@v5"
if: ${{ matrix.tox-prefix == 'coverage' }}
with:
python-version: "3.11"
python-version: "3.12"

- name: "Upload coverage to Codecov"
uses: "codecov/[email protected]"
Expand Down Expand Up @@ -559,7 +559,7 @@ jobs:
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"

- name: Deploy to staging
run: ./bin/deploy staging
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"

- name: System Python Information
uses: twisted/python-info-action@v1
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"

- name: System Python Information
uses: twisted/python-info-action@v1
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ repos:
rev: "v3.15.0"
hooks:
- id: pyupgrade
args: ["--py310-plus"]
args: ["--py312-plus"]

- repo: https://github.com/psf/black
rev: "24.1.1"
hooks:
- id: black
args: ["--target-version", "py311"]
args: ["--target-version", "py312"]

- repo: https://github.com/PyCQA/autoflake
rev: "v2.2.1"
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -----------------------------------------------------------------------------
# This stage builds the build container.
# -----------------------------------------------------------------------------
FROM python:3.11.0-alpine3.16 as build
FROM python:3.12.0-alpine3.18 as build

# Install compiler toolchain and libraries.
RUN apk add --no-cache build-base libffi-dev libressl-dev
Expand Down Expand Up @@ -35,7 +35,7 @@ RUN "${IMS_INSTALL_DIR}/bin/pip" --no-cache-dir install "${IMS_SOURCE_DIR}"
# -----------------------------------------------------------------------------
# This stage builds the application container.
# -----------------------------------------------------------------------------
FROM python:3.11.0-alpine3.16 as application
FROM python:3.12.0-alpine3.18 as application

# Paths
ARG IMS_INSTALL_DIR="/opt/ims"
Expand All @@ -53,7 +53,7 @@ RUN apk add --no-cache libressl

# Allow Python to bind to privileged port numbers
RUN apk add --no-cache libcap
RUN setcap "cap_net_bind_service=+ep" /usr/local/bin/python3.11
RUN setcap "cap_net_bind_service=+ep" /usr/local/bin/python3.12

# Create server root and make that our working directory
RUN install -o daemon -g daemon -d "${IMS_SERVER_ROOT}"
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ build-backend = "setuptools.build_meta"
[tool.black]

line-length = 80
target-version = ["py311"]
target-version = ["py312"]
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@
"Intended Audience :: Other Audience",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Office/Business",
]

Expand Down
12 changes: 6 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

envlist =
lint, mypy, bandit
test-py312
coverage-py311
test-py313
coverage-py312
coverage_report
docs
packaging
Expand All @@ -13,7 +13,7 @@ skip_missing_interpreters = {tty:True:False}

[default]

basepython = python3.11
basepython = python3.12

deps =
{test,coverage}: -r requirements/requirements-tests.txt
Expand All @@ -37,8 +37,8 @@ description = run tests
basepython =
py: python

py311: python3.11
py312: python3.12
py313: python3.13

deps = {[default]deps}

Expand Down Expand Up @@ -128,7 +128,7 @@ commands =

description = generate coverage report

depends = coverage-py{311,312}
depends = coverage-py{312,313}

basepython = {[default]basepython}

Expand Down Expand Up @@ -231,7 +231,7 @@ commands =

description = check for potential packaging problems

depends = {test,coverage}-py{311,312}
depends = {test,coverage}-py{312,313}

basepython = {[default]basepython}

Expand Down
Loading