Skip to content

Commit

Permalink
ci: regenerated with OpenAPI Doc 1.0.0, Speakeasy CLI 1.257.1
Browse files Browse the repository at this point in the history
  • Loading branch information
speakeasybot committed Apr 18, 2024
1 parent 131be23 commit 820e3f8
Show file tree
Hide file tree
Showing 14 changed files with 528 additions and 337 deletions.
10 changes: 5 additions & 5 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ id: 45d697d3-6c8d-4d6e-8825-3af8be149b31
management:
docChecksum: 2516596125ef223fbbef6c434d22eaac
docVersion: 1.0.0
speakeasyVersion: 1.227.0
generationVersion: 2.291.0
releaseVersion: 0.15.2
configChecksum: c690aa9e1dffca9976ec42d3f89d9a6c
speakeasyVersion: 1.257.1
generationVersion: 2.308.2
releaseVersion: 0.16.0
configChecksum: 9325249e865c40a27f6b4e2b9d5a4510
repoURL: https://github.com/speakeasy-sdks/test-repo-test2.git
repoSubDirectory: .
installationURL: https://github.com/speakeasy-sdks/test-repo-test2.git
features:
python:
core: 4.5.2
core: 4.6.4
globalServerURLs: 2.82.2
responseFormat: 0.1.0
generatedFiles:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Handling errors in this SDK should largely match your expectations. All operati

| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4x-5xx | */* |
| errors.SDKError | 4xx-5xx | */* |

### Example

Expand Down Expand Up @@ -142,7 +142,7 @@ import requests

