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

flake 8 style warnings #7925

Closed
behlendorf opened this issue Sep 18, 2018 · 3 comments
Closed

flake 8 style warnings #7925

behlendorf opened this issue Sep 18, 2018 · 3 comments
Labels
good first issue Indicates a good issue for first-time contributors Type: Building Indicates an issue related to building binaries
Milestone

Comments

@behlendorf
Copy link
Contributor

System information

Type Version/Name
Distribution Name any
Distribution Version any
Linux Kernel any
Architecture any
ZFS Version zfs-0.8.0-rc1
SPL Version

Describe the problem you're observing

Current versions of flake8 report new new probably in the python scripts. These need to be fixed for the make checkstyle target to pass cleanly.

$ flake8 --version
3.5.0 (mccabe: 0.6.1, pycodestyle: 2.3.1, pyflakes: 1.6.0) CPython 3.6.5 on Linux

Describe how to reproduce the problem

On Ubuntu 18.08 with flake8 installed.

$ make checkstyle
./tests/test-runner/bin/zts-report.py:281:11: E999 SyntaxError: invalid syntax
./tests/test-runner/bin/test-runner.py:207:22: E999 SyntaxError: invalid syntax
./contrib/pyzfs/libzfs_core/test/test_libzfs_core.py:47:17: E999 SyntaxError: invalid syntax
Makefile:1566: recipe for target 'flake8' failed
make: *** [flake8] Error 1

Include any warning/errors/backtraces from the system logs

N/A

@behlendorf behlendorf added Type: Building Indicates an issue related to building binaries good first issue Indicates a good issue for first-time contributors labels Sep 18, 2018
@behlendorf behlendorf added this to the 0.8.0 milestone Sep 18, 2018
@bunder2015
Copy link
Contributor

From what I can tell, these scripts are using python2 syntax, hopefully porting them to python3 should fix this.

@behlendorf
Copy link
Contributor Author

Converting zts-report.py and test-runner.py to python 3 shouldn't be a huge issue, but there's a larger discussion to be had about pyzfs, see #7828. Does anyone know if there's something we can do to allow flake8 to properly recognize those scripts as python2?

@bunder2015
Copy link
Contributor

I didn't happen to see one in their documentation, however we can possibly --ignore=E999 or --exclude the files in the interim. Unfortunately I'm not very versed in python, I tried fixing some of them up by hand but I'm not sure if the scripts would still work as intended if I were to make a PR for it. I think I'll leave this one for someone who knows more about python.

GregorKopka pushed a commit to GregorKopka/zfs that referenced this issue Sep 19, 2018
Ran zts-report.py and test-runner.py from ./tests/test-runner/bin/
through the 2to3 (https://docs.python.org/2/library/2to3.html).
Checked the result, looks good.

Signed-off-by: Gregor Kopka <gregor@kopka.net>
GregorKopka pushed a commit to GregorKopka/zfs that referenced this issue Sep 19, 2018
Ran zts-report.py and test-runner.py from ./tests/test-runner/bin/
through the 2to3 (https://docs.python.org/2/library/2to3.html).
Checked the result, looks good.

Signed-off-by: Gregor Kopka <gregor@kopka.net>
GregorKopka pushed a commit to GregorKopka/zfs that referenced this issue Sep 19, 2018
Ran zts-report.py and test-runner.py from ./tests/test-runner/bin/
through the 2to3 (https://docs.python.org/2/library/2to3.html).
Checked the result, looks good.

Signed-off-by: Gregor Kopka <gregor@kopka.net>
GregorKopka pushed a commit to GregorKopka/zfs that referenced this issue Sep 19, 2018
Ran zts-report.py and test-runner.py from ./tests/test-runner/bin/
through the 2to3 (https://docs.python.org/2/library/2to3.html).
Checked the result,
Fixed the complaints Builtbot had.

Signed-off-by: Gregor Kopka <gregor@kopka.net>
Closes openzfs#7925
GregorKopka pushed a commit to GregorKopka/zfs that referenced this issue Sep 19, 2018
Ran zts-report.py and test-runner.py from ./tests/test-runner/bin/
through the 2to3 (https://docs.python.org/2/library/2to3.html).
Checked the result, fixed 'maxint' -> 'maxsize' that 2to3 missed.
Fixed the complaints Builtbot had.

Signed-off-by: Gregor Kopka <gregor@kopka.net>
Closes openzfs#7925
GregorKopka pushed a commit to GregorKopka/zfs that referenced this issue Sep 19, 2018
Ran zts-report.py and test-runner.py from ./tests/test-runner/bin/
through the 2to3 (https://docs.python.org/2/library/2to3.html).
Checked the result, fixed 'maxint' -> 'maxsize' that 2to3 missed.
Fixed the complaints Builtbot had.

Signed-off-by: Gregor Kopka <gregor@kopka.net>
Closes openzfs#7925

Requires-builders: style
GregorKopka pushed a commit to GregorKopka/zfs that referenced this issue Sep 19, 2018
Ran zts-report.py and test-runner.py from ./tests/test-runner/bin/
through the 2to3 (https://docs.python.org/2/library/2to3.html).
Checked the result, fixed 'maxint' -> 'maxsize' that 2to3 missed.
Fixed the complaints Builtbot had.

Signed-off-by: Gregor Kopka <gregor@kopka.net>
Closes openzfs#7925

Requires-builders: style
GregorKopka pushed a commit to GregorKopka/zfs that referenced this issue Sep 19, 2018
Ran zts-report.py and test-runner.py from ./tests/test-runner/bin/
through the 2to3 (https://docs.python.org/2/library/2to3.html).
Checked the result, fixed 'maxint' -> 'maxsize' that 2to3 missed.
Fixed the complaints Builtbot had.

Signed-off-by: Gregor Kopka <gregor@kopka.net>
Closes openzfs#7925

Requires-builders: style
GregorKopka pushed a commit to GregorKopka/zfs that referenced this issue Sep 19, 2018
Ran zts-report.py and test-runner.py from ./tests/test-runner/bin/
through the 2to3 (https://docs.python.org/2/library/2to3.html).
Checked the result, fixed 'maxint' -> 'maxsize' that 2to3 missed.
Fixed the complaints Builtbot had.

Signed-off-by: Gregor Kopka <gregor@kopka.net>
Closes openzfs#7925

Requires-builders: style
GregorKopka pushed a commit to GregorKopka/zfs that referenced this issue Sep 19, 2018
Ran zts-report.py and test-runner.py from ./tests/test-runner/bin/
through the 2to3 (https://docs.python.org/2/library/2to3.html).
Checked the result, fixed 'maxint' -> 'maxsize' that 2to3 missed.
Fixed the complaints Builtbot had.

Signed-off-by: Gregor Kopka <gregor@kopka.net>
Closes openzfs#7925

Requires-builders: style
GregorKopka pushed a commit to GregorKopka/zfs that referenced this issue Sep 19, 2018
Ran zts-report.py and test-runner.py from ./tests/test-runner/bin/
through the 2to3 (https://docs.python.org/2/library/2to3.html).
Checked the result, fixed 'maxint' -> 'maxsize' that 2to3 missed.
Fixed the complaints Builtbot had.

Signed-off-by: Gregor Kopka <gregor@kopka.net>
Closes openzfs#7925

Requires-builders: style
GregorKopka pushed a commit to GregorKopka/zfs that referenced this issue Sep 19, 2018
Ran zts-report.py and test-runner.py from ./tests/test-runner/bin/
through the 2to3 (https://docs.python.org/2/library/2to3.html).
Checked the result, fixed 'maxint' -> 'maxsize' that 2to3 missed.
Fixed the complaints Builtbot had.

Signed-off-by: Gregor Kopka <gregor@kopka.net>
Closes openzfs#7925
GregorKopka pushed a commit to GregorKopka/zfs that referenced this issue Sep 22, 2018
Ran zts-report.py and test-runner.py from ./tests/test-runner/bin/
through the 2to3 (https://docs.python.org/2/library/2to3.html).
Checked the result, fixed:
- 'maxint' -> 'maxsize' that 2to3 missed.
- 'cmp=' parameter for a 'sorted()' with a 'key=' version.

Signed-off-by: Gregor Kopka <gregor@kopka.net>
Closes openzfs#7925
GregorKopka pushed a commit to GregorKopka/zfs that referenced this issue Sep 25, 2018
Ran zts-report.py and test-runner.py from ./tests/test-runner/bin/
through the 2to3 (https://docs.python.org/2/library/2to3.html).
Checked the result, fixed:
- 'maxint' -> 'maxsize' that 2to3 missed.
- 'cmp=' parameter for a 'sorted()' with a 'key=' version.
- try/except wrapping of configparser import as there are still
  python 2.7 systems that lack the compatibility shim

Signed-off-by: Gregor Kopka <gregor@kopka.net>
Closes openzfs#7925
GregorKopka pushed a commit to GregorKopka/zfs that referenced this issue Sep 25, 2018
Ran zts-report.py and test-runner.py from ./tests/test-runner/bin/
through the 2to3 (https://docs.python.org/2/library/2to3.html).
Checked the result, fixed:
- 'maxint' -> 'maxsize' that 2to3 missed.
- 'cmp=' parameter for a 'sorted()' with a 'key=' version.
- try/except wrapping of configparser import as there are still
  python 2.7 systems that lack a compatibility shim

Signed-off-by: Gregor Kopka <gregor@kopka.net>
Closes openzfs#7925
GregorKopka pushed a commit to GregorKopka/zfs that referenced this issue Sep 25, 2018
Ran zts-report.py and test-runner.py from ./tests/test-runner/bin/
through the 2to3 (https://docs.python.org/2/library/2to3.html).
Checked the result, fixed:
- 'maxint' -> 'maxsize' that 2to3 missed.
- 'cmp=' parameter for a 'sorted()' with a 'key=' version.
- try/except wrapping of configparser import as there are still
  python 2.7 systems that lack a compatibility shim

Signed-off-by: Gregor Kopka <gregor@kopka.net>
Closes openzfs#7925
behlendorf pushed a commit that referenced this issue Sep 26, 2018
Ran zts-report.py and test-runner.py from ./tests/test-runner/bin/
through the 2to3 (https://docs.python.org/2/library/2to3.html).
Checked the result, fixed:
- 'maxint' -> 'maxsize' that 2to3 missed.
- 'cmp=' parameter for a 'sorted()' with a 'key=' version.
- try/except wrapping of configparser import as there are still
  python 2.7 systems that lack a compatibility shim

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Gregor Kopka <gregor@kopka.net>
Closes #7925 
Closes #7952
GregorKopka added a commit to GregorKopka/zfs that referenced this issue Jan 7, 2019
Ran zts-report.py and test-runner.py from ./tests/test-runner/bin/
through the 2to3 (https://docs.python.org/2/library/2to3.html).
Checked the result, fixed:
- 'maxint' -> 'maxsize' that 2to3 missed.
- 'cmp=' parameter for a 'sorted()' with a 'key=' version.
- try/except wrapping of configparser import as there are still
  python 2.7 systems that lack a compatibility shim

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Gregor Kopka <gregor@kopka.net>
Closes openzfs#7925 
Closes openzfs#7952
tonyhutter pushed a commit to tonyhutter/zfs that referenced this issue Feb 13, 2019
Ran zts-report.py and test-runner.py from ./tests/test-runner/bin/
through the 2to3 (https://docs.python.org/2/library/2to3.html).
Checked the result, fixed:
- 'maxint' -> 'maxsize' that 2to3 missed.
- 'cmp=' parameter for a 'sorted()' with a 'key=' version.
- try/except wrapping of configparser import as there are still
  python 2.7 systems that lack a compatibility shim

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Gregor Kopka <gregor@kopka.net>
Closes openzfs#7925
Closes openzfs#7952
tonyhutter pushed a commit to tonyhutter/zfs that referenced this issue Feb 19, 2019
Ran zts-report.py and test-runner.py from ./tests/test-runner/bin/
through the 2to3 (https://docs.python.org/2/library/2to3.html).
Checked the result, fixed:
- 'maxint' -> 'maxsize' that 2to3 missed.
- 'cmp=' parameter for a 'sorted()' with a 'key=' version.
- try/except wrapping of configparser import as there are still
  python 2.7 systems that lack a compatibility shim

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Gregor Kopka <gregor@kopka.net>
Closes openzfs#7925
Closes openzfs#7952
tonyhutter pushed a commit that referenced this issue Mar 4, 2019
Ran zts-report.py and test-runner.py from ./tests/test-runner/bin/
through the 2to3 (https://docs.python.org/2/library/2to3.html).
Checked the result, fixed:
- 'maxint' -> 'maxsize' that 2to3 missed.
- 'cmp=' parameter for a 'sorted()' with a 'key=' version.
- try/except wrapping of configparser import as there are still
  python 2.7 systems that lack a compatibility shim

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Gregor Kopka <gregor@kopka.net>
Closes #7925
Closes #7952
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Indicates a good issue for first-time contributors Type: Building Indicates an issue related to building binaries
Projects
None yet
Development

No branches or pull requests

2 participants