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

Update packages and version to Python 3.12 #1530

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
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
5 changes: 4 additions & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ persistent=yes

# Minimum Python version to use for version dependent checks. Will default to
# the version used to run pylint.
py-version=3.11
py-version=3.12

# Discover python modules and packages in the file system subtree.
recursive=no
Expand Down Expand Up @@ -299,6 +299,9 @@ min-public-methods=2
# Maximum cyclomatic complexity
max-complexity=10

# Maximum positional arguments
max-positional-arguments=12

[EXCEPTIONS]

# Exceptions that will emit a warning when caught.
Expand Down
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.11.4
3.12.6
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-slim-bullseye
FROM python:3.12-slim-bullseye

EXPOSE 5000

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"

eval "$(pyenv init -)"
```
Python versions can be changed with the `pyenv local` or `pyenv global` commands suffixed with the desired version (e.g. 3.11.4). Different versions of Python can be installed first with the `pyenv install` command. Refer to the pyenv project Readme [here](https://github.com/pyenv/pyenv). To avoid confusion, check the current Python version at any given time using `python --version` or `python3 --version`.
Python versions can be changed with the `pyenv local` or `pyenv global` commands suffixed with the desired version (e.g. 3.12.6). Different versions of Python can be installed first with the `pyenv install` command. Refer to the pyenv project Readme [here](https://github.com/pyenv/pyenv). To avoid confusion, check the current Python version at any given time using `python --version` or `python3 --version`.

#### Python & dependencies

Expand Down
3 changes: 2 additions & 1 deletion app/questionnaire/placeholder_transforms.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from collections.abc import Sized
from datetime import date, datetime, timezone
from decimal import Decimal
from typing import TYPE_CHECKING, Literal, Mapping, Sequence, Sized
from typing import TYPE_CHECKING, Literal, Mapping, Sequence
from urllib.parse import quote

from babel.dates import format_datetime
Expand Down
2 changes: 1 addition & 1 deletion app/questionnaire/rules/operations.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from collections.abc import Sized
from copy import deepcopy
from datetime import date
from decimal import Decimal
Expand All @@ -6,7 +7,6 @@
Iterable,
Mapping,
Sequence,
Sized,
TypeAlias,
TypedDict,
TypeVar,
Expand Down
1,705 changes: 943 additions & 762 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ flake8-quotes = "^3.4.0"

[tool.poetry.dependencies]
# update dependabot.yaml when adding new dependencies
python = "^3.11.4"
python = "^3.12.6"
colorama = "^0.4.6"
flask = "^3.0.2"
flask-babel = "^4.0.0"
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ inline-quotes = double
multiline-quotes = double
docstring-quotes = double
avoid-escape = True
ignore = E704,W503,E203
ignore = E704,W503,E203,E902
7 changes: 6 additions & 1 deletion tests/app/publisher/test_publisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
from uuid import uuid4

import pytest
from google.cloud.pubsub_v1.open_telemetry.publish_message_wrapper import (
PublishMessageWrapper,
)
from google.pubsub_v1.types.pubsub import PubsubMessage

from app.publisher.exceptions import PublicationFailed
Expand Down Expand Up @@ -29,7 +32,9 @@ def test_publish(publisher, mocker):
assert future is mocker.sentinel.future

# Check mock.
batch.publish.assert_has_calls([mocker.call(PubsubMessage(data=b"test-message"))])
batch.publish.assert_has_calls(
[mocker.call(PublishMessageWrapper(PubsubMessage({"data": b"test-message"})))]
)


def test_resolving_message_raises_exception_on_error(publisher):
Expand Down
Loading