Skip to content

Commit 09b72c4

Browse files
authored
Upgrade to Django 5.2 and Python 3.14 (#407)
* Upgrade to Django 5.2 and Python 3.14 * fix password reset * update deps * fix password reset to work right * bump poetry * disable django q we don't even use it rn
1 parent e1b171b commit 09b72c4

File tree

13 files changed

+572
-239
lines changed

13 files changed

+572
-239
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
branches: [main]
88

99
env:
10-
POETRY_VERSION: "2.3.0"
10+
POETRY_VERSION: "2.3.1"
1111
POETRY_VIRTUALENVS_IN_PROJECT: true
1212

1313
jobs:
@@ -23,7 +23,7 @@ jobs:
2323
- name: Set up Python
2424
uses: actions/setup-python@v5
2525
with:
26-
python-version: "3.12"
26+
python-version: "3.14"
2727

2828
- name: Load cached Poetry installation
2929
id: cached-poetry
@@ -45,9 +45,9 @@ jobs:
4545
uses: actions/cache@v4
4646
with:
4747
path: .venv
48-
key: venv-lint-${{ runner.os }}-py3.12-${{ hashFiles('poetry.lock') }}
48+
key: venv-lint-${{ runner.os }}-py3.14-${{ hashFiles('poetry.lock') }}
4949
restore-keys: |
50-
venv-lint-${{ runner.os }}-py3.12-
50+
venv-lint-${{ runner.os }}-py3.14-
5151
5252
- name: Install dependencies
5353
if: steps.cached-venv.outputs.cache-hit != 'true'
@@ -68,10 +68,10 @@ jobs:
6868
- name: Checkout code
6969
uses: actions/checkout@v4
7070

71-
- name: Set up Python 3.12
71+
- name: Set up Python 3.14
7272
uses: actions/setup-python@v5
7373
with:
74-
python-version: "3.12"
74+
python-version: "3.14"
7575

7676
- name: Load cached Poetry installation
7777
id: cached-poetry
@@ -93,9 +93,9 @@ jobs:
9393
uses: actions/cache@v4
9494
with:
9595
path: .venv
96-
key: venv-test-${{ runner.os }}-py3.12-${{ hashFiles('poetry.lock') }}
96+
key: venv-test-${{ runner.os }}-py3.14-${{ hashFiles('poetry.lock') }}
9797
restore-keys: |
98-
venv-test-${{ runner.os }}-py3.12-
98+
venv-test-${{ runner.os }}-py3.14-
9999
100100
- name: Install dependencies
101101
if: steps.cached-venv.outputs.cache-hit != 'true'
@@ -131,10 +131,10 @@ jobs:
131131
- name: Checkout code
132132
uses: actions/checkout@v4
133133

134-
- name: Set up Python 3.12
134+
- name: Set up Python 3.14
135135
uses: actions/setup-python@v5
136136
with:
137-
python-version: "3.12"
137+
python-version: "3.14"
138138

139139
- name: Load cached Poetry installation
140140
id: cached-poetry
@@ -156,9 +156,9 @@ jobs:
156156
uses: actions/cache@v4
157157
with:
158158
path: .venv
159-
key: venv-security-${{ runner.os }}-py3.12-${{ hashFiles('poetry.lock') }}
159+
key: venv-security-${{ runner.os }}-py3.14-${{ hashFiles('poetry.lock') }}
160160
restore-keys: |
161-
venv-security-${{ runner.os }}-py3.12-
161+
venv-security-${{ runner.os }}-py3.14-
162162
163163
- name: Install dependencies
164164
if: steps.cached-venv.outputs.cache-hit != 'true'

Dockerfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# syntax=docker/dockerfile:1
22

33
# ============================================================================
4-
# Build stage: Install dependencies using Poetry
4+
# Build stage: Install depend using Poetry
55
# ============================================================================
6-
FROM python:3.12-slim AS builder
6+
FROM python:3.14-slim AS builder
77

88
# Install build dependencies required for compiling Python packages
99
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
@@ -15,7 +15,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
1515
curl
1616

1717
# Install Poetry
18-
ENV POETRY_VERSION=2.3.0 \
18+
ENV POETRY_VERSION=2.3.1 \
1919
POETRY_HOME="/opt/poetry" \
2020
POETRY_NO_INTERACTION=1 \
2121
POETRY_VIRTUALENVS_IN_PROJECT=1 \
@@ -48,7 +48,7 @@ RUN --mount=type=cache,target=$POETRY_CACHE_DIR \
4848
# ============================================================================
4949
# Development stage: Full development environment with dev tools
5050
# ============================================================================
51-
FROM python:3.12-slim AS development
51+
FROM python:3.14-slim AS development
5252

5353
LABEL org.opencontainers.image.source="https://github.com/operationcode/back-end"
5454
LABEL org.opencontainers.image.description="Operation Code Backend - Development"
@@ -96,7 +96,7 @@ CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]
9696
# ============================================================================
9797
# Production/Runtime stage: Minimal production image (DEFAULT)
9898
# ============================================================================
99-
FROM python:3.12-slim AS runtime
99+
FROM python:3.14-slim AS runtime
100100

101101
LABEL org.opencontainers.image.source="https://github.com/operationcode/back-end"
102102
LABEL org.opencontainers.image.description="Operation Code Backend - Django API"
@@ -146,5 +146,5 @@ EXPOSE 8000
146146
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
147147
CMD curl -f http://localhost:8000/healthz || exit 1
148148

149-
# Run background task processor and gunicorn
150-
CMD ["sh", "-c", "python manage.py qcluster & gunicorn operationcode_backend.wsgi -c gunicorn_config.py"]
149+
# Run gunicorn (qcluster disabled - not currently needed)
150+
CMD ["gunicorn", "operationcode_backend.wsgi", "-c", "gunicorn_config.py"]

README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ For information about the maintainers of the project, check out [MAINTAINERS.md]
2525

2626
## Quick Start
2727
Recommended versions of tools used within the repo:
28-
- `python@3.12` or greater
28+
- `python@3.14` or greater
2929
- `[email protected]` or greater
3030
- `[email protected]` or greater
3131
- [Poetry](https://python-poetry.org/) is a packaging and dependency manager
@@ -110,3 +110,20 @@ make clean
110110
# See all available commands
111111
make help
112112
```
113+
114+
## Background Tasks (Django Q)
115+
116+
This project uses Django Q2 for background task processing. The following tasks are defined but **currently disabled**:
117+
118+
- Welcome email on user registration
119+
- Slack invite via PyBot API
120+
- Mailchimp mailing list sync on email confirmation
121+
122+
**Status:** The `qcluster` worker is intentionally disabled in production (see Dockerfile:150). Tasks will queue in the database but won't be processed.
123+
124+
**To re-enable:**
125+
1. Uncomment the qcluster command in `Dockerfile` CMD line
126+
2. Ensure environment variables are configured: `PYBOT_URL`, `PYBOT_AUTH_TOKEN`, `MAILCHIMP_API_KEY`, `MAILCHIMP_LIST_ID`
127+
3. Run worker locally: `python manage.py qcluster`
128+
129+
Task code is preserved in `src/core/tasks.py` and triggered via signals in `src/core/handlers.py`.

0 commit comments

Comments
 (0)