File: 19-dont-try-to-use-thirdparty-dir.patch

package info (click to toggle)
ycmd 0%2B20240823%2Bgit8b61f19%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,464 kB
  • sloc: python: 43,993; cpp: 6,138; java: 486; sh: 378; cs: 207; javascript: 150; ansic: 82; makefile: 45; xml: 18; objc: 10
file content (142 lines) | stat: -rw-r--r-- 5,447 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
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 ),