Skip to content

Commit c9d9340

Browse files
authored
Merge pull request #7 from guardrails-ai/sync-version
add config to control version in generated package
2 parents 8b1932a + 448412d commit c9d9340

File tree

8 files changed

+15
-8
lines changed

8 files changed

+15
-8
lines changed

build-sdk.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
python3 -m pip install openapi-python-client;
33
version=$(yq '.info.version' open-api-spec.yml);
44
rm -rf ./guard-rails-api-client;
5-
openapi-python-client generate --path ./open-api-spec.yml --meta setup;
5+
openapi-python-client generate --config ./config.json --path ./open-api-spec.yml --meta setup;

config.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"package_version_override": "0.0.2"
3+
}

guard-rails-api-client/guard_rails_api_client/__init__.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
""" A client library for accessing GuardRails API """
1+
"""A client library for accessing GuardRails API"""
2+
23
from .client import AuthenticatedClient, Client
34

45
__all__ = (
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
""" Contains methods for accessing the API """
1+
"""Contains methods for accessing the API"""
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
""" Contains shared errors types that can be raised from API functions """
1+
"""Contains shared errors types that can be raised from API functions"""
22

33

44
class UnexpectedStatus(Exception):
@@ -8,7 +8,9 @@ def __init__(self, status_code: int, content: bytes):
88
self.status_code = status_code
99
self.content = content
1010

11-
super().__init__(f"Unexpected status code: {status_code}")
11+
super().__init__(
12+
f"Unexpected status code: {status_code}\n\nResponse content:\n{content.decode(errors='ignore')}"
13+
)
1214

1315

1416
__all__ = ["UnexpectedStatus"]

guard-rails-api-client/guard_rails_api_client/models/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
""" Contains all the data models used in inputs/outputs """
1+
"""Contains all the data models used in inputs/outputs"""
22

33
from .any_object import AnyObject
44
from .data_type import DataType

guard-rails-api-client/guard_rails_api_client/types.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
""" Contains some shared types for properties """
1+
"""Contains some shared types for properties"""
2+
23
from http import HTTPStatus
34
from typing import BinaryIO, Generic, Literal, MutableMapping, Optional, Tuple, TypeVar
45

guard-rails-api-client/setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
setup(
99
name="guard-rails-api-client",
10-
version="0.0.0",
10+
version="0.0.2",
1111
description="A client library for accessing GuardRails API",
1212
long_description=long_description,
1313
long_description_content_type="text/markdown",

0 commit comments

Comments
 (0)