-
Notifications
You must be signed in to change notification settings - Fork 193
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
Changes to test.sh and pyproject.toml. #1110
base: main
Are you sure you want to change the base?
Conversation
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.
thanks!
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 again @carlosgmartin !
I'm leaving you a small comment. I'm really not an expert here, so you and Fabian will know better, but I'm just curious about some pylint errors you disabled.
Also (probably in another PR), one should make different actions in the github workflow to speed up the tests in github (like one for the actual tests, one for pytype, one for pylint, one for the docs). But this can be done in another CL. (right now we are reaching a test time of 19min which is quite long).
"test_venv", | ||
] | ||
|
||
[tool.pylint.messages_control] |
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.
Just to understand: why did you disable all these errors?
Just for you to know: each time a PR does not comply to pylint correctly, we have to patch it internally which slows down the process of migration. So as annoying as pylint may be, we have no other choice to comply with it normally.
I agree that actually the code should be fully cleaned to comply with the usual formattings. If that's the reason for you to disable all these messages let me know. If it's because you are using flake8, that's great.
@vroulet I disabled these Pylint messages because they were giving me too many errors throughout the repo. In my latest commit, I was able to re-enable several of them after making many small changes throughout the repo to conform to them. On my tour across the repo, I noticed that the code formatting is quite inconsistent and not always ideal. I highly recommend adopting a code auto-formatter like black (and maybe isort). For example, in my own personal monorepo, I use the following configuration.
[project.optional-dependencies]
dev = [
"isort",
"black",
"flake8",
"flake8-comprehensions",
"pyright",
"pytest",
]
[tool.pyright]
useLibraryCodeForTypes = false
reportPrivateImportUsage = false
reportIncompatibleMethodOverride = false
[tool.black]
line-length = 79
[tool.isort]
profile = "black"
combine_as_imports = true
line_length = 79
While developing, I simply run the command isort . && black . && flake8 && pyright && pytest If you want, I can make a separate PR that adds black (and maybe isort) and applies it once to the entire repo. |
Hello @carlosgmartin, Sorry for the delay. I made a pass on the codebase to format all files with our formatter and harmonize the docstrings, see #1129. I am not sure that our internal formatting tool matches black. I don't think so, given that I usually see discrepancies between the formatting you use and ours. So we'll need to fix this later. That pass removed some of the linting issues that were lingering through the codebase. I see that you made additional changes throughout the codebase. Sorry for the duplicate effort but our internal integration tool sometimes does not accept some external formatting rules, so I preferred to start with them. Looking at your modifications, I think they are orthogonal to some of the modifications I've done so after a merge I think you could also add them. After that we probably need to add flake8 in the list of files synced between github and the internal version to let this PR pass. I'll take a look once you merged your changes and we will hopefully be able to merge your effort. By the way, I suppose you wanted to tackle parallel github actions in a separate cl? Our tests on github are rather slow now and the best thing to do would probably be to have separate actions for pytest, pylint, real tests, docs. Thank you again @carlosgmartin for all your work on this repo! Let me know if you want help for the merge etc... |
abc8e5d
to
1529957
Compare
@vroulet Merged. A few suggestions for the future:
Yes, I'd make that a separate PR. This one's already quite big. |
Hello @carlosgmartin, A few remarks on your pass:
About the two-space indent policy, it's a choice that Google tool before PEP8. But Google still complies with C0330 for some reason. I/We cannot change this. |
I don't have experience with ruff, but I think it's always a good idea to do as closely as JAX. So +1 for moving to ruff |
@rdyro: did you want me to review these changes or to answer the question? it was unclear to me |
Sorry, I misclicked and didn't see an option to undo it |
Cleanup related to #1091. Changes include the following:
pyproject.toml
, a central configuration file..flake8
. (Flake8 is the odd one out because they reject supporting flake8.)test_venv/
andoptax-*.whl
to.gitignore
.test.sh
and add progress messages to it.