Skip to content
Open
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: 1 addition & 1 deletion .claude/skills/scalar-galaxy-python-sdk/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,5 @@ except APIStatusError as err:

## Reference files

- [README.md](../../../README.md) — full feature tour: client options, request options, retries and timeouts, logging.
- [README.md](../../../README.md) — full feature tour: client options, retries and timeouts, logging.
- [api.md](../../../api.md) — complete catalogue of every operation with request and response types.
5 changes: 5 additions & 0 deletions .github/workflows/sdk-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,8 @@ jobs:
python-version: "3.11"
- run: python -m pip install --upgrade build
- run: python -m build
# Verification only, never auto-fix: the SDK is generated formatted, so a diff here means
# either hand-edited custom code or a regenerate that was not committed. ruff is pinned to
# the release that produced these bytes, since a formatter minor can change them.
- run: python -m pip install "ruff==0.16.1"
- run: ruff format --check .
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ __pycache__/
*.py[cod]
*.egg-info/
.venv/
dist/
build/
/dist/
/build/
.mypy_cache/
.pytest_cache/
.ruff_cache/
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.1"
".": "0.2.2"
}
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## [0.2.2](https://github.com/scalar/galaxy-python/compare/v0.2.1...v0.2.2) (2026-08-17)


### Chores

* **api:** regenerate SDK ([6d8385a](https://github.com/scalar/galaxy-python/commit/6d8385a6460f127c363d3586233cf1c378537a27))
* **api:** regenerate SDK ([a467cce](https://github.com/scalar/galaxy-python/commit/a467cce81af45aa31c3333e5b76d603cae853456))
* **api:** update generated SDK content ([bfc6022](https://github.com/scalar/galaxy-python/commit/bfc60224b758602477ba6bc702fc9db8657d9150))

## [0.2.1](https://github.com/scalar/galaxy-python/compare/v0.2.0...v0.2.1) (2026-08-07)


Expand Down
2 changes: 1 addition & 1 deletion SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,5 @@ except APIStatusError as err:

## Reference files

- [README.md](./README.md) — full feature tour: client options, request options, retries and timeouts, logging.
- [README.md](./README.md) — full feature tour: client options, retries and timeouts, logging.
- [api.md](./api.md) — complete catalogue of every operation with request and response types.
32 changes: 16 additions & 16 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ It's easy to say you know them all, but do you really? Retrieve all the planets

| Direction | Type |
| --- | --- |
| Request | [`PlanetListAllDataParams`](./src/types/planet_list_all_data_params.py) |
| Response | [`PlanetListAllDataResponse`](./src/types/planet_list_all_data_response.py) |
| Request | [`PlanetListAllDataParams`](./src/scalar_galaxy/types/planet_list_all_data_params.py) |
| Response | [`PlanetListAllDataResponse`](./src/scalar_galaxy/types/planet_list_all_data_response.py) |

```python
planet = client.planets.list_all_data(
Expand All @@ -54,8 +54,8 @@ Time to play god and create a new planet. What do you think? Ah, don't think too

| Direction | Type |
| --- | --- |
| Request | [`PlanetCreateParams`](./src/types/planet_create_params.py) |
| Response | [`Planet`](./src/types/planet.py) |
| Request | [`PlanetCreateParams`](./src/scalar_galaxy/types/planet_create_params.py) |
| Response | [`Planet`](./src/scalar_galaxy/types/planet.py) |

```python
planet = client.planets.create(
Expand All @@ -69,7 +69,7 @@ You'll better learn a little bit more about the planets. It might come in handy

| Direction | Type |
| --- | --- |
| Response | [`Planet`](./src/types/planet.py) |
| Response | [`Planet`](./src/scalar_galaxy/types/planet.py) |

```python
planet = client.planets.retrieve(
Expand All @@ -83,8 +83,8 @@ Sometimes you make mistakes, that's fine. No worries, you can update all planets

| Direction | Type |
| --- | --- |
| Request | [`PlanetUpdateParams`](./src/types/planet_update_params.py) |
| Response | [`Planet`](./src/types/planet.py) |
| Request | [`PlanetUpdateParams`](./src/scalar_galaxy/types/planet_update_params.py) |
| Response | [`Planet`](./src/scalar_galaxy/types/planet.py) |

```python
planet = client.planets.update(
Expand All @@ -109,8 +109,8 @@ Got a crazy good photo of a planet? Share it with the world!

| Direction | Type |
| --- | --- |
| Request | [`PlanetUploadImageParams`](./src/types/planet_upload_image_params.py) |
| Response | [`PlanetUploadImageResponse`](./src/types/planet_upload_image_response.py) |
| Request | [`PlanetUploadImageParams`](./src/scalar_galaxy/types/planet_upload_image_params.py) |
| Response | [`PlanetUploadImageResponse`](./src/scalar_galaxy/types/planet_upload_image_response.py) |

```python
planet = client.planets.upload_image(
Expand All @@ -126,8 +126,8 @@ Stars, moons, comets, the occasional rogue asteroid — if it glows or drifts th

| Direction | Type |
| --- | --- |
| Request | [`CelestialBodyCreateParams`](./src/types/celestial_body_create_params.py) |
| Response | [`CelestialBodyCreateResponse`](./src/types/celestial_body_create_response.py) |
| Request | [`CelestialBodyCreateParams`](./src/scalar_galaxy/types/celestial_body_create_params.py) |
| Response | [`CelestialBodyCreateResponse`](./src/scalar_galaxy/types/celestial_body_create_response.py) |

```python
celestial_body = client.celestial_bodies.create(
Expand All @@ -143,8 +143,8 @@ Time to create a user account, eh?

| Direction | Type |
| --- | --- |
| Request | [`AuthenticationCreateUserParams`](./src/types/authentication_create_user_params.py) |
| Response | [`User`](./src/types/user.py) |
| Request | [`AuthenticationCreateUserParams`](./src/scalar_galaxy/types/authentication_create_user_params.py) |
| Response | [`User`](./src/scalar_galaxy/types/user.py) |

```python
authentication = client.authentication.create_user(
Expand All @@ -160,8 +160,8 @@ Yeah, this is the boring security stuff. Just get your super secret token and mo

| Direction | Type |
| --- | --- |
| Request | [`AuthenticationCreateTokenParams`](./src/types/authentication_create_token_params.py) |
| Response | [`AuthenticationCreateTokenResponse`](./src/types/authentication_create_token_response.py) |
| Request | [`AuthenticationCreateTokenParams`](./src/scalar_galaxy/types/authentication_create_token_params.py) |
| Response | [`AuthenticationCreateTokenResponse`](./src/scalar_galaxy/types/authentication_create_token_response.py) |

```python
authentication = client.authentication.create_token(
Expand All @@ -176,7 +176,7 @@ Find yourself they say. That's what you can do here.

| Direction | Type |
| --- | --- |
| Response | [`User`](./src/types/user.py) |
| Response | [`User`](./src/scalar_galaxy/types/user.py) |

```python
authentication = client.authentication.list_me()
Expand Down
22 changes: 11 additions & 11 deletions openapi.augmented.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"x-scalar-sdk-installation": [
{
"lang": "TypeScript",
"description": "```sh\nnpm install @scalar/galaxy\n```"
"description": "```sh\nnpm install @scalar/galaxy-node\n```"
},
{
"lang": "Python",
Expand Down Expand Up @@ -169,7 +169,7 @@
{
"lang": "TypeScript",
"label": "TypeScript",
"source": "import Galaxy from '@scalar/galaxy';\n\nconst client = new Galaxy({\n bearerAuth: process.env['BEARER_AUTH'], // defaults to the BEARER_AUTH env var\n environment: 'production',\n});\n\nconst listAllData = await client.planets.listAllData({\n limit: 10,\n offset: 0,\n});\n\nconsole.log(listAllData);"
"source": "import Galaxy from '@scalar/galaxy-node';\n\nconst client = new Galaxy({\n bearerAuth: process.env['BEARER_AUTH'], // defaults to the BEARER_AUTH env var\n environment: 'production',\n});\n\nconst listAllData = await client.planets.listAllData({\n limit: 10,\n offset: 0,\n});\n\nconsole.log(listAllData);"
},
{
"lang": "Python",
Expand Down Expand Up @@ -310,7 +310,7 @@
{
"lang": "TypeScript",
"label": "TypeScript",
"source": "import Galaxy from '@scalar/galaxy';\n\nconst client = new Galaxy({\n bearerAuth: process.env['BEARER_AUTH'], // defaults to the BEARER_AUTH env var\n environment: 'production',\n});\n\nconst planet = await client.planets.create();\n\nconsole.log(planet);"
"source": "import Galaxy from '@scalar/galaxy-node';\n\nconst client = new Galaxy({\n bearerAuth: process.env['BEARER_AUTH'], // defaults to the BEARER_AUTH env var\n environment: 'production',\n});\n\nconst planet = await client.planets.create({\n name: 'Mars',\n});\n\nconsole.log(planet);"
},
{
"lang": "Python",
Expand Down Expand Up @@ -373,7 +373,7 @@
{
"lang": "TypeScript",
"label": "TypeScript",
"source": "import Galaxy from '@scalar/galaxy';\n\nconst client = new Galaxy({\n bearerAuth: process.env['BEARER_AUTH'], // defaults to the BEARER_AUTH env var\n environment: 'production',\n});\n\nconst planet = await client.planets.retrieve(1);\n\nconsole.log(planet);"
"source": "import Galaxy from '@scalar/galaxy-node';\n\nconst client = new Galaxy({\n bearerAuth: process.env['BEARER_AUTH'], // defaults to the BEARER_AUTH env var\n environment: 'production',\n});\n\nconst planet = await client.planets.retrieve(1);\n\nconsole.log(planet);"
},
{
"lang": "Python",
Expand Down Expand Up @@ -440,7 +440,7 @@
{
"lang": "TypeScript",
"label": "TypeScript",
"source": "import Galaxy from '@scalar/galaxy';\n\nconst client = new Galaxy({\n bearerAuth: process.env['BEARER_AUTH'], // defaults to the BEARER_AUTH env var\n environment: 'production',\n});\n\nconst planet = await client.planets.update(1);\n\nconsole.log(planet);"
"source": "import Galaxy from '@scalar/galaxy-node';\n\nconst client = new Galaxy({\n bearerAuth: process.env['BEARER_AUTH'], // defaults to the BEARER_AUTH env var\n environment: 'production',\n});\n\nconst planet = await client.planets.update(1, {\n name: 'Mars',\n});\n\nconsole.log(planet);"
},
{
"lang": "Python",
Expand Down Expand Up @@ -475,7 +475,7 @@
{
"lang": "TypeScript",
"label": "TypeScript",
"source": "import Galaxy from '@scalar/galaxy';\n\nconst client = new Galaxy({\n bearerAuth: process.env['BEARER_AUTH'], // defaults to the BEARER_AUTH env var\n environment: 'production',\n});\n\nawait client.planets.delete(1);"
"source": "import Galaxy from '@scalar/galaxy-node';\n\nconst client = new Galaxy({\n bearerAuth: process.env['BEARER_AUTH'], // defaults to the BEARER_AUTH env var\n environment: 'production',\n});\n\nawait client.planets.delete(1);"
},
{
"lang": "Python",
Expand Down Expand Up @@ -538,7 +538,7 @@
{
"lang": "TypeScript",
"label": "TypeScript",
"source": "import Galaxy from '@scalar/galaxy';\n\nconst client = new Galaxy({\n bearerAuth: process.env['BEARER_AUTH'], // defaults to the BEARER_AUTH env var\n environment: 'production',\n});\n\nconst uploadImage = await client.planets.uploadImage(1);\n\nconsole.log(uploadImage);"
"source": "import Galaxy from '@scalar/galaxy-node';\n\nconst client = new Galaxy({\n bearerAuth: process.env['BEARER_AUTH'], // defaults to the BEARER_AUTH env var\n environment: 'production',\n});\n\nconst uploadImage = await client.planets.uploadImage(1);\n\nconsole.log(uploadImage);"
},
{
"lang": "Python",
Expand Down Expand Up @@ -584,7 +584,7 @@
{
"lang": "TypeScript",
"label": "TypeScript",
"source": "import Galaxy from '@scalar/galaxy';\n\nconst client = new Galaxy({\n bearerAuth: process.env['BEARER_AUTH'], // defaults to the BEARER_AUTH env var\n environment: 'production',\n});\n\nconst celestialBody = await client.celestialBodies.create({\n name: 'Mars',\n});\n\nconsole.log(celestialBody);"
"source": "import Galaxy from '@scalar/galaxy-node';\n\nconst client = new Galaxy({\n bearerAuth: process.env['BEARER_AUTH'], // defaults to the BEARER_AUTH env var\n environment: 'production',\n});\n\nconst celestialBody = await client.celestialBodies.create({\n name: 'Mars',\n});\n\nconsole.log(celestialBody);"
},
{
"lang": "Python",
Expand Down Expand Up @@ -726,7 +726,7 @@
{
"lang": "TypeScript",
"label": "TypeScript",
"source": "import Galaxy from '@scalar/galaxy';\n\nconst client = new Galaxy({\n bearerAuth: process.env['BEARER_AUTH'], // defaults to the BEARER_AUTH env var\n environment: 'production',\n});\n\nconst user = await client.authentication.createUser();\n\nconsole.log(user);"
"source": "import Galaxy from '@scalar/galaxy-node';\n\nconst client = new Galaxy({\n bearerAuth: process.env['BEARER_AUTH'], // defaults to the BEARER_AUTH env var\n environment: 'production',\n});\n\nconst user = await client.authentication.createUser({\n name: 'Marc',\n email: 'marc@scalar.com',\n password: 'i-love-scalar',\n});\n\nconsole.log(user);"
},
{
"lang": "Python",
Expand Down Expand Up @@ -808,7 +808,7 @@
{
"lang": "TypeScript",
"label": "TypeScript",
"source": "import Galaxy from '@scalar/galaxy';\n\nconst client = new Galaxy({\n bearerAuth: process.env['BEARER_AUTH'], // defaults to the BEARER_AUTH env var\n environment: 'production',\n});\n\nconst createToken = await client.authentication.createToken();\n\nconsole.log(createToken);"
"source": "import Galaxy from '@scalar/galaxy-node';\n\nconst client = new Galaxy({\n bearerAuth: process.env['BEARER_AUTH'], // defaults to the BEARER_AUTH env var\n environment: 'production',\n});\n\nconst createToken = await client.authentication.createToken({\n email: 'marc@scalar.com',\n password: 'i-love-scalar',\n});\n\nconsole.log(createToken);"
},
{
"lang": "Python",
Expand Down Expand Up @@ -891,7 +891,7 @@
{
"lang": "TypeScript",
"label": "TypeScript",
"source": "import Galaxy from '@scalar/galaxy';\n\nconst client = new Galaxy({\n bearerAuth: process.env['BEARER_AUTH'], // defaults to the BEARER_AUTH env var\n environment: 'production',\n});\n\nconst user = await client.authentication.listMe();\n\nconsole.log(user);"
"source": "import Galaxy from '@scalar/galaxy-node';\n\nconst client = new Galaxy({\n bearerAuth: process.env['BEARER_AUTH'], // defaults to the BEARER_AUTH env var\n environment: 'production',\n});\n\nconst user = await client.authentication.listMe();\n\nconsole.log(user);"
},
{
"lang": "Python",
Expand Down
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
[project]
name = "scalar-galaxy"
version = "0.2.1" # x-release-please-version
version = "0.2.2" # x-release-please-version
description = "The Scalar Galaxy is an example OpenAPI document to test OpenAPI tools and libraries. It's a fictional universe with fictional planets and fictional data."
readme = "README.md"
license = "Apache-2.0"
authors = [
{ name = "Scalar Galaxy" },
]
requires-python = ">= 3.9"
dependencies = [
"httpx>=0.23.0, <1",
Expand All @@ -23,10 +26,7 @@ requires = ["hatchling>=1.18.0"]
build-backend = "hatchling.build"

[tool.hatch.build.targets.wheel]
packages = ["src"]

[tool.hatch.build.targets.wheel.sources]
"src" = "scalar_galaxy"
packages = ["src/scalar_galaxy"]

[tool.ruff]
line-length = 120
2 changes: 1 addition & 1 deletion release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
".": {
"release-type": "python",
"extra-files": [
"src/_version.py"
"src/scalar_galaxy/_version.py"
]
}
},
Expand Down
2 changes: 1 addition & 1 deletion scalar-sdk.manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ScalarGalaxy",
"slug": "scalarGalaxy",
"generatorVersion": "0.22.10",
"generatorVersion": "0.27.0",
"servers": [
"https://galaxy.scalar.com",
"{protocol}://void.scalar.com/{path}"
Expand Down
File renamed without changes.
14 changes: 10 additions & 4 deletions src/_base_client.py → src/scalar_galaxy/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
TYPE_CHECKING,
Any,
Dict,
List,
Type,
Union,
Generic,
Expand Down Expand Up @@ -494,7 +495,11 @@ def _custom_auth(
self,
security: SecurityOptions, # noqa: ARG002
) -> httpx.Auth | None:
return None
# Single hook for custom httpx auth on both the sync and async request paths. It defaults to
# the legacy public `custom_auth` property so subclasses that already override that property
# keep applying identically on both paths; override `_custom_auth` itself to layer
# per-operation, security-aware auth on top.
return self.custom_auth

def _build_headers(
self,
Expand All @@ -505,7 +510,7 @@ def _build_headers(
retries_taken: int = 0,
) -> httpx.Headers:
custom_headers = options.headers or {}
# Auth headers are folded into `default_headers` (matching Stainless), so
# Auth headers are folded into `default_headers` (matching the reference SDKs), so
# merging `default_headers` here already applies the configured credentials.
headers_dict = _merge_mappings(self.default_headers, custom_headers)
self._validate_headers(headers_dict, custom_headers, params, cookies)
Expand Down Expand Up @@ -1668,8 +1673,9 @@ async def request(
await self._prepare_request(request)

kwargs: HttpxSendArgs = {}
if self.custom_auth is not None:
kwargs["auth"] = self.custom_auth
custom_auth = self._custom_auth(options.security)
if custom_auth is not None:
kwargs["auth"] = custom_auth

if options.follow_redirects is not None:
kwargs["follow_redirects"] = options.follow_redirects
Expand Down
Loading
Loading