Skip to content
This repository has been archived by the owner on Jan 18, 2025. It is now read-only.

Makes all code PEP8 compliant. #276

Merged
merged 9 commits into from
Aug 23, 2015
Merged

Makes all code PEP8 compliant. #276

merged 9 commits into from
Aug 23, 2015

Conversation

dhermes
Copy link
Contributor

@dhermes dhermes commented Aug 20, 2015

Fixes #137.

Note that running

pep8 $(git ls-files '*py')

still has some failures. These are caused by

  • test_appengine.py since dev_appserver.fix_sys_path() happens before some imports
  • test_django_orm.py since modifications to django.conf.global_setting happen before some imports

and the rest are

docs/conf.py:43:1: E402 module level import not at top of file
samples/googleappengine/call_compute_service_from_gae.py:26:47: E231 missing whitespace after ','
scripts/run_system_tests.py:25:5: E129 visually indented line with same indent as next logical line
setup.py:31:1: E402 module level import not at top of file
setup.py:47:1: E402 module level import not at top of file

@nathanielmanistaatgoogle
Copy link
Contributor

Thanks for the multiple well-formed commits. What do you make of Travis being displeased with this pull request?

Simply ran

  pep8ify -w oauth2client/
  pep8ify -w tests/
Found the files via:

$ git ls-files '*py' | egrep -v \'^tests/\' | egrep -v '^oauth2client/'
This is all errors except E402: module level import not at top of file.
This is because in most (all?) files the __author__ global comes
before imports begin.

Ref: http://stackoverflow.com/a/24859703/1068170
Both test_appengine.py and test_django_orm.py still fail E402 since
they have some environment fixes during import (e.g.
dev_appserver.fix_sys_path() and changes to django.conf.global_settings)
This is to address PEP8 E402 as in previous commit.
Covers a few unexplained dedents (pep8ify missed them)
and an accidental use of b'.'.
@dhermes
Copy link
Contributor Author

dhermes commented Aug 21, 2015

tox -e docs failed, I never ran these tests with a fresh environment (e.g. tox -e docs --recreate) and more importantly never ran it at all since tox with no environment flag just runs py26,py27,py33,py34,pypy,gae,cover.

The error was:

Warning, treated as error:
/home/travis/build/google/oauth2client/oauth2client/client.py:docstring of oauth2client.client.OAuth2Credentials.set_store:5: ERROR: Unexpected indentation.

I just git push --forced with the needed change folded into Docstring pass after pep8ify in oauth2client/. I also removed (from history) an accidental *.bak file that was added in one commit and removed in another. (Easy-ish to do while git cherry-picking the commits back together.)


As for the coverage drop, I kind of just brush that off. It's probably because some long lines made the total line count go up, e.g.

  # 2 spaces
  foo = datetime.datetime.utcnow() + datetime.timedelta(seconds=3600)

becoming

    # 4 spaces
    foo = (datetime.datetime.utcnow() + 
           datetime.timedelta(seconds=3600))

@dhermes
Copy link
Contributor Author

dhermes commented Aug 21, 2015

@nathanielmanistaatgoogle Travis passes now and there is still that tiny -0.03% drop in coverage because math (#212 would make this annoyance stop).

@nathanielmanistaatgoogle
Copy link
Contributor

Yeah, I agree about brushing off the coverage drop. Re-reviewing now...

@nathanielmanistaatgoogle
Copy link
Contributor

LGTM; anything else to be done here?

@dhermes
Copy link
Contributor Author

dhermes commented Aug 23, 2015

Nope. But I'd be wary of making a new release until we have 100% test coverage.

dhermes added a commit that referenced this pull request Aug 23, 2015
Makes all code PEP8 compliant.
@dhermes dhermes merged commit 59e59a6 into googleapis:master Aug 23, 2015
@dhermes dhermes deleted the pep8ify branch August 23, 2015 22:06
This was referenced Aug 23, 2015
@dhermes dhermes mentioned this pull request Sep 7, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PEP8-conformity
4 participants