-   Notifications  You must be signed in to change notification settings 
- Fork 21
fix(testing+linting): add nox lint+format directives #123
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
   Merged  
  gauravpurohit06 merged 2 commits into googleapis:main from orijtech:testing-add-nox-lint+blacken+enable-unit-testing        Jan 30, 2025  
    Merged  
 Changes from all commits
 Commits 
  Show all changes 
  2 commits   Select commit Hold shift + click to select a range 
  File filter
Filter by extension
Conversations
 Failed to load comments.  
    Loading  
 Jump to
  Jump to file  
  Failed to load files.  
    Loading  
 Diff view
Diff view
There are no files selected for viewing
   This file contains hidden or 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   
        This file contains hidden or 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   
        This file contains hidden or 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   
        This file contains hidden or 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   
        This file contains hidden or 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   
        This file contains hidden or 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   
        This file contains hidden or 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   
        This file contains hidden or 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   
      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.    
 
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.
Please remove these changes. This project (and consistently across other projects) does not use nox to run lints. Please see https://github.com/googleapis/langchain-google-spanner-python/blob/main/.github/workflows/lint.yml
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.
Hi @averikitsch, Do we have a reason for not using it?
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.
Also, for the future we should not be using "fix" in the commit message, that will trigger a new release and we do not create new releases for CI updates.
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.
@averikitsch thanks for your reply. The purpose of the PR is to get functionality to allow code to be formatted, unit tests to be run locally et al as code is being built by developers so as to speed up development. Do you perhaps have alternative suggestions for how to accomplish the above?
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.
@averikitsch python-spanner the main repo representing Cloud Spanner does use nox https://github.com/googleapis/python-spanner/blob/main/noxfile.py for linting, testing and all, for more than 7 years https://github.com/googleapis/python-spanner/commits/main/noxfile.py?after=32e761b0d4052938bf67cfec63a0e83702a35ada+34.
Could you perhaps explain your objections and help out with suggestions? This PR has been sitting for more than 2 weeks and it moving is necessary to accomplish other tasks.
Uh oh!
There was an error while loading. Please reload this page.
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.
Hi @averikitsch,
@odeke-em is trying to define a
nox taskfor liniting and running the test locally and for linting he is usingblack(i.e. we are using same in our workflows).If
noxfile.pyis not getting copied from any other repos or configurations.. I don't see any problem with the change.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.
This will be diverting from the other langchain repos. I am fine with adding it, but the Spanner team will have to keep it up to date as I mentioned that it doesn't get auto-updates and will not stay in sync with the repo CI setup. This may cause long term confusion for maintainers.
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.
Thank you @averikitsch. It won't need many updates except indeed as you mention mirror-ing pyproject dependencies into setup.py and those won't be updates needed even with a year. However, the benefits of having non-Googlers be able to develop and make updates robustly I believe shall heavily outweigh any of those. Also currently I can't even look at the Kokoro statuses as one needs to be a Googler per https://console.cloud.google.com/cloud-build/triggers/edit/16ba25ff-d74a-42ef-8f19-9780571439ab?project=585680705374

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.
pytestas noted in https://github.com/googleapis/langchain-google-spanner-python/blob/main/DEVELOPER.md#testing. Using the noxfile is just wrapping that command.