Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[u] Update to Python 3.12.x (#5736)
Browse files Browse the repository at this point in the history
dsotirho-ucsc committed Nov 13, 2024
1 parent 17dadfa commit df6271c
Showing 13 changed files with 35 additions and 28 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ hello: check_python
virtualenv: check_env
@if test -s "$$VIRTUAL_ENV"; then echo -e "\nRun 'deactivate' first\n"; false; fi
if test -e .venv; then rm -rf .venv/; fi
python3.11 -m venv .venv
python3.12 -m venv .venv
@echo -e "\nRun 'source .venv/bin/activate' now!\n"

.PHONY: envhook
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1032,7 +1032,7 @@ found in [`AzulTestCase`](test/azul_test_case.py) and commit the modifications.
## Setting up the Azul build prerequisites on macOS 12 (Monterey)
The steps below are examplary for Python 3.11.6. Replace `3.11.6` with the value
The steps below are examplary for Python 3.12.6. Replace `3.12.6` with the value
of `azul_python_version` in [environment.py](environment.py).
Make `bash` the default shell. Google it.
@@ -1048,10 +1048,10 @@ brew install zlib pyenv
Install python
```
pyenv install 3.11.6
pyenv install 3.12.6
```
Set `PYENV_VERSION` to `3.11.6` in `environment.local.py` at the project root.
Set `PYENV_VERSION` to `3.12.6` in `environment.local.py` at the project root.
Do not set `SYSTEM_VERSION_COMPAT`. For a more maintainable configuration use
`os.environ['azul_python_version']` as the value and `import os` at the top.
@@ -2319,10 +2319,10 @@ If you add a dependency on a package with native code, you need to build the
wheel manually:

```
(.venv) ~/workspace/hca/azul$ docker run -it -v ${project_root}/:/root/azul python:3.11.6-bullseye bash
(.venv) ~/workspace/hca/azul$ docker run -it -v ${project_root}/:/root/azul python:3.12.6-slim-bookworm bash
root@97804cb60d95:/# pip --version
pip 22.0.4 from /usr/local/lib/python3.11/site-packages/pip (python 3.11)
pip 24.2 from /usr/local/lib/python3.12/site-packages/pip (python 3.12)
root@97804cb60d95:/# cd /root/azul/lambdas/.wheels
7 changes: 7 additions & 0 deletions UPGRADING.rst
Original file line number Diff line number Diff line change
@@ -19,6 +19,13 @@ branch that does not have the listed changes, the steps would need to be
reverted. This is all fairly informal and loosely defined. Hopefully we won't
have too many entries in this file.

#5736 Update to Python 3.12.x
=============================

Update Python on your developer machines to version 3.12.6. In your working
copy, run ``make virtualenv`` and ``make requirements envhook``.


#6531 Eliminate RepositoryPlugin.list_partitions
================================================

2 changes: 1 addition & 1 deletion deployments/dev/.example.environment.local.py
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ def env() -> Mapping[str, Optional[str]]:
other environment variables in the form `{FOO}` where FOO is the name of an
environment variable. See
https://docs.python.org/3.11/library/string.html#format-string-syntax
https://docs.python.org/3.12/library/string.html#format-string-syntax
for the concrete syntax. These references will be resolved *after* the
overall environment has been compiled by merging all relevant
2 changes: 1 addition & 1 deletion deployments/dev/environment.py
Original file line number Diff line number Diff line change
@@ -189,7 +189,7 @@ def env() -> Mapping[str, Optional[str]]:
other environment variables in the form `{FOO}` where FOO is the name of an
environment variable. See
https://docs.python.org/3.11/library/string.html#format-string-syntax
https://docs.python.org/3.12/library/string.html#format-string-syntax
for the concrete syntax. These references will be resolved *after* the
overall environment has been compiled by merging all relevant
14 changes: 7 additions & 7 deletions docker_images.json
Original file line number Diff line number Diff line change
@@ -15,18 +15,18 @@
}
}
},
"docker.io/library/python:3.11.10-slim-bullseye": {
"digest": "sha256:f6a64ef0a5cc14855b15548056a8fc77f4c3526b79883fa6709a8e23f676ac34",
"mirror_digest": "sha256:13b5591078b6450547762ed1faec89f9934d69d5cffc746f8cdbc1d2ee5b44d4",
"docker.io/library/python:3.12.6-slim-bookworm": {
"digest": "sha256:15bad989b293be1dd5eb26a87ecacadaee1559f98e29f02bf6d00c8d86129f39",
"mirror_digest": "sha256:289f8a62caa961ebb045882e86adf8870a802f322c962078c2532858c3090756",
"parts": {
"linux/amd64": {
"digest": "sha256:99010d5cbf95418c4dbaeb3be33658bc1b65c3a6324bba447424c6768728e4f7",
"id": "sha256:26c608e127a5277940aedc0d8683bcd8d7df926a1ffd0aa339b6e2423b24b5b3",
"digest": "sha256:e0203bb78451dc5e8fe447983dc664f454068e8eea8d47b204cbe80a99b09d3e",
"id": "sha256:0d8d642b665d136b7a11d9f4a3d8a25b18deba7479b5897009fdee7e3fe1eb0e",
"platform": "linux/amd64"
},
"linux/arm64": {
"digest": "sha256:fa2d1949ad1ecc4078bc0489137366c95eb8b2cebcac759cfa16b537891539be",
"id": "sha256:f04f078657e27cdbcbe225b931e03dfe6417f926835b19de0a1e986d4bee02de",
"digest": "sha256:c0c2008864355f2263dcc690b1190540315bdd179dfbb0fae6ee58b174da4041",
"id": "sha256:c0cb1ac1ea30eef3bedf58895ed0abf74baac5411ea0ed177645ff5a1c0a00c8",
"platform": "linux/arm64"
}
}
2 changes: 1 addition & 1 deletion docs/licenses/python.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
https://docs.python.org/3.11/license.html
https://docs.python.org/3.12/license.html

The MIT License

4 changes: 2 additions & 2 deletions environment.boot
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
azul_python_version=3.11.10
azul_python_image=docker.io/library/python@sha256:13b5591078b6450547762ed1faec89f9934d69d5cffc746f8cdbc1d2ee5b44d4
azul_python_version=3.12.6
azul_python_image=docker.io/library/python@sha256:289f8a62caa961ebb045882e86adf8870a802f322c962078c2532858c3090756
azul_docker_version=27.3.1
azul_terraform_version=1.9.8
6 changes: 3 additions & 3 deletions environment.py
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ def env() -> Mapping[str, Optional[str]]:
other environment variables in the form `{FOO}` where FOO is the name of an
environment variable. See
https://docs.python.org/3.11/library/string.html#format-string-syntax
https://docs.python.org/3.12/library/string.html#format-string-syntax
for the concrete syntax. These references will be resolved *after* the
overall environment has been compiled by merging all relevant
@@ -248,7 +248,7 @@ def env() -> Mapping[str, Optional[str]]:
# and committing the resulting changes. It also requires redeploying the
# `shared` component.
#
'azul_python_version': '3.11.10',
'azul_python_version': '3.12.6',

# The version of Terraform used throughout the system.
#
@@ -279,7 +279,7 @@ def env() -> Mapping[str, Optional[str]]:
# See `azul_python_version` above about what actions are required
# after modifying this entry.
'python': {
'ref': 'docker.io/library/python:{azul_python_version}-slim-bullseye',
'ref': 'docker.io/library/python:{azul_python_version}-slim-bookworm',
'url': 'https://hub.docker.com/_/python',
},
'pycharm': {
2 changes: 1 addition & 1 deletion scripts/convert_environment.py
Original file line number Diff line number Diff line change
@@ -109,7 +109,7 @@ def env() -> Mapping[str, Optional[str]]:
other environment variables in the form `{FOO}` where FOO is the name of an
environment variable. See
https://docs.python.org/3.11/library/string.html#format-string-syntax
https://docs.python.org/3.12/library/string.html#format-string-syntax
for the concrete syntax. These references will be resolved *after* the
overall environment has been compiled by merging all relevant
2 changes: 1 addition & 1 deletion scripts/export_environment.py
Original file line number Diff line number Diff line change
@@ -57,7 +57,7 @@ def env(self) -> DraftEnvironment:
references to other environment variables in the form `{FOO}` where
FOO is the name of an environment variable. See
https://docs.python.org/3.11/library/string.html#format-string-syntax
https://docs.python.org/3.12/library/string.html#format-string-syntax
for the concrete syntax. Any references will be resolved after the
environment has been compiled by merging all environment.py files.
2 changes: 1 addition & 1 deletion src/azul/logging.py
Original file line number Diff line number Diff line change
@@ -56,7 +56,7 @@ def configure_app_logging(app: AzulChaliceApp, *loggers):
# module can be found on GitHub, in the repository linked below. Note
# that one must extract the image tarball to get to the module.
#
# https://github.com/aws/aws-lambda-base-images/tree/python3.11
# https://github.com/aws/aws-lambda-base-images/tree/python3.12
#
handler = one(root_logger.handlers)
root_formatter = logging.Formatter(lambda_log_format, lambda_log_date_format)
8 changes: 4 additions & 4 deletions test/test_log_forwarding.py
Original file line number Diff line number Diff line change
@@ -153,8 +153,8 @@ def test_s3(self):
'85',
'52',
dq('-'),
dq('Boto3/1.24.94 Python/3.11.5 Linux/4.14.255-301-238.520.amzn2.x86_64',
'exec-env/AWS_Lambda_python3.11 aws-chalice/1.30.0 Botocore/1.27.94'),
dq('Boto3/1.24.94 Python/3.12.6 Linux/4.14.255-301-238.520.amzn2.x86_64',
'exec-env/AWS_Lambda_python3.12 aws-chalice/1.30.0 Botocore/1.27.94'),
'-',
'jcmyLMRqqJ7dT4ovtY21rtgwmuTC3qs24vgAtLAkcad9sRV92zC90gf2zGvCkxxsLSaKm48AMjo=',
'SigV4',
@@ -193,8 +193,8 @@ def test_s3(self):
'tls_version': 'TLSv1.2',
'total_time': '85',
'turn_around_time': '52',
'user_agent': 'Boto3/1.24.94 Python/3.11.5 Linux/4.14.255-301-238.520.amzn2.x86_64 '
'exec-env/AWS_Lambda_python3.11 aws-chalice/1.30.0 Botocore/1.27.94',
'user_agent': 'Boto3/1.24.94 Python/3.12.6 Linux/4.14.255-301-238.520.amzn2.x86_64 '
'exec-env/AWS_Lambda_python3.12 aws-chalice/1.30.0 Botocore/1.27.94',
'version_id': '-',
}]
self._test(self.controller.forward_s3_access_logs, input, expected_output)

0 comments on commit df6271c

Please sign in to comment.