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.11.10, prepare for Python 3.12, 3.13 #5167

Merged
merged 7 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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: 9 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -681,11 +681,18 @@ workflows:

- python_job:
name: python 3.12 test
python_version: "3.12"
python_version: "3.12.7"
command: pytest
pytest_fail_fast: true
test_results_filename: pytest-python-3-12.xml
filters: *default_filters
Comment on lines 683 to +687
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question (non-blocking): Should we alphabetize these? Or at least make their order consistent in each python job?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I'm ordering the python_job job definition, then ordering the workflow definitions:

  • python_job.executor parameters
    • name
    • postgres_version (as a matrix for the postgres jobs)
    • python_version
    • variant
  • python_job parameters
    • allow_fail
    • command
    • executor
    • mypy_strict
    • production_with_new_migrations
    • pytest_fail_fast
    • pytest_phones_backend
    • test_results_filename
    • update_dependency
  • workflow parameters
    • filters
    • (matrix could go here since it is a workflow parameter)


- python_job:
name: python 3.13 test
command: pytest
pytest_fail_fast: true
python_version: "3.13"
allow_fail: true
test_results_filename: pytest-python-3-13.xml
filters: *default_filters

- python_job:
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.8
FROM python:3.11.10

ARG CIRCLE_BRANCH
ARG CIRCLE_SHA1
Expand Down
5 changes: 4 additions & 1 deletion api/tests/emails_views_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -787,8 +787,11 @@ def test_first_forwarded_email_unknown_mask(free_api_client: APIClient) -> None:


def test_first_forwarded_email_success(
free_api_client: APIClient, free_user: User
free_api_client: APIClient,
free_user: User,
settings: SettingsWrapper,
) -> None:
settings.RELAY_FROM_ADDRESS = "[email protected]"
address = free_user.relayaddress_set.create()
with (
override_flag("free_user_onboarding", True),
Expand Down
2 changes: 1 addition & 1 deletion docs/developer_mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,6 @@ joined by whitespace, such as newlines, before sending it to

[Ascii85]: https://en.wikipedia.org/wiki/Ascii85
[MozLog format]: https://wiki.mozilla.org/Firefox/Services/Logging#MozLog_application_logging_standard
[base64.a85encode]: https://docs.python.org/3.11/library/base64.html#base64.a85encode
[base64.a85encode]: https://docs.python.org/3/library/base64.html#base64.a85encode
[zlib.compress]: https://docs.python.org/3/library/zlib.html
[zlib]: https://docs.python.org/3/library/zlib.html
4 changes: 2 additions & 2 deletions emails/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import re
import zlib
from collections.abc import Callable
from email.errors import InvalidHeaderDefect
from email.errors import HeaderParseError, InvalidHeaderDefect
from email.headerregistry import Address, AddressHeader
from email.message import EmailMessage
from email.utils import formataddr, parseaddr
Expand Down Expand Up @@ -301,7 +301,7 @@ def generate_from_header(original_from_address: str, relay_mask: str) -> str:
display_name, original_address = parseaddr(oneline_from_address)
try:
parsed_address = Address(addr_spec=original_address)
except (InvalidHeaderDefect, IndexError) as e:
except (InvalidHeaderDefect, IndexError, HeaderParseError) as e:
# TODO: MPP-3407, MPP-3417 - Determine how to handle these
raise InvalidFromHeader from e

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dockerflow==2024.4.2
drf-spectacular==0.27.2
drf-spectacular-sidecar==2024.7.1
glean_parser==15.2.0
google-cloud-profiler==4.1.0
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
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.8
python-3.11.10