-
Notifications
You must be signed in to change notification settings - Fork 7k
[doc] use python 3.12 to perform policy check #58526
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
Conversation
this makes it possible to run on a different python version than the CI wrapper code. Signed-off-by: Lonnie Liu <[email protected]>
It is technically still using the resolved dependencies of python 3.9, but all libraries used are version agnostic, it should run. Signed-off-by: Lonnie Liu <[email protected]>
|
this is built on top of #58516 |
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.
Code Review
This pull request updates the Python version for the policy check to 3.12 and refactors several scripts to remove dependencies on ray_ci.utils and ray_release. The changes replace a custom logger with standard print statements to sys.stderr, which is a reasonable simplification for CI scripts. The logic for determining when to perform a dry run in cmd_build.py has also been simplified. I've suggested a small refactoring to make the dry_run logic even cleaner. Overall, the changes are well-aligned with the goal of updating the Python environment and reducing dependencies.
| dry_run = False | ||
| if ( | ||
| os.environ.get("BUILDKITE_PIPELINE_ID") | ||
| not in get_global_config()["ci_pipeline_postmerge"] | ||
| ): | ||
| if os.environ.get("RAYCI_STAGE", "") != "postmerge": | ||
| dry_run = True | ||
| logger.info( | ||
| "Not uploading build artifacts because this is not a postmerge pipeline." | ||
| print( | ||
| "Not uploading build artifacts because this is not a postmerge pipeline.", | ||
| file=sys.stderr, | ||
| ) | ||
|
|
||
| if os.environ.get("BUILDKITE_BRANCH") != "master": | ||
| elif os.environ.get("BUILDKITE_BRANCH") != "master": | ||
| dry_run = True | ||
| logger.info( | ||
| "Not uploading build artifacts because this is not the master branch." | ||
| print( | ||
| "Not uploading build artifacts because this is not the master branch.", | ||
| file=sys.stderr, | ||
| ) |
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.
The logic to determine dry_run can be simplified. By setting dry_run to True by default and only changing it to False when the conditions for an upload are met, you can make the code more concise and avoid repeating dry_run = True.
| dry_run = False | |
| if ( | |
| os.environ.get("BUILDKITE_PIPELINE_ID") | |
| not in get_global_config()["ci_pipeline_postmerge"] | |
| ): | |
| if os.environ.get("RAYCI_STAGE", "") != "postmerge": | |
| dry_run = True | |
| logger.info( | |
| "Not uploading build artifacts because this is not a postmerge pipeline." | |
| print( | |
| "Not uploading build artifacts because this is not a postmerge pipeline.", | |
| file=sys.stderr, | |
| ) | |
| if os.environ.get("BUILDKITE_BRANCH") != "master": | |
| elif os.environ.get("BUILDKITE_BRANCH") != "master": | |
| dry_run = True | |
| logger.info( | |
| "Not uploading build artifacts because this is not the master branch." | |
| print( | |
| "Not uploading build artifacts because this is not the master branch.", | |
| file=sys.stderr, | |
| ) | |
| dry_run = True | |
| if os.environ.get("RAYCI_STAGE", "") != "postmerge": | |
| print( | |
| "Not uploading build artifacts because this is not a postmerge pipeline.", | |
| file=sys.stderr, | |
| ) | |
| elif os.environ.get("BUILDKITE_BRANCH") != "master": | |
| print( | |
| "Not uploading build artifacts because this is not the master branch.", | |
| file=sys.stderr, | |
| ) | |
| else: | |
| dry_run = False |
|
going to use python 3.10 instead. |
It is technically still using the resolved dependencies of python
3.9, but all libraries used are version agnostic, it should run.