-
Notifications
You must be signed in to change notification settings - Fork 69
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
Conversation
ee83359
to
874b67b
Compare
4207673
to
48b8557
Compare
48b8557
to
bee0d15
Compare
f0250fd
to
fdff2fd
Compare
There was a problem hiding this 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.
.github/workflows/tests.yaml
Outdated
@@ -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" |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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
.github/workflows/tests.yaml
Outdated
@@ -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" |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
:
gapic-generator-python/gapic/templates/noxfile.py.j2
Lines 147 to 159 in bd81e52
@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"] |
Changes
setup.py
innoxfile.py
which is deprecated. Removeslint_setup_py
nox session.invalid escape sequence
in 18dd230