Skip to content

Commit e4afabb

Browse files
Stainless Botstainless-bot
authored andcommitted
chore: update SDK settings (#224)
1 parent 5c822fa commit e4afabb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+124
-118
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ $ pip install -r requirements-dev.lock
3232
## Modifying/Adding code
3333

3434
Most of the SDK is generated code, and any modified code will be overridden on the next generation. The
35-
`src/openlayer/lib/` and `examples/` directories are exceptions and will never be overridden.
35+
`src/openlayer_test/lib/` and `examples/` directories are exceptions and will never be overridden.
3636

3737
## Adding and running examples
3838

README.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Openlayer Python API library
22

3-
[![PyPI version](https://img.shields.io/pypi/v/openlayer.svg)](https://pypi.org/project/openlayer/)
3+
[![PyPI version](https://img.shields.io/pypi/v/openlayer_test.svg)](https://pypi.org/project/openlayer_test/)
44

55
The Openlayer Python library provides convenient access to the Openlayer REST API from any Python 3.7+
66
application. The library includes type definitions for all request params and response fields,
@@ -16,7 +16,7 @@ The REST API documentation can be found [on openlayer.com](https://openlayer.com
1616

1717
```sh
1818
# install from PyPI
19-
pip install --pre openlayer
19+
pip install --pre openlayer_test
2020
```
2121

2222
## Usage
@@ -25,7 +25,7 @@ The full API of this library can be found in [api.md](api.md).
2525

2626
```python
2727
import os
28-
from openlayer import Openlayer
28+
from openlayer_test import Openlayer
2929

3030
client = Openlayer(
3131
# This is the default and can be omitted
@@ -66,7 +66,7 @@ Simply import `AsyncOpenlayer` instead of `Openlayer` and use `await` with each
6666
```python
6767
import os
6868
import asyncio
69-
from openlayer import AsyncOpenlayer
69+
from openlayer_test import AsyncOpenlayer
7070

7171
client = AsyncOpenlayer(
7272
# This is the default and can be omitted
@@ -113,16 +113,16 @@ Typed requests and responses provide autocomplete and documentation within your
113113

114114
## Handling errors
115115

116-
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `openlayer.APIConnectionError` is raised.
116+
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `openlayer_test.APIConnectionError` is raised.
117117

118118
When the API returns a non-success status code (that is, 4xx or 5xx
119-
response), a subclass of `openlayer.APIStatusError` is raised, containing `status_code` and `response` properties.
119+
response), a subclass of `openlayer_test.APIStatusError` is raised, containing `status_code` and `response` properties.
120120

121-
All errors inherit from `openlayer.APIError`.
121+
All errors inherit from `openlayer_test.APIError`.
122122

123123
```python
124-
import openlayer
125-
from openlayer import Openlayer
124+
import openlayer_test
125+
from openlayer_test import Openlayer
126126

127127
client = Openlayer()
128128

@@ -146,12 +146,12 @@ try:
146146
}
147147
],
148148
)
149-
except openlayer.APIConnectionError as e:
149+
except openlayer_test.APIConnectionError as e:
150150
print("The server could not be reached")
151151
print(e.__cause__) # an underlying Exception, likely raised within httpx.
152-
except openlayer.RateLimitError as e:
152+
except openlayer_test.RateLimitError as e:
153153
print("A 429 status code was received; we should back off a bit.")
154-
except openlayer.APIStatusError as e:
154+
except openlayer_test.APIStatusError as e:
155155
print("Another non-200-range status code was received")
156156
print(e.status_code)
157157
print(e.response)
@@ -179,7 +179,7 @@ Connection errors (for example, due to a network connectivity problem), 408 Requ
179179
You can use the `max_retries` option to configure or disable retry settings:
180180

181181
```python
182-
from openlayer import Openlayer
182+
from openlayer_test import Openlayer
183183

184184
# Configure the default for all requests:
185185
client = Openlayer(
@@ -215,7 +215,7 @@ By default requests time out after 1 minute. You can configure this with a `time
215215
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object:
216216

217217
```python
218-
from openlayer import Openlayer
218+
from openlayer_test import Openlayer
219219

220220
# Configure the default for all requests:
221221
client = Openlayer(
@@ -283,7 +283,7 @@ if response.my_field is None:
283283
The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,
284284

285285
```py
286-
from openlayer import Openlayer
286+
from openlayer_test import Openlayer
287287

288288
client = Openlayer()
289289
response = client.inference_pipelines.data.with_raw_response.stream(
@@ -309,9 +309,9 @@ data = response.parse() # get the object that `inference_pipelines.data.stream(
309309
print(data.success)
310310
```
311311

312-
These methods return an [`APIResponse`](https://github.com/openlayer-ai/openlayer-python/tree/main/src/openlayer/_response.py) object.
312+
These methods return an [`APIResponse`](https://github.com/openlayer-ai/openlayer-python/tree/main/src/openlayer_test/_response.py) object.
313313

314-
The async client returns an [`AsyncAPIResponse`](https://github.com/openlayer-ai/openlayer-python/tree/main/src/openlayer/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
314+
The async client returns an [`AsyncAPIResponse`](https://github.com/openlayer-ai/openlayer-python/tree/main/src/openlayer_test/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
315315

316316
#### `.with_streaming_response`
317317

@@ -391,7 +391,7 @@ You can directly override the [httpx client](https://www.python-httpx.org/api/#c
391391
- Additional [advanced](https://www.python-httpx.org/advanced/#client-instances) functionality
392392

393393
```python
394-
from openlayer import Openlayer, DefaultHttpxClient
394+
from openlayer_test import Openlayer, DefaultHttpxClient
395395

396396
client = Openlayer(
397397
# Or use the `OPENLAYER_BASE_URL` env var

api.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,36 @@
33
Types:
44

55
```python
6-
from openlayer.types import ProjectListResponse
6+
from openlayer_test.types import ProjectListResponse
77
```
88

99
Methods:
1010

11-
- <code title="get /projects">client.projects.<a href="./src/openlayer/resources/projects/projects.py">list</a>(\*\*<a href="src/openlayer/types/project_list_params.py">params</a>) -> <a href="./src/openlayer/types/project_list_response.py">ProjectListResponse</a></code>
11+
- <code title="get /projects">client.projects.<a href="./src/openlayer_test/resources/projects/projects.py">list</a>(\*\*<a href="src/openlayer_test/types/project_list_params.py">params</a>) -> <a href="./src/openlayer_test/types/project_list_response.py">ProjectListResponse</a></code>
1212

1313
## Commits
1414

1515
Types:
1616

1717
```python
18-
from openlayer.types.projects import CommitListResponse
18+
from openlayer_test.types.projects import CommitListResponse
1919
```
2020

2121
Methods:
2222

23-
- <code title="get /projects/{id}/versions">client.projects.commits.<a href="./src/openlayer/resources/projects/commits.py">list</a>(id, \*\*<a href="src/openlayer/types/projects/commit_list_params.py">params</a>) -> <a href="./src/openlayer/types/projects/commit_list_response.py">CommitListResponse</a></code>
23+
- <code title="get /projects/{id}/versions">client.projects.commits.<a href="./src/openlayer_test/resources/projects/commits.py">list</a>(id, \*\*<a href="src/openlayer_test/types/projects/commit_list_params.py">params</a>) -> <a href="./src/openlayer_test/types/projects/commit_list_response.py">CommitListResponse</a></code>
2424

2525
## InferencePipelines
2626

2727
Types:
2828

2929
```python
30-
from openlayer.types.projects import InferencePipelineListResponse
30+
from openlayer_test.types.projects import InferencePipelineListResponse
3131
```
3232

3333
Methods:
3434

35-
- <code title="get /projects/{id}/inference-pipelines">client.projects.inference_pipelines.<a href="./src/openlayer/resources/projects/inference_pipelines.py">list</a>(id, \*\*<a href="src/openlayer/types/projects/inference_pipeline_list_params.py">params</a>) -> <a href="./src/openlayer/types/projects/inference_pipeline_list_response.py">InferencePipelineListResponse</a></code>
35+
- <code title="get /projects/{id}/inference-pipelines">client.projects.inference_pipelines.<a href="./src/openlayer_test/resources/projects/inference_pipelines.py">list</a>(id, \*\*<a href="src/openlayer_test/types/projects/inference_pipeline_list_params.py">params</a>) -> <a href="./src/openlayer_test/types/projects/inference_pipeline_list_response.py">InferencePipelineListResponse</a></code>
3636

3737
# Commits
3838

@@ -41,12 +41,12 @@ Methods:
4141
Types:
4242

4343
```python
44-
from openlayer.types.commits import TestResultListResponse
44+
from openlayer_test.types.commits import TestResultListResponse
4545
```
4646

4747
Methods:
4848

49-
- <code title="get /versions/{id}/results">client.commits.test_results.<a href="./src/openlayer/resources/commits/test_results.py">list</a>(id, \*\*<a href="src/openlayer/types/commits/test_result_list_params.py">params</a>) -> <a href="./src/openlayer/types/commits/test_result_list_response.py">TestResultListResponse</a></code>
49+
- <code title="get /versions/{id}/results">client.commits.test_results.<a href="./src/openlayer_test/resources/commits/test_results.py">list</a>(id, \*\*<a href="src/openlayer_test/types/commits/test_result_list_params.py">params</a>) -> <a href="./src/openlayer_test/types/commits/test_result_list_response.py">TestResultListResponse</a></code>
5050

5151
# InferencePipelines
5252

@@ -55,21 +55,21 @@ Methods:
5555
Types:
5656

5757
```python
58-
from openlayer.types.inference_pipelines import DataStreamResponse
58+
from openlayer_test.types.inference_pipelines import DataStreamResponse
5959
```
6060

6161
Methods:
6262

63-
- <code title="post /inference-pipelines/{id}/data-stream">client.inference_pipelines.data.<a href="./src/openlayer/resources/inference_pipelines/data.py">stream</a>(id, \*\*<a href="src/openlayer/types/inference_pipelines/data_stream_params.py">params</a>) -> <a href="./src/openlayer/types/inference_pipelines/data_stream_response.py">DataStreamResponse</a></code>
63+
- <code title="post /inference-pipelines/{id}/data-stream">client.inference_pipelines.data.<a href="./src/openlayer_test/resources/inference_pipelines/data.py">stream</a>(id, \*\*<a href="src/openlayer_test/types/inference_pipelines/data_stream_params.py">params</a>) -> <a href="./src/openlayer_test/types/inference_pipelines/data_stream_response.py">DataStreamResponse</a></code>
6464

6565
## TestResults
6666

6767
Types:
6868

6969
```python
70-
from openlayer.types.inference_pipelines import TestResultListResponse
70+
from openlayer_test.types.inference_pipelines import TestResultListResponse
7171
```
7272

7373
Methods:
7474

75-
- <code title="get /inference-pipelines/{id}/results">client.inference_pipelines.test_results.<a href="./src/openlayer/resources/inference_pipelines/test_results.py">list</a>(id, \*\*<a href="src/openlayer/types/inference_pipelines/test_result_list_params.py">params</a>) -> <a href="./src/openlayer/types/inference_pipelines/test_result_list_response.py">TestResultListResponse</a></code>
75+
- <code title="get /inference-pipelines/{id}/results">client.inference_pipelines.test_results.<a href="./src/openlayer_test/resources/inference_pipelines/test_results.py">list</a>(id, \*\*<a href="src/openlayer_test/types/inference_pipelines/test_result_list_params.py">params</a>) -> <a href="./src/openlayer_test/types/inference_pipelines/test_result_list_response.py">TestResultListResponse</a></code>

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[project]
2-
name = "openlayer"
2+
name = "openlayer_test"
33
version = "0.1.0-alpha.5"
44
description = "The official Python library for the openlayer API"
55
dynamic = ["readme"]
@@ -84,7 +84,7 @@ typecheck = { chain = [
8484
"typecheck:mypy"
8585
]}
8686
"typecheck:pyright" = "pyright"
87-
"typecheck:verify-types" = "pyright --verifytypes openlayer --ignoreexternal"
87+
"typecheck:verify-types" = "pyright --verifytypes openlayer_test --ignoreexternal"
8888
"typecheck:mypy" = "mypy ."
8989

9090
[build-system]
@@ -97,7 +97,7 @@ include = [
9797
]
9898

9999
[tool.hatch.build.targets.wheel]
100-
packages = ["src/openlayer"]
100+
packages = ["src/openlayer_test"]
101101

102102
[tool.hatch.metadata.hooks.fancy-pypi-readme]
103103
content-type = "text/markdown"
@@ -189,7 +189,7 @@ length-sort = true
189189
length-sort-straight = true
190190
combine-as-imports = true
191191
extra-standard-library = ["typing_extensions"]
192-
known-first-party = ["openlayer", "tests"]
192+
known-first-party = ["openlayer_test", "tests"]
193193

194194
[tool.ruff.per-file-ignores]
195195
"bin/**.py" = ["T201", "T203"]

release-please-config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,6 @@
6161
],
6262
"release-type": "python",
6363
"extra-files": [
64-
"src/openlayer/_version.py"
64+
"src/openlayer_test/_version.py"
6565
]
6666
}

requirements-dev.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ annotated-types==0.6.0
1212
# via pydantic
1313
anyio==4.1.0
1414
# via httpx
15-
# via openlayer
15+
# via openlayer-test
1616
argcomplete==3.1.2
1717
# via nox
1818
attrs==23.1.0
@@ -26,7 +26,7 @@ dirty-equals==0.6.0
2626
distlib==0.3.7
2727
# via virtualenv
2828
distro==1.8.0
29-
# via openlayer
29+
# via openlayer-test
3030
exceptiongroup==1.1.3
3131
# via anyio
3232
filelock==3.12.4
@@ -36,7 +36,7 @@ h11==0.14.0
3636
httpcore==1.0.2
3737
# via httpx
3838
httpx==0.25.2
39-
# via openlayer
39+
# via openlayer-test
4040
# via respx
4141
idna==3.4
4242
# via anyio
@@ -60,7 +60,7 @@ pluggy==1.3.0
6060
py==1.11.0
6161
# via pytest
6262
pydantic==2.7.1
63-
# via openlayer
63+
# via openlayer-test
6464
pydantic-core==2.18.2
6565
# via pydantic
6666
pyright==1.1.364
@@ -80,14 +80,14 @@ six==1.16.0
8080
sniffio==1.3.0
8181
# via anyio
8282
# via httpx
83-
# via openlayer
83+
# via openlayer-test
8484
time-machine==2.9.0
8585
tomli==2.0.1
8686
# via mypy
8787
# via pytest
8888
typing-extensions==4.8.0
8989
# via mypy
90-
# via openlayer
90+
# via openlayer-test
9191
# via pydantic
9292
# via pydantic-core
9393
virtualenv==20.24.5

requirements.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,32 +12,32 @@ annotated-types==0.6.0
1212
# via pydantic
1313
anyio==4.1.0
1414
# via httpx
15-
# via openlayer
15+
# via openlayer-test
1616
certifi==2023.7.22
1717
# via httpcore
1818
# via httpx
1919
distro==1.8.0
20-
# via openlayer
20+
# via openlayer-test
2121
exceptiongroup==1.1.3
2222
# via anyio
2323
h11==0.14.0
2424
# via httpcore
2525
httpcore==1.0.2
2626
# via httpx
2727
httpx==0.25.2
28-
# via openlayer
28+
# via openlayer-test
2929
idna==3.4
3030
# via anyio
3131
# via httpx
3232
pydantic==2.7.1
33-
# via openlayer
33+
# via openlayer-test
3434
pydantic-core==2.18.2
3535
# via pydantic
3636
sniffio==1.3.0
3737
# via anyio
3838
# via httpx
39-
# via openlayer
39+
# via openlayer-test
4040
typing-extensions==4.8.0
41-
# via openlayer
41+
# via openlayer-test
4242
# via pydantic
4343
# via pydantic-core

scripts/lint

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ echo "==> Running lints"
88
rye run lint
99

1010
echo "==> Making sure it imports"
11-
rye run python -c 'import openlayer'
11+
rye run python -c 'import openlayer_test'
1212

src/openlayer/__init__.py renamed to src/openlayer_test/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,12 @@
8282
# Update the __module__ attribute for exported symbols so that
8383
# error messages point to this module instead of the module
8484
# it was originally defined in, e.g.
85-
# openlayer._exceptions.NotFoundError -> openlayer.NotFoundError
85+
# openlayer_test._exceptions.NotFoundError -> openlayer_test.NotFoundError
8686
__locals = locals()
8787
for __name in __all__:
8888
if not __name.startswith("__"):
8989
try:
90-
__locals[__name].__module__ = "openlayer"
90+
__locals[__name].__module__ = "openlayer_test"
9191
except (TypeError, AttributeError):
9292
# Some of our exported symbols are builtins which we can't set attributes for.
9393
pass

src/openlayer/_base_client.py renamed to src/openlayer_test/_base_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ def __init__(
361361

362362
if max_retries is None: # pyright: ignore[reportUnnecessaryComparison]
363363
raise TypeError(
364-
"max_retries cannot be None. If you want to disable retries, pass `0`; if you want unlimited retries, pass `math.inf` or a very high number; if you want the default behavior, pass `openlayer.DEFAULT_MAX_RETRIES`"
364+
"max_retries cannot be None. If you want to disable retries, pass `0`; if you want unlimited retries, pass `math.inf` or a very high number; if you want the default behavior, pass `openlayer_test.DEFAULT_MAX_RETRIES`"
365365
)
366366

367367
def _enforce_trailing_slash(self, url: URL) -> URL:
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)