diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 113f28c5..30c3810c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,13 +12,13 @@ jobs: strategy: fail-fast: false matrix: - python_version: ['3.11'] + python_version: ['3.11', '3.12'] ubuntu_version: ['22.04', '24.04'] tox_env: [ "django42", "django52"] include: - tox_env: quality ubuntu_version: '24.04' - python_version: '3.11' + python_version: '3.12' steps: - uses: actions/checkout@v5 diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 561e3aee..bc5fd2d9 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -16,6 +16,11 @@ Unreleased * +4.1.0 - 2025-11-04 +****************** + +* Adds support for Python 3.12 + 4.0.0 - 2025-06-13 ****************** diff --git a/Dockerfile b/Dockerfile index 3e625cdf..adb15bca 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,10 +14,24 @@ ENV TZ=Etc/UTC ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install -y software-properties-common RUN add-apt-repository -y ppa:deadsnakes/ppa && apt-get update && apt-get upgrade -y -RUN apt-get install -y vim python${python_version} python${python_version}-dev python${python_version}-distutils +# --------------------------------------------------------------------------- +# - The "distutils" module was removed in Python 3.12 (PEP 632). +# - To ensure virtualenv creation still works, we now prefer python3-venv instead. +# - Older Python versions (e.g., 3.11) still support distutils, so we keep the +# fallback to install python3-distutils if needed. +# --------------------------------------------------------------------------- +RUN apt-get install -y vim python${python_version} python${python_version}-dev python${python_version}-venv || \ + apt-get install -y vim python${python_version} python${python_version}-dev python3-distutils RUN apt-get install -y sudo git make curl build-essential -RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python${python_version} -RUN pip install virtualenv +# --------------------------------------------------------------------------- +# - Ubuntu 24.04 enforces "externally-managed-environment" per PEP 668, +# which prevents pip from modifying system packages by default. +# - We explicitly add "--break-system-packages" to allow pip installs inside +# the container environment (since it's isolated anyway). +# --------------------------------------------------------------------------- +RUN curl -sS https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \ + python${python_version} get-pip.py --break-system-packages && rm get-pip.py +RUN pip install virtualenv --break-system-packages # Define Environment Variables ENV CODEJAIL_GROUP=sandbox diff --git a/README.rst b/README.rst index 5c305503..21d2b95b 100644 --- a/README.rst +++ b/README.rst @@ -44,6 +44,7 @@ This library currently is tested to work with the following versions Python: * 3.11 +* 3.12 Ubuntu: @@ -80,7 +81,7 @@ Other details here that depend on your configuration: 1. Create the new virtualenv, using ``--copies`` so that there's a distinct Python executable to limit:: - $ sudo python3.11 -m venv --copies + $ sudo python3.12 -m venv --copies By default, the virtualenv would just symlink against the system Python, and apparmor's default configuration on some operating systems may prevent confinement from being appled to that. diff --git a/codejail/__init__.py b/codejail/__init__.py index 0e12136b..1f211cc2 100644 --- a/codejail/__init__.py +++ b/codejail/__init__.py @@ -1,3 +1,3 @@ """init""" -__version__ = '4.0.0' +__version__ = '4.1.0' diff --git a/setup.py b/setup.py index 91c1c46a..3b39e292 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ import os import re -from setuptools import find_packages, setup +from setuptools import find_packages, setup # pylint: disable=import-error with open('README.rst') as readme: long_description = readme.read() @@ -51,7 +51,7 @@ def get_version(*file_paths): "Intended Audience :: Developers", 'Programming Language :: Python', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', ], ) diff --git a/tox.ini b/tox.ini index 1464f7e1..f4061b81 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = django{42,52} +envlist = django{42,52},quality [testenv] passenv =