Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
0b0ddbe
chore(internal): remove mock server code
stainless-app[bot] Feb 20, 2026
8e39256
chore: update mock server docs
stainless-app[bot] Feb 20, 2026
c5b2e3c
chore(internal): add request options to SSE classes
stainless-app[bot] Feb 24, 2026
f5519ae
chore(internal): make `test_proxy_environment_variables` more resilient
stainless-app[bot] Feb 24, 2026
c7e0a49
chore(internal): make `test_proxy_environment_variables` more resilie…
stainless-app[bot] Feb 25, 2026
de8432b
chore(ci): bump uv version
stainless-app[bot] Feb 27, 2026
b29d84f
chore(internal): codegen related update
stainless-app[bot] Mar 3, 2026
0de31a0
chore(ci): skip uploading artifacts on stainless-internal branches
stainless-app[bot] Mar 7, 2026
7ec8f3c
chore: update placeholder string
stainless-app[bot] Mar 7, 2026
b5501a6
fix(pydantic): do not pass `by_alias` unless set
stainless-app[bot] Mar 17, 2026
472908c
fix(deps): bump minimum typing-extensions version
stainless-app[bot] Mar 17, 2026
b3d479d
chore(internal): tweak CI branches
stainless-app[bot] Mar 17, 2026
ed285f0
fix: sanitize endpoint path params
stainless-app[bot] Mar 20, 2026
508eb92
chore(internal): update gitignore
stainless-app[bot] Mar 24, 2026
827b72b
chore(ci): skip lint on metadata-only changes
stainless-app[bot] Mar 25, 2026
6f9ef5d
feat(internal): implement indices array format for query and form ser…
stainless-app[bot] Mar 27, 2026
b38a7dd
fix(client): preserve hardcoded query params when merging with user p…
stainless-app[bot] Apr 8, 2026
0b1dbd3
fix: ensure file data are only sent as 1 parameter
stainless-app[bot] Apr 11, 2026
2916819
perf(client): optimize file structure copying in multipart requests
stainless-app[bot] Apr 18, 2026
d363293
release: 0.2.0
stainless-app[bot] Apr 18, 2026
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
32 changes: 19 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
name: CI
on:
push:
branches-ignore:
- 'generated'
- 'codegen/**'
- 'integrated/**'
- 'stl-preview-head/**'
- 'stl-preview-base/**'
branches:
- '**'
- '!integrated/**'
- '!stl-preview-head/**'
- '!stl-preview-base/**'
- '!generated'
- '!codegen/**'
- 'codegen/stl/**'
pull_request:
branches-ignore:
- 'stl-preview-head/**'
Expand All @@ -17,14 +19,14 @@ jobs:
timeout-minutes: 10
name: lint
runs-on: ${{ github.repository == 'stainless-sdks/khulnasoft-openapi-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
steps:
- uses: actions/checkout@v6

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: '0.9.13'
version: '0.10.2'

- name: Install dependencies
run: uv sync --all-extras
Expand All @@ -33,7 +35,7 @@ jobs:
run: ./scripts/lint

build:
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
timeout-minutes: 10
name: build
permissions:
Expand All @@ -46,7 +48,7 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: '0.9.13'
version: '0.10.2'

- name: Install dependencies
run: uv sync --all-extras
Expand All @@ -55,14 +57,18 @@ jobs:
run: uv build

- name: Get GitHub OIDC Token
if: github.repository == 'stainless-sdks/khulnasoft-openapi-python'
if: |-
github.repository == 'stainless-sdks/khulnasoft-openapi-python' &&
!startsWith(github.ref, 'refs/heads/stl/')
id: github-oidc
uses: actions/github-script@v8
with:
script: core.setOutput('github_token', await core.getIDToken());

- name: Upload tarball
if: github.repository == 'stainless-sdks/khulnasoft-openapi-python'
if: |-
github.repository == 'stainless-sdks/khulnasoft-openapi-python' &&
!startsWith(github.ref, 'refs/heads/stl/')
env:
URL: https://pkg.stainless.com/s
AUTH: ${{ steps.github-oidc.outputs.github_token }}
Expand All @@ -80,7 +86,7 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: '0.9.13'
version: '0.10.2'

- name: Bootstrap
run: ./scripts/bootstrap
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.prism.log
.stdy.log
_dev

__pycache__
Expand Down
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.1.0"
".": "0.2.0"
}
38 changes: 38 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,43 @@
# Changelog

## 0.2.0 (2026-04-18)

Full Changelog: [v0.1.0...v0.2.0](https://github.com/khulnasoft/khulnasoft-openapi/compare/v0.1.0...v0.2.0)

### Features

* **internal:** implement indices array format for query and form serialization ([6f9ef5d](https://github.com/khulnasoft/khulnasoft-openapi/commit/6f9ef5d8958d57639179c2489b8a83754a99a1dd))


### Bug Fixes

* **client:** preserve hardcoded query params when merging with user params ([b38a7dd](https://github.com/khulnasoft/khulnasoft-openapi/commit/b38a7dd2b37726727a58683f8d5a38fa41d3d1fd))
* **deps:** bump minimum typing-extensions version ([472908c](https://github.com/khulnasoft/khulnasoft-openapi/commit/472908c4305e47c8c4e714458c889f68fdf6854c))
* ensure file data are only sent as 1 parameter ([0b1dbd3](https://github.com/khulnasoft/khulnasoft-openapi/commit/0b1dbd3e5553a22adada6cdaf3eab7dd50565280))
* **pydantic:** do not pass `by_alias` unless set ([b5501a6](https://github.com/khulnasoft/khulnasoft-openapi/commit/b5501a622cf659edf54bf1f056a15b3be3abc298))
* sanitize endpoint path params ([ed285f0](https://github.com/khulnasoft/khulnasoft-openapi/commit/ed285f0d29c8cd4270bd3acb173a18dbf3f5a352))


### Performance Improvements

* **client:** optimize file structure copying in multipart requests ([2916819](https://github.com/khulnasoft/khulnasoft-openapi/commit/29168199a3f0ef9ee7b2f4fa8d887324c1259ea9))


### Chores

* **ci:** bump uv version ([de8432b](https://github.com/khulnasoft/khulnasoft-openapi/commit/de8432b906ddb023821036ce754b208d256fc1be))
* **ci:** skip lint on metadata-only changes ([827b72b](https://github.com/khulnasoft/khulnasoft-openapi/commit/827b72b54c0a94c51f624bff525594274b8114a4))
* **ci:** skip uploading artifacts on stainless-internal branches ([0de31a0](https://github.com/khulnasoft/khulnasoft-openapi/commit/0de31a092b424886e973660a9c9292c2e54d823b))
* **internal:** add request options to SSE classes ([c5b2e3c](https://github.com/khulnasoft/khulnasoft-openapi/commit/c5b2e3c6903a647319d4511e783e706176ae2317))
* **internal:** codegen related update ([b29d84f](https://github.com/khulnasoft/khulnasoft-openapi/commit/b29d84f79ab072293b1314d0c82a409c9ff8bd01))
* **internal:** make `test_proxy_environment_variables` more resilient ([f5519ae](https://github.com/khulnasoft/khulnasoft-openapi/commit/f5519ae80eff377ec23f11770e4f063c0fa0dee6))
* **internal:** make `test_proxy_environment_variables` more resilient to env ([c7e0a49](https://github.com/khulnasoft/khulnasoft-openapi/commit/c7e0a49e3337fb6e03b024d7f43d4b57f2b2c28a))
* **internal:** remove mock server code ([0b0ddbe](https://github.com/khulnasoft/khulnasoft-openapi/commit/0b0ddbe4353a7f493f0002eab01d66c2725dffdc))
* **internal:** tweak CI branches ([b3d479d](https://github.com/khulnasoft/khulnasoft-openapi/commit/b3d479d39e3547259d5f6334ca972802ce6062ab))
* **internal:** update gitignore ([508eb92](https://github.com/khulnasoft/khulnasoft-openapi/commit/508eb9281cde0483136ed2da6252de267b1fdbbd))
* update mock server docs ([8e39256](https://github.com/khulnasoft/khulnasoft-openapi/commit/8e392563c1e63d3731db0a012d9ac30191e2b913))
* update placeholder string ([7ec8f3c](https://github.com/khulnasoft/khulnasoft-openapi/commit/7ec8f3cd27d4e70f48aaf3cc17f9c333aa8bc359))

## 0.1.0 (2026-02-13)

Full Changelog: [v0.0.1...v0.1.0](https://github.com/khulnasoft/khulnasoft-openapi/compare/v0.0.1...v0.1.0)
Expand Down
7 changes: 0 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,6 @@ $ pip install ./path-to-wheel-file.whl

## Running tests

Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests.

```sh
# you will need npm installed
$ npx prism mock path/to/your/openapi.yml
```

```sh
$ ./scripts/test
```
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "khulnasoft_openapi"
version = "0.1.0"
version = "0.2.0"
description = "The official Python library for the khulnasoft-openapi API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand All @@ -11,7 +11,7 @@ authors = [
dependencies = [
"httpx>=0.23.0, <1",
"pydantic>=1.9.0, <3",
"typing-extensions>=4.10, <5",
"typing-extensions>=4.14, <5",
"anyio>=3.5.0, <5",
"distro>=1.7.0, <2",
"sniffio",
Expand Down
41 changes: 0 additions & 41 deletions scripts/mock

This file was deleted.

46 changes: 0 additions & 46 deletions scripts/test
Original file line number Diff line number Diff line change
Expand Up @@ -4,53 +4,7 @@ set -e

cd "$(dirname "$0")/.."

RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
NC='\033[0m' # No Color

function prism_is_running() {
curl --silent "http://localhost:4010" >/dev/null 2>&1
}

kill_server_on_port() {
pids=$(lsof -t -i tcp:"$1" || echo "")
if [ "$pids" != "" ]; then
kill "$pids"
echo "Stopped $pids."
fi
}

function is_overriding_api_base_url() {
[ -n "$TEST_API_BASE_URL" ]
}

if ! is_overriding_api_base_url && ! prism_is_running ; then
# When we exit this script, make sure to kill the background mock server process
trap 'kill_server_on_port 4010' EXIT

# Start the dev server
./scripts/mock --daemon
fi

if is_overriding_api_base_url ; then
echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}"
echo
elif ! prism_is_running ; then
echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server"
echo -e "running against your OpenAPI spec."
echo
echo -e "To run the server, pass in the path or url of your OpenAPI"
echo -e "spec to the prism command:"
echo
echo -e " \$ ${YELLOW}npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}"
echo

exit 1
else
echo -e "${GREEN}✔ Mock prism server is running with your OpenAPI spec${NC}"
echo
fi

export DEFER_PYDANTIC_BUILD=false

Expand Down
4 changes: 4 additions & 0 deletions src/khulnasoft_openapi/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,10 @@ def _build_request(
files = cast(HttpxRequestFiles, ForceMultipartDict())

prepared_url = self._prepare_url(options.url)
# preserve hard-coded query params from the url
if params and prepared_url.query:
params = {**dict(prepared_url.params.items()), **params}
prepared_url = prepared_url.copy_with(raw_path=prepared_url.raw_path.split(b"?", 1)[0])
if "_" in prepared_url.host:
# work around https://github.com/encode/httpx/discussions/2880
kwargs["extensions"] = {"sni_hostname": prepared_url.host.replace("_", "-")}
Expand Down
Loading
Loading