Skip to content

[Issue 760] - Python tooling - #761

Merged
harshach merged 3 commits into
open-metadata:mainfrom
StuartApp:issue-760
Oct 14, 2021
Merged

harshach merged 3 commits into
open-metadata:mainfrom
StuartApp:issue-760

Conversation

@pmbrull

@pmbrull pmbrull commented Oct 13, 2021 •

Copy link
Copy Markdown
Member

Describe your changes :

Fixes #760 with a first round of:

  • Centralise python tooling in Makefile
  • Adding black as formatting tool in Makefile
  • Add black to Python's style check in the CI process
  • Run black to the current codebase

Type of change :

  • Bug fix
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation

Checklist:

  • I have read the CONTRIBUTING document.
  • I have performed a self-review of my own.
  • I have tagged my reviewers below.
  • I have commented on my code, particularly in hard-to-understand areas.
  • My changes generate no new warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • All new and existing tests passed.

Reviewers

@harshach if you could take a look pls. Also, happy to discuss the comments in the ticket #760

@harshach

Copy link
Copy Markdown
Collaborator

@pmbrull Thanks a lot for this patch. Looks great.
@ayush-shah can we run some tests before merging it in.

@pmbrull

pmbrull commented Oct 14, 2021 •

Copy link
Copy Markdown
Member Author

Thanks, @harshach!

Any thoughts on the usage of the pre-commit hook? To keep it clean, as here we already have quite some changes due to the formatting, I can open a new PR updating the contributing docs as well.

Finally, I had a couple of questions @ayush-shah:

  • Do we need to use a virtualenv in the CICD? If I understood it correctly, the agent should be ephemeral, or is there a specific reason to install the reqs in the venv?
  • We don't have the same Python version specified in the Makefile and the CICD workflow. Should we stick to 3.9?

Thanks

@pmbrull

pmbrull commented Oct 14, 2021

Copy link
Copy Markdown
Member Author

I've also noticed this PR #376. With these changes, the line-too-long error should be mostly fixed and if we add isort as a pre-commit and recipe, the import orders will automatically be ok.

@ayush-shah

Copy link
Copy Markdown
Member

Hey @pmbrull, this PR will help solve most of the formatting problems we were facing before.
Thank you

To answer your questions

  • We added installing of the requirements in venv because of pylint giving Unable to import or different import errors and to resolve those and keep a track if any of the package requirements have been misspelled or is fetching wrong version, we get to know that before merging the PR,so we started installing requirements under venv. Also without venv, we did try that, and some of the packages were conflicting with other and the checks went into infinite loop, installing the conflicted package again and again with different lower versions.
  • I think going with 3.8 or 3.9 both would be fine, but keeping it conventional throughout the project would be better.

I don't know if it made much sense, @harshach will be able to answer it much better

@harshach

Copy link
Copy Markdown
Collaborator

Can we set it to 3.8. We dont have hard requirement on 3.9 @ayush-shah

@harshach

Copy link
Copy Markdown
Collaborator

@pmbrull thanks for the patch. I am merging it. If there are any todos we can address in follow-up patches.

@harshach
harshach merged commit 9a362da into open-metadata:main Oct 14, 2021
@pmbrull
pmbrull deleted the issue-760 branch October 14, 2021 15:21
@pmbrull

pmbrull commented Oct 14, 2021

Copy link
Copy Markdown
Member Author

@pmbrull thanks for the patch. I am merging it. If there are any todos we can address in follow-up patches.

Great thanks, I'll prepare something with the rest of the topics

@ayush-shah ayush-shah mentioned this pull request Oct 14, 2021
3 of 7 tasks
@pmbrull pmbrull mentioned this pull request Oct 14, 2021
6 of 11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python tooling

3 participants