-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Update black to the latest version incrementally #8476
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Vladimir Bataev <vbataev@nvidia.com>
Signed-off-by: Vladimir Bataev <vbataev@nvidia.com>
Signed-off-by: Vladimir Bataev <vbataev@nvidia.com>
Signed-off-by: Vladimir Bataev <vbataev@nvidia.com>
Signed-off-by: Vladimir Bataev <vbataev@nvidia.com>
Signed-off-by: Vladimir Bataev <vbataev@nvidia.com>
Signed-off-by: Vladimir Bataev <vbataev@nvidia.com>
Signed-off-by: Vladimir Bataev <vbataev@nvidia.com>
Signed-off-by: Vladimir Bataev <vbataev@nvidia.com>
Signed-off-by: Vladimir Bataev <vbataev@nvidia.com>
Signed-off-by: Vladimir Bataev <vbataev@nvidia.com>
c3885e5
to
ebc576c
Compare
Signed-off-by: artbataev <artbataev@users.noreply.github.com>
Signed-off-by: Vladimir Bataev <vbataev@nvidia.com>
Signed-off-by: Vladimir Bataev <vbataev@nvidia.com>
Signed-off-by: Vladimir Bataev <vbataev@nvidia.com>
Signed-off-by: Vladimir Bataev <vbataev@nvidia.com>
This PR is stale because it has been open for 14 days with no activity. Remove stale label or comment or update or this will be closed in 7 days. |
This PR was closed because it has been inactive for 7 days since being marked as stale. |
Signed-off-by: Vladimir Bataev <vbataev@nvidia.com>
Signed-off-by: artbataev <artbataev@users.noreply.github.com>
Signed-off-by: Vladimir Bataev <vbataev@nvidia.com>
Signed-off-by: Vladimir Bataev <vbataev@nvidia.com>
Test changes from fork: #8996 |
Signed-off-by: Vladimir Bataev <vbataev@nvidia.com>
Signed-off-by: Vladimir Bataev <vbataev@nvidia.com>
Signed-off-by: Vladimir Bataev <vbataev@nvidia.com>
Signed-off-by: Vladimir Bataev <vbataev@nvidia.com>
Signed-off-by: Vladimir Bataev <vbataev@nvidia.com>
Signed-off-by: Vladimir Bataev <vbataev@nvidia.com>
Signed-off-by: Vladimir Bataev <vbataev@nvidia.com>
pablo-garay
approved these changes
Apr 29, 2024
titu1994
approved these changes
May 10, 2024
BoxiangW
pushed a commit
to BoxiangW/NeMo
that referenced
this pull request
Jun 5, 2024
* Update black version Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Skip pre-commit.ci Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Allow to fix PRs Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Fix requirements Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Add github action for reformatting Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Update github action Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Test change python file Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Use allowed github actions Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Remove installation Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Fix add-and-commit Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Apply isort and black reformatting Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Test DCO Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Apply isort and black reformatting Signed-off-by: artbataev <artbataev@users.noreply.github.com> * Clean up Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Clean up Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Fix isort version Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Fix isort version Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Fix isort version and add comments Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Trigger only on PRs Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Apply isort and black reformatting Signed-off-by: artbataev <artbataev@users.noreply.github.com> * Fix action (requires token) Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Update formatter versions Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Test reformat file Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Add comments Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Check with default github token Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Apply isort and black reformatting Signed-off-by: artbataev <artbataev@users.noreply.github.com> * Use custom token Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Test user Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Remove user Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Apply isort and black reformatting Signed-off-by: artbataev <artbataev@users.noreply.github.com> * Test change Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Apply isort and black reformatting Signed-off-by: artbataev <artbataev@users.noreply.github.com> * Use github token Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Test change Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Apply isort and black reformatting Signed-off-by: artbataev <artbataev@users.noreply.github.com> * Add token to changed files Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Test changes Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Apply isort and black reformatting Signed-off-by: artbataev <artbataev@users.noreply.github.com> * Fix fetch depth Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Fix fetch depth Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Avoid setting repository Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Avoid setting ref Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Use pull_request_target Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Fix version Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Add comments Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Test change Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Revert change Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> --------- Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> Signed-off-by: artbataev <artbataev@users.noreply.github.com> Co-authored-by: artbataev <artbataev@users.noreply.github.com> Signed-off-by: Boxiang Wang <boxiangw@nvidia.com>
rohitrango
pushed a commit
to rohitrango/NeMo
that referenced
this pull request
Jun 25, 2024
* Update black version Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Skip pre-commit.ci Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Allow to fix PRs Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Fix requirements Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Add github action for reformatting Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Update github action Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Test change python file Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Use allowed github actions Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Remove installation Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Fix add-and-commit Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Apply isort and black reformatting Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Test DCO Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Apply isort and black reformatting Signed-off-by: artbataev <artbataev@users.noreply.github.com> * Clean up Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Clean up Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Fix isort version Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Fix isort version Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Fix isort version and add comments Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Trigger only on PRs Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Apply isort and black reformatting Signed-off-by: artbataev <artbataev@users.noreply.github.com> * Fix action (requires token) Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Update formatter versions Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Test reformat file Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Add comments Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Check with default github token Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Apply isort and black reformatting Signed-off-by: artbataev <artbataev@users.noreply.github.com> * Use custom token Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Test user Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Remove user Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Apply isort and black reformatting Signed-off-by: artbataev <artbataev@users.noreply.github.com> * Test change Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Apply isort and black reformatting Signed-off-by: artbataev <artbataev@users.noreply.github.com> * Use github token Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Test change Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Apply isort and black reformatting Signed-off-by: artbataev <artbataev@users.noreply.github.com> * Add token to changed files Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Test changes Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Apply isort and black reformatting Signed-off-by: artbataev <artbataev@users.noreply.github.com> * Fix fetch depth Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Fix fetch depth Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Avoid setting repository Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Avoid setting ref Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Use pull_request_target Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Fix version Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Add comments Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Test change Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> * Revert change Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> --------- Signed-off-by: Vladimir Bataev <vbataev@nvidia.com> Signed-off-by: artbataev <artbataev@users.noreply.github.com> Co-authored-by: artbataev <artbataev@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Update black using incremental changes only for files changed in PRs.
black
package is updated to the latest versionblack .
will reformat nothingblack my_file.py
)Tests (target branch is
update_black
):Approach:
Q&A About the Approach
The pre-commit hook is still active and works, but pre-commit.ci reformats all the code (the pre-commit.ci team explicitly denied changing this behavior, see pre-commit-ci/issues#90), thus it is replaced with a custom GitHub Action, which does the same, but only for the changed files (in the PR)
Since both
isort
andblack
can change files, this should be done in one action to avoid concurrent changes. So, the GitHub Action will execute both formatters and commit changes if needed (same behavior as for pre-commit.ci).When GitHub action pushes the commit with the default secret token, it cannot trigger other workflows.
See the discussion: https://github.com/orgs/community/discussions/25702
This can only be done with custom tokens.
Collection: [CI]
Changelog
Usage
# Add a code snippet demonstrating how to use this
Jenkins CI
To run Jenkins, a NeMo User with write access must comment
jenkins
on the PR.Before your PR is "Ready for review"
Pre checks:
PR Type:
If you haven't finished some of the above items you can still open "Draft" PR.
Who can review?
Anyone in the community is free to review the PR once the checks have passed.
Contributor guidelines contains specific people who can review PRs to various areas.
Additional Information