diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 6eb0072..dd93962 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -3,7 +3,7 @@ FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT} USER vscode -RUN curl -sSf https://rye-up.com/get | RYE_VERSION="0.15.2" RYE_INSTALL_OPTION="--yes" bash +RUN curl -sSf https://rye-up.com/get | RYE_VERSION="0.24.0" RYE_INSTALL_OPTION="--yes" bash ENV PATH=/home/vscode/.rye/shims:$PATH RUN echo "[[ -d .venv ]] && source .venv/bin/activate" >> /home/vscode/.bashrc diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9d50d9d..86d36bf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,14 +14,14 @@ jobs: steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install Rye run: | curl -sSf https://rye-up.com/get | bash echo "$HOME/.rye/shims" >> $GITHUB_PATH env: - RYE_VERSION: 0.15.2 + RYE_VERSION: 0.24.0 RYE_INSTALL_OPTION: "--yes" - name: Install dependencies diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 24c02cf..75a1fc9 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -21,7 +21,7 @@ jobs: curl -sSf https://rye-up.com/get | bash echo "$HOME/.rye/shims" >> $GITHUB_PATH env: - RYE_VERSION: 0.15.2 + RYE_VERSION: 0.24.0 RYE_INSTALL_OPTION: "--yes" - name: Publish to PyPI diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 463488b..4ad3fef 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.17.1" + ".": "0.18.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index d3c1a8c..082ea1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 0.18.0 (2024-02-26) + +Full Changelog: [v0.17.1...v0.18.0](https://github.com/Dataherald/dataherald-python/compare/v0.17.1...v0.18.0) + +### Features + +* update via SDK Studio ([#45](https://github.com/Dataherald/dataherald-python/issues/45)) ([691fb86](https://github.com/Dataherald/dataherald-python/commit/691fb8679ad61c43b210653296b7a0dc6938a46a)) +* update via SDK Studio ([#47](https://github.com/Dataherald/dataherald-python/issues/47)) ([1269fff](https://github.com/Dataherald/dataherald-python/commit/1269ffffd9c0b9a17953cffdc1d61c0660f55adf)) + ## 0.17.1 (2024-02-19) Full Changelog: [v0.16.0...v0.17.1](https://github.com/Dataherald/dataherald-python/compare/v0.16.0...v0.17.1) diff --git a/README.md b/README.md index 78c09e5..1a436e0 100644 --- a/README.md +++ b/README.md @@ -128,7 +128,7 @@ Error codes are as followed: ### Retries -Certain errors are automatically retried 2 times by default, with a short exponential backoff. +Certain errors are automatically retried 0 times by default, with a short exponential backoff. Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict, 429 Rate Limit, and >=500 Internal errors are all retried by default. @@ -152,7 +152,7 @@ client.with_options(max_retries=5).database_connections.create( ### Timeouts -By default requests time out after 1 minute. You can configure this with a `timeout` option, +By default requests time out after 6 minutes. You can configure this with a `timeout` option, which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object: ```python @@ -160,7 +160,7 @@ from dataherald import Dataherald # Configure the default for all requests: client = Dataherald( - # 20 seconds (default is 1 minute) + # 20 seconds (default is 6 minutes) timeout=20.0, ) diff --git a/pyproject.toml b/pyproject.toml index f11ca66..20c88c1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "dataherald" -version = "0.17.1" +version = "0.18.0" description = "The official Python library for the Dataherald API" readme = "README.md" license = "Apache-2.0" diff --git a/requirements-dev.lock b/requirements-dev.lock index a0134d6..85366fe 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -5,48 +5,92 @@ # pre: false # features: [] # all-features: true +# with-sources: false -e file:. annotated-types==0.6.0 + # via pydantic anyio==4.1.0 + # via dataherald + # via httpx argcomplete==3.1.2 + # via nox attrs==23.1.0 + # via pytest certifi==2023.7.22 + # via httpcore + # via httpx colorlog==6.7.0 + # via nox dirty-equals==0.6.0 distlib==0.3.7 + # via virtualenv distro==1.8.0 + # via dataherald exceptiongroup==1.1.3 + # via anyio filelock==3.12.4 + # via virtualenv h11==0.14.0 + # via httpcore httpcore==1.0.2 + # via httpx httpx==0.25.2 + # via dataherald + # via respx idna==3.4 + # via anyio + # via httpx importlib-metadata==7.0.0 iniconfig==2.0.0 + # via pytest mypy==1.7.1 mypy-extensions==1.0.0 + # via mypy nodeenv==1.8.0 + # via pyright nox==2023.4.22 packaging==23.2 + # via nox + # via pytest platformdirs==3.11.0 + # via virtualenv pluggy==1.3.0 + # via pytest py==1.11.0 + # via pytest pydantic==2.4.2 + # via dataherald pydantic-core==2.10.1 -pyright==1.1.332 + # via pydantic +pyright==1.1.351 pytest==7.1.1 + # via pytest-asyncio pytest-asyncio==0.21.1 python-dateutil==2.8.2 + # via time-machine pytz==2023.3.post1 + # via dirty-equals respx==0.20.2 ruff==0.1.9 +setuptools==68.2.2 + # via nodeenv six==1.16.0 + # via python-dateutil sniffio==1.3.0 + # via anyio + # via dataherald + # via httpx time-machine==2.9.0 tomli==2.0.1 + # via mypy + # via pytest typing-extensions==4.8.0 + # via dataherald + # via mypy + # via pydantic + # via pydantic-core virtualenv==20.24.5 + # via nox zipp==3.17.0 -# The following packages are considered to be unsafe in a requirements file: -setuptools==68.2.2 + # via importlib-metadata diff --git a/requirements.lock b/requirements.lock index 2022a5c..4988d32 100644 --- a/requirements.lock +++ b/requirements.lock @@ -5,18 +5,39 @@ # pre: false # features: [] # all-features: true +# with-sources: false -e file:. annotated-types==0.6.0 + # via pydantic anyio==4.1.0 + # via dataherald + # via httpx certifi==2023.7.22 + # via httpcore + # via httpx distro==1.8.0 + # via dataherald exceptiongroup==1.1.3 + # via anyio h11==0.14.0 + # via httpcore httpcore==1.0.2 + # via httpx httpx==0.25.2 + # via dataherald idna==3.4 + # via anyio + # via httpx pydantic==2.4.2 + # via dataherald pydantic-core==2.10.1 + # via pydantic sniffio==1.3.0 + # via anyio + # via dataherald + # via httpx typing-extensions==4.8.0 + # via dataherald + # via pydantic + # via pydantic-core diff --git a/src/dataherald/_constants.py b/src/dataherald/_constants.py index bf15141..15568ee 100644 --- a/src/dataherald/_constants.py +++ b/src/dataherald/_constants.py @@ -5,9 +5,9 @@ RAW_RESPONSE_HEADER = "X-Stainless-Raw-Response" OVERRIDE_CAST_TO_HEADER = "____stainless_override_cast_to" -# default timeout is 1 minute -DEFAULT_TIMEOUT = httpx.Timeout(timeout=60.0, connect=5.0) -DEFAULT_MAX_RETRIES = 2 +# default timeout is 6 minutes +DEFAULT_TIMEOUT = httpx.Timeout(timeout=360.0, connect=5.0) +DEFAULT_MAX_RETRIES = 0 DEFAULT_LIMITS = httpx.Limits(max_connections=100, max_keepalive_connections=20) INITIAL_RETRY_DELAY = 0.5 diff --git a/src/dataherald/_models.py b/src/dataherald/_models.py index 48d5624..8108914 100644 --- a/src/dataherald/_models.py +++ b/src/dataherald/_models.py @@ -283,7 +283,7 @@ def construct_type(*, value: object, type_: type) -> object: if is_union(origin): try: - return validate_type(type_=type_, value=value) + return validate_type(type_=cast("type[object]", type_), value=value) except Exception: pass diff --git a/src/dataherald/_utils/_proxy.py b/src/dataherald/_utils/_proxy.py index 6f05efc..b9c12dc 100644 --- a/src/dataherald/_utils/_proxy.py +++ b/src/dataherald/_utils/_proxy.py @@ -45,7 +45,7 @@ def __dir__(self) -> Iterable[str]: @property # type: ignore @override - def __class__(self) -> type: + def __class__(self) -> type: # pyright: ignore proxied = self.__get_proxied__() if issubclass(type(proxied), LazyProxy): return type(proxied) diff --git a/src/dataherald/_version.py b/src/dataherald/_version.py index d5df6cd..392cec1 100644 --- a/src/dataherald/_version.py +++ b/src/dataherald/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. __title__ = "dataherald" -__version__ = "0.17.1" # x-release-please-version +__version__ = "0.18.0" # x-release-please-version diff --git a/tests/test_client.py b/tests/test_client.py index a839e4d..baf23b7 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -87,7 +87,7 @@ def test_copy_default_options(self) -> None: # options that have a default are overridden correctly copied = self.client.copy(max_retries=7) assert copied.max_retries == 7 - assert self.client.max_retries == 2 + assert self.client.max_retries == 0 copied2 = copied.copy(max_retries=6) assert copied2.max_retries == 6 @@ -763,7 +763,7 @@ def test_copy_default_options(self) -> None: # options that have a default are overridden correctly copied = self.client.copy(max_retries=7) assert copied.max_retries == 7 - assert self.client.max_retries == 2 + assert self.client.max_retries == 0 copied2 = copied.copy(max_retries=6) assert copied2.max_retries == 6