prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  `--prompt .` : the dot causes the basename of the current directory to be used
  **What's the problem this feature will solve?**
  <!-- What are you trying to do, that you are unable to achieve with pip as it currently stands? -->
  I'd like an easy way to have the prompt reflect the directory the env was created in.
  
  **Describe the solution you'd like**
  <!-- Clear and concise description of what you want to happen. -->
  I'd like `--prompt .` to use the basename of the current directory for the prompt, similar to what venv does. 
  More specifically, the prompt should be the directory in parentheses. 
  
  <!-- Provide examples of real world use cases that this would enable and how it solves the problem described above. -->
  ```bash
  $ mkdir foo
  $ cd foo
  $ virtualenv venv --prompt .
  $ source venv/bin/activate
  (foo) $ 
  ```
  
  **Alternative Solutions**
  <!-- Have you tried to workaround the problem using pip or other tools? Or a different approach to solving this issue? Please elaborate here. -->
  We could change the default prompt to be this. that'd be cool. 
  
  **Additional context**
  <!-- Add any other context, links, etc. about the feature here. -->
  This as been in the venv implementation of Pyhon since Python 3.9.something.
  
  Python 3 documentation: https://docs.python.org/3/library/venv.html#api 
  
  > prompt – a String to be used after virtual environment is activated (defaults to None which means directory name of the environment would be used). _If the special string "." is provided, the basename of the current directory is used as the prompt._
  
  
  </issue>
  <code>
  [start of src/virtualenv/run/plugin/activators.py]
  1 from __future__ import absolute_import, unicode_literals
  2 
  3 from argparse import ArgumentTypeError
  4 from collections import OrderedDict
  5 
  6 from .base import ComponentBuilder
  7 
  8 
  9 class ActivationSelector(ComponentBuilder):
  10     def __init__(self, interpreter, parser):
  11         self.default = None
  12         possible = OrderedDict(
  13             (k, v) for k, v in self.options("virtualenv.activate").items() if v.supports(interpreter)
  14         )
  15         super(ActivationSelector, self).__init__(interpreter, parser, "activators", possible)
  16         self.parser.description = "options for activation scripts"
  17         self.active = None
  18 
  19     def add_selector_arg_parse(self, name, choices):
  20         self.default = ",".join(choices)
  21         self.parser.add_argument(
  22             "--{}".format(name),
  23             default=self.default,
  24             metavar="comma_sep_list",
  25             required=False,
  26             help="activators to generate - default is all supported",
  27             type=self._extract_activators,
  28         )
  29 
  30     def _extract_activators(self, entered_str):
  31         elements = [e.strip() for e in entered_str.split(",") if e.strip()]
  32         missing = [e for e in elements if e not in self.possible]
  33         if missing:
  34             raise ArgumentTypeError("the following activators are not available {}".format(",".join(missing)))
  35         return elements
  36 
  37     def handle_selected_arg_parse(self, options):
  38         selected_activators = (
  39             self._extract_activators(self.default) if options.activators is self.default else options.activators
  40         )
  41         self.active = {k: v for k, v in self.possible.items() if k in selected_activators}
  42         self.parser.add_argument(
  43             "--prompt",
  44             dest="prompt",
  45             metavar="prompt",
  46             help="provides an alternative prompt prefix for this environment",
  47             default=None,
  48         )
  49         for activator in self.active.values():
  50             activator.add_parser_arguments(self.parser, self.interpreter)
  51 
  52     def create(self, options):
  53         return [activator_class(options) for activator_class in self.active.values()]
  54
  [end of src/virtualenv/run/plugin/activators.py]
  [start of src/virtualenv/activation/activator.py]
  1 from __future__ import absolute_import, unicode_literals
  2 
  3 from abc import ABCMeta, abstractmethod
  4 
  5 from six import add_metaclass
  6 
  7 
  8 @add_metaclass(ABCMeta)
  9 class Activator(object):
  10     """Generates an activate script for the virtual environment"""
  11 
  12     def __init__(self, options):
  13         """Create a new activator generator.
  14 
  15         :param options: the parsed options as defined within :meth:`add_parser_arguments`
  16         """
  17         self.flag_prompt = options.prompt
  18 
  19     @classmethod
  20     def supports(cls, interpreter):
  21         """Check if the activation script is supported in the given interpreter.
  22 
  23         :param interpreter: the interpreter we need to support
  24         :return: ``True`` if supported, ``False`` otherwise
  25         """
  26         return True
  27 
  28     @classmethod
  29     def add_parser_arguments(cls, parser, interpreter):
  30         """
  31         Add CLI arguments for this activation script.
  32 
  33         :param parser: the CLI parser
  34         :param interpreter: the interpreter this virtual environment is based of
  35         """
  36 
  37     @abstractmethod
  38     def generate(self, creator):
  39         """Generate the activate script for the given creator.
  40 
  41         :param creator: the creator (based of :class:`virtualenv.create.creator.Creator`) we used to create this \
  42         virtual environment
  43         """
  44         raise NotImplementedError
  45
  [end of src/virtualenv/activation/activator.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/src/virtualenv/activation/activator.py b/src/virtualenv/activation/activator.py
  --- a/src/virtualenv/activation/activator.py
  +++ b/src/virtualenv/activation/activator.py
  @@ -1,5 +1,6 @@
   from __future__ import absolute_import, unicode_literals
   
  +import os
   from abc import ABCMeta, abstractmethod
   
   from six import add_metaclass
  @@ -14,7 +15,7 @@
   
           :param options: the parsed options as defined within :meth:`add_parser_arguments`
           """
  -        self.flag_prompt = options.prompt
  +        self.flag_prompt = os.path.basename(os.getcwd()) if options.prompt == "." else options.prompt
   
       @classmethod
       def supports(cls, interpreter):
  diff --git a/src/virtualenv/run/plugin/activators.py b/src/virtualenv/run/plugin/activators.py
  --- a/src/virtualenv/run/plugin/activators.py
  +++ b/src/virtualenv/run/plugin/activators.py
  @@ -43,7 +43,10 @@
               "--prompt",
               dest="prompt",
               metavar="prompt",
  -            help="provides an alternative prompt prefix for this environment",
  +            help=(
  +                "provides an alternative prompt prefix for this environment "
  +                "(value of . means name of the current working directory)"
  +            ),
               default=None,
           )
           for activator in self.active.values():
  
verification_info: {"golden_diff": "diff --git a/src/virtualenv/activation/activator.py b/src/virtualenv/activation/activator.py\n--- a/src/virtualenv/activation/activator.py\n+++ b/src/virtualenv/activation/activator.py\n@@ -1,5 +1,6 @@\n from __future__ import absolute_import, unicode_literals\n \n+import os\n from abc import ABCMeta, abstractmethod\n \n from six import add_metaclass\n@@ -14,7 +15,7 @@\n \n         :param options: the parsed options as defined within :meth:`add_parser_arguments`\n         \"\"\"\n-        self.flag_prompt = options.prompt\n+        self.flag_prompt = os.path.basename(os.getcwd()) if options.prompt == \".\" else options.prompt\n \n     @classmethod\n     def supports(cls, interpreter):\ndiff --git a/src/virtualenv/run/plugin/activators.py b/src/virtualenv/run/plugin/activators.py\n--- a/src/virtualenv/run/plugin/activators.py\n+++ b/src/virtualenv/run/plugin/activators.py\n@@ -43,7 +43,10 @@\n             \"--prompt\",\n             dest=\"prompt\",\n             metavar=\"prompt\",\n-            help=\"provides an alternative prompt prefix for this environment\",\n+            help=(\n+                \"provides an alternative prompt prefix for this environment \"\n+                \"(value of . means name of the current working directory)\"\n+            ),\n             default=None,\n         )\n         for activator in self.active.values():\n", "issue": "`--prompt .` : the dot causes the basename of the current directory to be used\n**What's the problem this feature will solve?**\r\n<!-- What are you trying to do, that you are unable to achieve with pip as it currently stands? -->\r\nI'd like an easy way to have the prompt reflect the directory the env was created in.\r\n\r\n**Describe the solution you'd like**\r\n<!-- Clear and concise description of what you want to happen. -->\r\nI'd like `--prompt .` to use the basename of the current directory for the prompt, similar to what venv does. \r\nMore specifically, the prompt should be the directory in parentheses. \r\n\r\n<!-- Provide examples of real world use cases that this would enable and how it solves the problem described above. -->\r\n```bash\r\n$ mkdir foo\r\n$ cd foo\r\n$ virtualenv venv --prompt .\r\n$ source venv/bin/activate\r\n(foo) $ \r\n```\r\n\r\n**Alternative Solutions**\r\n<!-- Have you tried to workaround the problem using pip or other tools? Or a different approach to solving this issue? Please elaborate here. -->\r\nWe could change the default prompt to be this. that'd be cool. \r\n\r\n**Additional context**\r\n<!-- Add any other context, links, etc. about the feature here. -->\r\nThis as been in the venv implementation of Pyhon since Python 3.9.something.\r\n\r\nPython 3 documentation: https://docs.python.org/3/library/venv.html#api \r\n\r\n> prompt \u2013 a String to be used after virtual environment is activated (defaults to None which means directory name of the environment would be used). _If the special string \".\" is provided, the basename of the current directory is used as the prompt._\r\n\n", "before_files": [{"content": "from __future__ import absolute_import, unicode_literals\n\nfrom argparse import ArgumentTypeError\nfrom collections import OrderedDict\n\nfrom .base import ComponentBuilder\n\n\nclass ActivationSelector(ComponentBuilder):\n    def __init__(self, interpreter, parser):\n        self.default = None\n        possible = OrderedDict(\n            (k, v) for k, v in self.options(\"virtualenv.activate\").items() if v.supports(interpreter)\n        )\n        super(ActivationSelector, self).__init__(interpreter, parser, \"activators\", possible)\n        self.parser.description = \"options for activation scripts\"\n        self.active = None\n\n    def add_selector_arg_parse(self, name, choices):\n        self.default = \",\".join(choices)\n        self.parser.add_argument(\n            \"--{}\".format(name),\n            default=self.default,\n            metavar=\"comma_sep_list\",\n            required=False,\n            help=\"activators to generate - default is all supported\",\n            type=self._extract_activators,\n        )\n\n    def _extract_activators(self, entered_str):\n        elements = [e.strip() for e in entered_str.split(\",\") if e.strip()]\n        missing = [e for e in elements if e not in self.possible]\n        if missing:\n            raise ArgumentTypeError(\"the following activators are not available {}\".format(\",\".join(missing)))\n        return elements\n\n    def handle_selected_arg_parse(self, options):\n        selected_activators = (\n            self._extract_activators(self.default) if options.activators is self.default else options.activators\n        )\n        self.active = {k: v for k, v in self.possible.items() if k in selected_activators}\n        self.parser.add_argument(\n            \"--prompt\",\n            dest=\"prompt\",\n            metavar=\"prompt\",\n            help=\"provides an alternative prompt prefix for this environment\",\n            default=None,\n        )\n        for activator in self.active.values():\n            activator.add_parser_arguments(self.parser, self.interpreter)\n\n    def create(self, options):\n        return [activator_class(options) for activator_class in self.active.values()]\n", "path": "src/virtualenv/run/plugin/activators.py"}, {"content": "from __future__ import absolute_import, unicode_literals\n\nfrom abc import ABCMeta, abstractmethod\n\nfrom six import add_metaclass\n\n\n@add_metaclass(ABCMeta)\nclass Activator(object):\n    \"\"\"Generates an activate script for the virtual environment\"\"\"\n\n    def __init__(self, options):\n        \"\"\"Create a new activator generator.\n\n        :param options: the parsed options as defined within :meth:`add_parser_arguments`\n        \"\"\"\n        self.flag_prompt = options.prompt\n\n    @classmethod\n    def supports(cls, interpreter):\n        \"\"\"Check if the activation script is supported in the given interpreter.\n\n        :param interpreter: the interpreter we need to support\n        :return: ``True`` if supported, ``False`` otherwise\n        \"\"\"\n        return True\n\n    @classmethod\n    def add_parser_arguments(cls, parser, interpreter):\n        \"\"\"\n        Add CLI arguments for this activation script.\n\n        :param parser: the CLI parser\n        :param interpreter: the interpreter this virtual environment is based of\n        \"\"\"\n\n    @abstractmethod\n    def generate(self, creator):\n        \"\"\"Generate the activate script for the given creator.\n\n        :param creator: the creator (based of :class:`virtualenv.create.creator.Creator`) we used to create this \\\n        virtual environment\n        \"\"\"\n        raise NotImplementedError\n", "path": "src/virtualenv/activation/activator.py"}]}