Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions fern/products/sdks/legacy/generators/python/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,21 @@ Define optional dependency groups that users can install with your package using
Custom extras are merged with the built-in [`aiohttp` extra](/learn/sdks/legacy/generators/python/aiohttp-support) at generation time, so declaring your own extras won't clobber it.
</ParamField>

<ParamField path="http_client_extra" type="string" default="null" required={false} toc={true}>
Declares `httpx`, the HTTP client the SDK depends on, as an optional dependency installed through a pip extra with this name. A plain install of your package then pulls in only Pydantic and `typing_extensions`, which suits users who only build or parse the generated models, such as [XML-encoded types](/learn/sdks/deep-dives/xml-encoded-types). Users who call the API install the extra:

```yaml
config:
http_client_extra: client
```

```bash
pip install your-package[client]
```

`httpx` is also added to the built-in [`aiohttp` extra](/learn/sdks/legacy/generators/python/aiohttp-support), since the aiohttp transport requires it. Importing the client without either extra installed raises an `ImportError`. The value can't be `aiohttp`, and the option requires `lazy_imports` to stay enabled. When unset, `httpx` remains a required dependency.
</ParamField>

<ParamField path="flat_layout" type="bool" default="false" required={false} toc={true}>
When enabled, generates a flatter package structure by reducing nested directories and modules.
</ParamField>
Expand Down
Loading