@@ -1879,21 +1879,25 @@ def init_configurables(self):
1879
1879
# this determination, instantiate the GatewayClient config singleton.
1880
1880
self .gateway_config = GatewayClient .instance (parent = self )
1881
1881
1882
- if not issubclass (self .kernel_manager_class , AsyncMappingKernelManager ):
1882
+ if not issubclass (
1883
+ self .kernel_manager_class , AsyncMappingKernelManager # type:ignore[arg-type]
1884
+ ):
1883
1885
warnings .warn (
1884
1886
"The synchronous MappingKernelManager class is deprecated and will not be supported in Jupyter Server 3.0" ,
1885
1887
DeprecationWarning ,
1886
1888
stacklevel = 2 ,
1887
1889
)
1888
1890
1889
- if not issubclass (self .contents_manager_class , AsyncContentsManager ):
1891
+ if not issubclass (
1892
+ self .contents_manager_class , AsyncContentsManager # type:ignore[arg-type]
1893
+ ):
1890
1894
warnings .warn (
1891
1895
"The synchronous ContentsManager classes are deprecated and will not be supported in Jupyter Server 3.0" ,
1892
1896
DeprecationWarning ,
1893
1897
stacklevel = 2 ,
1894
1898
)
1895
1899
1896
- self .kernel_spec_manager = self .kernel_spec_manager_class (
1900
+ self .kernel_spec_manager = self .kernel_spec_manager_class ( # type:ignore[operator]
1897
1901
parent = self ,
1898
1902
)
1899
1903
@@ -1915,21 +1919,21 @@ def init_configurables(self):
1915
1919
"because jupyter-client's version does not allow them (should be >8.3.0)."
1916
1920
)
1917
1921
1918
- self .kernel_manager = self .kernel_manager_class (** kwargs )
1919
- self .contents_manager = self .contents_manager_class (
1922
+ self .kernel_manager = self .kernel_manager_class (** kwargs ) # type:ignore[operator]
1923
+ self .contents_manager = self .contents_manager_class ( # type:ignore[operator]
1920
1924
parent = self ,
1921
1925
log = self .log ,
1922
1926
)
1923
1927
# Trigger a default/validation here explicitly while we still support the
1924
1928
# deprecated trait on ServerApp (FIXME remove when deprecation finalized)
1925
1929
self .contents_manager .preferred_dir # noqa
1926
- self .session_manager = self .session_manager_class (
1930
+ self .session_manager = self .session_manager_class ( # type:ignore[operator]
1927
1931
parent = self ,
1928
1932
log = self .log ,
1929
1933
kernel_manager = self .kernel_manager ,
1930
1934
contents_manager = self .contents_manager ,
1931
1935
)
1932
- self .config_manager = self .config_manager_class (
1936
+ self .config_manager = self .config_manager_class ( # type:ignore[operator]
1933
1937
parent = self ,
1934
1938
log = self .log ,
1935
1939
)
@@ -1958,7 +1962,9 @@ def init_configurables(self):
1958
1962
f"Ignoring deprecated config ServerApp.login_handler_class={ self .login_handler_class } ."
1959
1963
" Superseded by ServerApp.identity_provider_class={self.identity_provider_class}."
1960
1964
)
1961
- self .identity_provider = self .identity_provider_class (** identity_provider_kwargs )
1965
+ self .identity_provider = self .identity_provider_class (
1966
+ ** identity_provider_kwargs
1967
+ ) # type:ignore[operator]
1962
1968
1963
1969
if self .identity_provider_class is LegacyIdentityProvider :
1964
1970
# legacy config stored the password in tornado_settings
@@ -1979,7 +1985,7 @@ def init_configurables(self):
1979
1985
# that means it has some config that should take higher priority than deprecated ServerApp.token
1980
1986
self .log .warning ("Ignoring deprecated ServerApp.token config" )
1981
1987
1982
- self .authorizer = self .authorizer_class (
1988
+ self .authorizer = self .authorizer_class ( # type:ignore[operator]
1983
1989
parent = self , log = self .log , identity_provider = self .identity_provider
1984
1990
)
1985
1991
@@ -2100,7 +2106,7 @@ def init_webapp(self):
2100
2106
if not self .ssl_options :
2101
2107
# could be an empty dict or None
2102
2108
# None indicates no SSL config
2103
- self .ssl_options = None
2109
+ self .ssl_options = None # type:ignore[assignment]
2104
2110
else :
2105
2111
# SSL may be missing, so only import it if it's to be used
2106
2112
import ssl
@@ -2130,7 +2136,7 @@ def init_resources(self):
2130
2136
old_soft , old_hard = resource .getrlimit (resource .RLIMIT_NOFILE )
2131
2137
soft = self .min_open_files_limit
2132
2138
hard = old_hard
2133
- if old_soft < soft :
2139
+ if soft is not None and old_soft < soft :
2134
2140
if hard < soft :
2135
2141
hard = soft
2136
2142
self .log .debug (
@@ -2911,7 +2917,7 @@ async def _cleanup(self):
2911
2917
await self .cleanup_extensions ()
2912
2918
await self .cleanup_kernels ()
2913
2919
try :
2914
- await self .kernel_websocket_connection_class .close_all ()
2920
+ await self .kernel_websocket_connection_class .close_all () # type:ignore[attr-defined]
2915
2921
except AttributeError :
2916
2922
# This can happen in two different scenarios:
2917
2923
#
0 commit comments