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

feat: add support for python 3.12 #1816

Merged
merged 20 commits into from
Nov 10, 2023
Merged

feat: add support for python 3.12 #1816

merged 20 commits into from
Nov 10, 2023

Conversation

ohmayr
Copy link
Contributor

@ohmayr ohmayr commented Oct 24, 2023

Changes

  • Removes calls to setup.py in noxfile.py which is deprecated. Removes lint_setup_py nox session.
  • Resolve SyntaxWarning with python 3.12 invalid escape sequence in 18dd230
  • Updates CI to use python 3.12

@product-auto-label product-auto-label bot added the size: m Pull request size is medium. label Oct 24, 2023
@ohmayr ohmayr force-pushed the add-support-for-python-3.12 branch from ee83359 to 874b67b Compare October 24, 2023 16:34
@parthea parthea added the owlbot:run Add this label to trigger the Owlbot post processor. label Nov 10, 2023
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Nov 10, 2023
@parthea parthea added the owlbot:run Add this label to trigger the Owlbot post processor. label Nov 10, 2023
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Nov 10, 2023
@parthea parthea force-pushed the add-support-for-python-3.12 branch from 4207673 to 48b8557 Compare November 10, 2023 18:47
@parthea parthea force-pushed the add-support-for-python-3.12 branch from 48b8557 to bee0d15 Compare November 10, 2023 19:19
@parthea parthea added the owlbot:run Add this label to trigger the Owlbot post processor. label Nov 10, 2023
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Nov 10, 2023
@parthea parthea force-pushed the add-support-for-python-3.12 branch from f0250fd to fdff2fd Compare November 10, 2023 19:34
@parthea parthea added the owlbot:run Add this label to trigger the Owlbot post processor. label Nov 10, 2023
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Nov 10, 2023
@parthea parthea marked this pull request as ready for review November 10, 2023 20:23
@parthea parthea requested a review from a team as a code owner November 10, 2023 20:23
@parthea parthea added the owlbot:run Add this label to trigger the Owlbot post processor. label Nov 10, 2023
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Nov 10, 2023
Copy link
Contributor

@vchudnov-g vchudnov-g left a comment

Choose a reason for hiding this comment

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

Looks good. One question about the lint check.

Also, in the places where we test against just the latest version of Python, it might be good to have a line about why testing only one version is good, and why we're doing the newest supported rather than the oldest.

@@ -36,10 +37,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python "3.11"
- name: Set up Python "3.12"
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we add a note explaining why we're running mypy only on the latest version? (Not objecting; just for clarity. We could choose to just run it on the earliest version)

Copy link
Contributor

Choose a reason for hiding this comment

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

In bd81e52, I've updated the code to run mypy on all runtimes supported by mypy since we should make sure static analysis passes on all versions. All checks passed on all runtimes

@@ -52,10 +53,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python "3.11"
- name: Set up Python "3.12"
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we add a note explaining why we're running showcase only on the latest version? (Not objecting; just for clarity. We could choose to just run it on the earliest version, to help ensure backwards compatibility)

Copy link
Contributor

Choose a reason for hiding this comment

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

I updated this check to run on the oldest and latest version and added a comment

@@ -169,11 +169,4 @@ def blacken(session):
*BLACK_PATHS,
)


@nox.session(python=DEFAULT_PYTHON_VERSION)
def lint_setup_py(session):
Copy link
Contributor

Choose a reason for hiding this comment

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

We're still doing the lint checks?

Copy link
Contributor

@parthea parthea Nov 10, 2023

Choose a reason for hiding this comment

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

Yes, we are still running black via the lint nox session which will fail if there are syntax errors in setup.py:

@nox.session(python=DEFAULT_PYTHON_VERSION)
def lint(session):
"""Run linters.
Returns a failure if the linters find linting errors or sufficiently
serious code quality issues.
"""
session.install("flake8", BLACK_VERSION)
session.run(
"black",
"--check",
*BLACK_PATHS,
)

BLACK_PATHS = ["docs", "google", "tests", "samples", "noxfile.py", "setup.py"]

@parthea parthea merged commit b65898e into main Nov 10, 2023
66 checks passed
@parthea parthea deleted the add-support-for-python-3.12 branch November 10, 2023 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants