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
PEP8 formatting python code #124
Conversation
Please verify, this has the code related to the single quotes/double quotes which was earlier formatted using black. |
@@ -37,7 +36,7 @@ def normpath(path: str) -> str: | |||
return os.path.normpath(path).replace('//', '/') | |||
|
|||
|
|||
def readlink(path: str, root: str, prefixed: bool=False) -> str: | |||
def readlink(path: str, root: str, prefixed: bool = False) -> str: |
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.
I was trying to figure out where this change came from and realized this error is from a relatively new version of PEP8: python/peps@acda0d1
Guess we must comply 🤷♀️
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.
We will need to get the tests passing before this is mergeable. I'm not sure what change is causing the breakage. Are you able to run them locally?
auditwheel/main.py
Outdated
@@ -47,7 +47,7 @@ def main(): | |||
|
|||
try: | |||
rval = args.func(args, p) | |||
except: | |||
except Exception: | |||
# TODO(rmcgibbo): nice message | |||
raise |
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.
This except
section doesn't do anything, so we can remove the whole try:
... except:
block in favour of just rval = args.func(args, p)
.
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.
sure, the error was no Exception statement so I placed that.
Now will remove the entire try catch and replace with the function rval
part only.
auditwheel/wheel_abi.py
Outdated
external_refs_by_fn = wheel_elfdata[1] | ||
versioned_symbols = wheel_elfdata[2] | ||
has_ucs2 = wheel_elfdata[3] | ||
uses_PyFPE_jbuf = wheel_elfdata[4] |
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.
IMO we should really just change this function to return a dict instead of a tuple, describing what the return arguments are. Anything more than 2 or 3 posargs is difficult to make sense of and these new assignments sort of lay that bare.
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.
Agreed.
docker_exec(manylinux_id, ['bash', '-c', | ||
'cd /auditwheel_src/tests/testpackage', | ||
'python setup.py bdist_wheel -d /io'] | ||
) |
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.
This change is not semantically equivalent and should be reverted. It's not showing up as test breakage because something else appears to be causing the tests to fail.
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.
The reason I removed the bash && operator and moved the python command
to a separate argument is to avoid the 90 character spill. To me this looks good to achieve that. In the future pep8 tests will fail on this for max-line.
Let me know for your suggestions.
1ac6179
to
0cb9959
Compare
used flake8 for PEP8 linting 1. Modified multiple python files 2. Added flake8 configuration under setup.cfg WIP for pypa#115 Comments in PR, 1. Removed .vscode from gitignore file 2. Comments on PR resolved
0cb9959
to
9ec3f6b
Compare
Made changes as per PR. I don't see how the builds are failing with the changes though, give some light on that, thanks for your co-operation. |
If it doesn't pass locally, it certainly won't pass in CI 😄 I recommend working to fix the test failures locally before submitting to Travis as you will be able to iterate faster. I can't merge this PR as is because it causes auditwheel to stop working in its current state. I've merged some PRs since this was first submitted so the merge conflicts will also need to be fixed. |
Yes @ehashman I will look to have it test locally first. Apologies for that, I cant understand what is the reason for mere syntactical changes as per PEP8 causing this but will check locally first then place it here, thanks. |
Yeah it doesn't make a ton of sense to me either; you might want to make sure that your code is rebased onto master. |
Hello @ehashman , within auditwheel directory, Please let me know what I am doing incorrect. |
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.
The build is probably failing because of a recursive import here: https://github.com/pypa/auditwheel/pull/124/files#diff-4629f407e7791be41dc48487a65a2653R8
I've actually submitted #158 to add flake8
before noticing this PR.
#158 has been merged which implements most of this. @isaac-philip if you think anything is missing from #158 which was part of your PR please open a new issue/PR. |
Made PEP8 changes using flake8.
Placed flake8 config in setup.cfg
WIP for #115
Next step is for including flake8 linting and stopping CI using travis etc as per maintainers direction.