From 153cd9d71364e67260743d52ec23d5414e3b0857 Mon Sep 17 00:00:00 2001 From: Baptiste Mispelon Date: Tue, 29 Oct 2024 19:04:34 +0100 Subject: [PATCH 1/3] Switched to Python 3.12 --- .github/workflows/tests.yml | 30 +++++++++++++++++++----------- Dockerfile | 2 +- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 05e81ba..add898d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,49 +15,57 @@ permissions: jobs: noshadows: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: '3.8' + python-version: '3.12' - run: pip install "tinycss2>=1.2.0" - run: python noshadows.py --tests - env: - PYTHONWARNINGS: error +# env: +# PYTHONWARNINGS: error tracdjangoplugin: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: '3.8' + python-version: '3.12' + - name: Install system package dependencies + run: | + sudo apt-get update + sudo apt-get -y install subversion - name: Install requirements run: python -m pip install -r requirements.txt - name: Run tests run: python -m django test tracdjangoplugin.tests env: DJANGO_SETTINGS_MODULE: tracdjangoplugin.settings_tests - PYTHONWARNINGS: error +# PYTHONWARNINGS: error traccheck: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: '3.8' + python-version: '3.12' + - name: Install system package dependencies + run: | + sudo apt-get update + sudo apt-get -y install subversion - name: Install requirements run: python -m pip install -r requirements.txt - run: python traccheck.py lint trac-env/ env: DJANGO_SETTINGS_MODULE: tracdjangoplugin.settings_tests - PYTHONWARNINGS: error +# PYTHONWARNINGS: error - run: python traccheck.py components --check .TRACFREEZE.txt trac-env/ env: DJANGO_SETTINGS_MODULE: tracdjangoplugin.settings_tests - PYTHONWARNINGS: error +# PYTHONWARNINGS: error diff --git a/Dockerfile b/Dockerfile index f7691c6..e385073 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # pull official base image -FROM python:3.8-slim-bullseye +FROM python:3.12-slim-bookworm # set work directory WORKDIR /code From ab1e909c4fca09d9bc35b2667f11b6e6183b2f19 Mon Sep 17 00:00:00 2001 From: Baptiste Mispelon Date: Fri, 1 Nov 2024 19:20:42 +0100 Subject: [PATCH 2/3] fixed PYTHONWARNINGS --- .github/workflows/tests.yml | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index add898d..3e72a7f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,6 +13,14 @@ concurrency: permissions: contents: read +env: + DJANGO_SETTINGS_MODULE: tracdjangoplugin.settings_tests + PYTHONWARNINGS: > + error, + default:pkg_resources::trac, + default:Deprecated call to `pkg_resources.declare_namespace::pkg_resources, + default:::passlib,default:version_info::trac.db.sqlite_backend, + jobs: noshadows: runs-on: ubuntu-24.04 @@ -24,8 +32,6 @@ jobs: python-version: '3.12' - run: pip install "tinycss2>=1.2.0" - run: python noshadows.py --tests -# env: -# PYTHONWARNINGS: error tracdjangoplugin: runs-on: ubuntu-24.04 @@ -43,9 +49,6 @@ jobs: run: python -m pip install -r requirements.txt - name: Run tests run: python -m django test tracdjangoplugin.tests - env: - DJANGO_SETTINGS_MODULE: tracdjangoplugin.settings_tests -# PYTHONWARNINGS: error traccheck: runs-on: ubuntu-24.04 @@ -61,11 +64,7 @@ jobs: sudo apt-get -y install subversion - name: Install requirements run: python -m pip install -r requirements.txt - - run: python traccheck.py lint trac-env/ - env: - DJANGO_SETTINGS_MODULE: tracdjangoplugin.settings_tests -# PYTHONWARNINGS: error - - run: python traccheck.py components --check .TRACFREEZE.txt trac-env/ - env: - DJANGO_SETTINGS_MODULE: tracdjangoplugin.settings_tests -# PYTHONWARNINGS: error + - name: Lint Trac configuration + run: python traccheck.py lint trac-env/ + - name: Check frozen Trac components + run: python traccheck.py components --check .TRACFREEZE.txt trac-env/ From 72e9e3af5ce8cb3e1df1794e7e2b47a12ecbd6c8 Mon Sep 17 00:00:00 2001 From: Baptiste Mispelon Date: Fri, 1 Nov 2024 20:21:08 +0100 Subject: [PATCH 3/3] maybe Python 3.11 :thinking: --- .github/workflows/tests.yml | 10 ++++------ requirements.txt | 4 ++++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3e72a7f..b52800e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,9 +17,7 @@ env: DJANGO_SETTINGS_MODULE: tracdjangoplugin.settings_tests PYTHONWARNINGS: > error, - default:pkg_resources::trac, - default:Deprecated call to `pkg_resources.declare_namespace::pkg_resources, - default:::passlib,default:version_info::trac.db.sqlite_backend, + default:::passlib.utils, jobs: noshadows: @@ -29,7 +27,7 @@ jobs: uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: '3.12' + python-version: '3.11' - run: pip install "tinycss2>=1.2.0" - run: python noshadows.py --tests @@ -40,7 +38,7 @@ jobs: uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: '3.12' + python-version: '3.11' - name: Install system package dependencies run: | sudo apt-get update @@ -57,7 +55,7 @@ jobs: uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: '3.12' + python-version: '3.11' - name: Install system package dependencies run: | sudo apt-get update diff --git a/requirements.txt b/requirements.txt index 55ff888..4782352 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,6 +5,10 @@ psycopg2==2.9.9 --no-binary=psycopg2 Django==4.2.15 libsass==0.23.0 +# Optional Trac dependencies that make DeprecationWarning go away +multipart==1.1.0 +passlib==1.7.4 + # Trac plugins TracSpamFilter[dns,spambayes] @ svn+https://svn.edgewall.org/repos/trac/plugins/trunk/spam-filter@17766 TracDragDrop @ svn+https://trac-hacks.org/svn/tracdragdropplugin/0.12@18635