prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Bug: Running `starlite run` after installing starlite[cli] gives error about missing cryptography package
  The error is here:
  ```
  Traceback (most recent call last):
    File "C:\Users\hanne\Documents\Programme\analyze-wiktionary\.venv\lib\site-packages\starlite\middleware\session\cookie_backend.py", line 20, 
  in <module>
      from cryptography.exceptions import InvalidTag
  ModuleNotFoundError: No module named 'cryptography'
  
  The above exception was the direct cause of the following exception:
  
  Traceback (most recent call last):
    File "C:\Python310\lib\runpy.py", line 196, in _run_module_as_main
      return _run_code(code, main_globals, None,
    File "C:\Python310\lib\runpy.py", line 86, in _run_code
      exec(code, run_globals)
    File "C:\Users\hanne\Documents\Programme\analyze-wiktionary\.venv\Scripts\starlite.exe\__main__.py", line 4, in <module>
    File "C:\Users\hanne\Documents\Programme\analyze-wiktionary\.venv\lib\site-packages\starlite\cli.py", line 41, in <module>
      from starlite.middleware.session import SessionMiddleware
    File "C:\Users\hanne\Documents\Programme\analyze-wiktionary\.venv\lib\site-packages\starlite\middleware\session\__init__.py", line 2, in <module>
      from .cookie_backend import (
    File "C:\Users\hanne\Documents\Programme\analyze-wiktionary\.venv\lib\site-packages\starlite\middleware\session\cookie_backend.py", line 23, 
  in <module>
      raise MissingDependencyException("cryptography is not installed") from e
  starlite.exceptions.base_exceptions.MissingDependencyException: cryptography is not installed
  ```
  
  I thought it might be a good idea to install the package automatically with the CLI extra. (Or to update the [docs](https://starlite-api.github.io/starlite/usage/19-cli/?h=uvicorn) if I'm missing something).
  
  My versions: Windows, Python 3.10, starlite 1.46.0 
  
  PS: Thank you all for the great amount of effort you spend on this project!
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `starlite/middleware/session/__init__.py`
  Content:
  ```
  1 from .base import SessionMiddleware
  2 from .cookie_backend import (
  3     CookieBackendConfig as SessionCookieConfig,  # backwards compatible export
  4 )
  5 
  6 __all__ = [
  7     "SessionMiddleware",
  8     "SessionCookieConfig",
  9 ]
  10
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/starlite/middleware/session/__init__.py b/starlite/middleware/session/__init__.py
  --- a/starlite/middleware/session/__init__.py
  +++ b/starlite/middleware/session/__init__.py
  @@ -1,9 +1,27 @@
  +from typing import Any
  +
  +from starlite.utils import warn_deprecation
  +
   from .base import SessionMiddleware
  -from .cookie_backend import (
  -    CookieBackendConfig as SessionCookieConfig,  # backwards compatible export
  -)
  -
  -__all__ = [
  -    "SessionMiddleware",
  -    "SessionCookieConfig",
  -]
  +
  +
  +def __getattr__(name: str) -> Any:
  +    """Provide lazy importing as per https://peps.python.org/pep-0562/"""
  +
  +    if name != "SessionCookieConfig":
  +        raise AttributeError(f"Module {__package__} has no attribute {name}")
  +
  +    from .cookie_backend import CookieBackendConfig
  +
  +    warn_deprecation(
  +        deprecated_name=f"{name} from {__package__}",
  +        kind="import",
  +        alternative="'from startlite.middleware.sessions.cookie_backend import CookieBackendConfig'",
  +        version="1.47.0",
  +    )
  +
  +    globals()[name] = CookieBackendConfig
  +    return CookieBackendConfig
  +
  +
  +__all__ = ["SessionMiddleware"]
  
verification_info: {"golden_diff": "diff --git a/starlite/middleware/session/__init__.py b/starlite/middleware/session/__init__.py\n--- a/starlite/middleware/session/__init__.py\n+++ b/starlite/middleware/session/__init__.py\n@@ -1,9 +1,27 @@\n+from typing import Any\n+\n+from starlite.utils import warn_deprecation\n+\n from .base import SessionMiddleware\n-from .cookie_backend import (\n-    CookieBackendConfig as SessionCookieConfig,  # backwards compatible export\n-)\n-\n-__all__ = [\n-    \"SessionMiddleware\",\n-    \"SessionCookieConfig\",\n-]\n+\n+\n+def __getattr__(name: str) -> Any:\n+    \"\"\"Provide lazy importing as per https://peps.python.org/pep-0562/\"\"\"\n+\n+    if name != \"SessionCookieConfig\":\n+        raise AttributeError(f\"Module {__package__} has no attribute {name}\")\n+\n+    from .cookie_backend import CookieBackendConfig\n+\n+    warn_deprecation(\n+        deprecated_name=f\"{name} from {__package__}\",\n+        kind=\"import\",\n+        alternative=\"'from startlite.middleware.sessions.cookie_backend import CookieBackendConfig'\",\n+        version=\"1.47.0\",\n+    )\n+\n+    globals()[name] = CookieBackendConfig\n+    return CookieBackendConfig\n+\n+\n+__all__ = [\"SessionMiddleware\"]\n", "issue": "Bug: Running `starlite run` after installing starlite[cli] gives error about missing cryptography package\nThe error is here:\r\n```\r\nTraceback (most recent call last):\r\n  File \"C:\\Users\\hanne\\Documents\\Programme\\analyze-wiktionary\\.venv\\lib\\site-packages\\starlite\\middleware\\session\\cookie_backend.py\", line 20, \r\nin <module>\r\n    from cryptography.exceptions import InvalidTag\r\nModuleNotFoundError: No module named 'cryptography'\r\n\r\nThe above exception was the direct cause of the following exception:\r\n\r\nTraceback (most recent call last):\r\n  File \"C:\\Python310\\lib\\runpy.py\", line 196, in _run_module_as_main\r\n    return _run_code(code, main_globals, None,\r\n  File \"C:\\Python310\\lib\\runpy.py\", line 86, in _run_code\r\n    exec(code, run_globals)\r\n  File \"C:\\Users\\hanne\\Documents\\Programme\\analyze-wiktionary\\.venv\\Scripts\\starlite.exe\\__main__.py\", line 4, in <module>\r\n  File \"C:\\Users\\hanne\\Documents\\Programme\\analyze-wiktionary\\.venv\\lib\\site-packages\\starlite\\cli.py\", line 41, in <module>\r\n    from starlite.middleware.session import SessionMiddleware\r\n  File \"C:\\Users\\hanne\\Documents\\Programme\\analyze-wiktionary\\.venv\\lib\\site-packages\\starlite\\middleware\\session\\__init__.py\", line 2, in <module>\r\n    from .cookie_backend import (\r\n  File \"C:\\Users\\hanne\\Documents\\Programme\\analyze-wiktionary\\.venv\\lib\\site-packages\\starlite\\middleware\\session\\cookie_backend.py\", line 23, \r\nin <module>\r\n    raise MissingDependencyException(\"cryptography is not installed\") from e\r\nstarlite.exceptions.base_exceptions.MissingDependencyException: cryptography is not installed\r\n```\r\n\r\nI thought it might be a good idea to install the package automatically with the CLI extra. (Or to update the [docs](https://starlite-api.github.io/starlite/usage/19-cli/?h=uvicorn) if I'm missing something).\r\n\r\nMy versions: Windows, Python 3.10, starlite 1.46.0 \r\n\r\nPS: Thank you all for the great amount of effort you spend on this project!\n", "before_files": [{"content": "from .base import SessionMiddleware\nfrom .cookie_backend import (\n    CookieBackendConfig as SessionCookieConfig,  # backwards compatible export\n)\n\n__all__ = [\n    \"SessionMiddleware\",\n    \"SessionCookieConfig\",\n]\n", "path": "starlite/middleware/session/__init__.py"}], "after_files": [{"content": "from typing import Any\n\nfrom starlite.utils import warn_deprecation\n\nfrom .base import SessionMiddleware\n\n\ndef __getattr__(name: str) -> Any:\n    \"\"\"Provide lazy importing as per https://peps.python.org/pep-0562/\"\"\"\n\n    if name != \"SessionCookieConfig\":\n        raise AttributeError(f\"Module {__package__} has no attribute {name}\")\n\n    from .cookie_backend import CookieBackendConfig\n\n    warn_deprecation(\n        deprecated_name=f\"{name} from {__package__}\",\n        kind=\"import\",\n        alternative=\"'from startlite.middleware.sessions.cookie_backend import CookieBackendConfig'\",\n        version=\"1.47.0\",\n    )\n\n    globals()[name] = CookieBackendConfig\n    return CookieBackendConfig\n\n\n__all__ = [\"SessionMiddleware\"]\n", "path": "starlite/middleware/session/__init__.py"}]}