Commit 00901b8
feat(python): eliminate SSE dependency 'httpx_sse' by hard-forking into core_utilities (#9784)
* Hard forked httpx_sse, moved into core_utilities, made fixes to line parsing bugs and improved idiomatic class definition.
* updated parser to: copy http_sse code into output, use new in-house SSE EventStream object and better handle failed SSE parsing
* updated changelog
* Automated update of seed files
* skip terminator sse events
* typing fixes
* Fix formatting issues: remove trailing whitespace and apply ruff formatting
* Automated update of seed files
* improved changelog language
* SSE Support arbitrary charsets from the headers - defaulting to utf-8
* added SSE unit tests
* properly copy core/http_sse to src/.../core/http_sse
* better typing in test_http_sse
* formatting
* refactored 'server-sent-event-examples' output (seed gen was broken), and added a test file 'tests/utils/test_sse_streaming.py'
* Hard forked httpx_sse, moved into core_utilities, made fixes to line parsing bugs and improved idiomatic class definition.
* updated parser to: copy http_sse code into output, use new in-house SSE EventStream object and better handle failed SSE parsing
* updated changelog
* skip terminator sse events
* Automated update of seed files
* typing fixes
* Fix formatting issues: remove trailing whitespace and apply ruff formatting
* improved changelog language
* Automated update of seed files
* SSE Support arbitrary charsets from the headers - defaulting to utf-8
* added SSE unit tests
* properly copy core/http_sse to src/.../core/http_sse
* better typing in test_http_sse
* formatting
* refactored 'server-sent-event-examples' output (seed gen was broken), and added a test file 'tests/utils/test_sse_streaming.py'
* Updated AsyncGenerator typing
* Properly generator stream terminator as a string i.e. was returning [[DONE]] before instead of '[[DONE]]'
* updated http_sse's __init__.py generation
* manual seed updates to fixture 'server-sent-event-examples'
* Automated update of seed files
* updated sse tests
* formatting fixes
---------
Co-authored-by: aditya-arolkar-swe <aditya-arolkar-swe@users.noreply.github.com>
Co-authored-by: fern-support <fern-support@users.noreply.github.com>1 parent 5934288 commit 00901b8
654 files changed
Lines changed: 32175 additions & 62 deletions
File tree
- generators/python
- sdk
- src/fern_python/generators/sdk
- client_generator
- core_utilities
- tests/utils
- seed/python-sdk
- accept-header/src/seed/core/http_sse
- alias-extends
- no-custom-config/src/seed/core/http_sse
- no-inheritance-for-extended-models/src/seed/core/http_sse
- alias/src/seed/core/http_sse
- any-auth/src/seed/core/http_sse
- api-wide-base-path/src/seed/core/http_sse
- audiences/src/seed/core/http_sse
- auth-environment-variables/src/seed/core/http_sse
- basic-auth-environment-variables/src/seed/core/http_sse
- basic-auth/src/seed/core/http_sse
- bearer-token-environment-variable/src/seed/core/http_sse
- bytes-download/src/seed/core/http_sse
- bytes-upload/src/seed/core/http_sse
- circular-references-advanced/no-inheritance-for-extended-models/src/seed/core/http_sse
- circular-references
- no-custom-config/src/seed/core/http_sse
- no-inheritance-for-extended-models/src/seed/core/http_sse
- client-side-params/src/seed/core/http_sse
- content-type/src/seed/core/http_sse
- cross-package-type-names/src/seed/core/http_sse
- custom-auth/src/seed/core/http_sse
- empty-clients/src/seed/core/http_sse
- enum
- no-custom-config/src/seed/core/http_sse
- strenum/src/seed/core/http_sse
- error-property/src/seed/core/http_sse
- errors/src/seed/core/http_sse
- examples
- client-filename/src/seed/core/http_sse
- legacy-wire-tests/src/seed/core/http_sse
- no-custom-config/src/seed/core/http_sse
- readme/src/seed/core/http_sse
- exhaustive
- additional_init_exports/src/seed/core/http_sse
- aliases_with_validation/src/seed/core/http_sse
- aliases_without_validation/src/seed/core/http_sse
- eager-imports/src/seed/core/http_sse
- extra_dependencies/src/seed/core/http_sse
- extra_dev_dependencies/src/seed/core/http_sse
- five-second-timeout/src/seed/core/http_sse
- follow_redirects_by_default/src/seed/core/http_sse
- improved_imports/src/seed/core/http_sse
- infinite-timeout/src/seed/core/http_sse
- inline-path-params/src/seed/core/http_sse
- inline_request_params/src/seed/core/http_sse
- no-custom-config/src/seed/core/http_sse
- pydantic-extra-fields/src/seed/core/http_sse
- pydantic-ignore-fields/src/seed/core/http_sse
- pydantic-v1-with-utils/src/seed/core/http_sse
- pydantic-v1-wrapped/src/seed/core/http_sse
- pydantic-v1/src/seed/core/http_sse
- pydantic-v2-wrapped/src/seed/core/http_sse
- pyproject_extras/src/seed/core/http_sse
- skip-pydantic-validation/src/seed/core/http_sse
- union-utils/src/seed/core/http_sse
- extends/src/seed/core/http_sse
- extra-properties/src/seed/core/http_sse
- file-download
- default-chunk-size/src/seed/core/http_sse
- no-custom-config/src/seed/core/http_sse
- file-upload
- exclude_types_from_init_exports/src/seed/core/http_sse
- no-custom-config/src/seed/core/http_sse
- use_typeddict_requests/src/seed/core/http_sse
- folders/src/seed/core/http_sse
- http-head/src/seed/core/http_sse
- idempotency-headers/src/seed/core/http_sse
- imdb/src/seed/core/http_sse
- inferred-auth-explicit/src/seed/core/http_sse
- inferred-auth-implicit-no-expiry/src/seed/core/http_sse
- inferred-auth-implicit/src/seed/core/http_sse
- license/src/seed/core/http_sse
- literals-unions/src/seed/core/http_sse
- literal
- no-custom-config/src/seed/core/http_sse
- use_typeddict_requests/src/seed/core/http_sse
- mixed-case/src/seed/core/http_sse
- mixed-file-directory
- exclude_types_from_init_exports/src/seed/core/http_sse
- no-custom-config/src/seed/core/http_sse
- multi-line-docs/src/seed/core/http_sse
- multi-url-environment-no-default/src/seed/core/http_sse
- multi-url-environment/src/seed/core/http_sse
- multiple-request-bodies/src/seed/core/http_sse
- no-environment/src/seed/core/http_sse
- nullable-optional/src/seed/core/http_sse
- nullable
- no-custom-config/src/seed/core/http_sse
- use-typeddict-requests/src/seed/core/http_sse
- oauth-client-credentials-custom/src/seed/core/http_sse
- oauth-client-credentials-default/src/seed/core/http_sse
- oauth-client-credentials-environment-variables/src/seed/core/http_sse
- oauth-client-credentials-nested-root/src/seed/core/http_sse
- oauth-client-credentials-with-variables/src/seed/core/http_sse
- oauth-client-credentials/src/seed/core/http_sse
- objects-with-imports/src/seed/core/http_sse
- object/src/seed/core/http_sse
- optional/src/seed/core/http_sse
- package-yml/src/seed/core/http_sse
- pagination
- no-custom-config/src/seed/core/http_sse
- no-inheritance-for-extended-models/src/seed/core/http_sse
- path-parameters/src/seed/core/http_sse
- plain-text/src/seed/core/http_sse
- property-access/src/seed/core/http_sse
- public-object/src/seed/core/http_sse
- query-parameters-openapi-as-objects/no-custom-config/src/seed/core/http_sse
- query-parameters-openapi/no-custom-config/src/seed/core/http_sse
- query-parameters/no-custom-config/src/seed/core/http_sse
- request-parameters/src/seed/core/http_sse
- required-nullable/src/seed/core/http_sse
- reserved-keywords/src/seed/core/http_sse
- response-property/src/seed/core/http_sse
- server-sent-event-examples
- src/seed
- completions
- core/http_sse
- tests/utils
- server-sent-events
- src/seed
- completions
- core/http_sse
- simple-api/src/seed/core/http_sse
- simple-fhir/no-inheritance-for-extended-models/src/seed/core/http_sse
- single-url-environment-default/src/seed/core/http_sse
- single-url-environment-no-default/src/seed/core/http_sse
- streaming-parameter/src/seed/core/http_sse
- streaming
- no-custom-config/src/seed/core/http_sse
- skip-pydantic-validation/src/seed/core/http_sse
- trace/src/seed/core/http_sse
- undiscriminated-unions/src/seed/core/http_sse
- unions
- no-custom-config/src/seed/core/http_sse
- union-naming-v1/src/seed/core/http_sse
- union-utils/src/seed/core/http_sse
- unknown/src/seed/core/http_sse
- validation
- no-custom-config/src/seed/core/http_sse
- with-defaults/src/seed/core/http_sse
- variables/src/seed/core/http_sse
- version-no-default/src/seed/core/http_sse
- version/src/seed/core/http_sse
- websocket-bearer-auth/src/seed/core/http_sse
- websocket-inferred-auth/src/seed/core/http_sse
- websocket
- websocket-base/src/seed/core/http_sse
- websocket-with_generated_clients/src/seed/core/http_sse
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
Lines changed: 110 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
Lines changed: 59 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
3 | 12 | | |
4 | 13 | | |
5 | 14 | | |
| |||
generators/python/src/fern_python/generators/sdk/client_generator/endpoint_response_code_writer.py
Lines changed: 81 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
| |||
99 | 98 | | |
100 | 99 | | |
101 | 100 | | |
102 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
103 | 113 | | |
104 | 114 | | |
105 | 115 | | |
| |||
119 | 129 | | |
120 | 130 | | |
121 | 131 | | |
122 | | - | |
| 132 | + | |
123 | 133 | | |
124 | 134 | | |
125 | 135 | | |
| |||
131 | 141 | | |
132 | 142 | | |
133 | 143 | | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
| 144 | + | |
139 | 145 | | |
140 | 146 | | |
141 | 147 | | |
142 | 148 | | |
143 | | - | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
144 | 215 | | |
145 | 216 | | |
146 | 217 | | |
| |||
156 | 227 | | |
157 | 228 | | |
158 | 229 | | |
159 | | - | |
| 230 | + | |
160 | 231 | | |
161 | 232 | | |
162 | 233 | | |
| |||
0 commit comments