From 5c12f5e357cb4ced6f327d2f870a45692a9ec22b Mon Sep 17 00:00:00 2001 From: Boris Staletic Date: Mon, 10 Dec 2018 04:02:31 +0100 Subject: [PATCH] Separate YCM/ycmd submodules --- .gitmodules | 18 +++++++++++++++++ .ycm_extra_conf.py | 31 ++++++++++++++++-------------- autoload/youcompleteme.vim | 12 +++++++++--- third_party/python-future | 1 + third_party/requests_deps/certifi | 1 + third_party/requests_deps/chardet | 1 + third_party/requests_deps/idna | 1 + third_party/requests_deps/requests | 1 + third_party/requests_deps/urllib3 | 1 + 9 files changed, 50 insertions(+), 17 deletions(-) create mode 160000 third_party/python-future create mode 160000 third_party/requests_deps/certifi create mode 160000 third_party/requests_deps/chardet create mode 160000 third_party/requests_deps/idna create mode 160000 third_party/requests_deps/requests create mode 160000 third_party/requests_deps/urllib3 diff --git a/.gitmodules b/.gitmodules index 81b39d10..9bab5186 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,21 @@ [submodule "third_party/ycmd"] path = third_party/ycmd url = https://github.com/Valloric/ycmd +[submodule "third_party/requests_deps/idna"] + path = third_party/requests_deps/idna + url = https://github.com/kjd/idna +[submodule "third_party/requests_deps/certifi"] + path = third_party/requests_deps/certifi + url = https://github.com/certifi/python-certifi +[submodule "third_party/requests_deps/chardet"] + path = third_party/requests_deps/chardet + url = https://github.com/chardet/chardet +[submodule "third_party/requests_deps/urllib3"] + path = third_party/requests_deps/urllib3 + url = https://github.com/urllib3/urllib3 +[submodule "third_party/requests_deps/requests"] + path = third_party/requests_deps/requests + url = https://github.com/kennethreitz/requests +[submodule "third_party/python-future"] + path = third_party/python-future + url = https://github.com/PythonCharmers/python-future diff --git a/.ycm_extra_conf.py b/.ycm_extra_conf.py index 9c34bbae..a53d1769 100755 --- a/.ycm_extra_conf.py +++ b/.ycm_extra_conf.py @@ -28,18 +28,16 @@ # # For more information, please refer to -import os +import os.path as p import subprocess -DIR_OF_THIS_SCRIPT = os.path.abspath( os.path.dirname( __file__ ) ) -DIR_OF_THIRD_PARTY = os.path.join( DIR_OF_THIS_SCRIPT, 'third_party' ) -DIR_OF_YCMD_THIRD_PARTY = os.path.join( DIR_OF_THIRD_PARTY, - 'ycmd', 'third_party' ) +DIR_OF_THIS_SCRIPT = p.abspath( p.dirname( __file__ ) ) +DIR_OF_THIRD_PARTY = p.join( DIR_OF_THIS_SCRIPT, 'third_party' ) def GetStandardLibraryIndexInSysPath( sys_path ): for index, path in enumerate( sys_path ): - if os.path.isfile( os.path.join( path, 'os.py' ) ): + if p.isfile( p.join( path, 'os.py' ) ): return index raise RuntimeError( 'Could not find standard library path in Python path.' ) @@ -47,11 +45,17 @@ def GetStandardLibraryIndexInSysPath( sys_path ): def PythonSysPath( **kwargs ): sys_path = kwargs[ 'sys_path' ] - dependencies = [ os.path.join( DIR_OF_THIS_SCRIPT, 'python' ), - os.path.join( DIR_OF_THIRD_PARTY, 'requests-futures' ), - os.path.join( DIR_OF_THIRD_PARTY, 'ycmd' ), - os.path.join( DIR_OF_YCMD_THIRD_PARTY, 'frozendict' ), - os.path.join( DIR_OF_YCMD_THIRD_PARTY, 'requests' ) ] + dependencies = [ p.join( DIR_OF_THIS_SCRIPT, 'python' ), + p.join( DIR_OF_THIRD_PARTY, 'requests-futures' ), + p.join( DIR_OF_THIRD_PARTY, 'ycmd' ), + p.join( DIR_OF_THIRD_PARTY, 'requests_deps', 'idna' ), + p.join( DIR_OF_THIRD_PARTY, 'requests_deps', 'chardet' ), + p.join( DIR_OF_THIRD_PARTY, + 'requests_deps', + 'urllib3', + 'src' ), + p.join( DIR_OF_THIRD_PARTY, 'requests_deps', 'certifi' ), + p.join( DIR_OF_THIRD_PARTY, 'requests_deps', 'requests' ) ] # The concurrent.futures module is part of the standard library on Python 3. interpreter_path = kwargs[ 'interpreter_path' ] @@ -59,11 +63,10 @@ def PythonSysPath( **kwargs ): interpreter_path, '-c', 'import sys; print( sys.version_info[ 0 ] )' ] ).rstrip().decode( 'utf8' ) ) if major_version == 2: - dependencies.append( os.path.join( DIR_OF_THIRD_PARTY, 'pythonfutures' ) ) + dependencies.append( p.join( DIR_OF_THIRD_PARTY, 'pythonfutures' ) ) sys_path[ 0:0 ] = dependencies sys_path.insert( GetStandardLibraryIndexInSysPath( sys_path ) + 1, - os.path.join( DIR_OF_YCMD_THIRD_PARTY, 'python-future', - 'src' ) ) + p.join( DIR_OF_THIRD_PARTY, 'python-future', 'src' ) ) return sys_path diff --git a/autoload/youcompleteme.vim b/autoload/youcompleteme.vim index 8a4dff82..eb2e1f4c 100644 --- a/autoload/youcompleteme.vim +++ b/autoload/youcompleteme.vim @@ -194,13 +194,19 @@ import vim root_folder = p.normpath( p.join( vim.eval( 's:script_folder_path' ), '..' ) ) third_party_folder = p.join( root_folder, 'third_party' ) -ycmd_third_party_folder = p.join( third_party_folder, 'ycmd', 'third_party' ) # Add dependencies to Python path. dependencies = [ p.join( root_folder, 'python' ), p.join( third_party_folder, 'requests-futures' ), p.join( third_party_folder, 'ycmd' ), - p.join( ycmd_third_party_folder, 'requests' ) ] + p.join( third_party_folder, 'requests_deps', 'idna' ), + p.join( third_party_folder, 'requests_deps', 'chardet' ), + p.join( third_party_folder, + 'requests_deps', + 'urllib3', + 'src' ), + p.join( third_party_folder, 'requests_deps', 'certifi' ), + p.join( third_party_folder, 'requests_deps', 'requests' ) ] # The concurrent.futures module is part of the standard library on Python 3. if sys.version_info[ 0 ] == 2: @@ -213,7 +219,7 @@ try: # The python-future module must be inserted after the standard library path. from ycmd.server_utils import GetStandardLibraryIndexInSysPath sys.path.insert( GetStandardLibraryIndexInSysPath() + 1, - p.join( ycmd_third_party_folder, 'python-future', 'src' ) ) + p.join( third_party_folder, 'python-future', 'src' ) ) # Import the modules used in this file. from ycm import base, vimsupport, youcompleteme diff --git a/third_party/python-future b/third_party/python-future new file mode 160000 index 00000000..a8114e48 --- /dev/null +++ b/third_party/python-future @@ -0,0 +1 @@ +Subproject commit a8114e48ce7dbc4cecbf6a764d73e83d03b0d6ba diff --git a/third_party/requests_deps/certifi b/third_party/requests_deps/certifi new file mode 160000 index 00000000..5b9e05c0 --- /dev/null +++ b/third_party/requests_deps/certifi @@ -0,0 +1 @@ +Subproject commit 5b9e05c06e69fe5c7835052cfc3ae1c899dfc8b1 diff --git a/third_party/requests_deps/chardet b/third_party/requests_deps/chardet new file mode 160000 index 00000000..9b8c5c2f --- /dev/null +++ b/third_party/requests_deps/chardet @@ -0,0 +1 @@ +Subproject commit 9b8c5c2fb118d76c6beeab9affd01c332732a530 diff --git a/third_party/requests_deps/idna b/third_party/requests_deps/idna new file mode 160000 index 00000000..0f50bdce --- /dev/null +++ b/third_party/requests_deps/idna @@ -0,0 +1 @@ +Subproject commit 0f50bdcea71e6602bf4cd22897970d71fc4074d9 diff --git a/third_party/requests_deps/requests b/third_party/requests_deps/requests new file mode 160000 index 00000000..6cfbe1ae --- /dev/null +++ b/third_party/requests_deps/requests @@ -0,0 +1 @@ +Subproject commit 6cfbe1aedd56f8c2f9ff8b968efe65b22669795b diff --git a/third_party/requests_deps/urllib3 b/third_party/requests_deps/urllib3 new file mode 160000 index 00000000..a6ec68a5 --- /dev/null +++ b/third_party/requests_deps/urllib3 @@ -0,0 +1 @@ +Subproject commit a6ec68a5c5c5743c59fe5c62c635c929586c429b