diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 646eee7b..819d8691 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.497.0" + ".": "0.498.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index f6f69af5..c44d0448 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.498.0 (2026-04-27) + +Full Changelog: [v0.497.0...v0.498.0](https://github.com/Increase/increase-python/compare/v0.497.0...v0.498.0) + +### Features + +* support setting headers via env ([ae4500c](https://github.com/Increase/increase-python/commit/ae4500cfb7c6d4e734542e9371001cfe9b4750b3)) + ## 0.497.0 (2026-04-27) Full Changelog: [v0.496.0...v0.497.0](https://github.com/Increase/increase-python/compare/v0.496.0...v0.497.0) diff --git a/pyproject.toml b/pyproject.toml index 4df8601c..648f5af8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "increase" -version = "0.497.0" +version = "0.498.0" description = "The official Python library for the increase API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/increase/_client.py b/src/increase/_client.py index 899a105a..e0723d90 100644 --- a/src/increase/_client.py +++ b/src/increase/_client.py @@ -22,6 +22,7 @@ from ._utils import ( is_given, is_mapping, + is_mapping_t, get_async_library, ) from ._compat import cached_property @@ -264,6 +265,15 @@ def __init__( except KeyError as exc: raise ValueError(f"Unknown environment: {environment}") from exc + custom_headers_env = os.environ.get("INCREASE_CUSTOM_HEADERS") + if custom_headers_env is not None: + parsed: dict[str, str] = {} + for line in custom_headers_env.split("\n"): + colon = line.find(":") + if colon >= 0: + parsed[line[:colon].strip()] = line[colon + 1 :].strip() + default_headers = {**parsed, **(default_headers if is_mapping_t(default_headers) else {})} + super().__init__( version=__version__, base_url=base_url, @@ -857,6 +867,15 @@ def __init__( except KeyError as exc: raise ValueError(f"Unknown environment: {environment}") from exc + custom_headers_env = os.environ.get("INCREASE_CUSTOM_HEADERS") + if custom_headers_env is not None: + parsed: dict[str, str] = {} + for line in custom_headers_env.split("\n"): + colon = line.find(":") + if colon >= 0: + parsed[line[:colon].strip()] = line[colon + 1 :].strip() + default_headers = {**parsed, **(default_headers if is_mapping_t(default_headers) else {})} + super().__init__( version=__version__, base_url=base_url, diff --git a/src/increase/_version.py b/src/increase/_version.py index 86e445cb..315f304f 100644 --- a/src/increase/_version.py +++ b/src/increase/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "increase" -__version__ = "0.497.0" # x-release-please-version +__version__ = "0.498.0" # x-release-please-version