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 20, 2024
1 parent 93637ff commit 5e1d676
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.7. Replace `3.12.7` 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.7
```
Set `PYENV_VERSION` to `3.11.6` in `environment.local.py` at the project root.
Set `PYENV_VERSION` to `3.12.7` 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.7-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.7. 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:08ef1d5c4e0c05244f0971150437c57f6c79863345e549dbaebaf1b61f56bdf5",
"mirror_digest": "sha256:09a5465104e071630d396dd7f5df5b9d1b5b153c4d93b1754d5b5ad54952add6",
"docker.io/library/python:3.12.7-slim-bookworm": {
"digest": "sha256:2a6386ad2db20e7f55073f69a98d6da2cf9f168e05e7487d2670baeb9b7601c5",
"mirror_digest": "sha256:e0a42aac29c848373dadeb69551ffa6ab97a9aceba49b415bafc8c117e9dd074",
"parts": {
"linux/amd64": {
"digest": "sha256:a7da3e46261ff9e4b50e9cddb3cd353e556f3cc25bf5d1afbdad7830d7774ea1",
"id": "sha256:f5a49d225614c739b0f588371e1738969fa5a2bcc8d713119ce986e3bdd5df7e",
"digest": "sha256:c013e32e74b0ed13ac59533a446bcfcc962a877ea534ef305d455624dd71b1ac",
"id": "sha256:668757ec60efb72ddf3c03bc8d452cc79173fcc6a04c5b5d5f8b470ff1370973",
"platform": "linux/amd64"
},
"linux/arm64": {
"digest": "sha256:5673b12f58d57c38e7efb2bd751defa984526efb3e4e50a33b4e9d1c217bfbee",
"id": "sha256:238e9ccdbb8c59f5680c31b84b6ef7e325004250a6036d97a54109aaabc29261",
"digest": "sha256:d21d7b3b7dbd985e7e71b42435d5218c2a4b211e4fca66f3a9b66f2c7624fcec",
"id": "sha256:e359a8be29f6b9052628a435cb590f905d643431f96f7c1decce226155cc6d3b",
"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:09a5465104e071630d396dd7f5df5b9d1b5b153c4d93b1754d5b5ad54952add6
azul_python_version=3.12.7
azul_python_image=docker.io/library/python@sha256:e0a42aac29c848373dadeb69551ffa6ab97a9aceba49b415bafc8c117e9dd074
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.7',

# 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.7 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.7 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 5e1d676

Please sign in to comment.