Open medullaskyline opened 9 years ago
If you run which
in bash (or another *nix shell) you'll see:
$ which dev_appserver.py
.../google-cloud-sdk/bin/dev_appserver.py
The other dev_appserver.py
is just an import-able module, not an actual binary and has been shipped with the SDK since before test_utils.which
was written.
Yes, and the file .../google-cloud-sdk/bin/dev_appserver.py
looks like this...
#!/usr/bin/env python
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
"""A convenience wrapper for starting dev_appserver for appengine for python."""
import os
import bootstrapping.bootstrapping as bootstrapping
from googlecloudsdk.core.util import platforms
def main():
"""Launches dev_appserver.py."""
args = [
'--skip_sdk_update_check=True'
]
if platforms.OperatingSystem.Current() == platforms.OperatingSystem.MACOSX:
php_path = os.path.join(bootstrapping.BOOTSTRAPPING_DIR, 'php-cgi')
if os.path.exists(php_path):
args.append('--php_executable_path=' + php_path)
# The executable for Windows will be in the correct default location.
bootstrapping.ExecutePythonTool(
'platform/google_appengine', 'dev_appserver.py', *args)
if __name__ == '__main__':
bootstrapping.CommandStart('dev_appserver', component_id='gae-python')
bootstrapping.CheckUpdates()
main()
...which doesn't have fix_sys_path()
, something that's in the test runner. Correct me if I'm missing something. :)
Ahhhh good call! I just checked and it appears the test runner doesn't work.
tox
.oauth2client
.
It looks like there are two
dev_appserver.py
files now in the google-cloud-sdk directory and the one with thefix_sys_path()
is located in:google_appengine/dev_appserver.py
. (Referenced from this issue.)Since that's the case, shouldn't
test_utils.which
return a list of potential paths instead of a string with only one path? It seems that was the original intent of the code. As it is, depending on the order of entries in $PATH, the test runner could only return the path to the dev_appserver.py file that doesn't havefix_sys_path()
.