]> khamidou — GitHub mirrors - electron.git/commitdiff
Build the python requests library
authorCheng Zhao <zcbenz@gmail.com>
Fri, 3 Jul 2015 06:23:42 +0000 (14:23 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Fri, 3 Jul 2015 06:23:42 +0000 (14:23 +0800)
.gitmodules
script/bootstrap.py
script/lib/github.py
vendor/requests [new submodule]

index 7c26c6c2c12d7968fed8fb271f7059035ccc1dec..5517d4434f386b8ffe51cc84b865f9cd65cb2bab 100644 (file)
@@ -16,3 +16,6 @@
 [submodule "vendor/crashpad"]
        path = vendor/crashpad
        url = https://github.com/atom/crashpad.git
+[submodule "vendor/requests"]
+       path = vendor/requests
+       url = https://github.com/kennethreitz/requests
index fd9958d9ca1ad9e30aba9cd1cb3c969a70bec148..94a566224c365ff1eebdc0e37cb6d7ef32f0b406 100755 (executable)
@@ -37,6 +37,7 @@ def main():
     update_clang()
 
   update_submodules()
+  setup_requests()
   update_node_modules('.')
   bootstrap_brightray(args.dev, args.url, args.target_arch)
 
@@ -84,6 +85,11 @@ def update_submodules():
   execute_stdout(['git', 'submodule', 'update', '--init', '--recursive'])
 
 
+def setup_requests():
+  with scoped_cwd(os.path.join(VENDOR_DIR, 'requests')):
+    execute_stdout([sys.executable, 'setup.py', 'build'])
+
+
 def bootstrap_brightray(is_dev, url, target_arch):
   bootstrap = os.path.join(VENDOR_DIR, 'brightray', 'script', 'bootstrap')
   args = [
@@ -109,7 +115,7 @@ def update_node_modules(dirname, env=None):
   with scoped_cwd(dirname):
     args = [NPM, 'install']
     if is_verbose_mode():
-      args += '--verbose'
+      args += ['--verbose']
     # Ignore npm install errors when running in CI.
     if os.environ.has_key('CI'):
       try:
index a742a209c167811c4734bd19e3dce0d72bb9f508..5e968d6698b60b64868fc6bcf11bd50fbaa60582 100644 (file)
@@ -1,7 +1,13 @@
 #!/usr/bin/env python
 
 import json
+import os
 import re
+import sys
+
+sys.path.append(os.path.abspath(os.path.join(__file__, '..', '..', '..',
+                                             'vendor', 'requests', 'build',
+                                             'lib')))
 import requests
 
 GITHUB_URL = 'https://api.github.com'
diff --git a/vendor/requests b/vendor/requests
new file mode 160000 (submodule)
index 0000000..e4d59be
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit e4d59bedfd3c7f4f254f4f5d036587bcd8152458