prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  StaticFilesConfig and virtual directories
  I'm trying to write a ``FileSystemProtocol`` to load files from the package data using [importlib_resources](https://importlib-resources.readthedocs.io/en/latest/using.html#). But because ``directories`` is defined as ``DirectoryPath``, pydantic checks if the given directories exist in the local filesystem. 
  
  This is not generally true, especially in any kind of virtual filesystem (e.g. a zipped package). I think this condition should be relaxed to support virtual filesystems.
  
  https://github.com/starlite-api/starlite/blob/9bb6dcd57c10a591377cf8e3a537e9292566d5b9/starlite/config/static_files.py#L32
  
  </issue>
  <code>
  [start of litestar/cli/main.py]
  1 from __future__ import annotations
  2 
  3 import sys
  4 from pathlib import Path
  5 from typing import TYPE_CHECKING
  6 
  7 from ._utils import RICH_CLICK_INSTALLED, LitestarEnv, LitestarExtensionGroup
  8 from .commands import core, schema, sessions
  9 
  10 if TYPE_CHECKING or not RICH_CLICK_INSTALLED:  # pragma: no cover
  11     import click
  12     from click import Context, group, option, pass_context
  13     from click import Path as ClickPath
  14 else:
  15     import rich_click as click
  16     from rich_click import Context, group, option, pass_context
  17     from rich_click import Path as ClickPath
  18     from rich_click.cli import patch as rich_click_patch
  19 
  20     rich_click_patch()
  21     click.rich_click.USE_RICH_MARKUP = True
  22     click.rich_click.USE_MARKDOWN = False
  23     click.rich_click.SHOW_ARGUMENTS = True
  24     click.rich_click.GROUP_ARGUMENTS_OPTIONS = True
  25     click.rich_click.SHOW_ARGUMENTS = True
  26     click.rich_click.GROUP_ARGUMENTS_OPTIONS = True
  27     click.rich_click.STYLE_ERRORS_SUGGESTION = "magenta italic"
  28     click.rich_click.ERRORS_SUGGESTION = ""
  29     click.rich_click.ERRORS_EPILOGUE = ""
  30     click.rich_click.MAX_WIDTH = 100
  31     click.rich_click.SHOW_METAVARS_COLUMN = True
  32     click.rich_click.APPEND_METAVARS_HELP = True
  33 
  34 
  35 __all__ = ("litestar_group",)
  36 
  37 
  38 @group(cls=LitestarExtensionGroup, context_settings={"help_option_names": ["-h", "--help"]})
  39 @option("--app", "app_path", help="Module path to a Litestar application")
  40 @option(
  41     "--app-dir",
  42     help="Look for APP in the specified directory, by adding this to the PYTHONPATH. Defaults to the current working directory.",
  43     default=None,
  44     type=ClickPath(dir_okay=True, file_okay=False, path_type=Path),
  45     show_default=False,
  46 )
  47 @pass_context
  48 def litestar_group(ctx: Context, app_path: str | None, app_dir: Path | None = None) -> None:
  49     """Litestar CLI."""
  50     sys.path.append(str(app_dir))
  51 
  52     if ctx.obj is None:  # env has not been loaded yet, so we can lazy load it
  53         ctx.obj = lambda: LitestarEnv.from_env(app_path)
  54 
  55 
  56 # add sub commands here
  57 
  58 litestar_group.add_command(core.info_command)
  59 litestar_group.add_command(core.run_command)
  60 litestar_group.add_command(core.routes_command)
  61 litestar_group.add_command(core.version_command)
  62 litestar_group.add_command(sessions.sessions_group)
  63 litestar_group.add_command(schema.schema_group)
  64
  [end of litestar/cli/main.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/litestar/cli/main.py b/litestar/cli/main.py
  --- a/litestar/cli/main.py
  +++ b/litestar/cli/main.py
  @@ -27,7 +27,7 @@
       click.rich_click.STYLE_ERRORS_SUGGESTION = "magenta italic"
       click.rich_click.ERRORS_SUGGESTION = ""
       click.rich_click.ERRORS_EPILOGUE = ""
  -    click.rich_click.MAX_WIDTH = 100
  +    click.rich_click.MAX_WIDTH = 80
       click.rich_click.SHOW_METAVARS_COLUMN = True
       click.rich_click.APPEND_METAVARS_HELP = True
  
verification_info: {"golden_diff": "diff --git a/litestar/cli/main.py b/litestar/cli/main.py\n--- a/litestar/cli/main.py\n+++ b/litestar/cli/main.py\n@@ -27,7 +27,7 @@\n     click.rich_click.STYLE_ERRORS_SUGGESTION = \"magenta italic\"\n     click.rich_click.ERRORS_SUGGESTION = \"\"\n     click.rich_click.ERRORS_EPILOGUE = \"\"\n-    click.rich_click.MAX_WIDTH = 100\n+    click.rich_click.MAX_WIDTH = 80\n     click.rich_click.SHOW_METAVARS_COLUMN = True\n     click.rich_click.APPEND_METAVARS_HELP = True\n", "issue": "StaticFilesConfig and virtual directories\nI'm trying to write a ``FileSystemProtocol`` to load files from the package data using [importlib_resources](https://importlib-resources.readthedocs.io/en/latest/using.html#). But because ``directories`` is defined as ``DirectoryPath``, pydantic checks if the given directories exist in the local filesystem. \r\n\r\nThis is not generally true, especially in any kind of virtual filesystem (e.g. a zipped package). I think this condition should be relaxed to support virtual filesystems.\r\n\r\nhttps://github.com/starlite-api/starlite/blob/9bb6dcd57c10a591377cf8e3a537e9292566d5b9/starlite/config/static_files.py#L32\n", "before_files": [{"content": "from __future__ import annotations\n\nimport sys\nfrom pathlib import Path\nfrom typing import TYPE_CHECKING\n\nfrom ._utils import RICH_CLICK_INSTALLED, LitestarEnv, LitestarExtensionGroup\nfrom .commands import core, schema, sessions\n\nif TYPE_CHECKING or not RICH_CLICK_INSTALLED:  # pragma: no cover\n    import click\n    from click import Context, group, option, pass_context\n    from click import Path as ClickPath\nelse:\n    import rich_click as click\n    from rich_click import Context, group, option, pass_context\n    from rich_click import Path as ClickPath\n    from rich_click.cli import patch as rich_click_patch\n\n    rich_click_patch()\n    click.rich_click.USE_RICH_MARKUP = True\n    click.rich_click.USE_MARKDOWN = False\n    click.rich_click.SHOW_ARGUMENTS = True\n    click.rich_click.GROUP_ARGUMENTS_OPTIONS = True\n    click.rich_click.SHOW_ARGUMENTS = True\n    click.rich_click.GROUP_ARGUMENTS_OPTIONS = True\n    click.rich_click.STYLE_ERRORS_SUGGESTION = \"magenta italic\"\n    click.rich_click.ERRORS_SUGGESTION = \"\"\n    click.rich_click.ERRORS_EPILOGUE = \"\"\n    click.rich_click.MAX_WIDTH = 100\n    click.rich_click.SHOW_METAVARS_COLUMN = True\n    click.rich_click.APPEND_METAVARS_HELP = True\n\n\n__all__ = (\"litestar_group\",)\n\n\n@group(cls=LitestarExtensionGroup, context_settings={\"help_option_names\": [\"-h\", \"--help\"]})\n@option(\"--app\", \"app_path\", help=\"Module path to a Litestar application\")\n@option(\n    \"--app-dir\",\n    help=\"Look for APP in the specified directory, by adding this to the PYTHONPATH. Defaults to the current working directory.\",\n    default=None,\n    type=ClickPath(dir_okay=True, file_okay=False, path_type=Path),\n    show_default=False,\n)\n@pass_context\ndef litestar_group(ctx: Context, app_path: str | None, app_dir: Path | None = None) -> None:\n    \"\"\"Litestar CLI.\"\"\"\n    sys.path.append(str(app_dir))\n\n    if ctx.obj is None:  # env has not been loaded yet, so we can lazy load it\n        ctx.obj = lambda: LitestarEnv.from_env(app_path)\n\n\n# add sub commands here\n\nlitestar_group.add_command(core.info_command)\nlitestar_group.add_command(core.run_command)\nlitestar_group.add_command(core.routes_command)\nlitestar_group.add_command(core.version_command)\nlitestar_group.add_command(sessions.sessions_group)\nlitestar_group.add_command(schema.schema_group)\n", "path": "litestar/cli/main.py"}]}