http_client = requests.Session()
http_client.headers.update({'x-custom-header': 'someValue'})
s = test.Test(client: http_client)
s = test.Test(client=http_client)
```
<!-- End Custom HTTP Client [http-client] -->

Expand Down
10 changes: 9 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,4 +342,12 @@ Based on:
- OpenAPI Doc 1.0.0
- Speakeasy CLI 1.227.0 (2.291.0) https://github.com/speakeasy-api/speakeasy
### Generated
- [python v0.15.2] .
- [python v0.15.2] .

## 2024-04-18 00:01:16
### Changes
Based on:
- OpenAPI Doc 1.0.0
- Speakeasy CLI 1.257.1 (2.308.2) https://github.com/speakeasy-api/speakeasy
### Generated
- [python v0.16.0] .
6 changes: 3 additions & 3 deletions docs/sdks/pets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ if res is not None:

| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4x-5xx | */* |
| errors.SDKError | 4xx-5xx | */* |

## list_pets

Expand Down Expand Up @@ -73,7 +73,7 @@ if res.pets is not None:

| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4x-5xx | */* |
| errors.SDKError | 4xx-5xx | */* |

## show_pet_by_id

Expand Down Expand Up @@ -113,4 +113,4 @@ if res.pet is not None:

| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4x-5xx | */* |
| errors.SDKError | 4xx-5xx | */* |
3 changes: 2 additions & 1 deletion gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ generation:
auth:
oAuth2ClientCredentialsEnabled: false
python:
version: 0.15.2
version: 0.16.0
additionalDependencies:
dependencies: {}
extraDependencies:
Expand All @@ -31,4 +31,5 @@ python:
maxMethodParams: 0
outputModelSuffix: output
packageName: test
projectUrls: {}
responseFormat: envelope
3 changes: 2 additions & 1 deletion pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,8 @@ disable=raw-checker-failed,
too-many-nested-blocks,
too-many-boolean-expressions,
no-else-raise,
bare-except
bare-except,
broad-exception-caught

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
Expand Down
32 changes: 22 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT."""

import setuptools
import re

try:
with open("README.md", "r") as fh:
with open('README.md', 'r') as fh:
long_description = fh.read()
GITHUB_URL = 'https://github.com/speakeasy-sdks/test-repo-test2.git'
GITHUB_URL = GITHUB_URL[: -len('.git')] if GITHUB_URL.endswith('.git') else GITHUB_URL
# links on PyPI should have absolute URLs
long_description = re.sub(
r'(\[[^\]]+\]\()((?!https?:)[^\)]+)(\))',
lambda m: m.group(1) + GITHUB_URL + '/blob/master/' + m.group(2) + m.group(3),
long_description,
)
except FileNotFoundError:
long_description = ""
long_description = ''

setuptools.setup(
name="test",
version="0.15.2",
author="my-test",
description="Python Client SDK Generated by Speakeasy",
name='test',
version='0.16.0',
author='my-test',
description='Python Client SDK Generated by Speakeasy',
url='https://github.com/speakeasy-sdks/test-repo-test2.git',
long_description=long_description,
long_description_content_type="text/markdown",
packages=setuptools.find_packages(where="src"),
long_description_content_type='text/markdown',
packages=setuptools.find_packages(where='src'),
install_requires=[
"certifi>=2023.7.22",
"charset-normalizer>=3.2.0",
Expand All @@ -34,10 +44,12 @@
],
extras_require={
"dev": [
"pylint==2.16.2",
"pylint==3.1.0",
],
},
package_dir={'': 'src'},
python_requires='>=3.8',
package_data={"test": ["py.typed"]},
package_data={
'test': ['py.typed']
},
)
18 changes: 10 additions & 8 deletions src/test/_hooks/sdkhooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import requests
from .types import SDKInitHook, BeforeRequestContext, BeforeRequestHook, AfterSuccessContext, AfterSuccessHook, AfterErrorContext, AfterErrorHook, Hooks
from typing import List, Optional, Tuple, Union
from typing import List, Optional, Tuple


class SDKHooks(Hooks):
Expand All @@ -29,19 +29,21 @@ def sdk_init(self, base_url: str, client: requests.Session) -> Tuple[str, reques
base_url, client = hook.sdk_init(base_url, client)
return base_url, client

def before_request(self, hook_ctx: BeforeRequestContext, request: requests.PreparedRequest) -> Union[requests.PreparedRequest, Exception]:
def before_request(self, hook_ctx: BeforeRequestContext, request: requests.PreparedRequest) -> requests.PreparedRequest:
for hook in self.before_request_hooks:
request = hook.before_request(hook_ctx, request)
if isinstance(request, Exception):
raise request
out = hook.before_request(hook_ctx, request)
if isinstance(out, Exception):
raise out
request = out

return request

def after_success(self, hook_ctx: AfterSuccessContext, response: requests.Response) -> requests.Response:
for hook in self.after_success_hooks:
response = hook.after_success(hook_ctx, response)
if isinstance(response, Exception):
raise response
out = hook.after_success(hook_ctx, response)
if isinstance(out, Exception):
raise out
response = out
return response

def after_error(self, hook_ctx: AfterErrorContext, response: Optional[requests.Response], error: Optional[Exception]) -> Tuple[Optional[requests.Response], Optional[Exception]]:
Expand Down
10 changes: 7 additions & 3 deletions src/test/_hooks/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,19 @@ def __init__(self, operation_id: str, oauth2_scopes: Optional[List[str]], securi


class BeforeRequestContext(HookContext):
pass
def __init__(self, hook_ctx: HookContext):
super().__init__(hook_ctx.operation_id, hook_ctx.oauth2_scopes, hook_ctx.security_source)


class AfterSuccessContext(HookContext):
pass
def __init__(self, hook_ctx: HookContext):
super().__init__(hook_ctx.operation_id, hook_ctx.oauth2_scopes, hook_ctx.security_source)



class AfterErrorContext(HookContext):
pass
def __init__(self, hook_ctx: HookContext):
super().__init__(hook_ctx.operation_id, hook_ctx.oauth2_scopes, hook_ctx.security_source)


class SDKInitHook(ABC):
Expand Down
Loading

0 comments on commit 820e3f8

Please sign in to comment.