Repository: pantsbuild/pants

Issue:
`stevedore_namespace` documentation shows `str`'s doc string
**Describe the bug**

The `stevedore_namespace` BUILD file symbol has a doc-string, but it isn't shown in `pants help-all`. It instead shows what looks like the doc string for `str`.

https://github.com/pantsbuild/pants/blob/ec86d19cd954cd49a9562880a7c0dbc45632778c/src/python/pants/backend/python/framework/stevedore/target_types.py#L13-L30

To reproduce, enable the stevedore backend and look at `help` or `help-all`:

```shell
PANTS_VERSION=2.22.0.dev3 pants --backend-packages=pants.backend.experimental.python.framework.stevedore help stevedore_namespace
```
```
`stevedore_namespace` BUILD file symbol
---------------------------------------

str(object='') -> str
str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or
errors is specified, then the object must expose a data buffer
that will be decoded using the given encoding and error handler.
Otherwise, returns the result of object.__str__() (if defined)
or repr(object).
encoding defaults to sys.getdefaultencoding().
errors defaults to 'strict'.
```

```shell
PANTS_VERSION=2.22.0.dev3 pants --backend-packages=pants.backend.experimental.python.framework.stevedore help-all | \
  jq .name_to_build_file_info.stevedore_namespace
```
```json
{
  "documentation": "str(object='') -> str\nstr(bytes_or_buffer[, encoding[, errors]]) -> str\n\nCreate a new string object from the given object. If encoding or\nerrors is specified, then the object must expose a data buffer\nthat will be decoded using the given encoding and error handler.\nOtherwise, returns the result of object.__str__() (if defined)\nor repr(object).\nencoding defaults to sys.getdefaultencoding().\nerrors defaults to 'strict'.",
  "is_target": false,
  "name": "stevedore_namespace",
  "signature": null
}
```

**Pants version**
Seems to be visible in 2.16 through to the currently latest.

**OS**
both

**Additional info**

- Will appear in online docs too after https://github.com/pantsbuild/pantsbuild.org/pull/216
- Relevant issues:
  - https://github.com/pantsbuild/pants/discussions/18117
  - https://github.com/pantsbuild/pants/issues/14832


Discussion:

Resolving patch:
diff --git a/src/python/pants/backend/python/framework/stevedore/target_types.py b/src/python/pants/backend/python/framework/stevedore/target_types.py
--- a/src/python/pants/backend/python/framework/stevedore/target_types.py
+++ b/src/python/pants/backend/python/framework/stevedore/target_types.py
@@ -11,20 +11,22 @@
 
 
 class StevedoreNamespace(str):
-    f"""Tag a namespace in entry_points as a stevedore namespace.
+    """Tag a namespace in entry_points as a stevedore namespace.
 
     This is required for the entry_point to be visible to dep inference
     based on the `stevedore_namespaces` field.
 
     For example:
-        {PythonDistribution.alias}(
-            ...
-            entry_points={{
-                stevedore_namespace("a.b.c"): {{
-                    "plugin_name": "some.entry:point",
-                }},
-            }},
-        )
+    ```python
+    python_distribution(
+        ...
+        entry_points={
+            stevedore_namespace("a.b.c"): {
+                "plugin_name": "some.entry:point",
+            },
+        },
+    )
+    ```
     """
 
     alias = "stevedore_namespace"


Test patch: