-
Notifications
You must be signed in to change notification settings - Fork 429
Allow GCE credentials even if GAE SDK is detected. #208
Conversation
LGTM pending Travis. That code needs some love (this whole library makes me sad though). |
Sorry, realized I didn't include the tests my first commit. |
Honestly no new tests (probably) would have been accepted. Pretty low standards for current PRs 😞 |
:-( it looks like test_oauth2client.py doesn't actually get run.... I'm going to dig into it a bit. |
Looks like nosetests ignores tests files if they are executable. Gotta fix some tests, but I'm going to do that tomorrow. |
That is scary. We detected this many months ago and realized it caused a false belief that Python3 was supported. I am going to do some |
From $ git log -1 --pretty=%H
c47dcd7f66cb8463e5432ad1f2a2a54cc4653df4
$
$ export LINES_BEFORE=20 # Needed to actually see the commit messages
$
$ git log --summary | \
> grep "mode change" -B ${LINES_BEFORE} | \
> grep test_oauth2client\.py -B ${LINES_BEFORE} | \
> grep -e '^commit'
commit bb37fa5ed9e81e951017e813dc8e39b952f40c33
commit 1426ec69137f1290e58104d036ab1bd9c19d321d
commit 39972db41344b46685c0ee202c4665e4b0514eeb
commit 7e1c3b23e4734e546a290edf4d22766d31046a63
commit f25fd3cce7b7df450fd7245d406eac9b4feb4cfa
$
$ git show bb37fa5ed9e81e951017e813dc8e39b952f40c33 --summary
commit bb37fa5ed9e81e951017e813dc8e39b952f40c33
Merge: c815c2b 1426ec6
Author: Nathaniel Manista <nathaniel@google.com>
Date: Thu Jun 18 08:10:23 2015 -0700
Merge pull request #196 from eamonnmcmanus/master
Remove @util.positional from the authorize() wrapper.
$
$ git show 1426ec69137f1290e58104d036ab1bd9c19d321d --summary
commit 1426ec69137f1290e58104d036ab1bd9c19d321d
Author: Éamonn McManus <eamonn@mcmanus.net>
Date: Wed Jun 17 17:49:55 2015 -0700
Add a regression test for the @util.positional bug
mode change 100644 => 100755 tests/test_oauth2client.py
$
$ git show 39972db41344b46685c0ee202c4665e4b0514eeb --summary
commit 39972db41344b46685c0ee202c4665e4b0514eeb
Author: Danny Hermes <daniel.j.hermes@gmail.com>
Date: Fri Dec 5 17:25:50 2014 -0800
Fixing code that causes test_oauth2client to fail.
In particular:
- Removing executable bit from "test_oauth2client".
- Temporarily disabling slow (network bound) tests.
- Making client.SETTINGS a class so it can be mutable.
- Making GoogleCredentials._get_implicit_credentials a classmethod
so it can access `cls`.
- Changing use of `urlparse.parse_qs` to `urllib.parse.parse_qs` (did
not get converted during Py3K switch).
Partially addresses #85. Not closing out until slow tests are
re-enabled and other test failures of `py33openssl14` and
`py34openssl14` pass.
mode change 100755 => 100644 tests/test_oauth2client.py
$
$ git show 7e1c3b23e4734e546a290edf4d22766d31046a63 --summary
commit 7e1c3b23e4734e546a290edf4d22766d31046a63
Author: INADA Naoki <inada-n@klab.com>
Date: Wed Jul 9 01:14:19 2014 +0900
Update django to 1.6.5
$
$ git show f25fd3cce7b7df450fd7245d406eac9b4feb4cfa --summary
commit f25fd3cce7b7df450fd7245d406eac9b4feb4cfa
Author: Pat Ferate <pferate@gmail.com>
Date: Sun Jul 6 01:07:03 2014 -0700
Cleaned up more imports. Fixed exceptions. Used 'six' for iteritems().
mode change 100644 => 100755 tests/test_oauth2client.py |
H/T to http://stackoverflow.com/a/5094604/1068170 for how to see about a mode change Looks it was added back in 1426ec6 which came in #196, so luckily it hasn't been in for long. How could we avoid this? Is it worth checking that the modes of the test files don't change? @eamonnmcmanus any idea how the executable bit got set? |
One option might be to use --exe on nosetest. It makes it so that nose will still run the tests even if they are executable. |
Allows GCE credentials to load if the App Engine SDK is present but the appropriate environment variable 'SERVER_SOFTWARE' is not. This change also refactors implicit environment detection to only make an external call in GCE if the well known file credentials don't exist. Also re-enables test_oauth2client.py Fixes googleapis#205.
@pcostell I suppose that'd work, but it's not common that people do that (the reason it's avoided is to keep from running scripts by accident). |
I guess I must have made the test executable while experimenting with the changes I made in that commit. I had no idea it would have such a surprising effect! My apologies for the inconvenience. |
Alright @dhermes, I think this CL is actually ready now. PTAL. |
LGTM. I really appreciate the tests! |
I have merge privileges but maybe should hold off before an owner? How long has it been since a release? Worth cutting a new one? |
👍 I would definitely appreciate a release so I can integrate it with Remote API |
+1. A release would also allow us to apply the bugfix in #196 to the GAE SDK. |
Looks like we've had 19 commits since the last release. I don't know what @craigcitro was doing for releases and I don't know who is in charge now. @nathanielmanistaatgoogle might know. I think the best way to do it is by making an account to let Travis publish a release, see @eamonnmcmanus I assume you are in charge of the GAE SDK? I just did a This is a big surprise to me. I remember the old days of a frozen in time version created with a big nasty script that created a massive zipfile (pre- |
Haven't heard from @nathanielmanistaatgoogle, we can rollback if a merge wasn't a good idea. |
Allow GCE credentials even if GAE SDK is detected.
Allows GCE credentials to load if the App Engine SDK is present but the appropriate environment variable 'SERVER_SOFTWARE' is not.
This change also refactors implicit environment detection to only make an external call in GCE if the well known file credentials don't exist.
Fixes #205.