Skip to content

release: 0.2.0-alpha.11 #268

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions .github/workflows/release-doctor.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Release Doctor
on:
pull_request:
branches:
- main
workflow_dispatch:

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.2.0-alpha.10"
".": "0.2.0-alpha.11"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
configured_endpoints: 9
configured_endpoints: 10
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,20 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Removed
* Deprecated and removed `publish_ground_truths` method. Use `update_data` instead.

## 0.2.0-alpha.11 (2024-07-22)

Full Changelog: [v0.2.0-alpha.10...v0.2.0-alpha.11](https://github.com/openlayer-ai/openlayer-python/compare/v0.2.0-alpha.10...v0.2.0-alpha.11)

### Features

* **api:** update via SDK Studio ([#270](https://github.com/openlayer-ai/openlayer-python/issues/270)) ([b5d333b](https://github.com/openlayer-ai/openlayer-python/commit/b5d333bc6c654cbe0d0952f949da0bfd9bc91cf4))


### Chores

* **internal:** refactor release doctor script ([#269](https://github.com/openlayer-ai/openlayer-python/issues/269)) ([11a5605](https://github.com/openlayer-ai/openlayer-python/commit/11a5605b48310b1bc9fa840865e375a74c93e55b))
* **internal:** version bump ([#267](https://github.com/openlayer-ai/openlayer-python/issues/267)) ([932aac4](https://github.com/openlayer-ai/openlayer-python/commit/932aac43080f81ac5f5e3725f068bb4a628d8c88))

## 0.2.0-alpha.10 (2024-07-19)

Full Changelog: [v0.2.0-alpha.9...v0.2.0-alpha.10](https://github.com/openlayer-ai/openlayer-python/compare/v0.2.0-alpha.9...v0.2.0-alpha.10)
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,12 @@ client = Openlayer(
)
```

You can also customize the client on a per-request basis by using `with_options()`:

```python
client.with_options(http_client=DefaultHttpxClient(...))
```

### Managing HTTP resources

By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.
Expand Down
14 changes: 14 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,17 @@ from openlayer.types.inference_pipelines import TestResultListResponse
Methods:

- <code title="get /inference-pipelines/{inferencePipelineId}/results">client.inference_pipelines.test_results.<a href="./src/openlayer/resources/inference_pipelines/test_results.py">list</a>(inference_pipeline_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>

# Storage

## PresignedURL

Types:

```python
from openlayer.types.storage import PresignedURLCreateResponse
```

Methods:

- <code title="post /storage/presigned-url">client.storage.presigned_url.<a href="./src/openlayer/resources/storage/presigned_url.py">create</a>(\*\*<a href="src/openlayer/types/storage/presigned_url_create_params.py">params</a>) -> <a href="./src/openlayer/types/storage/presigned_url_create_response.py">PresignedURLCreateResponse</a></code>
13 changes: 1 addition & 12 deletions bin/check-release-environment
Original file line number Diff line number Diff line change
@@ -1,20 +1,9 @@
#!/usr/bin/env bash

warnings=()
errors=()

if [ -z "${PYPI_TOKEN}" ]; then
warnings+=("The OPENLAYER_PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.")
fi

lenWarnings=${#warnings[@]}

if [[ lenWarnings -gt 0 ]]; then
echo -e "Found the following warnings in the release environment:\n"

for warning in "${warnings[@]}"; do
echo -e "- $warning\n"
done
errors+=("The OPENLAYER_PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.")
fi

lenErrors=${#errors[@]}
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "openlayer"
version = "0.2.0-alpha.10"
version = "0.2.0-alpha.11"
description = "The official Python library for the openlayer API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
8 changes: 8 additions & 0 deletions src/openlayer/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class Openlayer(SyncAPIClient):
projects: resources.ProjectsResource
commits: resources.CommitsResource
inference_pipelines: resources.InferencePipelinesResource
storage: resources.StorageResource
with_raw_response: OpenlayerWithRawResponse
with_streaming_response: OpenlayerWithStreamedResponse

Expand Down Expand Up @@ -106,6 +107,7 @@ def __init__(
self.projects = resources.ProjectsResource(self)
self.commits = resources.CommitsResource(self)
self.inference_pipelines = resources.InferencePipelinesResource(self)
self.storage = resources.StorageResource(self)
self.with_raw_response = OpenlayerWithRawResponse(self)
self.with_streaming_response = OpenlayerWithStreamedResponse(self)

Expand Down Expand Up @@ -231,6 +233,7 @@ class AsyncOpenlayer(AsyncAPIClient):
projects: resources.AsyncProjectsResource
commits: resources.AsyncCommitsResource
inference_pipelines: resources.AsyncInferencePipelinesResource
storage: resources.AsyncStorageResource
with_raw_response: AsyncOpenlayerWithRawResponse
with_streaming_response: AsyncOpenlayerWithStreamedResponse

Expand Down Expand Up @@ -287,6 +290,7 @@ def __init__(
self.projects = resources.AsyncProjectsResource(self)
self.commits = resources.AsyncCommitsResource(self)
self.inference_pipelines = resources.AsyncInferencePipelinesResource(self)
self.storage = resources.AsyncStorageResource(self)
self.with_raw_response = AsyncOpenlayerWithRawResponse(self)
self.with_streaming_response = AsyncOpenlayerWithStreamedResponse(self)

Expand Down Expand Up @@ -413,20 +417,23 @@ def __init__(self, client: Openlayer) -> None:
self.projects = resources.ProjectsResourceWithRawResponse(client.projects)
self.commits = resources.CommitsResourceWithRawResponse(client.commits)
self.inference_pipelines = resources.InferencePipelinesResourceWithRawResponse(client.inference_pipelines)
self.storage = resources.StorageResourceWithRawResponse(client.storage)


class AsyncOpenlayerWithRawResponse:
def __init__(self, client: AsyncOpenlayer) -> None:
self.projects = resources.AsyncProjectsResourceWithRawResponse(client.projects)
self.commits = resources.AsyncCommitsResourceWithRawResponse(client.commits)
self.inference_pipelines = resources.AsyncInferencePipelinesResourceWithRawResponse(client.inference_pipelines)
self.storage = resources.AsyncStorageResourceWithRawResponse(client.storage)


class OpenlayerWithStreamedResponse:
def __init__(self, client: Openlayer) -> None:
self.projects = resources.ProjectsResourceWithStreamingResponse(client.projects)
self.commits = resources.CommitsResourceWithStreamingResponse(client.commits)
self.inference_pipelines = resources.InferencePipelinesResourceWithStreamingResponse(client.inference_pipelines)
self.storage = resources.StorageResourceWithStreamingResponse(client.storage)


class AsyncOpenlayerWithStreamedResponse:
Expand All @@ -436,6 +443,7 @@ def __init__(self, client: AsyncOpenlayer) -> None:
self.inference_pipelines = resources.AsyncInferencePipelinesResourceWithStreamingResponse(
client.inference_pipelines
)
self.storage = resources.AsyncStorageResourceWithStreamingResponse(client.storage)


Client = Openlayer
Expand Down
2 changes: 1 addition & 1 deletion src/openlayer/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "openlayer"
__version__ = "0.2.0-alpha.10" # x-release-please-version
__version__ = "0.2.0-alpha.11" # x-release-please-version
14 changes: 14 additions & 0 deletions src/openlayer/resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
CommitsResourceWithStreamingResponse,
AsyncCommitsResourceWithStreamingResponse,
)
from .storage import (
StorageResource,
AsyncStorageResource,
StorageResourceWithRawResponse,
AsyncStorageResourceWithRawResponse,
StorageResourceWithStreamingResponse,
AsyncStorageResourceWithStreamingResponse,
)
from .projects import (
ProjectsResource,
AsyncProjectsResource,
Expand Down Expand Up @@ -44,4 +52,10 @@
"AsyncInferencePipelinesResourceWithRawResponse",
"InferencePipelinesResourceWithStreamingResponse",
"AsyncInferencePipelinesResourceWithStreamingResponse",
"StorageResource",
"AsyncStorageResource",
"StorageResourceWithRawResponse",
"AsyncStorageResourceWithRawResponse",
"StorageResourceWithStreamingResponse",
"AsyncStorageResourceWithStreamingResponse",
]
33 changes: 33 additions & 0 deletions src/openlayer/resources/storage/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from .storage import (
StorageResource,
AsyncStorageResource,
StorageResourceWithRawResponse,
AsyncStorageResourceWithRawResponse,
StorageResourceWithStreamingResponse,
AsyncStorageResourceWithStreamingResponse,
)
from .presigned_url import (
PresignedURLResource,
AsyncPresignedURLResource,
PresignedURLResourceWithRawResponse,
AsyncPresignedURLResourceWithRawResponse,
PresignedURLResourceWithStreamingResponse,
AsyncPresignedURLResourceWithStreamingResponse,
)

__all__ = [
"PresignedURLResource",
"AsyncPresignedURLResource",
"PresignedURLResourceWithRawResponse",
"AsyncPresignedURLResourceWithRawResponse",
"PresignedURLResourceWithStreamingResponse",
"AsyncPresignedURLResourceWithStreamingResponse",
"StorageResource",
"AsyncStorageResource",
"StorageResourceWithRawResponse",
"AsyncStorageResourceWithRawResponse",
"StorageResourceWithStreamingResponse",
"AsyncStorageResourceWithStreamingResponse",
]
158 changes: 158 additions & 0 deletions src/openlayer/resources/storage/presigned_url.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

import httpx

from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ..._utils import (
maybe_transform,
async_maybe_transform,
)
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
to_raw_response_wrapper,
to_streamed_response_wrapper,
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
from ..._base_client import make_request_options
from ...types.storage import presigned_url_create_params
from ...types.storage.presigned_url_create_response import PresignedURLCreateResponse

__all__ = ["PresignedURLResource", "AsyncPresignedURLResource"]


class PresignedURLResource(SyncAPIResource):
@cached_property
def with_raw_response(self) -> PresignedURLResourceWithRawResponse:
return PresignedURLResourceWithRawResponse(self)

@cached_property
def with_streaming_response(self) -> PresignedURLResourceWithStreamingResponse:
return PresignedURLResourceWithStreamingResponse(self)

def create(
self,
*,
object_name: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> PresignedURLCreateResponse:
"""
Retrieve a presigned url to post storage artifacts.

Args:
object_name: The name of the object.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
return self._post(
"/storage/presigned-url",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=maybe_transform(
{"object_name": object_name}, presigned_url_create_params.PresignedURLCreateParams
),
),
cast_to=PresignedURLCreateResponse,
)


class AsyncPresignedURLResource(AsyncAPIResource):
@cached_property
def with_raw_response(self) -> AsyncPresignedURLResourceWithRawResponse:
return AsyncPresignedURLResourceWithRawResponse(self)

@cached_property
def with_streaming_response(self) -> AsyncPresignedURLResourceWithStreamingResponse:
return AsyncPresignedURLResourceWithStreamingResponse(self)

async def create(
self,
*,
object_name: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> PresignedURLCreateResponse:
"""
Retrieve a presigned url to post storage artifacts.

Args:
object_name: The name of the object.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
return await self._post(
"/storage/presigned-url",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=await async_maybe_transform(
{"object_name": object_name}, presigned_url_create_params.PresignedURLCreateParams
),
),
cast_to=PresignedURLCreateResponse,
)


class PresignedURLResourceWithRawResponse:
def __init__(self, presigned_url: PresignedURLResource) -> None:
self._presigned_url = presigned_url

self.create = to_raw_response_wrapper(
presigned_url.create,
)


class AsyncPresignedURLResourceWithRawResponse:
def __init__(self, presigned_url: AsyncPresignedURLResource) -> None:
self._presigned_url = presigned_url

self.create = async_to_raw_response_wrapper(
presigned_url.create,
)


class PresignedURLResourceWithStreamingResponse:
def __init__(self, presigned_url: PresignedURLResource) -> None:
self._presigned_url = presigned_url

self.create = to_streamed_response_wrapper(
presigned_url.create,
)


class AsyncPresignedURLResourceWithStreamingResponse:
def __init__(self, presigned_url: AsyncPresignedURLResource) -> None:
self._presigned_url = presigned_url

self.create = async_to_streamed_response_wrapper(
presigned_url.create,
)
Loading