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: update default Python version to 3.12 for tests and formatting #93

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

tswast
Copy link
Collaborator

@tswast tswast commented Feb 14, 2025

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> 🦕

@tswast tswast requested review from a team as code owners February 14, 2025 22:42
@product-auto-label product-auto-label bot added the size: xs Pull request size is extra small. label Feb 14, 2025
@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/python-bigquery-magics API. label Feb 14, 2025
@tswast tswast added owlbot:run Add this label to trigger the Owlbot post processor. and removed api: bigquery Issues related to the googleapis/python-bigquery-magics API. size: xs Pull request size is extra small. labels Feb 14, 2025
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Feb 14, 2025
@product-auto-label product-auto-label bot added the size: xs Pull request size is extra small. label Feb 14, 2025
@tswast tswast added the owlbot:run Add this label to trigger the Owlbot post processor. label Feb 14, 2025
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Feb 14, 2025
@tswast tswast added the owlbot:run Add this label to trigger the Owlbot post processor. label Feb 14, 2025
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Feb 14, 2025
@tswast
Copy link
Collaborator Author

tswast commented Feb 14, 2025

Owlbot is failing at the final step:

Step #5: noxfile.py.j2
Step #5: Traceback (most recent call last):
Step #5:   File "/workspace/python-bigquery-magics/owlbot.py", line 102, in <module>
Step #5:     s.shell.run(["nox", "-s", "format"], hide_output=False)
Step #5:   File "/synthtool/synthtool/shell.py", line 39, in run
Step #5:     raise exc
Step #5:   File "/synthtool/synthtool/shell.py", line 27, in run
Step #5:     return subprocess.run(
Step #5:   File "/usr/local/lib/python3.10/subprocess.py", line 524, in run
Step #5:     raise CalledProcessError(retcode, process.args,
Step #5: subprocess.CalledProcessError: Command '['nox', '-s', 'format']' returned non-zero exit status 1.
Finished Step #

I suspect this is because the gcr.io/cloud-devrel-public-resources/owlbot-python might not have Python 3.9+ installed? @parthea Do you know? I'm not seeing it in https://github.com/googleapis/testing-infra-docker/tree/main

@tswast tswast added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Feb 14, 2025
@@ -41,6 +41,7 @@
"3.13": extras_bf,
}
templated_files = common.py_library(
default_python_version="3.9",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
default_python_version="3.9",
default_python_version="3.12",

@parthea
Copy link
Contributor

parthea commented Feb 14, 2025

Correct, only 3.8 and 3.10 are available in owlbot-python. We could update 3.8 to a newer runtime given that it's almost EOL

https://github.com/googleapis/synthtool/blob/master/docker/owlbot/python/Dockerfile

@parthea
Copy link
Contributor

parthea commented Feb 14, 2025

We could consider removing the automatic code formatting and add a presubmit to fail if the code is does not meet formatting requirements. Alternatively, code formatting could be outside of owlbot.py , via something like Github actions.

WDYT about removing the lines below?

s.shell.run(["nox", "-s", "format"], hide_output=False)
for noxfile in REPO_ROOT.glob("samples/**/noxfile.py"):
s.shell.run(["nox", "-s", "blacken"], cwd=noxfile.parent, hide_output=False)

@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/python-bigquery-magics API. label Feb 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-bigquery-magics API. do not merge Indicates a pull request not ready for merge, due to either quality or timing. size: xs Pull request size is extra small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants