Description: don't try to use non-existent thirdparty directory
 We strip the thirdparty directory from the tarball to avoid shipping
 and using the various embedded copies upstream has. On the plus side:
 As we don't include them, we don't need to load them.
Author: David Kalnischkies <donkult@debian.org>
Forwarded: not-needed

--- a/ycmd/__main__.py
+++ b/ycmd/__main__.py
@@ -31,17 +31,8 @@
 if PY_VERSION < ( 3, 8, 0 ):
   sys.exit( 8 )
 
-ROOT_DIR = os.path.abspath( os.path.join( os.path.dirname( __file__ ), '..' ) )
-DIR_OF_THIRD_PARTY = os.path.join( ROOT_DIR, 'third_party' )
-DIR_OF_WATCHDOG_DEPS = os.path.join( DIR_OF_THIRD_PARTY, 'watchdog_deps' )
-DIR_OF_REQUESTS_DEPS = os.path.join( DIR_OF_THIRD_PARTY, 'requests_deps' )
-sys.path[ 0:0 ] = [
-    os.path.join( ROOT_DIR ),
-    os.path.join( DIR_OF_THIRD_PARTY, 'regex-build' ),
-    os.path.join( DIR_OF_THIRD_PARTY, 'jedi_deps', 'jedi' ),
-    os.path.join( DIR_OF_THIRD_PARTY, 'jedi_deps', 'parso' ),
-    os.path.join( DIR_OF_WATCHDOG_DEPS, 'watchdog', 'build', 'lib3' ) ]
-sys.path.append( os.path.join( DIR_OF_THIRD_PARTY, 'jedi_deps', 'numpydoc' ) )
+ROOT_DIR = os.path.abspath( os.path.join( os.path.dirname( os.path.realpath( __file__ ) ), '..' ) )
+sys.path.insert( 0, ROOT_DIR);
 
 import atexit
 import logging
--- a/run_tests.py
+++ b/run_tests.py
@@ -12,22 +12,6 @@
 
 BASE_UNITTEST_ARGS = [ '-cb' ]
 DIR_OF_THIS_SCRIPT = p.dirname( p.abspath( __file__ ) )
-DIR_OF_THIRD_PARTY = p.join( DIR_OF_THIS_SCRIPT, 'third_party' )
-DIR_OF_WATCHDOG_DEPS = p.join( DIR_OF_THIRD_PARTY, 'watchdog_deps' )
-
-python_path = [
-  p.join( DIR_OF_THIRD_PARTY, 'regex-build' ),
-  p.join( DIR_OF_THIRD_PARTY, 'jedi_deps', 'jedi' ),
-  p.join( DIR_OF_THIRD_PARTY, 'jedi_deps', 'parso' ),
-  p.join( DIR_OF_WATCHDOG_DEPS, 'watchdog', 'build', 'lib3' ),
-]
-if os.environ.get( 'PYTHONPATH' ) is not None:
-  python_path.append( os.environ[ 'PYTHONPATH' ] )
-os.environ[ 'PYTHONPATH' ] = (
-    os.pathsep.join( python_path ) +
-    os.pathsep +
-    p.join( DIR_OF_THIRD_PARTY, 'jedi_deps', 'numpydoc' ) )
-
 LOMBOK_VERSION = '1.18.26'
 
 
--- a/.ycm_extra_conf.py
+++ b/.ycm_extra_conf.py
@@ -34,8 +34,6 @@
 import subprocess
 
 DIR_OF_THIS_SCRIPT = p.abspath( p.dirname( __file__ ) )
-DIR_OF_THIRD_PARTY = p.join( DIR_OF_THIS_SCRIPT, 'third_party' )
-DIR_OF_WATCHDOG_DEPS = p.join( DIR_OF_THIRD_PARTY, 'watchdog_deps' )
 SOURCE_EXTENSIONS = [ '.cpp', '.cxx', '.cc', '.c', '.m', '.mm' ]
 
 database = None
@@ -177,24 +175,6 @@
   if language == 'python':
     return {
       'interpreter_path': PathToPythonUsedDuringBuild(),
-      'ls': {
-        'python': {
-          'analysis': {
-            'extraPaths': [
-              p.join( DIR_OF_THIS_SCRIPT ),
-              p.join( DIR_OF_THIRD_PARTY, 'bottle' ),
-              p.join( DIR_OF_THIRD_PARTY, 'regex-build' ),
-              p.join( DIR_OF_THIRD_PARTY, 'frozendict' ),
-              p.join( DIR_OF_THIRD_PARTY, 'jedi_deps', 'jedi' ),
-              p.join( DIR_OF_THIRD_PARTY, 'jedi_deps', 'parso' ),
-              p.join( DIR_OF_WATCHDOG_DEPS, 'watchdog', 'build', 'lib3' ),
-              p.join( DIR_OF_WATCHDOG_DEPS, 'pathtools' ),
-              p.join( DIR_OF_THIRD_PARTY, 'waitress' )
-            ],
-            'useLibraryCodeForTypes': True
-          }
-        }
-      }
     }
 
   return {}
@@ -202,19 +182,5 @@
 
 def PythonSysPath( **kwargs ):
   sys_path = kwargs[ 'sys_path' ]
-
-  sys_path[ 0:0 ] = [ p.join( DIR_OF_THIS_SCRIPT ),
-                      p.join( DIR_OF_THIRD_PARTY, 'bottle' ),
-                      p.join( DIR_OF_THIRD_PARTY, 'regex-build' ),
-                      p.join( DIR_OF_THIRD_PARTY, 'frozendict' ),
-                      p.join( DIR_OF_THIRD_PARTY, 'jedi_deps', 'jedi' ),
-                      p.join( DIR_OF_THIRD_PARTY, 'jedi_deps', 'parso' ),
-                      p.join( DIR_OF_WATCHDOG_DEPS,
-                              'watchdog',
-                              'build',
-                              'lib3' ),
-                      p.join( DIR_OF_WATCHDOG_DEPS, 'pathtools' ),
-                      p.join( DIR_OF_THIRD_PARTY, 'waitress' ) ]
-
-  sys_path.append( p.join( DIR_OF_THIRD_PARTY, 'jedi_deps', 'numpydoc' ) )
+  sys_path.insert( 0, DIR_OF_THIS_SCRIPT);
   return sys_path
--- a/ycmd/tests/python/subcommands_test.py
+++ b/ycmd/tests/python/subcommands_test.py
@@ -40,10 +40,6 @@
                                     ErrorMatcher,
                                     ExpectedFailure )
 
-TYPESHED_PATH = os.path.normpath(
-  PathToTestFile( '..', '..', '..', '..', 'third_party', 'jedi_deps', 'jedi',
-    'jedi', 'third_party', 'typeshed', 'stdlib', '3', 'builtins.pyi' ) )
-
 
 class JediDef:
   def __init__( self, col = None, line = None, path = None ):
@@ -153,8 +149,6 @@
           # Builtin
           { 'request': ( 'basic.py', 1,  4 ),
             'response': ( 'basic.py', 1, 1 ) },
-          { 'request': ( 'basic.py', 1, 12 ),
-            'response': ( TYPESHED_PATH, 742, 7 ) },
           { 'request': ( 'basic.py', 2,  2 ),
             'response': ( 'basic.py', 1, 1 ) },
           # Class
@@ -380,8 +374,6 @@
   @SharedYcmd
   def test_Subcommands_GoToType( self, app ):
     for test in [
-      { 'request':  ( 'basic.py', 2, 1 ),
-        'response': ( TYPESHED_PATH, 742, 7 ) },
       { 'request':  ( 'basic.py', 8, 1 ),
         'response': ( 'basic.py', 4, 7 ) },
       { 'request':  ( 'basic.py', 3, 1 ),
