[mypy] Need help to fix all mypy errors in the codebase
#4052
Comments
|
@dhruvmanila I am beginner programmer in python. Is there any help I can do regarding this? |
|
wrking |
Update:With the latest update for |
|
I updated the list above to reflect the directories that pass in our build GitHub Action. As contributors fix directories, please add them to the mypy tests in |
…dimensional.py" (TheAlgorithms#4216) Related Issue: TheAlgorithms#4052
|
Whle happily plugging away fixing mypy issues, I inadvertently triggered the bot by opening too many MRs Shall I work by directory instead @dhruvmanila ? It'd save me considerable overhead in creating potentially many MRs, but would lead to probably considerably bigger MRs. I see that @pikulet ran into the same problem fixing the proj euler files and then switched to 1 MR for all the proj euler files. |
|
I would be willing to live with mypy fixes on a directory-by-directory basis. I doubt that we need to go all the way to |
* Update annotations to Python 3.10 #4052 * Add floats doctest * Copy list to avoid changing input unpredictably * Refactor code to make it readable * updating DIRECTORY.md * Improve raised ValueErrors and add doctest * Split doctest in multiples lines * Change ValueError to Monogons and Digons are not poly * Correct doctest refering number of sides Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
…dimensional.py" (TheAlgorithms#4216) Related Issue: TheAlgorithms#4052
* fix: type annotations for pypi🏷️ Fixes TheAlgorithms#4052 * updating DIRECTORY.md * apply suggestions from code review Co-authored-by: Christian Clauss <cclauss@me.com> Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Co-authored-by: Christian Clauss <cclauss@me.com>
* Update annotations to Python 3.10 TheAlgorithms#4052 * Add floats doctest * Copy list to avoid changing input unpredictably * Refactor code to make it readable * updating DIRECTORY.md * Improve raised ValueErrors and add doctest * Split doctest in multiples lines * Change ValueError to Monogons and Digons are not poly * Correct doctest refering number of sides Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* [mypy] fix type annotations for graphs/a_star.py #4052 * updating DIRECTORY.md * Add from __future__ import anotations * rename delta by DIRECTIONS Co-authored-by: John Law <johnlaw.po@gmail.com> * Rename delta by DIRECTIONS in all code * Enclose script in __main__ code block * Refactor DIRECTIONS with comments for readibility * Delete heuristic example comment * Do not print, return all values * Fix multilines * fix black * Update a_star.py Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Co-authored-by: John Law <johnlaw.po@gmail.com>
|
Going directory by directory now: 3 additional directories done. Back into timeout, because the next PR will make the bot angry ;) I'm personally aiming for |
+ Prefer tuple to list for point x,y pairs
+ Prefer tuple to list for point x,y pairs
+ Prefer tuple to list for point x,y pairs
UPDATE: Our GitHub Actions now run
mypy --ignore-missing-importsexcluding those directories that fail that test.Currently, we are not running
mypyin our regular CI tests as there are a lot of errors in the entire codebase, which needs to be fixed. This won't be a one-person job, so we are asking for help from you. I cannot paste the entire message in here as there are around 600 of them, so here's just a gist of it:Guidelines to follow:
mypyin our CI tests, the user who is submitting a pull request should run it on their local machine and ensure there are no errors in their submission.mypyin it. If possible use this template for your pull request title:Which errors to fix?
Please follow the below steps to produce all the errors in this library:
Then you need to install all the necessary requirements:
Then run either of the two commands:
mypy --ignore-missing-imports .-> To produce all the error messages for the entire codebase.mypy --ignore-missing-imports <filepath1> <filepath2> ...-> To produce error messages for the mentioned file.How to fix the errors?
Focus on one directory at a time:
Pre-requisites:
mypy: https://mypy.readthedocs.ioThe text was updated successfully, but these errors were encountered: