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

chore(python): Add Python 3.12 #1903

Merged
merged 2 commits into from
Nov 23, 2023
Merged

chore(python): Add Python 3.12 #1903

merged 2 commits into from
Nov 23, 2023

Conversation

m-strzelczyk
Copy link
Contributor

Following what #1742 did.

@m-strzelczyk m-strzelczyk marked this pull request as ready for review November 21, 2023 13:38
@parthea
Copy link
Contributor

parthea commented Nov 21, 2023

Thanks for putting this together @m-strzelczyk ! Please could you also help with testing in a downstream repo, for example python-bigquery-storage?

I think we may need to add python 3.12 support in https://github.com/googleapis/testing-infra-docker/blob/c02d27d75de5d8f4edb90568e15f42bd9d400c91/python/googleapis/python-multi/Dockerfile#L122 which is for the gcr.io/cloud-devrel-kokoro-resources/python-multi:latest image used in the Kokoro Prerelease Dependencies . For example, see this check in python-bigquery-storage.

To test the changes, run the following command in a clone of this repo (in the specific branch where you made changes)

docker build -f docker/owlbot/python/Dockerfile -t python312 .

Then in a downstream repo such as https://github.com/googleapis/python-bigquery-storage, run

docker run --user $(id -u):$(id -g) --rm -v $(pwd):/repo -w /repo python312

@parthea parthea assigned m-strzelczyk and unassigned chingor13 Nov 21, 2023
@parthea parthea changed the title feat(python): Adding Python3.12 support chore(python): Adding Python3.12 support Nov 21, 2023
@m-strzelczyk
Copy link
Contributor Author

I ran the commands you mentioned, but I'm not sure that it actually tested the new python-multi image. I did build the docker/owlbot/python/Dockerfile image and used it on python-bigquery-storage - it seems to only run black on the source code.

Not sure how to locally replicate the whole build and test process that actually runs inside the python-multi on Kokoro.

I did similar changes to python-docs-samples/.kokoro/docker/Dockerfile in #10930 and it worked fine there. As far as I can see, those Dockerfiles are almost identical.

@parthea
Copy link
Contributor

parthea commented Nov 22, 2023

In the monorepo we use the latest python runtime in the prerelease_deps nox session. I think we need this change in split repositories to help with the roll out of the new runtime. Unrelated to your changes, could you please update the file synthtool/gcp/templates/python_library/noxfile.py.j2 to use the latest python version for the prerelease_deps nox session in split repos?

@nox.session(python="{{ unit_test_python_versions | last }}")
def prerelease_deps(session):

@nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS)
def prerelease_deps(session):

@parthea parthea assigned m-strzelczyk and unassigned parthea Nov 22, 2023
@parthea
Copy link
Contributor

parthea commented Nov 23, 2023

Will address #1903 (comment) in a separate PR

@parthea parthea changed the title chore(python): Adding Python3.12 support chore(python): Adding Python 3.12 support to templates Nov 23, 2023
@parthea parthea changed the title chore(python): Adding Python 3.12 support to templates chore(python): Add Python 3.12 to templates Nov 23, 2023
@parthea parthea changed the title chore(python): Add Python 3.12 to templates chore(python): Add Python 3.12 Nov 23, 2023
@parthea parthea merged commit af16e6d into master Nov 23, 2023
11 checks passed
@parthea parthea deleted the strzelczyk/python3.12 branch November 23, 2023 18:12
parthea added a commit to googleapis/google-cloud-python that referenced this pull request Nov 29, 2023
This PR updates the post processor image to the latest one which is
`gcr.io/cloud-devrel-public-resources/owlbot-python-mono-repo@sha256:957ddc3272f6b8058ff0ca2e8692b56f0a764d804fd577670385d54f19ee43d6`.

The latest image adds support for python 3.12
googleapis/synthtool#1903

Run the following commands to obtain the latest sha256
```
docker pull gcr.io/cloud-devrel-public-resources/owlbot-python-mono-repo:latest
```

```
docker inspect --format='{{.RepoDigests}}' gcr.io/cloud-devrel-public-resources/owlbot-python-mono-repo:latest
[gcr.io/cloud-devrel-public-resources/owlbot-python-mono-repo@sha256:957ddc3272f6b8058ff0ca2e8692b56f0a764d804fd577670385d54f19ee43d6]
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants