From 3147f7a479d89cec0d0cbce4e600a5ace0d57c66 Mon Sep 17 00:00:00 2001 From: Boris Staletic Date: Mon, 2 Oct 2023 21:32:50 +0200 Subject: [PATCH 1/3] Avoid distutils distutils has been deprecated for a long time and has finally been removed. --- .ycm_extra_conf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.ycm_extra_conf.py b/.ycm_extra_conf.py index aa5e153b5e..d97014841c 100644 --- a/.ycm_extra_conf.py +++ b/.ycm_extra_conf.py @@ -28,7 +28,7 @@ # # For more information, please refer to -from distutils.sysconfig import get_python_inc +from sysconfig import get_path import platform import os.path as p import subprocess @@ -71,7 +71,7 @@ '-isystem', 'cpp/BoostParts', '-isystem', -get_python_inc(), +get_path( 'include' ), '-isystem', 'cpp/llvm/include', '-isystem', From f76f1314e7a3b666d386f08b80a7d96de1e96eba Mon Sep 17 00:00:00 2001 From: Boris Staletic Date: Mon, 2 Oct 2023 21:33:55 +0200 Subject: [PATCH 2/3] Update jedi to the latest release This update of jedi is compatible with python 3.12 --- third_party/jedi_deps/jedi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/jedi_deps/jedi b/third_party/jedi_deps/jedi index eaab706038..4e175ca82b 160000 --- a/third_party/jedi_deps/jedi +++ b/third_party/jedi_deps/jedi @@ -1 +1 @@ -Subproject commit eaab7060388c8f438f1dbe6502e47c6639aa9bac +Subproject commit 4e175ca82bbd680cb90f462545c10a8b1c0b5f2e From 53a7c2c3ed7686130f7b74537630021eabdc29d5 Mon Sep 17 00:00:00 2001 From: Boris Staletic Date: Mon, 2 Oct 2023 21:34:40 +0200 Subject: [PATCH 3/3] Fix flake8 errors reported in python 3.12 --- build.py | 18 +++++++++--------- ycmd/completers/cs/solutiondetection.py | 2 +- .../typescript/typescript_completer.py | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/build.py b/build.py index f24143e90a..f4a95deee8 100755 --- a/build.py +++ b/build.py @@ -132,23 +132,23 @@ def FindLatestMSVC( quiet ): try: latest_v = int( latest_full_v.split( '.' )[ 0 ] ) except ValueError: - raise ValueError( f"{latest_full_v} is not a version number." ) + raise ValueError( f"{ latest_full_v } is not a version number." ) if not quiet: - print( f'vswhere -latest returned version {latest_full_v}' ) + print( f'vswhere -latest returned version { latest_full_v }' ) if latest_v not in ACCEPTABLE_VERSIONS: if latest_v > 17: if not quiet: - print( f'MSVC Version {latest_full_v} is newer than expected.' ) + print( f'MSVC Version { latest_full_v } is newer than expected.' ) else: raise ValueError( - f'vswhere returned {latest_full_v} which is unexpected.' + f'vswhere returned { latest_full_v } which is unexpected.' 'Pass --msvc argument.' ) return latest_v else: if not quiet: - print( f'vswhere returned nothing usable, {latest_full_v}' ) + print( f'vswhere returned nothing usable, { latest_full_v }' ) # Fall back to registry parsing, which works at least until MSVC 2019 (16) # but is likely failing on MSVC 2022 (17) @@ -161,11 +161,11 @@ def FindLatestMSVC( quiet ): for i in ACCEPTABLE_VERSIONS: if not quiet: print( 'Trying to find ' - rf'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\{i}.0' ) + rf'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\{ i }.0' ) try: - winreg.OpenKey( handle, rf'SOFTWARE\Microsoft\VisualStudio\{i}.0' ) + winreg.OpenKey( handle, rf'SOFTWARE\Microsoft\VisualStudio\{ i }.0' ) if not quiet: - print( f"Found MSVC version {i}" ) + print( f"Found MSVC version { i }" ) msvc = i break except FileNotFoundError: @@ -978,7 +978,7 @@ def EnableRustCompleter( switches ): req_toolchain_version = switches.rust_toolchain_version if switches.quiet: - sys.stdout.write( f'Installing rust-analyzer "{req_toolchain_version}" ' + sys.stdout.write( f'Installing rust-analyzer "{ req_toolchain_version }" ' 'for Rust support...' ) sys.stdout.flush() diff --git a/ycmd/completers/cs/solutiondetection.py b/ycmd/completers/cs/solutiondetection.py index e136306dd1..8b13035a00 100644 --- a/ycmd/completers/cs/solutiondetection.py +++ b/ycmd/completers/cs/solutiondetection.py @@ -93,7 +93,7 @@ def _SolutionTestCheckHeuristics( candidates, tokens, i ): # 1. is there a solution named just like the subdirectory with the source? if ( not selection and i < len( tokens ) - 1 and f'{ tokens[ i + 1 ] }.sln' in candidates ): - selection = os.path.join( path, f'{ tokens[ i + 1] }.sln' ) + selection = os.path.join( path, f'{ tokens[ i + 1 ] }.sln' ) LOGGER.info( 'Selected solution file %s as it matches source subfolder', selection ) diff --git a/ycmd/completers/typescript/typescript_completer.py b/ycmd/completers/typescript/typescript_completer.py index 6db904a577..99439421da 100644 --- a/ycmd/completers/typescript/typescript_completer.py +++ b/ycmd/completers/typescript/typescript_completer.py @@ -214,7 +214,7 @@ def _StartServerNoLock( self ): return self._logfile = utils.CreateLogfile( LOGFILE_FORMAT ) - tsserver_log = f'-file { self._logfile } -level {_LogLevel()}' + tsserver_log = f'-file { self._logfile } -level { _LogLevel() }' # TSServer gets the configuration for the log file through the # environment variable 'TSS_LOG'. This seems to be undocumented but # looking at the source code it seems like this is the way: @@ -911,7 +911,7 @@ def _GetDoc( self, request_data ): 'offset': request_data[ 'column_codepoint' ] } ) - message = f'{ info[ "displayString" ] }\n\n{info[ "documentation" ]}' + message = f'{ info[ "displayString" ] }\n\n{ info[ "documentation" ] }' return responses.BuildDetailedInfoResponse( message )