Skip to content

Commit 22abd6f

Browse files
Merge pull request #15 from CASParser/release-please--branches--main--changes--next
release: 1.6.1
2 parents 0468512 + 3ea835e commit 22abd6f

25 files changed

Lines changed: 667 additions & 20 deletions

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Install uv
2525
uses: astral-sh/setup-uv@v5
2626
with:
27-
version: '0.9.13'
27+
version: '0.10.2'
2828

2929
- name: Install dependencies
3030
run: uv sync --all-extras
@@ -46,7 +46,7 @@ jobs:
4646
- name: Install uv
4747
uses: astral-sh/setup-uv@v5
4848
with:
49-
version: '0.9.13'
49+
version: '0.10.2'
5050

5151
- name: Install dependencies
5252
run: uv sync --all-extras
@@ -80,7 +80,7 @@ jobs:
8080
- name: Install uv
8181
uses: astral-sh/setup-uv@v5
8282
with:
83-
version: '0.9.13'
83+
version: '0.10.2'
8484

8585
- name: Bootstrap
8686
run: ./scripts/bootstrap

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "1.6.0"
2+
".": "1.6.1"
33
}

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Changelog
22

3+
## 1.6.1 (2026-03-03)
4+
5+
Full Changelog: [v1.6.0...v1.6.1](https://github.com/CASParser/cas-parser-python/compare/v1.6.0...v1.6.1)
6+
7+
### Chores
8+
9+
* **ci:** bump uv version ([8b38574](https://github.com/CASParser/cas-parser-python/commit/8b38574493387605ea62763e2dac86b90cb41697))
10+
* **internal:** add request options to SSE classes ([7488011](https://github.com/CASParser/cas-parser-python/commit/74880111923232fba22d9870f00aabf17cd7ef2f))
11+
* **internal:** codegen related update ([b9079a9](https://github.com/CASParser/cas-parser-python/commit/b9079a9473681d297cfdd4165e2aae413d784bfd))
12+
* **internal:** make `test_proxy_environment_variables` more resilient ([3608c6e](https://github.com/CASParser/cas-parser-python/commit/3608c6eddf68e65c153c4e186346b79859aab866))
13+
* **internal:** make `test_proxy_environment_variables` more resilient to env ([60ab278](https://github.com/CASParser/cas-parser-python/commit/60ab27826aeea8d2b9dc6ec19f8a94bc4108b180))
14+
* **internal:** refactor authentication internals ([deb70b3](https://github.com/CASParser/cas-parser-python/commit/deb70b3a007f6596260f115d964f69cd55b456c3))
15+
316
## 1.6.0 (2026-02-23)
417

518
Full Changelog: [v1.5.0...v1.6.0](https://github.com/CASParser/cas-parser-python/compare/v1.5.0...v1.6.0)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "cas-parser-python"
3-
version = "1.6.0"
3+
version = "1.6.1"
44
description = "The official Python library for the cas-parser API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"

src/cas_parser/_base_client.py

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
)
6464
from ._utils import is_dict, is_list, asyncify, is_given, lru_cache, is_mapping
6565
from ._compat import PYDANTIC_V1, model_copy, model_dump
66-
from ._models import GenericModel, FinalRequestOptions, validate_type, construct_type
66+
from ._models import GenericModel, SecurityOptions, FinalRequestOptions, validate_type, construct_type
6767
from ._response import (
6868
APIResponse,
6969
BaseAPIResponse,
@@ -432,9 +432,27 @@ def _make_status_error(
432432
) -> _exceptions.APIStatusError:
433433
raise NotImplementedError()
434434

435+
def _auth_headers(
436+
self,
437+
security: SecurityOptions, # noqa: ARG002
438+
) -> dict[str, str]:
439+
return {}
440+
441+
def _auth_query(
442+
self,
443+
security: SecurityOptions, # noqa: ARG002
444+
) -> dict[str, str]:
445+
return {}
446+
447+
def _custom_auth(
448+
self,
449+
security: SecurityOptions, # noqa: ARG002
450+
) -> httpx.Auth | None:
451+
return None
452+
435453
def _build_headers(self, options: FinalRequestOptions, *, retries_taken: int = 0) -> httpx.Headers:
436454
custom_headers = options.headers or {}
437-
headers_dict = _merge_mappings(self.default_headers, custom_headers)
455+
headers_dict = _merge_mappings({**self._auth_headers(options.security), **self.default_headers}, custom_headers)
438456
self._validate_headers(headers_dict, custom_headers)
439457

440458
# headers are case-insensitive while dictionaries are not.
@@ -506,7 +524,7 @@ def _build_request(
506524
raise RuntimeError(f"Unexpected JSON data type, {type(json_data)}, cannot merge with `extra_body`")
507525

508526
headers = self._build_headers(options, retries_taken=retries_taken)
509-
params = _merge_mappings(self.default_query, options.params)
527+
params = _merge_mappings({**self._auth_query(options.security), **self.default_query}, options.params)
510528
content_type = headers.get("Content-Type")
511529
files = options.files
512530

@@ -671,7 +689,6 @@ def default_headers(self) -> dict[str, str | Omit]:
671689
"Content-Type": "application/json",
672690
"User-Agent": self.user_agent,
673691
**self.platform_headers(),
674-
**self.auth_headers,
675692
**self._custom_headers,
676693
}
677694

@@ -990,8 +1007,9 @@ def request(
9901007
self._prepare_request(request)
9911008

9921009
kwargs: HttpxSendArgs = {}
993-
if self.custom_auth is not None:
994-
kwargs["auth"] = self.custom_auth
1010+
custom_auth = self._custom_auth(options.security)
1011+
if custom_auth is not None:
1012+
kwargs["auth"] = custom_auth
9951013

9961014
if options.follow_redirects is not None:
9971015
kwargs["follow_redirects"] = options.follow_redirects
@@ -1952,6 +1970,7 @@ def make_request_options(
19521970
idempotency_key: str | None = None,
19531971
timeout: float | httpx.Timeout | None | NotGiven = not_given,
19541972
post_parser: PostParser | NotGiven = not_given,
1973+
security: SecurityOptions | None = None,
19551974
) -> RequestOptions:
19561975
"""Create a dict of type RequestOptions without keys of NotGiven values."""
19571976
options: RequestOptions = {}
@@ -1977,6 +1996,9 @@ def make_request_options(
19771996
# internal
19781997
options["post_parser"] = post_parser # type: ignore
19791998

1999+
if security is not None:
2000+
options["security"] = security
2001+
19802002
return options
19812003

19822004

0 commit comments

Comments
 (0)