Skip to content

Commit 743b729

Browse files
committed
Drop bottle in favour of a tiny hand-rolled "framework"
Turns out ycmd needs a tiny part of the whole framework specification from PEP 3333. Note that this does not fully conform to the specification, but it mostly does. Currently we are only handling POST and GET requests. Support for middleware is limited. Inspired by Bottle plugins API, but only `plugin.__call__` and `app.install` are implemented. Error handling is also limited. Application needs to replace the default error handler that *will* handle all errors.
1 parent 1693a93 commit 743b729

File tree

10 files changed

+323
-97
lines changed

10 files changed

+323
-97
lines changed

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
[submodule "third_party/bottle"]
2-
path = third_party/bottle
3-
url = https://github.com/defnull/bottle
41
[submodule "third_party/jedi"]
52
path = third_party/jedi_deps/jedi
63
url = https://github.com/davidhalter/jedi

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
bottle >= 0.12.18
21
regex >= 2020.2.20
32
jedi >= 0.16.0
43
watchdog >= 0.10.2

run_tests.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,10 @@
1717
LIBCLANG_DIR = p.join( DIR_OF_THIRD_PARTY, 'clang', 'lib' )
1818

1919
python_path = [
20-
p.join( DIR_OF_THIRD_PARTY, 'bottle' ),
2120
p.join( DIR_OF_THIRD_PARTY, 'regex-build' ),
22-
p.join( DIR_OF_THIRD_PARTY, 'frozendict' ),
2321
p.join( DIR_OF_THIRD_PARTY, 'jedi_deps', 'jedi' ),
2422
p.join( DIR_OF_THIRD_PARTY, 'jedi_deps', 'parso' ),
2523
p.join( DIR_OF_WATCHDOG_DEPS, 'watchdog', 'build', 'lib3' ),
26-
p.join( DIR_OF_WATCHDOG_DEPS, 'pathtools' ),
27-
p.join( DIR_OF_THIRD_PARTY, 'waitress' ),
2824
]
2925
if os.environ.get( 'PYTHONPATH' ) is not None:
3026
python_path.append( os.environ[ 'PYTHONPATH' ] )

third_party/bottle

Lines changed: 0 additions & 1 deletion
This file was deleted.

ycmd/__main__.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,10 @@
3636
DIR_OF_REQUESTS_DEPS = os.path.join( DIR_OF_THIRD_PARTY, 'requests_deps' )
3737
sys.path[ 0:0 ] = [
3838
os.path.join( ROOT_DIR ),
39-
os.path.join( DIR_OF_THIRD_PARTY, 'bottle' ),
4039
os.path.join( DIR_OF_THIRD_PARTY, 'regex-build' ),
41-
os.path.join( DIR_OF_THIRD_PARTY, 'frozendict' ),
4240
os.path.join( DIR_OF_THIRD_PARTY, 'jedi_deps', 'jedi' ),
4341
os.path.join( DIR_OF_THIRD_PARTY, 'jedi_deps', 'parso' ),
44-
os.path.join( DIR_OF_REQUESTS_DEPS, 'requests' ),
45-
os.path.join( DIR_OF_REQUESTS_DEPS, 'chardet' ),
46-
os.path.join( DIR_OF_REQUESTS_DEPS, 'certifi' ),
47-
os.path.join( DIR_OF_REQUESTS_DEPS, 'idna' ),
48-
os.path.join( DIR_OF_REQUESTS_DEPS, 'urllib3', 'src' ),
49-
os.path.join( DIR_OF_WATCHDOG_DEPS, 'watchdog', 'build', 'lib3' ),
50-
os.path.join( DIR_OF_WATCHDOG_DEPS, 'pathtools' ),
51-
os.path.join( DIR_OF_THIRD_PARTY, 'waitress' ) ]
42+
os.path.join( DIR_OF_WATCHDOG_DEPS, 'watchdog', 'build', 'lib3' ) ]
5243
sys.path.append( os.path.join( DIR_OF_THIRD_PARTY, 'jedi_deps', 'numpydoc' ) )
5344

5445
import atexit
@@ -203,7 +194,6 @@ def Main():
203194
args.stderr,
204195
args.keep_logfiles )
205196
atexit.register( handlers.ServerCleanup )
206-
handlers.app.uninstall( True )
207197
handlers.app.install( WatchdogPlugin( args.idle_suicide_seconds,
208198
args.check_interval_seconds ) )
209199
handlers.app.install( HmacPlugin( hmac_secret ) )

0 commit comments

Comments
 (0)