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

MPP-3487: Update to Python 3.12 #5180

Merged
merged 3 commits into from
Nov 13, 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
11 changes: 2 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ executors:
parameters: &python_parameters
python_version:
description: "python version tag"
default: "3.11.8"
default: "3.12.7"
type: string
variant:
description: "image variant"
Expand All @@ -74,7 +74,7 @@ executors:
enum: ["", "-node", "-browsers"]
postgres_version:
description: "postgres version tag"
default: "14.7"
default: "14.13"
type: string
python_with_postgres:
# https://circleci.com/developer/images/image/cimg/python
Expand Down Expand Up @@ -679,13 +679,6 @@ workflows:
update_dependency: "Django>=5.0,<5.1"
filters: *default_filters

- python_job:
name: python 3.12 test
python_version: "3.12.7"
command: pytest
test_results_filename: pytest-python-3-12.xml
filters: *default_filters

- python_job:
name: python 3.13 test
python_version: "3.13"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependabot-glean-parser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Set up Python 3
uses: actions/[email protected]
with:
python-version: '3.11'
python-version: '3.12'
cache: 'pip'
- name: Install Python dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-pending-strings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up Python 3
uses: actions/[email protected]
with:
python-version: '3.11'
python-version: '3.12'
cache: 'pip'
- name: Install Python dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.11.10
FROM python:3.12.7

ARG CIRCLE_BRANCH
ARG CIRCLE_SHA1
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Please refer to our [coding standards](docs/coding-standards.md) for code styles

### Requirements

- python 3.11 (we recommend [venv](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/))
- python 3.12 (we recommend [venv](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/))
- PostgreSQL - even if you are using sqlite for development, requirements.txt installs
psycopg2 which [requires libpq](https://www.psycopg.org/docs/install.html#build-prerequisites) and Python header files.
The following should work:
Expand Down
10 changes: 0 additions & 10 deletions privaterelay/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,6 @@
except ImportError:
HAS_SILK = False

try:
import google.cloud.sqlcommenter # noqa: F401

HAS_SQLCOMMENTER = True
except ImportError:
HAS_SQLCOMMENTER = False

try:
from privaterelay.glean.server_events import GLEAN_EVENT_MOZLOG_TYPE
except ImportError:
Expand Down Expand Up @@ -405,9 +398,6 @@
"privaterelay.middleware.StoreFirstVisit",
]

if HAS_SQLCOMMENTER:
MIDDLEWARE.append("google.cloud.sqlcommenter.django.middleware.SqlCommenter")

ROOT_URLCONF = "privaterelay.urls"

TEMPLATES = [
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
requires-python = ">= 3.11"
requires-python = ">= 3.12"

[tool.coverage.report]
omit = [
Expand Down Expand Up @@ -28,7 +28,7 @@ django_settings_module = "privaterelay.settings"
exclude = "env"
mypy_path = "$MYPY_CONFIG_FILE_DIR/mypy_stubs"
plugins = ["mypy_django_plugin.main"]
python_version = "3.11"
python_version = "3.12"
show_error_codes = true
strict = true

Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ drf-spectacular==0.27.2
drf-spectacular-sidecar==2024.11.1
glean_parser==15.2.1
google-cloud-profiler==4.1.0; python_version < '3.13'
google-cloud-sqlcommenter==2.0.0; python_version < '3.12'
gunicorn==23.0.0
jwcrypto==1.5.6
markus[datadog]==5.1.0
Expand Down
2 changes: 1 addition & 1 deletion runtime.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python-3.11.10
python-3.12.7