Skip to content
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

Fix flake8 in setup.py #598

Merged
merged 2 commits into from
Aug 5, 2020
Merged

Fix flake8 in setup.py #598

merged 2 commits into from
Aug 5, 2020

Conversation

esc
Copy link
Member

@esc esc commented Jun 16, 2020

As title. Clean this up with the start of a new release cycle.

esc added 2 commits June 16, 2020 09:50
The `shutil` import is no longer needed.
In Python we do prefer indentation to be done with 4 spaces.
Copy link
Contributor

@stuartarchibald stuartarchibald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the patch. Is flake8 CI not picking this up? Could it be added?

@esc
Copy link
Member Author

esc commented Jun 17, 2020

I looked into this today and it turns out, that the flake8 invocation on azure pipelines is flake8 llvmlite which will only run the style checker on the files inside the llvmlite directory. This excludes top level files such as the setup.py.

Running flake8 on the top level directory on master results in the following errors:

./run_coverage.py:9:1: F401 'sys' imported but unused
./bench.py:17:24: E702 multiple statements on one line (semicolon)
./setup.py:23:1: F401 'shutil' imported but unused
./setup.py:99:1: E302 expected 2 blank lines, found 1
./setup.py:174:9: E121 continuation line under-indented for hanging indent
./versioneer.py:335:1: E305 expected 2 blank lines after class or function definition, found 0
./versioneer.py:415:35: W605 invalid escape sequence '\s'
./versioneer.py:419:35: W605 invalid escape sequence '\s'
./versioneer.py:449:52: W605 invalid escape sequence '\d'
./versioneer.py:484:29: W605 invalid escape sequence '\d'
./versioneer.py:623:63: E226 missing whitespace around arithmetic operator
./versioneer.py:653:30: E226 missing whitespace around arithmetic operator
./versioneer.py:653:43: E226 missing whitespace around arithmetic operator
./versioneer.py:659:31: E226 missing whitespace around arithmetic operator
./versioneer.py:766:1: E305 expected 2 blank lines after class or function definition, found 1
./versioneer.py:909:1: E305 expected 2 blank lines after class or function definition, found 1
./versioneer.py:951:1: E305 expected 2 blank lines after class or function definition, found 1
./runtests.py:3:1: F401 'sys' imported but unused
./docs/gh-pages.py:40:1: E302 expected 2 blank lines, found 1
./docs/gh-pages.py:82:25: E228 missing whitespace around modulo operator
./docs/gh-pages.py:91:1: E305 expected 2 blank lines after class or function definition, found 1
./docs/gh-pages.py:115:81: E501 line too long (82 > 80 characters)
./docs/gh-pages.py:133:28: W605 invalid escape sequence '\#'
./docs/gh-pages.py:133:31: W605 invalid escape sequence '\s'
./docs/source/conf.py:18:1: F401 'shlex' imported but unused
./docs/source/conf.py:63:81: E501 line too long (87 > 80 characters)
./docs/source/conf.py:69:1: E402 module level import not at top of file
./docs/source/conf.py:131:81: E501 line too long (86 > 80 characters)
./docs/source/conf.py:232:1: E122 continuation line missing indentation or outdented
./docs/source/conf.py:233:1: E122 continuation line missing indentation or outdented
./docs/source/conf.py:235:1: E122 continuation line missing indentation or outdented
./docs/source/conf.py:236:1: E122 continuation line missing indentation or outdented
./docs/source/conf.py:238:1: E122 continuation line missing indentation or outdented
./docs/source/conf.py:239:1: E122 continuation line missing indentation or outdented
./docs/source/conf.py:241:1: E122 continuation line missing indentation or outdented
./docs/source/conf.py:242:1: E122 continuation line missing indentation or outdented
./docs/source/conf.py:249:3: E121 continuation line under-indented for hanging indent
./docs/source/conf.py:293:3: E121 continuation line under-indented for hanging indent
./docs/source/conf.py:315:5: E123 closing bracket does not match indentation of opening bracket's line
./docs/source/user-guide/examples/parseasm.py:37:1: W391 blank line at end of file
./docs/source/user-guide/examples/ll_fpadd.py:26:1: E302 expected 2 blank lines, found 1
./docs/source/user-guide/examples/sum.py:4:1: F401 'sys' imported but unused
./docs/source/user-guide/examples/sum.py:13:24: E702 multiple statements on one line (semicolon)
./docs/source/user-guide/examples/sum.py:68:28: E226 missing whitespace around arithmetic operator
./docs/source/user-guide/examples/sum.py:76:31: E226 missing whitespace around arithmetic operator
./docs/source/user-guide/examples/sum.py:91:25: E226 missing whitespace around arithmetic operator
./docs/source/user-guide/examples/sum.py:111:1: W391 blank line at end of file
./ffi/build.py:8:1: F401 'ctypes.util.find_library' imported but unused
./ffi/build.py:43:81: E501 line too long (84 > 80 characters)
./ffi/build.py:63:5: E306 expected 1 blank line before a nested definition, found 0
./ffi/build.py:84:81: E501 line too long (81 > 80 characters)
./examples/parseasm.py:37:1: W391 blank line at end of file
./examples/ll_fpadd.py:26:1: E302 expected 2 blank lines, found 1
./examples/sum.py:4:1: F401 'sys' imported but unused
./examples/sum.py:13:24: E702 multiple statements on one line (semicolon)
./examples/sum.py:68:28: E226 missing whitespace around arithmetic operator
./examples/sum.py:76:31: E226 missing whitespace around arithmetic operator
./examples/sum.py:91:25: E226 missing whitespace around arithmetic operator
./examples/sum.py:111:1: W391 blank line at end of file

It probably makes sense to try to fix as many of these as we can. I am unsure if we should touch stuff like versioneer.py or `docs/source/conf.py´ as these may have been autogenerated. Maybe for those it makes more sense to use the original tools use for autogeneration and re-run those to fix them?

Copy link
Contributor

@stuartarchibald stuartarchibald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the patch.

@stuartarchibald stuartarchibald added this to the Version 0.34.0 milestone Aug 4, 2020
@sklam sklam merged commit 1dc8c20 into numba:master Aug 5, 2020
sklam added a commit to sklam/llvmlite that referenced this pull request Aug 5, 2020
@esc esc deleted the fix/flake8_setup.py branch February 26, 2021 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants