From 163c4659c64f6b954d9b91e7b340554f0919efa6 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Sun, 5 Oct 2025 19:15:45 +0000
Subject: [PATCH 1/3] refactor(api): rename miru-server to miru
---
.github/workflows/publish-pypi.yml | 2 +-
.github/workflows/release-doctor.yml | 2 +-
.stats.yml | 2 +-
CONTRIBUTING.md | 2 +-
LICENSE | 2 +-
README.md | 74 +++---
SECURITY.md | 2 +-
api.md | 36 +--
pyproject.toml | 14 +-
release-please-config.json | 2 +-
scripts/lint | 2 +-
src/{miru_server => miru}/__init__.py | 24 +-
src/{miru_server => miru}/_base_client.py | 2 +-
src/{miru_server => miru}/_client.py | 65 +++--
src/{miru_server => miru}/_compat.py | 0
src/{miru_server => miru}/_constants.py | 0
src/{miru_server => miru}/_exceptions.py | 4 +-
src/{miru_server => miru}/_files.py | 0
src/{miru_server => miru}/_models.py | 0
src/{miru_server => miru}/_qs.py | 0
src/{miru_server => miru}/_resource.py | 10 +-
src/{miru_server => miru}/_response.py | 14 +-
src/{miru_server => miru}/_streaming.py | 6 +-
src/{miru_server => miru}/_types.py | 2 +-
src/{miru_server => miru}/_utils/__init__.py | 0
src/{miru_server => miru}/_utils/_compat.py | 0
.../_utils/_datetime_parse.py | 0
src/{miru_server => miru}/_utils/_logs.py | 6 +-
src/{miru_server => miru}/_utils/_proxy.py | 0
.../_utils/_reflection.py | 0
.../_utils/_resources_proxy.py | 8 +-
src/{miru_server => miru}/_utils/_streams.py | 0
src/{miru_server => miru}/_utils/_sync.py | 0
.../_utils/_transform.py | 0
src/{miru_server => miru}/_utils/_typing.py | 0
src/{miru_server => miru}/_utils/_utils.py | 0
src/{miru_server => miru}/_version.py | 2 +-
src/miru/lib/.keep | 4 +
src/{miru_server => miru}/py.typed | 0
.../resources/__init__.py | 0
.../resources/config_instances.py | 0
.../resources/deployments.py | 0
.../resources/devices.py | 0
.../resources/releases.py | 0
src/{miru_server => miru}/types/__init__.py | 0
.../types/config_instance.py | 0
.../types/config_instance_list_params.py | 0
.../types/config_instance_list_response.py | 0
.../types/config_instance_retrieve_params.py | 0
.../types/config_schema.py | 0
.../types/config_schema_list.py | 0
.../types/config_type.py | 0
src/{miru_server => miru}/types/deployment.py | 0
.../types/deployment_create_params.py | 0
.../types/deployment_list_params.py | 0
.../types/deployment_list_response.py | 0
.../types/deployment_retrieve_params.py | 0
.../types/deployment_validate_params.py | 0
.../types/deployment_validate_response.py | 0
src/{miru_server => miru}/types/device.py | 0
.../device_create_activation_token_params.py | 0
...device_create_activation_token_response.py | 0
.../types/device_create_params.py | 0
.../types/device_delete_response.py | 0
.../types/device_list_params.py | 0
.../types/device_list_response.py | 0
.../types/device_update_params.py | 0
.../types/paginated_list.py | 0
src/{miru_server => miru}/types/release.py | 0
.../types/release_list_params.py | 0
.../types/release_list_response.py | 0
.../types/release_retrieve_params.py | 0
tests/api_resources/test_config_instances.py | 42 ++--
tests/api_resources/test_deployments.py | 74 +++---
tests/api_resources/test_devices.py | 106 ++++----
tests/api_resources/test_releases.py | 40 +--
tests/conftest.py | 14 +-
tests/test_client.py | 234 ++++++++----------
tests/test_deepcopy.py | 2 +-
tests/test_extract_files.py | 4 +-
tests/test_files.py | 2 +-
tests/test_models.py | 6 +-
tests/test_qs.py | 2 +-
tests/test_required_args.py | 2 +-
tests/test_response.py | 38 +--
tests/test_streaming.py | 34 ++-
tests/test_transform.py | 8 +-
tests/test_utils/test_datetime_parse.py | 2 +-
tests/test_utils/test_proxy.py | 2 +-
tests/test_utils/test_typing.py | 2 +-
tests/utils.py | 8 +-
91 files changed, 429 insertions(+), 480 deletions(-)
rename src/{miru_server => miru}/__init__.py (86%)
rename src/{miru_server => miru}/_base_client.py (99%)
rename src/{miru_server => miru}/_client.py (91%)
rename src/{miru_server => miru}/_compat.py (100%)
rename src/{miru_server => miru}/_constants.py (100%)
rename src/{miru_server => miru}/_exceptions.py (97%)
rename src/{miru_server => miru}/_files.py (100%)
rename src/{miru_server => miru}/_models.py (100%)
rename src/{miru_server => miru}/_qs.py (100%)
rename src/{miru_server => miru}/_resource.py (80%)
rename src/{miru_server => miru}/_response.py (98%)
rename src/{miru_server => miru}/_streaming.py (98%)
rename src/{miru_server => miru}/_types.py (99%)
rename src/{miru_server => miru}/_utils/__init__.py (100%)
rename src/{miru_server => miru}/_utils/_compat.py (100%)
rename src/{miru_server => miru}/_utils/_datetime_parse.py (100%)
rename src/{miru_server => miru}/_utils/_logs.py (70%)
rename src/{miru_server => miru}/_utils/_proxy.py (100%)
rename src/{miru_server => miru}/_utils/_reflection.py (100%)
rename src/{miru_server => miru}/_utils/_resources_proxy.py (51%)
rename src/{miru_server => miru}/_utils/_streams.py (100%)
rename src/{miru_server => miru}/_utils/_sync.py (100%)
rename src/{miru_server => miru}/_utils/_transform.py (100%)
rename src/{miru_server => miru}/_utils/_typing.py (100%)
rename src/{miru_server => miru}/_utils/_utils.py (100%)
rename src/{miru_server => miru}/_version.py (84%)
create mode 100644 src/miru/lib/.keep
rename src/{miru_server => miru}/py.typed (100%)
rename src/{miru_server => miru}/resources/__init__.py (100%)
rename src/{miru_server => miru}/resources/config_instances.py (100%)
rename src/{miru_server => miru}/resources/deployments.py (100%)
rename src/{miru_server => miru}/resources/devices.py (100%)
rename src/{miru_server => miru}/resources/releases.py (100%)
rename src/{miru_server => miru}/types/__init__.py (100%)
rename src/{miru_server => miru}/types/config_instance.py (100%)
rename src/{miru_server => miru}/types/config_instance_list_params.py (100%)
rename src/{miru_server => miru}/types/config_instance_list_response.py (100%)
rename src/{miru_server => miru}/types/config_instance_retrieve_params.py (100%)
rename src/{miru_server => miru}/types/config_schema.py (100%)
rename src/{miru_server => miru}/types/config_schema_list.py (100%)
rename src/{miru_server => miru}/types/config_type.py (100%)
rename src/{miru_server => miru}/types/deployment.py (100%)
rename src/{miru_server => miru}/types/deployment_create_params.py (100%)
rename src/{miru_server => miru}/types/deployment_list_params.py (100%)
rename src/{miru_server => miru}/types/deployment_list_response.py (100%)
rename src/{miru_server => miru}/types/deployment_retrieve_params.py (100%)
rename src/{miru_server => miru}/types/deployment_validate_params.py (100%)
rename src/{miru_server => miru}/types/deployment_validate_response.py (100%)
rename src/{miru_server => miru}/types/device.py (100%)
rename src/{miru_server => miru}/types/device_create_activation_token_params.py (100%)
rename src/{miru_server => miru}/types/device_create_activation_token_response.py (100%)
rename src/{miru_server => miru}/types/device_create_params.py (100%)
rename src/{miru_server => miru}/types/device_delete_response.py (100%)
rename src/{miru_server => miru}/types/device_list_params.py (100%)
rename src/{miru_server => miru}/types/device_list_response.py (100%)
rename src/{miru_server => miru}/types/device_update_params.py (100%)
rename src/{miru_server => miru}/types/paginated_list.py (100%)
rename src/{miru_server => miru}/types/release.py (100%)
rename src/{miru_server => miru}/types/release_list_params.py (100%)
rename src/{miru_server => miru}/types/release_list_response.py (100%)
rename src/{miru_server => miru}/types/release_retrieve_params.py (100%)
diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml
index f0abae3..0eb2ff8 100644
--- a/.github/workflows/publish-pypi.yml
+++ b/.github/workflows/publish-pypi.yml
@@ -28,4 +28,4 @@ jobs:
run: |
bash ./bin/publish-pypi
env:
- PYPI_TOKEN: ${{ secrets.MIRU_SERVER_PYPI_TOKEN || secrets.PYPI_TOKEN }}
+ PYPI_TOKEN: ${{ secrets.MIRU_PYPI_TOKEN || secrets.PYPI_TOKEN }}
diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml
index 9e49e8e..5bcf955 100644
--- a/.github/workflows/release-doctor.yml
+++ b/.github/workflows/release-doctor.yml
@@ -18,4 +18,4 @@ jobs:
run: |
bash ./bin/check-release-environment
env:
- PYPI_TOKEN: ${{ secrets.MIRU_SERVER_PYPI_TOKEN || secrets.PYPI_TOKEN }}
+ PYPI_TOKEN: ${{ secrets.MIRU_PYPI_TOKEN || secrets.PYPI_TOKEN }}
diff --git a/.stats.yml b/.stats.yml
index 30451b1..0872e67 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 14
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/miru-ml%2Fmiru-server-7d0dd143c8ea9bc230d9810d8cfb3fde8b1d4eb48295ebf2db7ea67916fb96c3.yml
openapi_spec_hash: b6667a2e80a356a67bab83f8d5f6e51a
-config_hash: a6a12b948f6bbf51b6e6c16c1e99fae7
+config_hash: 5cc88c35128978e4da46092835211852
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 1e540fe..184ae75 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -36,7 +36,7 @@ $ pip install -r requirements-dev.lock
Most of the SDK is generated code. Modifications to code will be persisted between generations, but may
result in merge conflicts between manual patches and changes from the generator. The generator will never
-modify the contents of the `src/miru_server/lib/` and `examples/` directories.
+modify the contents of the `src/miru/lib/` and `examples/` directories.
## Adding and running examples
diff --git a/LICENSE b/LICENSE
index 3865d8a..9600cfc 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright 2025 miru-server
+Copyright 2025 miru
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
diff --git a/README.md b/README.md
index d4e32d3..78392fa 100644
--- a/README.md
+++ b/README.md
@@ -1,9 +1,9 @@
-# Miru Server Python API library
+# Miru Python API library
[)](https://pypi.org/project/miru_server_sdk/)
-The Miru Server Python library provides convenient access to the Miru Server REST API from any Python 3.8+
+The Miru Python library provides convenient access to the Miru REST API from any Python 3.8+
application. The library includes type definitions for all request params and response fields,
and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).
@@ -26,9 +26,9 @@ The full API of this library can be found in [api.md](api.md).
```python
import os
-from miru_server import MiruServer
+from miru import Miru
-client = MiruServer(
+client = Miru(
api_key=os.environ.get("MIRU_SERVER_API_KEY"), # This is the default and can be omitted
)
@@ -45,14 +45,14 @@ so that your API Key is not stored in source control.
## Async usage
-Simply import `AsyncMiruServer` instead of `MiruServer` and use `await` with each API call:
+Simply import `AsyncMiru` instead of `Miru` and use `await` with each API call:
```python
import os
import asyncio
-from miru_server import AsyncMiruServer
+from miru import AsyncMiru
-client = AsyncMiruServer(
+client = AsyncMiru(
api_key=os.environ.get("MIRU_SERVER_API_KEY"), # This is the default and can be omitted
)
@@ -84,12 +84,12 @@ Then you can enable it by instantiating the client with `http_client=DefaultAioH
```python
import asyncio
-from miru_server import DefaultAioHttpClient
-from miru_server import AsyncMiruServer
+from miru import DefaultAioHttpClient
+from miru import AsyncMiru
async def main() -> None:
- async with AsyncMiruServer(
+ async with AsyncMiru(
api_key="My API Key",
http_client=DefaultAioHttpClient(),
) as client:
@@ -113,29 +113,29 @@ Typed requests and responses provide autocomplete and documentation within your
## Handling errors
-When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `miru_server.APIConnectionError` is raised.
+When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `miru.APIConnectionError` is raised.
When the API returns a non-success status code (that is, 4xx or 5xx
-response), a subclass of `miru_server.APIStatusError` is raised, containing `status_code` and `response` properties.
+response), a subclass of `miru.APIStatusError` is raised, containing `status_code` and `response` properties.
-All errors inherit from `miru_server.APIError`.
+All errors inherit from `miru.APIError`.
```python
-import miru_server
-from miru_server import MiruServer
+import miru
+from miru import Miru
-client = MiruServer()
+client = Miru()
try:
client.config_instances.retrieve(
config_instance_id="cfg_inst_123",
)
-except miru_server.APIConnectionError as e:
+except miru.APIConnectionError as e:
print("The server could not be reached")
print(e.__cause__) # an underlying Exception, likely raised within httpx.
-except miru_server.RateLimitError as e:
+except miru.RateLimitError as e:
print("A 429 status code was received; we should back off a bit.")
-except miru_server.APIStatusError as e:
+except miru.APIStatusError as e:
print("Another non-200-range status code was received")
print(e.status_code)
print(e.response)
@@ -163,10 +163,10 @@ Connection errors (for example, due to a network connectivity problem), 408 Requ
You can use the `max_retries` option to configure or disable retry settings:
```python
-from miru_server import MiruServer
+from miru import Miru
# Configure the default for all requests:
-client = MiruServer(
+client = Miru(
# default is 2
max_retries=0,
)
@@ -183,16 +183,16 @@ By default requests time out after 1 minute. You can configure this with a `time
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:
```python
-from miru_server import MiruServer
+from miru import Miru
# Configure the default for all requests:
-client = MiruServer(
+client = Miru(
# 20 seconds (default is 1 minute)
timeout=20.0,
)
# More granular control:
-client = MiruServer(
+client = Miru(
timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0),
)
@@ -212,10 +212,10 @@ Note that requests that time out are [retried twice by default](#retries).
We use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module.
-You can enable logging by setting the environment variable `MIRU_SERVER_LOG` to `info`.
+You can enable logging by setting the environment variable `MIRU_LOG` to `info`.
```shell
-$ export MIRU_SERVER_LOG=info
+$ export MIRU_LOG=info
```
Or to `debug` for more verbose logging.
@@ -237,9 +237,9 @@ if response.my_field is None:
The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,
```py
-from miru_server import MiruServer
+from miru import Miru
-client = MiruServer()
+client = Miru()
response = client.config_instances.with_raw_response.retrieve(
config_instance_id="cfg_inst_123",
)
@@ -249,9 +249,9 @@ config_instance = response.parse() # get the object that `config_instances.retr
print(config_instance.id)
```
-These methods return an [`APIResponse`](https://github.com/miruml/python-server-sdk/tree/main/src/miru_server/_response.py) object.
+These methods return an [`APIResponse`](https://github.com/miruml/python-server-sdk/tree/main/src/miru/_response.py) object.
-The async client returns an [`AsyncAPIResponse`](https://github.com/miruml/python-server-sdk/tree/main/src/miru_server/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
+The async client returns an [`AsyncAPIResponse`](https://github.com/miruml/python-server-sdk/tree/main/src/miru/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
#### `.with_streaming_response`
@@ -315,10 +315,10 @@ You can directly override the [httpx client](https://www.python-httpx.org/api/#c
```python
import httpx
-from miru_server import MiruServer, DefaultHttpxClient
+from miru import Miru, DefaultHttpxClient
-client = MiruServer(
- # Or use the `MIRU_SERVER_BASE_URL` env var
+client = Miru(
+ # Or use the `MIRU_BASE_URL` env var
base_url="http://my.test.server.example.com:8083",
http_client=DefaultHttpxClient(
proxy="http://my.test.proxy.example.com",
@@ -338,9 +338,9 @@ client.with_options(http_client=DefaultHttpxClient(...))
By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.
```py
-from miru_server import MiruServer
+from miru import Miru
-with MiruServer() as client:
+with Miru() as client:
# make requests here
...
@@ -366,8 +366,8 @@ If you've upgraded to the latest version but aren't seeing any new features you
You can determine the version that is being used at runtime with:
```py
-import miru_server
-print(miru_server.__version__)
+import miru
+print(miru.__version__)
```
## Requirements
diff --git a/SECURITY.md b/SECURITY.md
index 4451e0f..4d9ec81 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -16,7 +16,7 @@ before making any information public.
## Reporting Non-SDK Related Security Issues
If you encounter security issues that are not directly related to SDKs but pertain to the services
-or products provided by Miru Server, please follow the respective company's security reporting guidelines.
+or products provided by Miru, please follow the respective company's security reporting guidelines.
---
diff --git a/api.md b/api.md
index 279bce7..cd85faf 100644
--- a/api.md
+++ b/api.md
@@ -3,7 +3,7 @@
Types:
```python
-from miru_server.types import (
+from miru.types import (
ConfigInstance,
ConfigSchema,
ConfigSchemaList,
@@ -15,30 +15,30 @@ from miru_server.types import (
Methods:
-- client.config_instances.retrieve(config_instance_id, \*\*params) -> ConfigInstance
-- client.config_instances.list(\*\*params) -> ConfigInstanceListResponse
+- client.config_instances.retrieve(config_instance_id, \*\*params) -> ConfigInstance
+- client.config_instances.list(\*\*params) -> ConfigInstanceListResponse
# Deployments
Types:
```python
-from miru_server.types import Deployment, DeploymentListResponse, DeploymentValidateResponse
+from miru.types import Deployment, DeploymentListResponse, DeploymentValidateResponse
```
Methods:
-- client.deployments.create(\*\*params) -> Deployment
-- client.deployments.retrieve(deployment_id, \*\*params) -> Deployment
-- client.deployments.list(\*\*params) -> DeploymentListResponse
-- client.deployments.validate(deployment_id, \*\*params) -> DeploymentValidateResponse
+- client.deployments.create(\*\*params) -> Deployment
+- client.deployments.retrieve(deployment_id, \*\*params) -> Deployment
+- client.deployments.list(\*\*params) -> DeploymentListResponse
+- client.deployments.validate(deployment_id, \*\*params) -> DeploymentValidateResponse
# Devices
Types:
```python
-from miru_server.types import (
+from miru.types import (
Device,
DeviceListResponse,
DeviceDeleteResponse,
@@ -48,22 +48,22 @@ from miru_server.types import (
Methods:
-- client.devices.create(\*\*params) -> Device
-- client.devices.retrieve(device_id) -> Device
-- client.devices.update(device_id, \*\*params) -> Device
-- client.devices.list(\*\*params) -> DeviceListResponse
-- client.devices.delete(device_id) -> DeviceDeleteResponse
-- client.devices.create_activation_token(device_id, \*\*params) -> DeviceCreateActivationTokenResponse
+- client.devices.create(\*\*params) -> Device
+- client.devices.retrieve(device_id) -> Device
+- client.devices.update(device_id, \*\*params) -> Device
+- client.devices.list(\*\*params) -> DeviceListResponse
+- client.devices.delete(device_id) -> DeviceDeleteResponse
+- client.devices.create_activation_token(device_id, \*\*params) -> DeviceCreateActivationTokenResponse
# Releases
Types:
```python
-from miru_server.types import Release, ReleaseListResponse
+from miru.types import Release, ReleaseListResponse
```
Methods:
-- client.releases.retrieve(release_id, \*\*params) -> Release
-- client.releases.list(\*\*params) -> ReleaseListResponse
+- client.releases.retrieve(release_id, \*\*params) -> Release
+- client.releases.list(\*\*params) -> ReleaseListResponse
diff --git a/pyproject.toml b/pyproject.toml
index 273fca2..5720900 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,11 +1,11 @@
[project]
name = "miru_server_sdk"
version = "0.4.0"
-description = "The official Python library for the miru-server API"
+description = "The official Python library for the miru API"
dynamic = ["readme"]
license = "MIT"
authors = [
-{ name = "Miru Server", email = "" },
+{ name = "Miru", email = "" },
]
dependencies = [
"httpx>=0.23.0, <1",
@@ -78,14 +78,14 @@ format = { chain = [
"check:ruff" = "ruff check ."
"fix:ruff" = "ruff check --fix ."
-"check:importable" = "python -c 'import miru_server'"
+"check:importable" = "python -c 'import miru'"
typecheck = { chain = [
"typecheck:pyright",
"typecheck:mypy"
]}
"typecheck:pyright" = "pyright"
-"typecheck:verify-types" = "pyright --verifytypes miru_server --ignoreexternal"
+"typecheck:verify-types" = "pyright --verifytypes miru --ignoreexternal"
"typecheck:mypy" = "mypy ."
[build-system]
@@ -98,7 +98,7 @@ include = [
]
[tool.hatch.build.targets.wheel]
-packages = ["src/miru_server"]
+packages = ["src/miru"]
[tool.hatch.build.targets.sdist]
# Basically everything except hidden files/directories (such as .github, .devcontainers, .python-version, etc)
@@ -166,7 +166,7 @@ show_error_codes = true
#
# We also exclude our `tests` as mypy doesn't always infer
# types correctly and Pyright will still catch any type errors.
-exclude = ['src/miru_server/_files.py', '_dev/.*.py', 'tests/.*']
+exclude = ['src/miru/_files.py', '_dev/.*.py', 'tests/.*']
strict_equality = true
implicit_reexport = true
@@ -254,7 +254,7 @@ length-sort = true
length-sort-straight = true
combine-as-imports = true
extra-standard-library = ["typing_extensions"]
-known-first-party = ["miru_server", "tests"]
+known-first-party = ["miru", "tests"]
[tool.ruff.lint.per-file-ignores]
"bin/**.py" = ["T201", "T203"]
diff --git a/release-please-config.json b/release-please-config.json
index d2978c8..dc00bb0 100644
--- a/release-please-config.json
+++ b/release-please-config.json
@@ -61,6 +61,6 @@
],
"release-type": "python",
"extra-files": [
- "src/miru_server/_version.py"
+ "src/miru/_version.py"
]
}
\ No newline at end of file
diff --git a/scripts/lint b/scripts/lint
index 3eb1acf..230252a 100755
--- a/scripts/lint
+++ b/scripts/lint
@@ -8,4 +8,4 @@ echo "==> Running lints"
rye run lint
echo "==> Making sure it imports"
-rye run python -c 'import miru_server'
+rye run python -c 'import miru'
diff --git a/src/miru_server/__init__.py b/src/miru/__init__.py
similarity index 86%
rename from src/miru_server/__init__.py
rename to src/miru/__init__.py
index 8b1c6c8..4d27d30 100644
--- a/src/miru_server/__init__.py
+++ b/src/miru/__init__.py
@@ -5,30 +5,20 @@
from . import types
from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes, omit, not_given
from ._utils import file_from_path
-from ._client import (
- Client,
- Stream,
- Timeout,
- Transport,
- MiruServer,
- AsyncClient,
- AsyncStream,
- RequestOptions,
- AsyncMiruServer,
-)
+from ._client import Miru, Client, Stream, Timeout, AsyncMiru, Transport, AsyncClient, AsyncStream, RequestOptions
from ._models import BaseModel
from ._version import __title__, __version__
from ._response import APIResponse as APIResponse, AsyncAPIResponse as AsyncAPIResponse
from ._constants import DEFAULT_TIMEOUT, DEFAULT_MAX_RETRIES, DEFAULT_CONNECTION_LIMITS
from ._exceptions import (
APIError,
+ MiruError,
ConflictError,
NotFoundError,
APIStatusError,
RateLimitError,
APITimeoutError,
BadRequestError,
- MiruServerError,
APIConnectionError,
AuthenticationError,
InternalServerError,
@@ -51,7 +41,7 @@
"not_given",
"Omit",
"omit",
- "MiruServerError",
+ "MiruError",
"APIError",
"APIStatusError",
"APITimeoutError",
@@ -71,8 +61,8 @@
"AsyncClient",
"Stream",
"AsyncStream",
- "MiruServer",
- "AsyncMiruServer",
+ "Miru",
+ "AsyncMiru",
"file_from_path",
"BaseModel",
"DEFAULT_TIMEOUT",
@@ -91,12 +81,12 @@
# Update the __module__ attribute for exported symbols so that
# error messages point to this module instead of the module
# it was originally defined in, e.g.
-# miru_server._exceptions.NotFoundError -> miru_server.NotFoundError
+# miru._exceptions.NotFoundError -> miru.NotFoundError
__locals = locals()
for __name in __all__:
if not __name.startswith("__"):
try:
- __locals[__name].__module__ = "miru_server"
+ __locals[__name].__module__ = "miru"
except (TypeError, AttributeError):
# Some of our exported symbols are builtins which we can't set attributes for.
pass
diff --git a/src/miru_server/_base_client.py b/src/miru/_base_client.py
similarity index 99%
rename from src/miru_server/_base_client.py
rename to src/miru/_base_client.py
index f365b9e..199ea1f 100644
--- a/src/miru_server/_base_client.py
+++ b/src/miru/_base_client.py
@@ -389,7 +389,7 @@ def __init__(
if max_retries is None: # pyright: ignore[reportUnnecessaryComparison]
raise TypeError(
- "max_retries cannot be None. If you want to disable retries, pass `0`; if you want unlimited retries, pass `math.inf` or a very high number; if you want the default behavior, pass `miru_server.DEFAULT_MAX_RETRIES`"
+ "max_retries cannot be None. If you want to disable retries, pass `0`; if you want unlimited retries, pass `math.inf` or a very high number; if you want the default behavior, pass `miru.DEFAULT_MAX_RETRIES`"
)
def _enforce_trailing_slash(self, url: URL) -> URL:
diff --git a/src/miru_server/_client.py b/src/miru/_client.py
similarity index 91%
rename from src/miru_server/_client.py
rename to src/miru/_client.py
index 4f555d0..2302a6b 100644
--- a/src/miru_server/_client.py
+++ b/src/miru/_client.py
@@ -23,32 +23,23 @@
from ._version import __version__
from .resources import devices, releases, deployments, config_instances
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
-from ._exceptions import APIStatusError, MiruServerError
+from ._exceptions import MiruError, APIStatusError
from ._base_client import (
DEFAULT_MAX_RETRIES,
SyncAPIClient,
AsyncAPIClient,
)
-__all__ = [
- "Timeout",
- "Transport",
- "ProxiesTypes",
- "RequestOptions",
- "MiruServer",
- "AsyncMiruServer",
- "Client",
- "AsyncClient",
-]
+__all__ = ["Timeout", "Transport", "ProxiesTypes", "RequestOptions", "Miru", "AsyncMiru", "Client", "AsyncClient"]
-class MiruServer(SyncAPIClient):
+class Miru(SyncAPIClient):
config_instances: config_instances.ConfigInstancesResource
deployments: deployments.DeploymentsResource
devices: devices.DevicesResource
releases: releases.ReleasesResource
- with_raw_response: MiruServerWithRawResponse
- with_streaming_response: MiruServerWithStreamedResponse
+ with_raw_response: MiruWithRawResponse
+ with_streaming_response: MiruWithStreamedResponse
# client options
api_key: str
@@ -80,7 +71,7 @@ def __init__(
# part of our public interface in the future.
_strict_response_validation: bool = False,
) -> None:
- """Construct a new synchronous MiruServer client instance.
+ """Construct a new synchronous Miru client instance.
This automatically infers the following arguments from their corresponding environment variables if they are not provided:
- `api_key` from `MIRU_SERVER_API_KEY`
@@ -90,7 +81,7 @@ def __init__(
if api_key is None:
api_key = os.environ.get("MIRU_SERVER_API_KEY")
if api_key is None:
- raise MiruServerError(
+ raise MiruError(
"The api_key client option must be set either by passing api_key to the client or by setting the MIRU_SERVER_API_KEY environment variable"
)
self.api_key = api_key
@@ -104,7 +95,7 @@ def __init__(
self.version = version
if base_url is None:
- base_url = os.environ.get("MIRU_SERVER_BASE_URL")
+ base_url = os.environ.get("MIRU_BASE_URL")
if base_url is None:
base_url = f"https://{host}/{version}"
@@ -123,8 +114,8 @@ def __init__(
self.deployments = deployments.DeploymentsResource(self)
self.devices = devices.DevicesResource(self)
self.releases = releases.ReleasesResource(self)
- self.with_raw_response = MiruServerWithRawResponse(self)
- self.with_streaming_response = MiruServerWithStreamedResponse(self)
+ self.with_raw_response = MiruWithRawResponse(self)
+ self.with_streaming_response = MiruWithStreamedResponse(self)
@property
@override
@@ -235,13 +226,13 @@ def _make_status_error(
return APIStatusError(err_msg, response=response, body=body)
-class AsyncMiruServer(AsyncAPIClient):
+class AsyncMiru(AsyncAPIClient):
config_instances: config_instances.AsyncConfigInstancesResource
deployments: deployments.AsyncDeploymentsResource
devices: devices.AsyncDevicesResource
releases: releases.AsyncReleasesResource
- with_raw_response: AsyncMiruServerWithRawResponse
- with_streaming_response: AsyncMiruServerWithStreamedResponse
+ with_raw_response: AsyncMiruWithRawResponse
+ with_streaming_response: AsyncMiruWithStreamedResponse
# client options
api_key: str
@@ -273,7 +264,7 @@ def __init__(
# part of our public interface in the future.
_strict_response_validation: bool = False,
) -> None:
- """Construct a new async AsyncMiruServer client instance.
+ """Construct a new async AsyncMiru client instance.
This automatically infers the following arguments from their corresponding environment variables if they are not provided:
- `api_key` from `MIRU_SERVER_API_KEY`
@@ -283,7 +274,7 @@ def __init__(
if api_key is None:
api_key = os.environ.get("MIRU_SERVER_API_KEY")
if api_key is None:
- raise MiruServerError(
+ raise MiruError(
"The api_key client option must be set either by passing api_key to the client or by setting the MIRU_SERVER_API_KEY environment variable"
)
self.api_key = api_key
@@ -297,7 +288,7 @@ def __init__(
self.version = version
if base_url is None:
- base_url = os.environ.get("MIRU_SERVER_BASE_URL")
+ base_url = os.environ.get("MIRU_BASE_URL")
if base_url is None:
base_url = f"https://{host}/{version}"
@@ -316,8 +307,8 @@ def __init__(
self.deployments = deployments.AsyncDeploymentsResource(self)
self.devices = devices.AsyncDevicesResource(self)
self.releases = releases.AsyncReleasesResource(self)
- self.with_raw_response = AsyncMiruServerWithRawResponse(self)
- self.with_streaming_response = AsyncMiruServerWithStreamedResponse(self)
+ self.with_raw_response = AsyncMiruWithRawResponse(self)
+ self.with_streaming_response = AsyncMiruWithStreamedResponse(self)
@property
@override
@@ -428,32 +419,32 @@ def _make_status_error(
return APIStatusError(err_msg, response=response, body=body)
-class MiruServerWithRawResponse:
- def __init__(self, client: MiruServer) -> None:
+class MiruWithRawResponse:
+ def __init__(self, client: Miru) -> None:
self.config_instances = config_instances.ConfigInstancesResourceWithRawResponse(client.config_instances)
self.deployments = deployments.DeploymentsResourceWithRawResponse(client.deployments)
self.devices = devices.DevicesResourceWithRawResponse(client.devices)
self.releases = releases.ReleasesResourceWithRawResponse(client.releases)
-class AsyncMiruServerWithRawResponse:
- def __init__(self, client: AsyncMiruServer) -> None:
+class AsyncMiruWithRawResponse:
+ def __init__(self, client: AsyncMiru) -> None:
self.config_instances = config_instances.AsyncConfigInstancesResourceWithRawResponse(client.config_instances)
self.deployments = deployments.AsyncDeploymentsResourceWithRawResponse(client.deployments)
self.devices = devices.AsyncDevicesResourceWithRawResponse(client.devices)
self.releases = releases.AsyncReleasesResourceWithRawResponse(client.releases)
-class MiruServerWithStreamedResponse:
- def __init__(self, client: MiruServer) -> None:
+class MiruWithStreamedResponse:
+ def __init__(self, client: Miru) -> None:
self.config_instances = config_instances.ConfigInstancesResourceWithStreamingResponse(client.config_instances)
self.deployments = deployments.DeploymentsResourceWithStreamingResponse(client.deployments)
self.devices = devices.DevicesResourceWithStreamingResponse(client.devices)
self.releases = releases.ReleasesResourceWithStreamingResponse(client.releases)
-class AsyncMiruServerWithStreamedResponse:
- def __init__(self, client: AsyncMiruServer) -> None:
+class AsyncMiruWithStreamedResponse:
+ def __init__(self, client: AsyncMiru) -> None:
self.config_instances = config_instances.AsyncConfigInstancesResourceWithStreamingResponse(
client.config_instances
)
@@ -462,6 +453,6 @@ def __init__(self, client: AsyncMiruServer) -> None:
self.releases = releases.AsyncReleasesResourceWithStreamingResponse(client.releases)
-Client = MiruServer
+Client = Miru
-AsyncClient = AsyncMiruServer
+AsyncClient = AsyncMiru
diff --git a/src/miru_server/_compat.py b/src/miru/_compat.py
similarity index 100%
rename from src/miru_server/_compat.py
rename to src/miru/_compat.py
diff --git a/src/miru_server/_constants.py b/src/miru/_constants.py
similarity index 100%
rename from src/miru_server/_constants.py
rename to src/miru/_constants.py
diff --git a/src/miru_server/_exceptions.py b/src/miru/_exceptions.py
similarity index 97%
rename from src/miru_server/_exceptions.py
rename to src/miru/_exceptions.py
index dd9031f..1552bbb 100644
--- a/src/miru_server/_exceptions.py
+++ b/src/miru/_exceptions.py
@@ -18,11 +18,11 @@
]
-class MiruServerError(Exception):
+class MiruError(Exception):
pass
-class APIError(MiruServerError):
+class APIError(MiruError):
message: str
request: httpx.Request
diff --git a/src/miru_server/_files.py b/src/miru/_files.py
similarity index 100%
rename from src/miru_server/_files.py
rename to src/miru/_files.py
diff --git a/src/miru_server/_models.py b/src/miru/_models.py
similarity index 100%
rename from src/miru_server/_models.py
rename to src/miru/_models.py
diff --git a/src/miru_server/_qs.py b/src/miru/_qs.py
similarity index 100%
rename from src/miru_server/_qs.py
rename to src/miru/_qs.py
diff --git a/src/miru_server/_resource.py b/src/miru/_resource.py
similarity index 80%
rename from src/miru_server/_resource.py
rename to src/miru/_resource.py
index 0341d5e..da6d66b 100644
--- a/src/miru_server/_resource.py
+++ b/src/miru/_resource.py
@@ -8,13 +8,13 @@
import anyio
if TYPE_CHECKING:
- from ._client import MiruServer, AsyncMiruServer
+ from ._client import Miru, AsyncMiru
class SyncAPIResource:
- _client: MiruServer
+ _client: Miru
- def __init__(self, client: MiruServer) -> None:
+ def __init__(self, client: Miru) -> None:
self._client = client
self._get = client.get
self._post = client.post
@@ -28,9 +28,9 @@ def _sleep(self, seconds: float) -> None:
class AsyncAPIResource:
- _client: AsyncMiruServer
+ _client: AsyncMiru
- def __init__(self, client: AsyncMiruServer) -> None:
+ def __init__(self, client: AsyncMiru) -> None:
self._client = client
self._get = client.get
self._post = client.post
diff --git a/src/miru_server/_response.py b/src/miru/_response.py
similarity index 98%
rename from src/miru_server/_response.py
rename to src/miru/_response.py
index 48f364c..5de180d 100644
--- a/src/miru_server/_response.py
+++ b/src/miru/_response.py
@@ -29,7 +29,7 @@
from ._models import BaseModel, is_basemodel
from ._constants import RAW_RESPONSE_HEADER, OVERRIDE_CAST_TO_HEADER
from ._streaming import Stream, AsyncStream, is_stream_class_type, extract_stream_chunk_type
-from ._exceptions import MiruServerError, APIResponseValidationError
+from ._exceptions import MiruError, APIResponseValidationError
if TYPE_CHECKING:
from ._models import FinalRequestOptions
@@ -217,9 +217,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T:
and not issubclass(origin, BaseModel)
and issubclass(origin, pydantic.BaseModel)
):
- raise TypeError(
- "Pydantic models must subclass our base model type, e.g. `from miru_server import BaseModel`"
- )
+ raise TypeError("Pydantic models must subclass our base model type, e.g. `from miru import BaseModel`")
if (
cast_to is not object
@@ -285,7 +283,7 @@ def parse(self, *, to: type[_T] | None = None) -> R | _T:
the `to` argument, e.g.
```py
- from miru_server import BaseModel
+ from miru import BaseModel
class MyModel(BaseModel):
@@ -387,7 +385,7 @@ async def parse(self, *, to: type[_T] | None = None) -> R | _T:
the `to` argument, e.g.
```py
- from miru_server import BaseModel
+ from miru import BaseModel
class MyModel(BaseModel):
@@ -558,11 +556,11 @@ async def stream_to_file(
class MissingStreamClassError(TypeError):
def __init__(self) -> None:
super().__init__(
- "The `stream` argument was set to `True` but the `stream_cls` argument was not given. See `miru_server._streaming` for reference",
+ "The `stream` argument was set to `True` but the `stream_cls` argument was not given. See `miru._streaming` for reference",
)
-class StreamAlreadyConsumed(MiruServerError):
+class StreamAlreadyConsumed(MiruError):
"""
Attempted to read or stream content, but the content has already
been streamed.
diff --git a/src/miru_server/_streaming.py b/src/miru/_streaming.py
similarity index 98%
rename from src/miru_server/_streaming.py
rename to src/miru/_streaming.py
index 6ee83dd..b647204 100644
--- a/src/miru_server/_streaming.py
+++ b/src/miru/_streaming.py
@@ -12,7 +12,7 @@
from ._utils import extract_type_var_from_base
if TYPE_CHECKING:
- from ._client import MiruServer, AsyncMiruServer
+ from ._client import Miru, AsyncMiru
_T = TypeVar("_T")
@@ -30,7 +30,7 @@ def __init__(
*,
cast_to: type[_T],
response: httpx.Response,
- client: MiruServer,
+ client: Miru,
) -> None:
self.response = response
self._cast_to = cast_to
@@ -93,7 +93,7 @@ def __init__(
*,
cast_to: type[_T],
response: httpx.Response,
- client: AsyncMiruServer,
+ client: AsyncMiru,
) -> None:
self.response = response
self._cast_to = cast_to
diff --git a/src/miru_server/_types.py b/src/miru/_types.py
similarity index 99%
rename from src/miru_server/_types.py
rename to src/miru/_types.py
index 0ad9735..b3f722f 100644
--- a/src/miru_server/_types.py
+++ b/src/miru/_types.py
@@ -92,7 +92,7 @@
# This unfortunately means that you will either have
# to import this type and pass it explicitly:
#
-# from miru_server import NoneType
+# from miru import NoneType
# client.get('/foo', cast_to=NoneType)
#
# or build it yourself:
diff --git a/src/miru_server/_utils/__init__.py b/src/miru/_utils/__init__.py
similarity index 100%
rename from src/miru_server/_utils/__init__.py
rename to src/miru/_utils/__init__.py
diff --git a/src/miru_server/_utils/_compat.py b/src/miru/_utils/_compat.py
similarity index 100%
rename from src/miru_server/_utils/_compat.py
rename to src/miru/_utils/_compat.py
diff --git a/src/miru_server/_utils/_datetime_parse.py b/src/miru/_utils/_datetime_parse.py
similarity index 100%
rename from src/miru_server/_utils/_datetime_parse.py
rename to src/miru/_utils/_datetime_parse.py
diff --git a/src/miru_server/_utils/_logs.py b/src/miru/_utils/_logs.py
similarity index 70%
rename from src/miru_server/_utils/_logs.py
rename to src/miru/_utils/_logs.py
index 560a388..60916f9 100644
--- a/src/miru_server/_utils/_logs.py
+++ b/src/miru/_utils/_logs.py
@@ -1,12 +1,12 @@
import os
import logging
-logger: logging.Logger = logging.getLogger("miru_server")
+logger: logging.Logger = logging.getLogger("miru")
httpx_logger: logging.Logger = logging.getLogger("httpx")
def _basic_config() -> None:
- # e.g. [2023-10-05 14:12:26 - miru_server._base_client:818 - DEBUG] HTTP Request: POST http://127.0.0.1:4010/foo/bar "200 OK"
+ # e.g. [2023-10-05 14:12:26 - miru._base_client:818 - DEBUG] HTTP Request: POST http://127.0.0.1:4010/foo/bar "200 OK"
logging.basicConfig(
format="[%(asctime)s - %(name)s:%(lineno)d - %(levelname)s] %(message)s",
datefmt="%Y-%m-%d %H:%M:%S",
@@ -14,7 +14,7 @@ def _basic_config() -> None:
def setup_logging() -> None:
- env = os.environ.get("MIRU_SERVER_LOG")
+ env = os.environ.get("MIRU_LOG")
if env == "debug":
_basic_config()
logger.setLevel(logging.DEBUG)
diff --git a/src/miru_server/_utils/_proxy.py b/src/miru/_utils/_proxy.py
similarity index 100%
rename from src/miru_server/_utils/_proxy.py
rename to src/miru/_utils/_proxy.py
diff --git a/src/miru_server/_utils/_reflection.py b/src/miru/_utils/_reflection.py
similarity index 100%
rename from src/miru_server/_utils/_reflection.py
rename to src/miru/_utils/_reflection.py
diff --git a/src/miru_server/_utils/_resources_proxy.py b/src/miru/_utils/_resources_proxy.py
similarity index 51%
rename from src/miru_server/_utils/_resources_proxy.py
rename to src/miru/_utils/_resources_proxy.py
index 1f0eff4..22893c0 100644
--- a/src/miru_server/_utils/_resources_proxy.py
+++ b/src/miru/_utils/_resources_proxy.py
@@ -7,17 +7,17 @@
class ResourcesProxy(LazyProxy[Any]):
- """A proxy for the `miru_server.resources` module.
+ """A proxy for the `miru.resources` module.
- This is used so that we can lazily import `miru_server.resources` only when
- needed *and* so that users can just import `miru_server` and reference `miru_server.resources`
+ This is used so that we can lazily import `miru.resources` only when
+ needed *and* so that users can just import `miru` and reference `miru.resources`
"""
@override
def __load__(self) -> Any:
import importlib
- mod = importlib.import_module("miru_server.resources")
+ mod = importlib.import_module("miru.resources")
return mod
diff --git a/src/miru_server/_utils/_streams.py b/src/miru/_utils/_streams.py
similarity index 100%
rename from src/miru_server/_utils/_streams.py
rename to src/miru/_utils/_streams.py
diff --git a/src/miru_server/_utils/_sync.py b/src/miru/_utils/_sync.py
similarity index 100%
rename from src/miru_server/_utils/_sync.py
rename to src/miru/_utils/_sync.py
diff --git a/src/miru_server/_utils/_transform.py b/src/miru/_utils/_transform.py
similarity index 100%
rename from src/miru_server/_utils/_transform.py
rename to src/miru/_utils/_transform.py
diff --git a/src/miru_server/_utils/_typing.py b/src/miru/_utils/_typing.py
similarity index 100%
rename from src/miru_server/_utils/_typing.py
rename to src/miru/_utils/_typing.py
diff --git a/src/miru_server/_utils/_utils.py b/src/miru/_utils/_utils.py
similarity index 100%
rename from src/miru_server/_utils/_utils.py
rename to src/miru/_utils/_utils.py
diff --git a/src/miru_server/_version.py b/src/miru/_version.py
similarity index 84%
rename from src/miru_server/_version.py
rename to src/miru/_version.py
index 4f9f9da..028ca67 100644
--- a/src/miru_server/_version.py
+++ b/src/miru/_version.py
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-__title__ = "miru_server"
+__title__ = "miru"
__version__ = "0.4.0" # x-release-please-version
diff --git a/src/miru/lib/.keep b/src/miru/lib/.keep
new file mode 100644
index 0000000..5e2c99f
--- /dev/null
+++ b/src/miru/lib/.keep
@@ -0,0 +1,4 @@
+File generated from our OpenAPI spec by Stainless.
+
+This directory can be used to store custom files to expand the SDK.
+It is ignored by Stainless code generation and its content (other than this keep file) won't be touched.
\ No newline at end of file
diff --git a/src/miru_server/py.typed b/src/miru/py.typed
similarity index 100%
rename from src/miru_server/py.typed
rename to src/miru/py.typed
diff --git a/src/miru_server/resources/__init__.py b/src/miru/resources/__init__.py
similarity index 100%
rename from src/miru_server/resources/__init__.py
rename to src/miru/resources/__init__.py
diff --git a/src/miru_server/resources/config_instances.py b/src/miru/resources/config_instances.py
similarity index 100%
rename from src/miru_server/resources/config_instances.py
rename to src/miru/resources/config_instances.py
diff --git a/src/miru_server/resources/deployments.py b/src/miru/resources/deployments.py
similarity index 100%
rename from src/miru_server/resources/deployments.py
rename to src/miru/resources/deployments.py
diff --git a/src/miru_server/resources/devices.py b/src/miru/resources/devices.py
similarity index 100%
rename from src/miru_server/resources/devices.py
rename to src/miru/resources/devices.py
diff --git a/src/miru_server/resources/releases.py b/src/miru/resources/releases.py
similarity index 100%
rename from src/miru_server/resources/releases.py
rename to src/miru/resources/releases.py
diff --git a/src/miru_server/types/__init__.py b/src/miru/types/__init__.py
similarity index 100%
rename from src/miru_server/types/__init__.py
rename to src/miru/types/__init__.py
diff --git a/src/miru_server/types/config_instance.py b/src/miru/types/config_instance.py
similarity index 100%
rename from src/miru_server/types/config_instance.py
rename to src/miru/types/config_instance.py
diff --git a/src/miru_server/types/config_instance_list_params.py b/src/miru/types/config_instance_list_params.py
similarity index 100%
rename from src/miru_server/types/config_instance_list_params.py
rename to src/miru/types/config_instance_list_params.py
diff --git a/src/miru_server/types/config_instance_list_response.py b/src/miru/types/config_instance_list_response.py
similarity index 100%
rename from src/miru_server/types/config_instance_list_response.py
rename to src/miru/types/config_instance_list_response.py
diff --git a/src/miru_server/types/config_instance_retrieve_params.py b/src/miru/types/config_instance_retrieve_params.py
similarity index 100%
rename from src/miru_server/types/config_instance_retrieve_params.py
rename to src/miru/types/config_instance_retrieve_params.py
diff --git a/src/miru_server/types/config_schema.py b/src/miru/types/config_schema.py
similarity index 100%
rename from src/miru_server/types/config_schema.py
rename to src/miru/types/config_schema.py
diff --git a/src/miru_server/types/config_schema_list.py b/src/miru/types/config_schema_list.py
similarity index 100%
rename from src/miru_server/types/config_schema_list.py
rename to src/miru/types/config_schema_list.py
diff --git a/src/miru_server/types/config_type.py b/src/miru/types/config_type.py
similarity index 100%
rename from src/miru_server/types/config_type.py
rename to src/miru/types/config_type.py
diff --git a/src/miru_server/types/deployment.py b/src/miru/types/deployment.py
similarity index 100%
rename from src/miru_server/types/deployment.py
rename to src/miru/types/deployment.py
diff --git a/src/miru_server/types/deployment_create_params.py b/src/miru/types/deployment_create_params.py
similarity index 100%
rename from src/miru_server/types/deployment_create_params.py
rename to src/miru/types/deployment_create_params.py
diff --git a/src/miru_server/types/deployment_list_params.py b/src/miru/types/deployment_list_params.py
similarity index 100%
rename from src/miru_server/types/deployment_list_params.py
rename to src/miru/types/deployment_list_params.py
diff --git a/src/miru_server/types/deployment_list_response.py b/src/miru/types/deployment_list_response.py
similarity index 100%
rename from src/miru_server/types/deployment_list_response.py
rename to src/miru/types/deployment_list_response.py
diff --git a/src/miru_server/types/deployment_retrieve_params.py b/src/miru/types/deployment_retrieve_params.py
similarity index 100%
rename from src/miru_server/types/deployment_retrieve_params.py
rename to src/miru/types/deployment_retrieve_params.py
diff --git a/src/miru_server/types/deployment_validate_params.py b/src/miru/types/deployment_validate_params.py
similarity index 100%
rename from src/miru_server/types/deployment_validate_params.py
rename to src/miru/types/deployment_validate_params.py
diff --git a/src/miru_server/types/deployment_validate_response.py b/src/miru/types/deployment_validate_response.py
similarity index 100%
rename from src/miru_server/types/deployment_validate_response.py
rename to src/miru/types/deployment_validate_response.py
diff --git a/src/miru_server/types/device.py b/src/miru/types/device.py
similarity index 100%
rename from src/miru_server/types/device.py
rename to src/miru/types/device.py
diff --git a/src/miru_server/types/device_create_activation_token_params.py b/src/miru/types/device_create_activation_token_params.py
similarity index 100%
rename from src/miru_server/types/device_create_activation_token_params.py
rename to src/miru/types/device_create_activation_token_params.py
diff --git a/src/miru_server/types/device_create_activation_token_response.py b/src/miru/types/device_create_activation_token_response.py
similarity index 100%
rename from src/miru_server/types/device_create_activation_token_response.py
rename to src/miru/types/device_create_activation_token_response.py
diff --git a/src/miru_server/types/device_create_params.py b/src/miru/types/device_create_params.py
similarity index 100%
rename from src/miru_server/types/device_create_params.py
rename to src/miru/types/device_create_params.py
diff --git a/src/miru_server/types/device_delete_response.py b/src/miru/types/device_delete_response.py
similarity index 100%
rename from src/miru_server/types/device_delete_response.py
rename to src/miru/types/device_delete_response.py
diff --git a/src/miru_server/types/device_list_params.py b/src/miru/types/device_list_params.py
similarity index 100%
rename from src/miru_server/types/device_list_params.py
rename to src/miru/types/device_list_params.py
diff --git a/src/miru_server/types/device_list_response.py b/src/miru/types/device_list_response.py
similarity index 100%
rename from src/miru_server/types/device_list_response.py
rename to src/miru/types/device_list_response.py
diff --git a/src/miru_server/types/device_update_params.py b/src/miru/types/device_update_params.py
similarity index 100%
rename from src/miru_server/types/device_update_params.py
rename to src/miru/types/device_update_params.py
diff --git a/src/miru_server/types/paginated_list.py b/src/miru/types/paginated_list.py
similarity index 100%
rename from src/miru_server/types/paginated_list.py
rename to src/miru/types/paginated_list.py
diff --git a/src/miru_server/types/release.py b/src/miru/types/release.py
similarity index 100%
rename from src/miru_server/types/release.py
rename to src/miru/types/release.py
diff --git a/src/miru_server/types/release_list_params.py b/src/miru/types/release_list_params.py
similarity index 100%
rename from src/miru_server/types/release_list_params.py
rename to src/miru/types/release_list_params.py
diff --git a/src/miru_server/types/release_list_response.py b/src/miru/types/release_list_response.py
similarity index 100%
rename from src/miru_server/types/release_list_response.py
rename to src/miru/types/release_list_response.py
diff --git a/src/miru_server/types/release_retrieve_params.py b/src/miru/types/release_retrieve_params.py
similarity index 100%
rename from src/miru_server/types/release_retrieve_params.py
rename to src/miru/types/release_retrieve_params.py
diff --git a/tests/api_resources/test_config_instances.py b/tests/api_resources/test_config_instances.py
index f64b232..5e69226 100644
--- a/tests/api_resources/test_config_instances.py
+++ b/tests/api_resources/test_config_instances.py
@@ -7,12 +7,12 @@
import pytest
-from miru_server import MiruServer, AsyncMiruServer
-from tests.utils import assert_matches_type
-from miru_server.types import (
+from miru import Miru, AsyncMiru
+from miru.types import (
ConfigInstance,
ConfigInstanceListResponse,
)
+from tests.utils import assert_matches_type
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -22,7 +22,7 @@ class TestConfigInstances:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_method_retrieve(self, client: MiruServer) -> None:
+ def test_method_retrieve(self, client: Miru) -> None:
config_instance = client.config_instances.retrieve(
config_instance_id="cfg_inst_123",
)
@@ -30,7 +30,7 @@ def test_method_retrieve(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_method_retrieve_with_all_params(self, client: MiruServer) -> None:
+ def test_method_retrieve_with_all_params(self, client: Miru) -> None:
config_instance = client.config_instances.retrieve(
config_instance_id="cfg_inst_123",
expand=["content"],
@@ -39,7 +39,7 @@ def test_method_retrieve_with_all_params(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_raw_response_retrieve(self, client: MiruServer) -> None:
+ def test_raw_response_retrieve(self, client: Miru) -> None:
response = client.config_instances.with_raw_response.retrieve(
config_instance_id="cfg_inst_123",
)
@@ -51,7 +51,7 @@ def test_raw_response_retrieve(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_streaming_response_retrieve(self, client: MiruServer) -> None:
+ def test_streaming_response_retrieve(self, client: Miru) -> None:
with client.config_instances.with_streaming_response.retrieve(
config_instance_id="cfg_inst_123",
) as response:
@@ -65,7 +65,7 @@ def test_streaming_response_retrieve(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_path_params_retrieve(self, client: MiruServer) -> None:
+ def test_path_params_retrieve(self, client: Miru) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `config_instance_id` but received ''"):
client.config_instances.with_raw_response.retrieve(
config_instance_id="",
@@ -73,13 +73,13 @@ def test_path_params_retrieve(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_method_list(self, client: MiruServer) -> None:
+ def test_method_list(self, client: Miru) -> None:
config_instance = client.config_instances.list()
assert_matches_type(ConfigInstanceListResponse, config_instance, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_method_list_with_all_params(self, client: MiruServer) -> None:
+ def test_method_list_with_all_params(self, client: Miru) -> None:
config_instance = client.config_instances.list(
id="cfg_inst_123",
activity_status="created",
@@ -97,7 +97,7 @@ def test_method_list_with_all_params(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_raw_response_list(self, client: MiruServer) -> None:
+ def test_raw_response_list(self, client: Miru) -> None:
response = client.config_instances.with_raw_response.list()
assert response.is_closed is True
@@ -107,7 +107,7 @@ def test_raw_response_list(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_streaming_response_list(self, client: MiruServer) -> None:
+ def test_streaming_response_list(self, client: Miru) -> None:
with client.config_instances.with_streaming_response.list() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -125,7 +125,7 @@ class TestAsyncConfigInstances:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_method_retrieve(self, async_client: AsyncMiruServer) -> None:
+ async def test_method_retrieve(self, async_client: AsyncMiru) -> None:
config_instance = await async_client.config_instances.retrieve(
config_instance_id="cfg_inst_123",
)
@@ -133,7 +133,7 @@ async def test_method_retrieve(self, async_client: AsyncMiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_method_retrieve_with_all_params(self, async_client: AsyncMiruServer) -> None:
+ async def test_method_retrieve_with_all_params(self, async_client: AsyncMiru) -> None:
config_instance = await async_client.config_instances.retrieve(
config_instance_id="cfg_inst_123",
expand=["content"],
@@ -142,7 +142,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncMiruServ
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_raw_response_retrieve(self, async_client: AsyncMiruServer) -> None:
+ async def test_raw_response_retrieve(self, async_client: AsyncMiru) -> None:
response = await async_client.config_instances.with_raw_response.retrieve(
config_instance_id="cfg_inst_123",
)
@@ -154,7 +154,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncMiruServer) -> Non
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_streaming_response_retrieve(self, async_client: AsyncMiruServer) -> None:
+ async def test_streaming_response_retrieve(self, async_client: AsyncMiru) -> None:
async with async_client.config_instances.with_streaming_response.retrieve(
config_instance_id="cfg_inst_123",
) as response:
@@ -168,7 +168,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncMiruServer)
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_path_params_retrieve(self, async_client: AsyncMiruServer) -> None:
+ async def test_path_params_retrieve(self, async_client: AsyncMiru) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `config_instance_id` but received ''"):
await async_client.config_instances.with_raw_response.retrieve(
config_instance_id="",
@@ -176,13 +176,13 @@ async def test_path_params_retrieve(self, async_client: AsyncMiruServer) -> None
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_method_list(self, async_client: AsyncMiruServer) -> None:
+ async def test_method_list(self, async_client: AsyncMiru) -> None:
config_instance = await async_client.config_instances.list()
assert_matches_type(ConfigInstanceListResponse, config_instance, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_method_list_with_all_params(self, async_client: AsyncMiruServer) -> None:
+ async def test_method_list_with_all_params(self, async_client: AsyncMiru) -> None:
config_instance = await async_client.config_instances.list(
id="cfg_inst_123",
activity_status="created",
@@ -200,7 +200,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncMiruServer)
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_raw_response_list(self, async_client: AsyncMiruServer) -> None:
+ async def test_raw_response_list(self, async_client: AsyncMiru) -> None:
response = await async_client.config_instances.with_raw_response.list()
assert response.is_closed is True
@@ -210,7 +210,7 @@ async def test_raw_response_list(self, async_client: AsyncMiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_streaming_response_list(self, async_client: AsyncMiruServer) -> None:
+ async def test_streaming_response_list(self, async_client: AsyncMiru) -> None:
async with async_client.config_instances.with_streaming_response.list() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
diff --git a/tests/api_resources/test_deployments.py b/tests/api_resources/test_deployments.py
index aee866c..2d57a7c 100644
--- a/tests/api_resources/test_deployments.py
+++ b/tests/api_resources/test_deployments.py
@@ -7,13 +7,13 @@
import pytest
-from miru_server import MiruServer, AsyncMiruServer
-from tests.utils import assert_matches_type
-from miru_server.types import (
+from miru import Miru, AsyncMiru
+from miru.types import (
Deployment,
DeploymentListResponse,
DeploymentValidateResponse,
)
+from tests.utils import assert_matches_type
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -23,7 +23,7 @@ class TestDeployments:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_method_create(self, client: MiruServer) -> None:
+ def test_method_create(self, client: Miru) -> None:
deployment = client.deployments.create(
description="Update safety mode to 'manual'",
device_id="dvc_123",
@@ -45,7 +45,7 @@ def test_method_create(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_method_create_with_all_params(self, client: MiruServer) -> None:
+ def test_method_create_with_all_params(self, client: Miru) -> None:
deployment = client.deployments.create(
description="Update safety mode to 'manual'",
device_id="dvc_123",
@@ -69,7 +69,7 @@ def test_method_create_with_all_params(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_raw_response_create(self, client: MiruServer) -> None:
+ def test_raw_response_create(self, client: Miru) -> None:
response = client.deployments.with_raw_response.create(
description="Update safety mode to 'manual'",
device_id="dvc_123",
@@ -95,7 +95,7 @@ def test_raw_response_create(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_streaming_response_create(self, client: MiruServer) -> None:
+ def test_streaming_response_create(self, client: Miru) -> None:
with client.deployments.with_streaming_response.create(
description="Update safety mode to 'manual'",
device_id="dvc_123",
@@ -123,7 +123,7 @@ def test_streaming_response_create(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_method_retrieve(self, client: MiruServer) -> None:
+ def test_method_retrieve(self, client: Miru) -> None:
deployment = client.deployments.retrieve(
deployment_id="dpl_123",
)
@@ -131,7 +131,7 @@ def test_method_retrieve(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_method_retrieve_with_all_params(self, client: MiruServer) -> None:
+ def test_method_retrieve_with_all_params(self, client: Miru) -> None:
deployment = client.deployments.retrieve(
deployment_id="dpl_123",
expand=["device"],
@@ -140,7 +140,7 @@ def test_method_retrieve_with_all_params(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_raw_response_retrieve(self, client: MiruServer) -> None:
+ def test_raw_response_retrieve(self, client: Miru) -> None:
response = client.deployments.with_raw_response.retrieve(
deployment_id="dpl_123",
)
@@ -152,7 +152,7 @@ def test_raw_response_retrieve(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_streaming_response_retrieve(self, client: MiruServer) -> None:
+ def test_streaming_response_retrieve(self, client: Miru) -> None:
with client.deployments.with_streaming_response.retrieve(
deployment_id="dpl_123",
) as response:
@@ -166,7 +166,7 @@ def test_streaming_response_retrieve(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_path_params_retrieve(self, client: MiruServer) -> None:
+ def test_path_params_retrieve(self, client: Miru) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `deployment_id` but received ''"):
client.deployments.with_raw_response.retrieve(
deployment_id="",
@@ -174,13 +174,13 @@ def test_path_params_retrieve(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_method_list(self, client: MiruServer) -> None:
+ def test_method_list(self, client: Miru) -> None:
deployment = client.deployments.list()
assert_matches_type(DeploymentListResponse, deployment, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_method_list_with_all_params(self, client: MiruServer) -> None:
+ def test_method_list_with_all_params(self, client: Miru) -> None:
deployment = client.deployments.list(
id="dpl_123",
activity_status="validating",
@@ -197,7 +197,7 @@ def test_method_list_with_all_params(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_raw_response_list(self, client: MiruServer) -> None:
+ def test_raw_response_list(self, client: Miru) -> None:
response = client.deployments.with_raw_response.list()
assert response.is_closed is True
@@ -207,7 +207,7 @@ def test_raw_response_list(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_streaming_response_list(self, client: MiruServer) -> None:
+ def test_streaming_response_list(self, client: Miru) -> None:
with client.deployments.with_streaming_response.list() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -219,7 +219,7 @@ def test_streaming_response_list(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_method_validate(self, client: MiruServer) -> None:
+ def test_method_validate(self, client: Miru) -> None:
deployment = client.deployments.validate(
deployment_id="dpl_123",
config_instances=[
@@ -241,7 +241,7 @@ def test_method_validate(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_raw_response_validate(self, client: MiruServer) -> None:
+ def test_raw_response_validate(self, client: Miru) -> None:
response = client.deployments.with_raw_response.validate(
deployment_id="dpl_123",
config_instances=[
@@ -267,7 +267,7 @@ def test_raw_response_validate(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_streaming_response_validate(self, client: MiruServer) -> None:
+ def test_streaming_response_validate(self, client: Miru) -> None:
with client.deployments.with_streaming_response.validate(
deployment_id="dpl_123",
config_instances=[
@@ -295,7 +295,7 @@ def test_streaming_response_validate(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_path_params_validate(self, client: MiruServer) -> None:
+ def test_path_params_validate(self, client: Miru) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `deployment_id` but received ''"):
client.deployments.with_raw_response.validate(
deployment_id="",
@@ -323,7 +323,7 @@ class TestAsyncDeployments:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_method_create(self, async_client: AsyncMiruServer) -> None:
+ async def test_method_create(self, async_client: AsyncMiru) -> None:
deployment = await async_client.deployments.create(
description="Update safety mode to 'manual'",
device_id="dvc_123",
@@ -345,7 +345,7 @@ async def test_method_create(self, async_client: AsyncMiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_method_create_with_all_params(self, async_client: AsyncMiruServer) -> None:
+ async def test_method_create_with_all_params(self, async_client: AsyncMiru) -> None:
deployment = await async_client.deployments.create(
description="Update safety mode to 'manual'",
device_id="dvc_123",
@@ -369,7 +369,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncMiruServer
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_raw_response_create(self, async_client: AsyncMiruServer) -> None:
+ async def test_raw_response_create(self, async_client: AsyncMiru) -> None:
response = await async_client.deployments.with_raw_response.create(
description="Update safety mode to 'manual'",
device_id="dvc_123",
@@ -395,7 +395,7 @@ async def test_raw_response_create(self, async_client: AsyncMiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_streaming_response_create(self, async_client: AsyncMiruServer) -> None:
+ async def test_streaming_response_create(self, async_client: AsyncMiru) -> None:
async with async_client.deployments.with_streaming_response.create(
description="Update safety mode to 'manual'",
device_id="dvc_123",
@@ -423,7 +423,7 @@ async def test_streaming_response_create(self, async_client: AsyncMiruServer) ->
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_method_retrieve(self, async_client: AsyncMiruServer) -> None:
+ async def test_method_retrieve(self, async_client: AsyncMiru) -> None:
deployment = await async_client.deployments.retrieve(
deployment_id="dpl_123",
)
@@ -431,7 +431,7 @@ async def test_method_retrieve(self, async_client: AsyncMiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_method_retrieve_with_all_params(self, async_client: AsyncMiruServer) -> None:
+ async def test_method_retrieve_with_all_params(self, async_client: AsyncMiru) -> None:
deployment = await async_client.deployments.retrieve(
deployment_id="dpl_123",
expand=["device"],
@@ -440,7 +440,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncMiruServ
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_raw_response_retrieve(self, async_client: AsyncMiruServer) -> None:
+ async def test_raw_response_retrieve(self, async_client: AsyncMiru) -> None:
response = await async_client.deployments.with_raw_response.retrieve(
deployment_id="dpl_123",
)
@@ -452,7 +452,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncMiruServer) -> Non
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_streaming_response_retrieve(self, async_client: AsyncMiruServer) -> None:
+ async def test_streaming_response_retrieve(self, async_client: AsyncMiru) -> None:
async with async_client.deployments.with_streaming_response.retrieve(
deployment_id="dpl_123",
) as response:
@@ -466,7 +466,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncMiruServer)
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_path_params_retrieve(self, async_client: AsyncMiruServer) -> None:
+ async def test_path_params_retrieve(self, async_client: AsyncMiru) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `deployment_id` but received ''"):
await async_client.deployments.with_raw_response.retrieve(
deployment_id="",
@@ -474,13 +474,13 @@ async def test_path_params_retrieve(self, async_client: AsyncMiruServer) -> None
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_method_list(self, async_client: AsyncMiruServer) -> None:
+ async def test_method_list(self, async_client: AsyncMiru) -> None:
deployment = await async_client.deployments.list()
assert_matches_type(DeploymentListResponse, deployment, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_method_list_with_all_params(self, async_client: AsyncMiruServer) -> None:
+ async def test_method_list_with_all_params(self, async_client: AsyncMiru) -> None:
deployment = await async_client.deployments.list(
id="dpl_123",
activity_status="validating",
@@ -497,7 +497,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncMiruServer)
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_raw_response_list(self, async_client: AsyncMiruServer) -> None:
+ async def test_raw_response_list(self, async_client: AsyncMiru) -> None:
response = await async_client.deployments.with_raw_response.list()
assert response.is_closed is True
@@ -507,7 +507,7 @@ async def test_raw_response_list(self, async_client: AsyncMiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_streaming_response_list(self, async_client: AsyncMiruServer) -> None:
+ async def test_streaming_response_list(self, async_client: AsyncMiru) -> None:
async with async_client.deployments.with_streaming_response.list() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -519,7 +519,7 @@ async def test_streaming_response_list(self, async_client: AsyncMiruServer) -> N
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_method_validate(self, async_client: AsyncMiruServer) -> None:
+ async def test_method_validate(self, async_client: AsyncMiru) -> None:
deployment = await async_client.deployments.validate(
deployment_id="dpl_123",
config_instances=[
@@ -541,7 +541,7 @@ async def test_method_validate(self, async_client: AsyncMiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_raw_response_validate(self, async_client: AsyncMiruServer) -> None:
+ async def test_raw_response_validate(self, async_client: AsyncMiru) -> None:
response = await async_client.deployments.with_raw_response.validate(
deployment_id="dpl_123",
config_instances=[
@@ -567,7 +567,7 @@ async def test_raw_response_validate(self, async_client: AsyncMiruServer) -> Non
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_streaming_response_validate(self, async_client: AsyncMiruServer) -> None:
+ async def test_streaming_response_validate(self, async_client: AsyncMiru) -> None:
async with async_client.deployments.with_streaming_response.validate(
deployment_id="dpl_123",
config_instances=[
@@ -595,7 +595,7 @@ async def test_streaming_response_validate(self, async_client: AsyncMiruServer)
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_path_params_validate(self, async_client: AsyncMiruServer) -> None:
+ async def test_path_params_validate(self, async_client: AsyncMiru) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `deployment_id` but received ''"):
await async_client.deployments.with_raw_response.validate(
deployment_id="",
diff --git a/tests/api_resources/test_devices.py b/tests/api_resources/test_devices.py
index 5efe6f8..334a261 100644
--- a/tests/api_resources/test_devices.py
+++ b/tests/api_resources/test_devices.py
@@ -7,14 +7,14 @@
import pytest
-from miru_server import MiruServer, AsyncMiruServer
-from tests.utils import assert_matches_type
-from miru_server.types import (
+from miru import Miru, AsyncMiru
+from miru.types import (
Device,
DeviceListResponse,
DeviceDeleteResponse,
DeviceCreateActivationTokenResponse,
)
+from tests.utils import assert_matches_type
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -24,7 +24,7 @@ class TestDevices:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_method_create(self, client: MiruServer) -> None:
+ def test_method_create(self, client: Miru) -> None:
device = client.devices.create(
name="Robot 1",
)
@@ -32,7 +32,7 @@ def test_method_create(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_raw_response_create(self, client: MiruServer) -> None:
+ def test_raw_response_create(self, client: Miru) -> None:
response = client.devices.with_raw_response.create(
name="Robot 1",
)
@@ -44,7 +44,7 @@ def test_raw_response_create(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_streaming_response_create(self, client: MiruServer) -> None:
+ def test_streaming_response_create(self, client: Miru) -> None:
with client.devices.with_streaming_response.create(
name="Robot 1",
) as response:
@@ -58,7 +58,7 @@ def test_streaming_response_create(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_method_retrieve(self, client: MiruServer) -> None:
+ def test_method_retrieve(self, client: Miru) -> None:
device = client.devices.retrieve(
"dvc_123",
)
@@ -66,7 +66,7 @@ def test_method_retrieve(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_raw_response_retrieve(self, client: MiruServer) -> None:
+ def test_raw_response_retrieve(self, client: Miru) -> None:
response = client.devices.with_raw_response.retrieve(
"dvc_123",
)
@@ -78,7 +78,7 @@ def test_raw_response_retrieve(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_streaming_response_retrieve(self, client: MiruServer) -> None:
+ def test_streaming_response_retrieve(self, client: Miru) -> None:
with client.devices.with_streaming_response.retrieve(
"dvc_123",
) as response:
@@ -92,7 +92,7 @@ def test_streaming_response_retrieve(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_path_params_retrieve(self, client: MiruServer) -> None:
+ def test_path_params_retrieve(self, client: Miru) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `device_id` but received ''"):
client.devices.with_raw_response.retrieve(
"",
@@ -100,7 +100,7 @@ def test_path_params_retrieve(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_method_update(self, client: MiruServer) -> None:
+ def test_method_update(self, client: Miru) -> None:
device = client.devices.update(
device_id="dvc_123",
)
@@ -108,7 +108,7 @@ def test_method_update(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_method_update_with_all_params(self, client: MiruServer) -> None:
+ def test_method_update_with_all_params(self, client: Miru) -> None:
device = client.devices.update(
device_id="dvc_123",
name="Robot 1",
@@ -117,7 +117,7 @@ def test_method_update_with_all_params(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_raw_response_update(self, client: MiruServer) -> None:
+ def test_raw_response_update(self, client: Miru) -> None:
response = client.devices.with_raw_response.update(
device_id="dvc_123",
)
@@ -129,7 +129,7 @@ def test_raw_response_update(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_streaming_response_update(self, client: MiruServer) -> None:
+ def test_streaming_response_update(self, client: Miru) -> None:
with client.devices.with_streaming_response.update(
device_id="dvc_123",
) as response:
@@ -143,7 +143,7 @@ def test_streaming_response_update(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_path_params_update(self, client: MiruServer) -> None:
+ def test_path_params_update(self, client: Miru) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `device_id` but received ''"):
client.devices.with_raw_response.update(
device_id="",
@@ -151,13 +151,13 @@ def test_path_params_update(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_method_list(self, client: MiruServer) -> None:
+ def test_method_list(self, client: Miru) -> None:
device = client.devices.list()
assert_matches_type(DeviceListResponse, device, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_method_list_with_all_params(self, client: MiruServer) -> None:
+ def test_method_list_with_all_params(self, client: Miru) -> None:
device = client.devices.list(
id="dev_123",
agent_version="v1.0.0",
@@ -172,7 +172,7 @@ def test_method_list_with_all_params(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_raw_response_list(self, client: MiruServer) -> None:
+ def test_raw_response_list(self, client: Miru) -> None:
response = client.devices.with_raw_response.list()
assert response.is_closed is True
@@ -182,7 +182,7 @@ def test_raw_response_list(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_streaming_response_list(self, client: MiruServer) -> None:
+ def test_streaming_response_list(self, client: Miru) -> None:
with client.devices.with_streaming_response.list() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -194,7 +194,7 @@ def test_streaming_response_list(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_method_delete(self, client: MiruServer) -> None:
+ def test_method_delete(self, client: Miru) -> None:
device = client.devices.delete(
"dvc_123",
)
@@ -202,7 +202,7 @@ def test_method_delete(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_raw_response_delete(self, client: MiruServer) -> None:
+ def test_raw_response_delete(self, client: Miru) -> None:
response = client.devices.with_raw_response.delete(
"dvc_123",
)
@@ -214,7 +214,7 @@ def test_raw_response_delete(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_streaming_response_delete(self, client: MiruServer) -> None:
+ def test_streaming_response_delete(self, client: Miru) -> None:
with client.devices.with_streaming_response.delete(
"dvc_123",
) as response:
@@ -228,7 +228,7 @@ def test_streaming_response_delete(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_path_params_delete(self, client: MiruServer) -> None:
+ def test_path_params_delete(self, client: Miru) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `device_id` but received ''"):
client.devices.with_raw_response.delete(
"",
@@ -236,7 +236,7 @@ def test_path_params_delete(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_method_create_activation_token(self, client: MiruServer) -> None:
+ def test_method_create_activation_token(self, client: Miru) -> None:
device = client.devices.create_activation_token(
device_id="dvc_123",
)
@@ -244,7 +244,7 @@ def test_method_create_activation_token(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_method_create_activation_token_with_all_params(self, client: MiruServer) -> None:
+ def test_method_create_activation_token_with_all_params(self, client: Miru) -> None:
device = client.devices.create_activation_token(
device_id="dvc_123",
allow_reactivation=False,
@@ -253,7 +253,7 @@ def test_method_create_activation_token_with_all_params(self, client: MiruServer
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_raw_response_create_activation_token(self, client: MiruServer) -> None:
+ def test_raw_response_create_activation_token(self, client: Miru) -> None:
response = client.devices.with_raw_response.create_activation_token(
device_id="dvc_123",
)
@@ -265,7 +265,7 @@ def test_raw_response_create_activation_token(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_streaming_response_create_activation_token(self, client: MiruServer) -> None:
+ def test_streaming_response_create_activation_token(self, client: Miru) -> None:
with client.devices.with_streaming_response.create_activation_token(
device_id="dvc_123",
) as response:
@@ -279,7 +279,7 @@ def test_streaming_response_create_activation_token(self, client: MiruServer) ->
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_path_params_create_activation_token(self, client: MiruServer) -> None:
+ def test_path_params_create_activation_token(self, client: Miru) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `device_id` but received ''"):
client.devices.with_raw_response.create_activation_token(
device_id="",
@@ -293,7 +293,7 @@ class TestAsyncDevices:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_method_create(self, async_client: AsyncMiruServer) -> None:
+ async def test_method_create(self, async_client: AsyncMiru) -> None:
device = await async_client.devices.create(
name="Robot 1",
)
@@ -301,7 +301,7 @@ async def test_method_create(self, async_client: AsyncMiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_raw_response_create(self, async_client: AsyncMiruServer) -> None:
+ async def test_raw_response_create(self, async_client: AsyncMiru) -> None:
response = await async_client.devices.with_raw_response.create(
name="Robot 1",
)
@@ -313,7 +313,7 @@ async def test_raw_response_create(self, async_client: AsyncMiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_streaming_response_create(self, async_client: AsyncMiruServer) -> None:
+ async def test_streaming_response_create(self, async_client: AsyncMiru) -> None:
async with async_client.devices.with_streaming_response.create(
name="Robot 1",
) as response:
@@ -327,7 +327,7 @@ async def test_streaming_response_create(self, async_client: AsyncMiruServer) ->
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_method_retrieve(self, async_client: AsyncMiruServer) -> None:
+ async def test_method_retrieve(self, async_client: AsyncMiru) -> None:
device = await async_client.devices.retrieve(
"dvc_123",
)
@@ -335,7 +335,7 @@ async def test_method_retrieve(self, async_client: AsyncMiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_raw_response_retrieve(self, async_client: AsyncMiruServer) -> None:
+ async def test_raw_response_retrieve(self, async_client: AsyncMiru) -> None:
response = await async_client.devices.with_raw_response.retrieve(
"dvc_123",
)
@@ -347,7 +347,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncMiruServer) -> Non
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_streaming_response_retrieve(self, async_client: AsyncMiruServer) -> None:
+ async def test_streaming_response_retrieve(self, async_client: AsyncMiru) -> None:
async with async_client.devices.with_streaming_response.retrieve(
"dvc_123",
) as response:
@@ -361,7 +361,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncMiruServer)
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_path_params_retrieve(self, async_client: AsyncMiruServer) -> None:
+ async def test_path_params_retrieve(self, async_client: AsyncMiru) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `device_id` but received ''"):
await async_client.devices.with_raw_response.retrieve(
"",
@@ -369,7 +369,7 @@ async def test_path_params_retrieve(self, async_client: AsyncMiruServer) -> None
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_method_update(self, async_client: AsyncMiruServer) -> None:
+ async def test_method_update(self, async_client: AsyncMiru) -> None:
device = await async_client.devices.update(
device_id="dvc_123",
)
@@ -377,7 +377,7 @@ async def test_method_update(self, async_client: AsyncMiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_method_update_with_all_params(self, async_client: AsyncMiruServer) -> None:
+ async def test_method_update_with_all_params(self, async_client: AsyncMiru) -> None:
device = await async_client.devices.update(
device_id="dvc_123",
name="Robot 1",
@@ -386,7 +386,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncMiruServer
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_raw_response_update(self, async_client: AsyncMiruServer) -> None:
+ async def test_raw_response_update(self, async_client: AsyncMiru) -> None:
response = await async_client.devices.with_raw_response.update(
device_id="dvc_123",
)
@@ -398,7 +398,7 @@ async def test_raw_response_update(self, async_client: AsyncMiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_streaming_response_update(self, async_client: AsyncMiruServer) -> None:
+ async def test_streaming_response_update(self, async_client: AsyncMiru) -> None:
async with async_client.devices.with_streaming_response.update(
device_id="dvc_123",
) as response:
@@ -412,7 +412,7 @@ async def test_streaming_response_update(self, async_client: AsyncMiruServer) ->
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_path_params_update(self, async_client: AsyncMiruServer) -> None:
+ async def test_path_params_update(self, async_client: AsyncMiru) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `device_id` but received ''"):
await async_client.devices.with_raw_response.update(
device_id="",
@@ -420,13 +420,13 @@ async def test_path_params_update(self, async_client: AsyncMiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_method_list(self, async_client: AsyncMiruServer) -> None:
+ async def test_method_list(self, async_client: AsyncMiru) -> None:
device = await async_client.devices.list()
assert_matches_type(DeviceListResponse, device, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_method_list_with_all_params(self, async_client: AsyncMiruServer) -> None:
+ async def test_method_list_with_all_params(self, async_client: AsyncMiru) -> None:
device = await async_client.devices.list(
id="dev_123",
agent_version="v1.0.0",
@@ -441,7 +441,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncMiruServer)
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_raw_response_list(self, async_client: AsyncMiruServer) -> None:
+ async def test_raw_response_list(self, async_client: AsyncMiru) -> None:
response = await async_client.devices.with_raw_response.list()
assert response.is_closed is True
@@ -451,7 +451,7 @@ async def test_raw_response_list(self, async_client: AsyncMiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_streaming_response_list(self, async_client: AsyncMiruServer) -> None:
+ async def test_streaming_response_list(self, async_client: AsyncMiru) -> None:
async with async_client.devices.with_streaming_response.list() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -463,7 +463,7 @@ async def test_streaming_response_list(self, async_client: AsyncMiruServer) -> N
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_method_delete(self, async_client: AsyncMiruServer) -> None:
+ async def test_method_delete(self, async_client: AsyncMiru) -> None:
device = await async_client.devices.delete(
"dvc_123",
)
@@ -471,7 +471,7 @@ async def test_method_delete(self, async_client: AsyncMiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_raw_response_delete(self, async_client: AsyncMiruServer) -> None:
+ async def test_raw_response_delete(self, async_client: AsyncMiru) -> None:
response = await async_client.devices.with_raw_response.delete(
"dvc_123",
)
@@ -483,7 +483,7 @@ async def test_raw_response_delete(self, async_client: AsyncMiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_streaming_response_delete(self, async_client: AsyncMiruServer) -> None:
+ async def test_streaming_response_delete(self, async_client: AsyncMiru) -> None:
async with async_client.devices.with_streaming_response.delete(
"dvc_123",
) as response:
@@ -497,7 +497,7 @@ async def test_streaming_response_delete(self, async_client: AsyncMiruServer) ->
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_path_params_delete(self, async_client: AsyncMiruServer) -> None:
+ async def test_path_params_delete(self, async_client: AsyncMiru) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `device_id` but received ''"):
await async_client.devices.with_raw_response.delete(
"",
@@ -505,7 +505,7 @@ async def test_path_params_delete(self, async_client: AsyncMiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_method_create_activation_token(self, async_client: AsyncMiruServer) -> None:
+ async def test_method_create_activation_token(self, async_client: AsyncMiru) -> None:
device = await async_client.devices.create_activation_token(
device_id="dvc_123",
)
@@ -513,7 +513,7 @@ async def test_method_create_activation_token(self, async_client: AsyncMiruServe
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_method_create_activation_token_with_all_params(self, async_client: AsyncMiruServer) -> None:
+ async def test_method_create_activation_token_with_all_params(self, async_client: AsyncMiru) -> None:
device = await async_client.devices.create_activation_token(
device_id="dvc_123",
allow_reactivation=False,
@@ -522,7 +522,7 @@ async def test_method_create_activation_token_with_all_params(self, async_client
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_raw_response_create_activation_token(self, async_client: AsyncMiruServer) -> None:
+ async def test_raw_response_create_activation_token(self, async_client: AsyncMiru) -> None:
response = await async_client.devices.with_raw_response.create_activation_token(
device_id="dvc_123",
)
@@ -534,7 +534,7 @@ async def test_raw_response_create_activation_token(self, async_client: AsyncMir
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_streaming_response_create_activation_token(self, async_client: AsyncMiruServer) -> None:
+ async def test_streaming_response_create_activation_token(self, async_client: AsyncMiru) -> None:
async with async_client.devices.with_streaming_response.create_activation_token(
device_id="dvc_123",
) as response:
@@ -548,7 +548,7 @@ async def test_streaming_response_create_activation_token(self, async_client: As
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_path_params_create_activation_token(self, async_client: AsyncMiruServer) -> None:
+ async def test_path_params_create_activation_token(self, async_client: AsyncMiru) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `device_id` but received ''"):
await async_client.devices.with_raw_response.create_activation_token(
device_id="",
diff --git a/tests/api_resources/test_releases.py b/tests/api_resources/test_releases.py
index f61bbbf..8f4ca2d 100644
--- a/tests/api_resources/test_releases.py
+++ b/tests/api_resources/test_releases.py
@@ -7,9 +7,9 @@
import pytest
-from miru_server import MiruServer, AsyncMiruServer
+from miru import Miru, AsyncMiru
+from miru.types import Release, ReleaseListResponse
from tests.utils import assert_matches_type
-from miru_server.types import Release, ReleaseListResponse
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -19,7 +19,7 @@ class TestReleases:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_method_retrieve(self, client: MiruServer) -> None:
+ def test_method_retrieve(self, client: Miru) -> None:
release = client.releases.retrieve(
release_id="rls_123",
)
@@ -27,7 +27,7 @@ def test_method_retrieve(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_method_retrieve_with_all_params(self, client: MiruServer) -> None:
+ def test_method_retrieve_with_all_params(self, client: Miru) -> None:
release = client.releases.retrieve(
release_id="rls_123",
expand=["config_schemas"],
@@ -36,7 +36,7 @@ def test_method_retrieve_with_all_params(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_raw_response_retrieve(self, client: MiruServer) -> None:
+ def test_raw_response_retrieve(self, client: Miru) -> None:
response = client.releases.with_raw_response.retrieve(
release_id="rls_123",
)
@@ -48,7 +48,7 @@ def test_raw_response_retrieve(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_streaming_response_retrieve(self, client: MiruServer) -> None:
+ def test_streaming_response_retrieve(self, client: Miru) -> None:
with client.releases.with_streaming_response.retrieve(
release_id="rls_123",
) as response:
@@ -62,7 +62,7 @@ def test_streaming_response_retrieve(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_path_params_retrieve(self, client: MiruServer) -> None:
+ def test_path_params_retrieve(self, client: Miru) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `release_id` but received ''"):
client.releases.with_raw_response.retrieve(
release_id="",
@@ -70,13 +70,13 @@ def test_path_params_retrieve(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_method_list(self, client: MiruServer) -> None:
+ def test_method_list(self, client: Miru) -> None:
release = client.releases.list()
assert_matches_type(ReleaseListResponse, release, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_method_list_with_all_params(self, client: MiruServer) -> None:
+ def test_method_list_with_all_params(self, client: Miru) -> None:
release = client.releases.list(
id="rls_123",
expand=["total_count"],
@@ -89,7 +89,7 @@ def test_method_list_with_all_params(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_raw_response_list(self, client: MiruServer) -> None:
+ def test_raw_response_list(self, client: Miru) -> None:
response = client.releases.with_raw_response.list()
assert response.is_closed is True
@@ -99,7 +99,7 @@ def test_raw_response_list(self, client: MiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- def test_streaming_response_list(self, client: MiruServer) -> None:
+ def test_streaming_response_list(self, client: Miru) -> None:
with client.releases.with_streaming_response.list() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -117,7 +117,7 @@ class TestAsyncReleases:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_method_retrieve(self, async_client: AsyncMiruServer) -> None:
+ async def test_method_retrieve(self, async_client: AsyncMiru) -> None:
release = await async_client.releases.retrieve(
release_id="rls_123",
)
@@ -125,7 +125,7 @@ async def test_method_retrieve(self, async_client: AsyncMiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_method_retrieve_with_all_params(self, async_client: AsyncMiruServer) -> None:
+ async def test_method_retrieve_with_all_params(self, async_client: AsyncMiru) -> None:
release = await async_client.releases.retrieve(
release_id="rls_123",
expand=["config_schemas"],
@@ -134,7 +134,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncMiruServ
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_raw_response_retrieve(self, async_client: AsyncMiruServer) -> None:
+ async def test_raw_response_retrieve(self, async_client: AsyncMiru) -> None:
response = await async_client.releases.with_raw_response.retrieve(
release_id="rls_123",
)
@@ -146,7 +146,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncMiruServer) -> Non
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_streaming_response_retrieve(self, async_client: AsyncMiruServer) -> None:
+ async def test_streaming_response_retrieve(self, async_client: AsyncMiru) -> None:
async with async_client.releases.with_streaming_response.retrieve(
release_id="rls_123",
) as response:
@@ -160,7 +160,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncMiruServer)
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_path_params_retrieve(self, async_client: AsyncMiruServer) -> None:
+ async def test_path_params_retrieve(self, async_client: AsyncMiru) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `release_id` but received ''"):
await async_client.releases.with_raw_response.retrieve(
release_id="",
@@ -168,13 +168,13 @@ async def test_path_params_retrieve(self, async_client: AsyncMiruServer) -> None
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_method_list(self, async_client: AsyncMiruServer) -> None:
+ async def test_method_list(self, async_client: AsyncMiru) -> None:
release = await async_client.releases.list()
assert_matches_type(ReleaseListResponse, release, path=["response"])
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_method_list_with_all_params(self, async_client: AsyncMiruServer) -> None:
+ async def test_method_list_with_all_params(self, async_client: AsyncMiru) -> None:
release = await async_client.releases.list(
id="rls_123",
expand=["total_count"],
@@ -187,7 +187,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncMiruServer)
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_raw_response_list(self, async_client: AsyncMiruServer) -> None:
+ async def test_raw_response_list(self, async_client: AsyncMiru) -> None:
response = await async_client.releases.with_raw_response.list()
assert response.is_closed is True
@@ -197,7 +197,7 @@ async def test_raw_response_list(self, async_client: AsyncMiruServer) -> None:
@pytest.mark.skip(reason="Prism tests are disabled")
@parametrize
- async def test_streaming_response_list(self, async_client: AsyncMiruServer) -> None:
+ async def test_streaming_response_list(self, async_client: AsyncMiru) -> None:
async with async_client.releases.with_streaming_response.list() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
diff --git a/tests/conftest.py b/tests/conftest.py
index c55c1b5..8ed685b 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -10,15 +10,15 @@
import pytest
from pytest_asyncio import is_async_test
-from miru_server import MiruServer, AsyncMiruServer, DefaultAioHttpClient
-from miru_server._utils import is_dict
+from miru import Miru, AsyncMiru, DefaultAioHttpClient
+from miru._utils import is_dict
if TYPE_CHECKING:
from _pytest.fixtures import FixtureRequest # pyright: ignore[reportPrivateImportUsage]
pytest.register_assert_rewrite("tests.utils")
-logging.getLogger("miru_server").setLevel(logging.DEBUG)
+logging.getLogger("miru").setLevel(logging.DEBUG)
# automatically add `pytest.mark.asyncio()` to all of our async tests
@@ -49,17 +49,17 @@ def pytest_collection_modifyitems(items: list[pytest.Function]) -> None:
@pytest.fixture(scope="session")
-def client(request: FixtureRequest) -> Iterator[MiruServer]:
+def client(request: FixtureRequest) -> Iterator[Miru]:
strict = getattr(request, "param", True)
if not isinstance(strict, bool):
raise TypeError(f"Unexpected fixture parameter type {type(strict)}, expected {bool}")
- with MiruServer(base_url=base_url, api_key=api_key, _strict_response_validation=strict) as client:
+ with Miru(base_url=base_url, api_key=api_key, _strict_response_validation=strict) as client:
yield client
@pytest.fixture(scope="session")
-async def async_client(request: FixtureRequest) -> AsyncIterator[AsyncMiruServer]:
+async def async_client(request: FixtureRequest) -> AsyncIterator[AsyncMiru]:
param = getattr(request, "param", True)
# defaults
@@ -78,7 +78,7 @@ async def async_client(request: FixtureRequest) -> AsyncIterator[AsyncMiruServer
else:
raise TypeError(f"Unexpected fixture parameter type {type(param)}, expected bool or dict")
- async with AsyncMiruServer(
+ async with AsyncMiru(
base_url=base_url, api_key=api_key, _strict_response_validation=strict, http_client=http_client
) as client:
yield client
diff --git a/tests/test_client.py b/tests/test_client.py
index 76affd0..e0c2639 100644
--- a/tests/test_client.py
+++ b/tests/test_client.py
@@ -18,12 +18,12 @@
from respx import MockRouter
from pydantic import ValidationError
-from miru_server import MiruServer, AsyncMiruServer, APIResponseValidationError
-from miru_server._types import Omit
-from miru_server._utils import asyncify
-from miru_server._models import BaseModel, FinalRequestOptions
-from miru_server._exceptions import APIStatusError, APITimeoutError, MiruServerError, APIResponseValidationError
-from miru_server._base_client import (
+from miru import Miru, AsyncMiru, APIResponseValidationError
+from miru._types import Omit
+from miru._utils import asyncify
+from miru._models import BaseModel, FinalRequestOptions
+from miru._exceptions import MiruError, APIStatusError, APITimeoutError, APIResponseValidationError
+from miru._base_client import (
DEFAULT_TIMEOUT,
HTTPX_DEFAULT_TIMEOUT,
BaseClient,
@@ -50,7 +50,7 @@ def _low_retry_timeout(*_args: Any, **_kwargs: Any) -> float:
return 0.1
-def _get_open_connections(client: MiruServer | AsyncMiruServer) -> int:
+def _get_open_connections(client: Miru | AsyncMiru) -> int:
transport = client._client._transport
assert isinstance(transport, httpx.HTTPTransport) or isinstance(transport, httpx.AsyncHTTPTransport)
@@ -58,8 +58,8 @@ def _get_open_connections(client: MiruServer | AsyncMiruServer) -> int:
return len(pool._requests)
-class TestMiruServer:
- client = MiruServer(base_url=base_url, api_key=api_key, _strict_response_validation=True)
+class TestMiru:
+ client = Miru(base_url=base_url, api_key=api_key, _strict_response_validation=True)
@pytest.mark.respx(base_url=base_url)
def test_raw_response(self, respx_mock: MockRouter) -> None:
@@ -106,7 +106,7 @@ def test_copy_default_options(self) -> None:
assert isinstance(self.client.timeout, httpx.Timeout)
def test_copy_default_headers(self) -> None:
- client = MiruServer(
+ client = Miru(
base_url=base_url, api_key=api_key, _strict_response_validation=True, default_headers={"X-Foo": "bar"}
)
assert client.default_headers["X-Foo"] == "bar"
@@ -140,7 +140,7 @@ def test_copy_default_headers(self) -> None:
client.copy(set_default_headers={}, default_headers={"X-Foo": "Bar"})
def test_copy_default_query(self) -> None:
- client = MiruServer(
+ client = Miru(
base_url=base_url, api_key=api_key, _strict_response_validation=True, default_query={"foo": "bar"}
)
assert _get_params(client)["foo"] == "bar"
@@ -232,10 +232,10 @@ def add_leak(leaks: list[tracemalloc.StatisticDiff], diff: tracemalloc.Statistic
# to_raw_response_wrapper leaks through the @functools.wraps() decorator.
#
# removing the decorator fixes the leak for reasons we don't understand.
- "miru_server/_legacy_response.py",
- "miru_server/_response.py",
+ "miru/_legacy_response.py",
+ "miru/_response.py",
# pydantic.BaseModel.model_dump || pydantic.BaseModel.dict leak memory for some reason.
- "miru_server/_compat.py",
+ "miru/_compat.py",
# Standard library leaks we don't care about.
"/logging/__init__.py",
]
@@ -266,9 +266,7 @@ def test_request_timeout(self) -> None:
assert timeout == httpx.Timeout(100.0)
def test_client_timeout_option(self) -> None:
- client = MiruServer(
- base_url=base_url, api_key=api_key, _strict_response_validation=True, timeout=httpx.Timeout(0)
- )
+ client = Miru(base_url=base_url, api_key=api_key, _strict_response_validation=True, timeout=httpx.Timeout(0))
request = client._build_request(FinalRequestOptions(method="get", url="/foo"))
timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore
@@ -277,9 +275,7 @@ def test_client_timeout_option(self) -> None:
def test_http_client_timeout_option(self) -> None:
# custom timeout given to the httpx client should be used
with httpx.Client(timeout=None) as http_client:
- client = MiruServer(
- base_url=base_url, api_key=api_key, _strict_response_validation=True, http_client=http_client
- )
+ client = Miru(base_url=base_url, api_key=api_key, _strict_response_validation=True, http_client=http_client)
request = client._build_request(FinalRequestOptions(method="get", url="/foo"))
timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore
@@ -287,9 +283,7 @@ def test_http_client_timeout_option(self) -> None:
# no timeout given to the httpx client should not use the httpx default
with httpx.Client() as http_client:
- client = MiruServer(
- base_url=base_url, api_key=api_key, _strict_response_validation=True, http_client=http_client
- )
+ client = Miru(base_url=base_url, api_key=api_key, _strict_response_validation=True, http_client=http_client)
request = client._build_request(FinalRequestOptions(method="get", url="/foo"))
timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore
@@ -297,9 +291,7 @@ def test_http_client_timeout_option(self) -> None:
# explicitly passing the default timeout currently results in it being ignored
with httpx.Client(timeout=HTTPX_DEFAULT_TIMEOUT) as http_client:
- client = MiruServer(
- base_url=base_url, api_key=api_key, _strict_response_validation=True, http_client=http_client
- )
+ client = Miru(base_url=base_url, api_key=api_key, _strict_response_validation=True, http_client=http_client)
request = client._build_request(FinalRequestOptions(method="get", url="/foo"))
timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore
@@ -308,7 +300,7 @@ def test_http_client_timeout_option(self) -> None:
async def test_invalid_http_client(self) -> None:
with pytest.raises(TypeError, match="Invalid `http_client` arg"):
async with httpx.AsyncClient() as http_client:
- MiruServer(
+ Miru(
base_url=base_url,
api_key=api_key,
_strict_response_validation=True,
@@ -316,14 +308,14 @@ async def test_invalid_http_client(self) -> None:
)
def test_default_headers_option(self) -> None:
- client = MiruServer(
+ client = Miru(
base_url=base_url, api_key=api_key, _strict_response_validation=True, default_headers={"X-Foo": "bar"}
)
request = client._build_request(FinalRequestOptions(method="get", url="/foo"))
assert request.headers.get("x-foo") == "bar"
assert request.headers.get("x-stainless-lang") == "python"
- client2 = MiruServer(
+ client2 = Miru(
base_url=base_url,
api_key=api_key,
_strict_response_validation=True,
@@ -337,17 +329,17 @@ def test_default_headers_option(self) -> None:
assert request.headers.get("x-stainless-lang") == "my-overriding-header"
def test_validate_headers(self) -> None:
- client = MiruServer(base_url=base_url, api_key=api_key, _strict_response_validation=True)
+ client = Miru(base_url=base_url, api_key=api_key, _strict_response_validation=True)
request = client._build_request(FinalRequestOptions(method="get", url="/foo"))
assert request.headers.get("X-API-Key") == api_key
- with pytest.raises(MiruServerError):
+ with pytest.raises(MiruError):
with update_env(**{"MIRU_SERVER_API_KEY": Omit()}):
- client2 = MiruServer(base_url=base_url, api_key=None, _strict_response_validation=True)
+ client2 = Miru(base_url=base_url, api_key=None, _strict_response_validation=True)
_ = client2
def test_default_query_option(self) -> None:
- client = MiruServer(
+ client = Miru(
base_url=base_url, api_key=api_key, _strict_response_validation=True, default_query={"query_param": "bar"}
)
request = client._build_request(FinalRequestOptions(method="get", url="/foo"))
@@ -461,7 +453,7 @@ def test_request_extra_query(self) -> None:
params = dict(request.url.params)
assert params == {"foo": "2"}
- def test_multipart_repeating_array(self, client: MiruServer) -> None:
+ def test_multipart_repeating_array(self, client: Miru) -> None:
request = client._build_request(
FinalRequestOptions.construct(
method="post",
@@ -548,7 +540,7 @@ class Model(BaseModel):
assert response.foo == 2
def test_base_url_setter(self) -> None:
- client = MiruServer(base_url="https://example.com/from_init", api_key=api_key, _strict_response_validation=True)
+ client = Miru(base_url="https://example.com/from_init", api_key=api_key, _strict_response_validation=True)
assert client.base_url == "https://example.com/from_init/"
client.base_url = "https://example.com/from_setter" # type: ignore[assignment]
@@ -556,17 +548,15 @@ def test_base_url_setter(self) -> None:
assert client.base_url == "https://example.com/from_setter/"
def test_base_url_env(self) -> None:
- with update_env(MIRU_SERVER_BASE_URL="http://localhost:5000/from/env"):
- client = MiruServer(api_key=api_key, _strict_response_validation=True)
+ with update_env(MIRU_BASE_URL="http://localhost:5000/from/env"):
+ client = Miru(api_key=api_key, _strict_response_validation=True)
assert client.base_url == "http://localhost:5000/from/env/"
@pytest.mark.parametrize(
"client",
[
- MiruServer(
- base_url="http://localhost:5000/custom/path/", api_key=api_key, _strict_response_validation=True
- ),
- MiruServer(
+ Miru(base_url="http://localhost:5000/custom/path/", api_key=api_key, _strict_response_validation=True),
+ Miru(
base_url="http://localhost:5000/custom/path/",
api_key=api_key,
_strict_response_validation=True,
@@ -575,7 +565,7 @@ def test_base_url_env(self) -> None:
],
ids=["standard", "custom http client"],
)
- def test_base_url_trailing_slash(self, client: MiruServer) -> None:
+ def test_base_url_trailing_slash(self, client: Miru) -> None:
request = client._build_request(
FinalRequestOptions(
method="post",
@@ -588,10 +578,8 @@ def test_base_url_trailing_slash(self, client: MiruServer) -> None:
@pytest.mark.parametrize(
"client",
[
- MiruServer(
- base_url="http://localhost:5000/custom/path/", api_key=api_key, _strict_response_validation=True
- ),
- MiruServer(
+ Miru(base_url="http://localhost:5000/custom/path/", api_key=api_key, _strict_response_validation=True),
+ Miru(
base_url="http://localhost:5000/custom/path/",
api_key=api_key,
_strict_response_validation=True,
@@ -600,7 +588,7 @@ def test_base_url_trailing_slash(self, client: MiruServer) -> None:
],
ids=["standard", "custom http client"],
)
- def test_base_url_no_trailing_slash(self, client: MiruServer) -> None:
+ def test_base_url_no_trailing_slash(self, client: Miru) -> None:
request = client._build_request(
FinalRequestOptions(
method="post",
@@ -613,10 +601,8 @@ def test_base_url_no_trailing_slash(self, client: MiruServer) -> None:
@pytest.mark.parametrize(
"client",
[
- MiruServer(
- base_url="http://localhost:5000/custom/path/", api_key=api_key, _strict_response_validation=True
- ),
- MiruServer(
+ Miru(base_url="http://localhost:5000/custom/path/", api_key=api_key, _strict_response_validation=True),
+ Miru(
base_url="http://localhost:5000/custom/path/",
api_key=api_key,
_strict_response_validation=True,
@@ -625,7 +611,7 @@ def test_base_url_no_trailing_slash(self, client: MiruServer) -> None:
],
ids=["standard", "custom http client"],
)
- def test_absolute_request_url(self, client: MiruServer) -> None:
+ def test_absolute_request_url(self, client: Miru) -> None:
request = client._build_request(
FinalRequestOptions(
method="post",
@@ -636,7 +622,7 @@ def test_absolute_request_url(self, client: MiruServer) -> None:
assert request.url == "https://myapi.com/foo"
def test_copied_client_does_not_close_http(self) -> None:
- client = MiruServer(base_url=base_url, api_key=api_key, _strict_response_validation=True)
+ client = Miru(base_url=base_url, api_key=api_key, _strict_response_validation=True)
assert not client.is_closed()
copied = client.copy()
@@ -647,7 +633,7 @@ def test_copied_client_does_not_close_http(self) -> None:
assert not client.is_closed()
def test_client_context_manager(self) -> None:
- client = MiruServer(base_url=base_url, api_key=api_key, _strict_response_validation=True)
+ client = Miru(base_url=base_url, api_key=api_key, _strict_response_validation=True)
with client as c2:
assert c2 is client
assert not c2.is_closed()
@@ -668,9 +654,7 @@ class Model(BaseModel):
def test_client_max_retries_validation(self) -> None:
with pytest.raises(TypeError, match=r"max_retries cannot be None"):
- MiruServer(
- base_url=base_url, api_key=api_key, _strict_response_validation=True, max_retries=cast(Any, None)
- )
+ Miru(base_url=base_url, api_key=api_key, _strict_response_validation=True, max_retries=cast(Any, None))
@pytest.mark.respx(base_url=base_url)
def test_received_text_for_expected_json(self, respx_mock: MockRouter) -> None:
@@ -679,12 +663,12 @@ class Model(BaseModel):
respx_mock.get("/foo").mock(return_value=httpx.Response(200, text="my-custom-format"))
- strict_client = MiruServer(base_url=base_url, api_key=api_key, _strict_response_validation=True)
+ strict_client = Miru(base_url=base_url, api_key=api_key, _strict_response_validation=True)
with pytest.raises(APIResponseValidationError):
strict_client.get("/foo", cast_to=Model)
- client = MiruServer(base_url=base_url, api_key=api_key, _strict_response_validation=False)
+ client = Miru(base_url=base_url, api_key=api_key, _strict_response_validation=False)
response = client.get("/foo", cast_to=Model)
assert isinstance(response, str) # type: ignore[unreachable]
@@ -712,16 +696,16 @@ class Model(BaseModel):
)
@mock.patch("time.time", mock.MagicMock(return_value=1696004797))
def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str, timeout: float) -> None:
- client = MiruServer(base_url=base_url, api_key=api_key, _strict_response_validation=True)
+ client = Miru(base_url=base_url, api_key=api_key, _strict_response_validation=True)
headers = httpx.Headers({"retry-after": retry_after})
options = FinalRequestOptions(method="get", url="/foo", max_retries=3)
calculated = client._calculate_retry_timeout(remaining_retries, options, headers)
assert calculated == pytest.approx(timeout, 0.5 * 0.875) # pyright: ignore[reportUnknownMemberType]
- @mock.patch("miru_server._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
+ @mock.patch("miru._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@pytest.mark.respx(base_url=base_url)
- def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter, client: MiruServer) -> None:
+ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter, client: Miru) -> None:
respx_mock.get("/config_instances/cfg_inst_123").mock(side_effect=httpx.TimeoutException("Test timeout error"))
with pytest.raises(APITimeoutError):
@@ -729,9 +713,9 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter, clien
assert _get_open_connections(self.client) == 0
- @mock.patch("miru_server._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
+ @mock.patch("miru._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@pytest.mark.respx(base_url=base_url)
- def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter, client: MiruServer) -> None:
+ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter, client: Miru) -> None:
respx_mock.get("/config_instances/cfg_inst_123").mock(return_value=httpx.Response(500))
with pytest.raises(APIStatusError):
@@ -739,12 +723,12 @@ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter, client
assert _get_open_connections(self.client) == 0
@pytest.mark.parametrize("failures_before_success", [0, 2, 4])
- @mock.patch("miru_server._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
+ @mock.patch("miru._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@pytest.mark.respx(base_url=base_url)
@pytest.mark.parametrize("failure_mode", ["status", "exception"])
def test_retries_taken(
self,
- client: MiruServer,
+ client: Miru,
failures_before_success: int,
failure_mode: Literal["status", "exception"],
respx_mock: MockRouter,
@@ -770,11 +754,9 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
assert int(response.http_request.headers.get("x-stainless-retry-count")) == failures_before_success
@pytest.mark.parametrize("failures_before_success", [0, 2, 4])
- @mock.patch("miru_server._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
+ @mock.patch("miru._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@pytest.mark.respx(base_url=base_url)
- def test_omit_retry_count_header(
- self, client: MiruServer, failures_before_success: int, respx_mock: MockRouter
- ) -> None:
+ def test_omit_retry_count_header(self, client: Miru, failures_before_success: int, respx_mock: MockRouter) -> None:
client = client.with_options(max_retries=4)
nb_retries = 0
@@ -795,10 +777,10 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0
@pytest.mark.parametrize("failures_before_success", [0, 2, 4])
- @mock.patch("miru_server._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
+ @mock.patch("miru._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@pytest.mark.respx(base_url=base_url)
def test_overwrite_retry_count_header(
- self, client: MiruServer, failures_before_success: int, respx_mock: MockRouter
+ self, client: Miru, failures_before_success: int, respx_mock: MockRouter
) -> None:
client = client.with_options(max_retries=4)
@@ -869,8 +851,8 @@ def test_follow_redirects_disabled(self, respx_mock: MockRouter) -> None:
assert exc_info.value.response.headers["Location"] == f"{base_url}/redirected"
-class TestAsyncMiruServer:
- client = AsyncMiruServer(base_url=base_url, api_key=api_key, _strict_response_validation=True)
+class TestAsyncMiru:
+ client = AsyncMiru(base_url=base_url, api_key=api_key, _strict_response_validation=True)
@pytest.mark.respx(base_url=base_url)
@pytest.mark.asyncio
@@ -919,7 +901,7 @@ def test_copy_default_options(self) -> None:
assert isinstance(self.client.timeout, httpx.Timeout)
def test_copy_default_headers(self) -> None:
- client = AsyncMiruServer(
+ client = AsyncMiru(
base_url=base_url, api_key=api_key, _strict_response_validation=True, default_headers={"X-Foo": "bar"}
)
assert client.default_headers["X-Foo"] == "bar"
@@ -953,7 +935,7 @@ def test_copy_default_headers(self) -> None:
client.copy(set_default_headers={}, default_headers={"X-Foo": "Bar"})
def test_copy_default_query(self) -> None:
- client = AsyncMiruServer(
+ client = AsyncMiru(
base_url=base_url, api_key=api_key, _strict_response_validation=True, default_query={"foo": "bar"}
)
assert _get_params(client)["foo"] == "bar"
@@ -1045,10 +1027,10 @@ def add_leak(leaks: list[tracemalloc.StatisticDiff], diff: tracemalloc.Statistic
# to_raw_response_wrapper leaks through the @functools.wraps() decorator.
#
# removing the decorator fixes the leak for reasons we don't understand.
- "miru_server/_legacy_response.py",
- "miru_server/_response.py",
+ "miru/_legacy_response.py",
+ "miru/_response.py",
# pydantic.BaseModel.model_dump || pydantic.BaseModel.dict leak memory for some reason.
- "miru_server/_compat.py",
+ "miru/_compat.py",
# Standard library leaks we don't care about.
"/logging/__init__.py",
]
@@ -1079,7 +1061,7 @@ async def test_request_timeout(self) -> None:
assert timeout == httpx.Timeout(100.0)
async def test_client_timeout_option(self) -> None:
- client = AsyncMiruServer(
+ client = AsyncMiru(
base_url=base_url, api_key=api_key, _strict_response_validation=True, timeout=httpx.Timeout(0)
)
@@ -1090,7 +1072,7 @@ async def test_client_timeout_option(self) -> None:
async def test_http_client_timeout_option(self) -> None:
# custom timeout given to the httpx client should be used
async with httpx.AsyncClient(timeout=None) as http_client:
- client = AsyncMiruServer(
+ client = AsyncMiru(
base_url=base_url, api_key=api_key, _strict_response_validation=True, http_client=http_client
)
@@ -1100,7 +1082,7 @@ async def test_http_client_timeout_option(self) -> None:
# no timeout given to the httpx client should not use the httpx default
async with httpx.AsyncClient() as http_client:
- client = AsyncMiruServer(
+ client = AsyncMiru(
base_url=base_url, api_key=api_key, _strict_response_validation=True, http_client=http_client
)
@@ -1110,7 +1092,7 @@ async def test_http_client_timeout_option(self) -> None:
# explicitly passing the default timeout currently results in it being ignored
async with httpx.AsyncClient(timeout=HTTPX_DEFAULT_TIMEOUT) as http_client:
- client = AsyncMiruServer(
+ client = AsyncMiru(
base_url=base_url, api_key=api_key, _strict_response_validation=True, http_client=http_client
)
@@ -1121,7 +1103,7 @@ async def test_http_client_timeout_option(self) -> None:
def test_invalid_http_client(self) -> None:
with pytest.raises(TypeError, match="Invalid `http_client` arg"):
with httpx.Client() as http_client:
- AsyncMiruServer(
+ AsyncMiru(
base_url=base_url,
api_key=api_key,
_strict_response_validation=True,
@@ -1129,14 +1111,14 @@ def test_invalid_http_client(self) -> None:
)
def test_default_headers_option(self) -> None:
- client = AsyncMiruServer(
+ client = AsyncMiru(
base_url=base_url, api_key=api_key, _strict_response_validation=True, default_headers={"X-Foo": "bar"}
)
request = client._build_request(FinalRequestOptions(method="get", url="/foo"))
assert request.headers.get("x-foo") == "bar"
assert request.headers.get("x-stainless-lang") == "python"
- client2 = AsyncMiruServer(
+ client2 = AsyncMiru(
base_url=base_url,
api_key=api_key,
_strict_response_validation=True,
@@ -1150,17 +1132,17 @@ def test_default_headers_option(self) -> None:
assert request.headers.get("x-stainless-lang") == "my-overriding-header"
def test_validate_headers(self) -> None:
- client = AsyncMiruServer(base_url=base_url, api_key=api_key, _strict_response_validation=True)
+ client = AsyncMiru(base_url=base_url, api_key=api_key, _strict_response_validation=True)
request = client._build_request(FinalRequestOptions(method="get", url="/foo"))
assert request.headers.get("X-API-Key") == api_key
- with pytest.raises(MiruServerError):
+ with pytest.raises(MiruError):
with update_env(**{"MIRU_SERVER_API_KEY": Omit()}):
- client2 = AsyncMiruServer(base_url=base_url, api_key=None, _strict_response_validation=True)
+ client2 = AsyncMiru(base_url=base_url, api_key=None, _strict_response_validation=True)
_ = client2
def test_default_query_option(self) -> None:
- client = AsyncMiruServer(
+ client = AsyncMiru(
base_url=base_url, api_key=api_key, _strict_response_validation=True, default_query={"query_param": "bar"}
)
request = client._build_request(FinalRequestOptions(method="get", url="/foo"))
@@ -1274,7 +1256,7 @@ def test_request_extra_query(self) -> None:
params = dict(request.url.params)
assert params == {"foo": "2"}
- def test_multipart_repeating_array(self, async_client: AsyncMiruServer) -> None:
+ def test_multipart_repeating_array(self, async_client: AsyncMiru) -> None:
request = async_client._build_request(
FinalRequestOptions.construct(
method="post",
@@ -1361,9 +1343,7 @@ class Model(BaseModel):
assert response.foo == 2
def test_base_url_setter(self) -> None:
- client = AsyncMiruServer(
- base_url="https://example.com/from_init", api_key=api_key, _strict_response_validation=True
- )
+ client = AsyncMiru(base_url="https://example.com/from_init", api_key=api_key, _strict_response_validation=True)
assert client.base_url == "https://example.com/from_init/"
client.base_url = "https://example.com/from_setter" # type: ignore[assignment]
@@ -1371,17 +1351,15 @@ def test_base_url_setter(self) -> None:
assert client.base_url == "https://example.com/from_setter/"
def test_base_url_env(self) -> None:
- with update_env(MIRU_SERVER_BASE_URL="http://localhost:5000/from/env"):
- client = AsyncMiruServer(api_key=api_key, _strict_response_validation=True)
+ with update_env(MIRU_BASE_URL="http://localhost:5000/from/env"):
+ client = AsyncMiru(api_key=api_key, _strict_response_validation=True)
assert client.base_url == "http://localhost:5000/from/env/"
@pytest.mark.parametrize(
"client",
[
- AsyncMiruServer(
- base_url="http://localhost:5000/custom/path/", api_key=api_key, _strict_response_validation=True
- ),
- AsyncMiruServer(
+ AsyncMiru(base_url="http://localhost:5000/custom/path/", api_key=api_key, _strict_response_validation=True),
+ AsyncMiru(
base_url="http://localhost:5000/custom/path/",
api_key=api_key,
_strict_response_validation=True,
@@ -1390,7 +1368,7 @@ def test_base_url_env(self) -> None:
],
ids=["standard", "custom http client"],
)
- def test_base_url_trailing_slash(self, client: AsyncMiruServer) -> None:
+ def test_base_url_trailing_slash(self, client: AsyncMiru) -> None:
request = client._build_request(
FinalRequestOptions(
method="post",
@@ -1403,10 +1381,8 @@ def test_base_url_trailing_slash(self, client: AsyncMiruServer) -> None:
@pytest.mark.parametrize(
"client",
[
- AsyncMiruServer(
- base_url="http://localhost:5000/custom/path/", api_key=api_key, _strict_response_validation=True
- ),
- AsyncMiruServer(
+ AsyncMiru(base_url="http://localhost:5000/custom/path/", api_key=api_key, _strict_response_validation=True),
+ AsyncMiru(
base_url="http://localhost:5000/custom/path/",
api_key=api_key,
_strict_response_validation=True,
@@ -1415,7 +1391,7 @@ def test_base_url_trailing_slash(self, client: AsyncMiruServer) -> None:
],
ids=["standard", "custom http client"],
)
- def test_base_url_no_trailing_slash(self, client: AsyncMiruServer) -> None:
+ def test_base_url_no_trailing_slash(self, client: AsyncMiru) -> None:
request = client._build_request(
FinalRequestOptions(
method="post",
@@ -1428,10 +1404,8 @@ def test_base_url_no_trailing_slash(self, client: AsyncMiruServer) -> None:
@pytest.mark.parametrize(
"client",
[
- AsyncMiruServer(
- base_url="http://localhost:5000/custom/path/", api_key=api_key, _strict_response_validation=True
- ),
- AsyncMiruServer(
+ AsyncMiru(base_url="http://localhost:5000/custom/path/", api_key=api_key, _strict_response_validation=True),
+ AsyncMiru(
base_url="http://localhost:5000/custom/path/",
api_key=api_key,
_strict_response_validation=True,
@@ -1440,7 +1414,7 @@ def test_base_url_no_trailing_slash(self, client: AsyncMiruServer) -> None:
],
ids=["standard", "custom http client"],
)
- def test_absolute_request_url(self, client: AsyncMiruServer) -> None:
+ def test_absolute_request_url(self, client: AsyncMiru) -> None:
request = client._build_request(
FinalRequestOptions(
method="post",
@@ -1451,7 +1425,7 @@ def test_absolute_request_url(self, client: AsyncMiruServer) -> None:
assert request.url == "https://myapi.com/foo"
async def test_copied_client_does_not_close_http(self) -> None:
- client = AsyncMiruServer(base_url=base_url, api_key=api_key, _strict_response_validation=True)
+ client = AsyncMiru(base_url=base_url, api_key=api_key, _strict_response_validation=True)
assert not client.is_closed()
copied = client.copy()
@@ -1463,7 +1437,7 @@ async def test_copied_client_does_not_close_http(self) -> None:
assert not client.is_closed()
async def test_client_context_manager(self) -> None:
- client = AsyncMiruServer(base_url=base_url, api_key=api_key, _strict_response_validation=True)
+ client = AsyncMiru(base_url=base_url, api_key=api_key, _strict_response_validation=True)
async with client as c2:
assert c2 is client
assert not c2.is_closed()
@@ -1485,9 +1459,7 @@ class Model(BaseModel):
async def test_client_max_retries_validation(self) -> None:
with pytest.raises(TypeError, match=r"max_retries cannot be None"):
- AsyncMiruServer(
- base_url=base_url, api_key=api_key, _strict_response_validation=True, max_retries=cast(Any, None)
- )
+ AsyncMiru(base_url=base_url, api_key=api_key, _strict_response_validation=True, max_retries=cast(Any, None))
@pytest.mark.respx(base_url=base_url)
@pytest.mark.asyncio
@@ -1497,12 +1469,12 @@ class Model(BaseModel):
respx_mock.get("/foo").mock(return_value=httpx.Response(200, text="my-custom-format"))
- strict_client = AsyncMiruServer(base_url=base_url, api_key=api_key, _strict_response_validation=True)
+ strict_client = AsyncMiru(base_url=base_url, api_key=api_key, _strict_response_validation=True)
with pytest.raises(APIResponseValidationError):
await strict_client.get("/foo", cast_to=Model)
- client = AsyncMiruServer(base_url=base_url, api_key=api_key, _strict_response_validation=False)
+ client = AsyncMiru(base_url=base_url, api_key=api_key, _strict_response_validation=False)
response = await client.get("/foo", cast_to=Model)
assert isinstance(response, str) # type: ignore[unreachable]
@@ -1531,18 +1503,16 @@ class Model(BaseModel):
@mock.patch("time.time", mock.MagicMock(return_value=1696004797))
@pytest.mark.asyncio
async def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str, timeout: float) -> None:
- client = AsyncMiruServer(base_url=base_url, api_key=api_key, _strict_response_validation=True)
+ client = AsyncMiru(base_url=base_url, api_key=api_key, _strict_response_validation=True)
headers = httpx.Headers({"retry-after": retry_after})
options = FinalRequestOptions(method="get", url="/foo", max_retries=3)
calculated = client._calculate_retry_timeout(remaining_retries, options, headers)
assert calculated == pytest.approx(timeout, 0.5 * 0.875) # pyright: ignore[reportUnknownMemberType]
- @mock.patch("miru_server._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
+ @mock.patch("miru._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@pytest.mark.respx(base_url=base_url)
- async def test_retrying_timeout_errors_doesnt_leak(
- self, respx_mock: MockRouter, async_client: AsyncMiruServer
- ) -> None:
+ async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter, async_client: AsyncMiru) -> None:
respx_mock.get("/config_instances/cfg_inst_123").mock(side_effect=httpx.TimeoutException("Test timeout error"))
with pytest.raises(APITimeoutError):
@@ -1552,11 +1522,9 @@ async def test_retrying_timeout_errors_doesnt_leak(
assert _get_open_connections(self.client) == 0
- @mock.patch("miru_server._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
+ @mock.patch("miru._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@pytest.mark.respx(base_url=base_url)
- async def test_retrying_status_errors_doesnt_leak(
- self, respx_mock: MockRouter, async_client: AsyncMiruServer
- ) -> None:
+ async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter, async_client: AsyncMiru) -> None:
respx_mock.get("/config_instances/cfg_inst_123").mock(return_value=httpx.Response(500))
with pytest.raises(APIStatusError):
@@ -1566,13 +1534,13 @@ async def test_retrying_status_errors_doesnt_leak(
assert _get_open_connections(self.client) == 0
@pytest.mark.parametrize("failures_before_success", [0, 2, 4])
- @mock.patch("miru_server._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
+ @mock.patch("miru._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@pytest.mark.respx(base_url=base_url)
@pytest.mark.asyncio
@pytest.mark.parametrize("failure_mode", ["status", "exception"])
async def test_retries_taken(
self,
- async_client: AsyncMiruServer,
+ async_client: AsyncMiru,
failures_before_success: int,
failure_mode: Literal["status", "exception"],
respx_mock: MockRouter,
@@ -1598,11 +1566,11 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
assert int(response.http_request.headers.get("x-stainless-retry-count")) == failures_before_success
@pytest.mark.parametrize("failures_before_success", [0, 2, 4])
- @mock.patch("miru_server._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
+ @mock.patch("miru._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@pytest.mark.respx(base_url=base_url)
@pytest.mark.asyncio
async def test_omit_retry_count_header(
- self, async_client: AsyncMiruServer, failures_before_success: int, respx_mock: MockRouter
+ self, async_client: AsyncMiru, failures_before_success: int, respx_mock: MockRouter
) -> None:
client = async_client.with_options(max_retries=4)
@@ -1624,11 +1592,11 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0
@pytest.mark.parametrize("failures_before_success", [0, 2, 4])
- @mock.patch("miru_server._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
+ @mock.patch("miru._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@pytest.mark.respx(base_url=base_url)
@pytest.mark.asyncio
async def test_overwrite_retry_count_header(
- self, async_client: AsyncMiruServer, failures_before_success: int, respx_mock: MockRouter
+ self, async_client: AsyncMiru, failures_before_success: int, respx_mock: MockRouter
) -> None:
client = async_client.with_options(max_retries=4)
diff --git a/tests/test_deepcopy.py b/tests/test_deepcopy.py
index f8d056e..6d9aefc 100644
--- a/tests/test_deepcopy.py
+++ b/tests/test_deepcopy.py
@@ -1,4 +1,4 @@
-from miru_server._utils import deepcopy_minimal
+from miru._utils import deepcopy_minimal
def assert_different_identities(obj1: object, obj2: object) -> None:
diff --git a/tests/test_extract_files.py b/tests/test_extract_files.py
index d2fecd4..3da088c 100644
--- a/tests/test_extract_files.py
+++ b/tests/test_extract_files.py
@@ -4,8 +4,8 @@
import pytest
-from miru_server._types import FileTypes
-from miru_server._utils import extract_files
+from miru._types import FileTypes
+from miru._utils import extract_files
def test_removes_files_from_input() -> None:
diff --git a/tests/test_files.py b/tests/test_files.py
index 4b84e9f..4ac5608 100644
--- a/tests/test_files.py
+++ b/tests/test_files.py
@@ -4,7 +4,7 @@
import pytest
from dirty_equals import IsDict, IsList, IsBytes, IsTuple
-from miru_server._files import to_httpx_files, async_to_httpx_files
+from miru._files import to_httpx_files, async_to_httpx_files
readme_path = Path(__file__).parent.parent.joinpath("README.md")
diff --git a/tests/test_models.py b/tests/test_models.py
index b65e7af..10f5796 100644
--- a/tests/test_models.py
+++ b/tests/test_models.py
@@ -7,9 +7,9 @@
import pydantic
from pydantic import Field
-from miru_server._utils import PropertyInfo
-from miru_server._compat import PYDANTIC_V1, parse_obj, model_dump, model_json
-from miru_server._models import BaseModel, construct_type
+from miru._utils import PropertyInfo
+from miru._compat import PYDANTIC_V1, parse_obj, model_dump, model_json
+from miru._models import BaseModel, construct_type
class BasicModel(BaseModel):
diff --git a/tests/test_qs.py b/tests/test_qs.py
index a27f833..6f865a7 100644
--- a/tests/test_qs.py
+++ b/tests/test_qs.py
@@ -4,7 +4,7 @@
import pytest
-from miru_server._qs import Querystring, stringify
+from miru._qs import Querystring, stringify
def test_empty() -> None:
diff --git a/tests/test_required_args.py b/tests/test_required_args.py
index 6a1c26f..3844648 100644
--- a/tests/test_required_args.py
+++ b/tests/test_required_args.py
@@ -2,7 +2,7 @@
import pytest
-from miru_server._utils import required_args
+from miru._utils import required_args
def test_too_many_positional_params() -> None:
diff --git a/tests/test_response.py b/tests/test_response.py
index c5a716b..81aead8 100644
--- a/tests/test_response.py
+++ b/tests/test_response.py
@@ -6,8 +6,8 @@
import pytest
import pydantic
-from miru_server import BaseModel, MiruServer, AsyncMiruServer
-from miru_server._response import (
+from miru import Miru, AsyncMiru, BaseModel
+from miru._response import (
APIResponse,
BaseAPIResponse,
AsyncAPIResponse,
@@ -15,8 +15,8 @@
AsyncBinaryAPIResponse,
extract_response_type,
)
-from miru_server._streaming import Stream
-from miru_server._base_client import FinalRequestOptions
+from miru._streaming import Stream
+from miru._base_client import FinalRequestOptions
class ConcreteBaseAPIResponse(APIResponse[bytes]): ...
@@ -37,7 +37,7 @@ def test_extract_response_type_direct_classes() -> None:
def test_extract_response_type_direct_class_missing_type_arg() -> None:
with pytest.raises(
RuntimeError,
- match="Expected type to have a type argument at index 0 but it did not",
+ match="Expected type to have a type argument at index 0 but it did not",
):
extract_response_type(AsyncAPIResponse)
@@ -56,7 +56,7 @@ def test_extract_response_type_binary_response() -> None:
class PydanticModel(pydantic.BaseModel): ...
-def test_response_parse_mismatched_basemodel(client: MiruServer) -> None:
+def test_response_parse_mismatched_basemodel(client: Miru) -> None:
response = APIResponse(
raw=httpx.Response(200, content=b"foo"),
client=client,
@@ -68,13 +68,13 @@ def test_response_parse_mismatched_basemodel(client: MiruServer) -> None:
with pytest.raises(
TypeError,
- match="Pydantic models must subclass our base model type, e.g. `from miru_server import BaseModel`",
+ match="Pydantic models must subclass our base model type, e.g. `from miru import BaseModel`",
):
response.parse(to=PydanticModel)
@pytest.mark.asyncio
-async def test_async_response_parse_mismatched_basemodel(async_client: AsyncMiruServer) -> None:
+async def test_async_response_parse_mismatched_basemodel(async_client: AsyncMiru) -> None:
response = AsyncAPIResponse(
raw=httpx.Response(200, content=b"foo"),
client=async_client,
@@ -86,12 +86,12 @@ async def test_async_response_parse_mismatched_basemodel(async_client: AsyncMiru
with pytest.raises(
TypeError,
- match="Pydantic models must subclass our base model type, e.g. `from miru_server import BaseModel`",
+ match="Pydantic models must subclass our base model type, e.g. `from miru import BaseModel`",
):
await response.parse(to=PydanticModel)
-def test_response_parse_custom_stream(client: MiruServer) -> None:
+def test_response_parse_custom_stream(client: Miru) -> None:
response = APIResponse(
raw=httpx.Response(200, content=b"foo"),
client=client,
@@ -106,7 +106,7 @@ def test_response_parse_custom_stream(client: MiruServer) -> None:
@pytest.mark.asyncio
-async def test_async_response_parse_custom_stream(async_client: AsyncMiruServer) -> None:
+async def test_async_response_parse_custom_stream(async_client: AsyncMiru) -> None:
response = AsyncAPIResponse(
raw=httpx.Response(200, content=b"foo"),
client=async_client,
@@ -125,7 +125,7 @@ class CustomModel(BaseModel):
bar: int
-def test_response_parse_custom_model(client: MiruServer) -> None:
+def test_response_parse_custom_model(client: Miru) -> None:
response = APIResponse(
raw=httpx.Response(200, content=json.dumps({"foo": "hello!", "bar": 2})),
client=client,
@@ -141,7 +141,7 @@ def test_response_parse_custom_model(client: MiruServer) -> None:
@pytest.mark.asyncio
-async def test_async_response_parse_custom_model(async_client: AsyncMiruServer) -> None:
+async def test_async_response_parse_custom_model(async_client: AsyncMiru) -> None:
response = AsyncAPIResponse(
raw=httpx.Response(200, content=json.dumps({"foo": "hello!", "bar": 2})),
client=async_client,
@@ -156,7 +156,7 @@ async def test_async_response_parse_custom_model(async_client: AsyncMiruServer)
assert obj.bar == 2
-def test_response_parse_annotated_type(client: MiruServer) -> None:
+def test_response_parse_annotated_type(client: Miru) -> None:
response = APIResponse(
raw=httpx.Response(200, content=json.dumps({"foo": "hello!", "bar": 2})),
client=client,
@@ -173,7 +173,7 @@ def test_response_parse_annotated_type(client: MiruServer) -> None:
assert obj.bar == 2
-async def test_async_response_parse_annotated_type(async_client: AsyncMiruServer) -> None:
+async def test_async_response_parse_annotated_type(async_client: AsyncMiru) -> None:
response = AsyncAPIResponse(
raw=httpx.Response(200, content=json.dumps({"foo": "hello!", "bar": 2})),
client=async_client,
@@ -201,7 +201,7 @@ async def test_async_response_parse_annotated_type(async_client: AsyncMiruServer
("FalSe", False),
],
)
-def test_response_parse_bool(client: MiruServer, content: str, expected: bool) -> None:
+def test_response_parse_bool(client: Miru, content: str, expected: bool) -> None:
response = APIResponse(
raw=httpx.Response(200, content=content),
client=client,
@@ -226,7 +226,7 @@ def test_response_parse_bool(client: MiruServer, content: str, expected: bool) -
("FalSe", False),
],
)
-async def test_async_response_parse_bool(client: AsyncMiruServer, content: str, expected: bool) -> None:
+async def test_async_response_parse_bool(client: AsyncMiru, content: str, expected: bool) -> None:
response = AsyncAPIResponse(
raw=httpx.Response(200, content=content),
client=client,
@@ -245,7 +245,7 @@ class OtherModel(BaseModel):
@pytest.mark.parametrize("client", [False], indirect=True) # loose validation
-def test_response_parse_expect_model_union_non_json_content(client: MiruServer) -> None:
+def test_response_parse_expect_model_union_non_json_content(client: Miru) -> None:
response = APIResponse(
raw=httpx.Response(200, content=b"foo", headers={"Content-Type": "application/text"}),
client=client,
@@ -262,7 +262,7 @@ def test_response_parse_expect_model_union_non_json_content(client: MiruServer)
@pytest.mark.asyncio
@pytest.mark.parametrize("async_client", [False], indirect=True) # loose validation
-async def test_async_response_parse_expect_model_union_non_json_content(async_client: AsyncMiruServer) -> None:
+async def test_async_response_parse_expect_model_union_non_json_content(async_client: AsyncMiru) -> None:
response = AsyncAPIResponse(
raw=httpx.Response(200, content=b"foo", headers={"Content-Type": "application/text"}),
client=async_client,
diff --git a/tests/test_streaming.py b/tests/test_streaming.py
index 7d1ea64..3d5cb6e 100644
--- a/tests/test_streaming.py
+++ b/tests/test_streaming.py
@@ -5,13 +5,13 @@
import httpx
import pytest
-from miru_server import MiruServer, AsyncMiruServer
-from miru_server._streaming import Stream, AsyncStream, ServerSentEvent
+from miru import Miru, AsyncMiru
+from miru._streaming import Stream, AsyncStream, ServerSentEvent
@pytest.mark.asyncio
@pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"])
-async def test_basic(sync: bool, client: MiruServer, async_client: AsyncMiruServer) -> None:
+async def test_basic(sync: bool, client: Miru, async_client: AsyncMiru) -> None:
def body() -> Iterator[bytes]:
yield b"event: completion\n"
yield b'data: {"foo":true}\n'
@@ -28,7 +28,7 @@ def body() -> Iterator[bytes]:
@pytest.mark.asyncio
@pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"])
-async def test_data_missing_event(sync: bool, client: MiruServer, async_client: AsyncMiruServer) -> None:
+async def test_data_missing_event(sync: bool, client: Miru, async_client: AsyncMiru) -> None:
def body() -> Iterator[bytes]:
yield b'data: {"foo":true}\n'
yield b"\n"
@@ -44,7 +44,7 @@ def body() -> Iterator[bytes]:
@pytest.mark.asyncio
@pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"])
-async def test_event_missing_data(sync: bool, client: MiruServer, async_client: AsyncMiruServer) -> None:
+async def test_event_missing_data(sync: bool, client: Miru, async_client: AsyncMiru) -> None:
def body() -> Iterator[bytes]:
yield b"event: ping\n"
yield b"\n"
@@ -60,7 +60,7 @@ def body() -> Iterator[bytes]:
@pytest.mark.asyncio
@pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"])
-async def test_multiple_events(sync: bool, client: MiruServer, async_client: AsyncMiruServer) -> None:
+async def test_multiple_events(sync: bool, client: Miru, async_client: AsyncMiru) -> None:
def body() -> Iterator[bytes]:
yield b"event: ping\n"
yield b"\n"
@@ -82,7 +82,7 @@ def body() -> Iterator[bytes]:
@pytest.mark.asyncio
@pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"])
-async def test_multiple_events_with_data(sync: bool, client: MiruServer, async_client: AsyncMiruServer) -> None:
+async def test_multiple_events_with_data(sync: bool, client: Miru, async_client: AsyncMiru) -> None:
def body() -> Iterator[bytes]:
yield b"event: ping\n"
yield b'data: {"foo":true}\n'
@@ -106,9 +106,7 @@ def body() -> Iterator[bytes]:
@pytest.mark.asyncio
@pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"])
-async def test_multiple_data_lines_with_empty_line(
- sync: bool, client: MiruServer, async_client: AsyncMiruServer
-) -> None:
+async def test_multiple_data_lines_with_empty_line(sync: bool, client: Miru, async_client: AsyncMiru) -> None:
def body() -> Iterator[bytes]:
yield b"event: ping\n"
yield b"data: {\n"
@@ -130,7 +128,7 @@ def body() -> Iterator[bytes]:
@pytest.mark.asyncio
@pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"])
-async def test_data_json_escaped_double_new_line(sync: bool, client: MiruServer, async_client: AsyncMiruServer) -> None:
+async def test_data_json_escaped_double_new_line(sync: bool, client: Miru, async_client: AsyncMiru) -> None:
def body() -> Iterator[bytes]:
yield b"event: ping\n"
yield b'data: {"foo": "my long\\n\\ncontent"}'
@@ -147,7 +145,7 @@ def body() -> Iterator[bytes]:
@pytest.mark.asyncio
@pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"])
-async def test_multiple_data_lines(sync: bool, client: MiruServer, async_client: AsyncMiruServer) -> None:
+async def test_multiple_data_lines(sync: bool, client: Miru, async_client: AsyncMiru) -> None:
def body() -> Iterator[bytes]:
yield b"event: ping\n"
yield b"data: {\n"
@@ -167,8 +165,8 @@ def body() -> Iterator[bytes]:
@pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"])
async def test_special_new_line_character(
sync: bool,
- client: MiruServer,
- async_client: AsyncMiruServer,
+ client: Miru,
+ async_client: AsyncMiru,
) -> None:
def body() -> Iterator[bytes]:
yield b'data: {"content":" culpa"}\n'
@@ -198,8 +196,8 @@ def body() -> Iterator[bytes]:
@pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"])
async def test_multi_byte_character_multiple_chunks(
sync: bool,
- client: MiruServer,
- async_client: AsyncMiruServer,
+ client: Miru,
+ async_client: AsyncMiru,
) -> None:
def body() -> Iterator[bytes]:
yield b'data: {"content":"'
@@ -239,8 +237,8 @@ def make_event_iterator(
content: Iterator[bytes],
*,
sync: bool,
- client: MiruServer,
- async_client: AsyncMiruServer,
+ client: Miru,
+ async_client: AsyncMiru,
) -> Iterator[ServerSentEvent] | AsyncIterator[ServerSentEvent]:
if sync:
return Stream(cast_to=object, client=client, response=httpx.Response(200, content=content))._iter_events()
diff --git a/tests/test_transform.py b/tests/test_transform.py
index 6e753e4..674e6cb 100644
--- a/tests/test_transform.py
+++ b/tests/test_transform.py
@@ -8,15 +8,15 @@
import pytest
-from miru_server._types import Base64FileInput, omit, not_given
-from miru_server._utils import (
+from miru._types import Base64FileInput, omit, not_given
+from miru._utils import (
PropertyInfo,
transform as _transform,
parse_datetime,
async_transform as _async_transform,
)
-from miru_server._compat import PYDANTIC_V1
-from miru_server._models import BaseModel
+from miru._compat import PYDANTIC_V1
+from miru._models import BaseModel
_T = TypeVar("_T")
diff --git a/tests/test_utils/test_datetime_parse.py b/tests/test_utils/test_datetime_parse.py
index 1d00102..08e43e1 100644
--- a/tests/test_utils/test_datetime_parse.py
+++ b/tests/test_utils/test_datetime_parse.py
@@ -8,7 +8,7 @@
import pytest
-from miru_server._utils import parse_date, parse_datetime
+from miru._utils import parse_date, parse_datetime
def create_tz(minutes: int) -> timezone:
diff --git a/tests/test_utils/test_proxy.py b/tests/test_utils/test_proxy.py
index cd6e02b..422c987 100644
--- a/tests/test_utils/test_proxy.py
+++ b/tests/test_utils/test_proxy.py
@@ -2,7 +2,7 @@
from typing import Any
from typing_extensions import override
-from miru_server._utils import LazyProxy
+from miru._utils import LazyProxy
class RecursiveLazyProxy(LazyProxy[Any]):
diff --git a/tests/test_utils/test_typing.py b/tests/test_utils/test_typing.py
index 345cac3..7c52762 100644
--- a/tests/test_utils/test_typing.py
+++ b/tests/test_utils/test_typing.py
@@ -2,7 +2,7 @@
from typing import Generic, TypeVar, cast
-from miru_server._utils import extract_type_var_from_base
+from miru._utils import extract_type_var_from_base
_T = TypeVar("_T")
_T2 = TypeVar("_T2")
diff --git a/tests/utils.py b/tests/utils.py
index 94a77d4..af0a82c 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -8,8 +8,8 @@
from datetime import date, datetime
from typing_extensions import Literal, get_args, get_origin, assert_type
-from miru_server._types import Omit, NoneType
-from miru_server._utils import (
+from miru._types import Omit, NoneType
+from miru._utils import (
is_dict,
is_list,
is_list_type,
@@ -19,8 +19,8 @@
is_annotated_type,
is_type_alias_type,
)
-from miru_server._compat import PYDANTIC_V1, field_outer_type, get_model_fields
-from miru_server._models import BaseModel
+from miru._compat import PYDANTIC_V1, field_outer_type, get_model_fields
+from miru._models import BaseModel
BaseModelT = TypeVar("BaseModelT", bound=BaseModel)
From 0c8b7d74ae67df4005fc069c4575ffae78b975c6 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Sun, 5 Oct 2025 19:18:31 +0000
Subject: [PATCH 2/3] refactor(api): revert package name to miru_server_sdk
---
.stats.yml | 2 +-
CONTRIBUTING.md | 2 +-
README.md | 42 +++++++++---------
api.md | 36 +++++++--------
pyproject.toml | 10 ++---
release-please-config.json | 2 +-
scripts/lint | 2 +-
src/{miru => miru_server_sdk}/__init__.py | 4 +-
src/{miru => miru_server_sdk}/_base_client.py | 2 +-
src/{miru => miru_server_sdk}/_client.py | 0
src/{miru => miru_server_sdk}/_compat.py | 0
src/{miru => miru_server_sdk}/_constants.py | 0
src/{miru => miru_server_sdk}/_exceptions.py | 0
src/{miru => miru_server_sdk}/_files.py | 0
src/{miru => miru_server_sdk}/_models.py | 0
src/{miru => miru_server_sdk}/_qs.py | 0
src/{miru => miru_server_sdk}/_resource.py | 0
src/{miru => miru_server_sdk}/_response.py | 10 +++--
src/{miru => miru_server_sdk}/_streaming.py | 0
src/{miru => miru_server_sdk}/_types.py | 2 +-
.../_utils/__init__.py | 0
.../_utils/_compat.py | 0
.../_utils/_datetime_parse.py | 0
src/{miru => miru_server_sdk}/_utils/_logs.py | 4 +-
.../_utils/_proxy.py | 0
.../_utils/_reflection.py | 0
.../_utils/_resources_proxy.py | 8 ++--
.../_utils/_streams.py | 0
src/{miru => miru_server_sdk}/_utils/_sync.py | 0
.../_utils/_transform.py | 0
.../_utils/_typing.py | 0
.../_utils/_utils.py | 0
src/{miru => miru_server_sdk}/_version.py | 2 +-
src/miru_server_sdk/lib/.keep | 4 ++
src/{miru => miru_server_sdk}/py.typed | 0
.../resources/__init__.py | 0
.../resources/config_instances.py | 0
.../resources/deployments.py | 0
.../resources/devices.py | 0
.../resources/releases.py | 0
.../types/__init__.py | 0
.../types/config_instance.py | 0
.../types/config_instance_list_params.py | 0
.../types/config_instance_list_response.py | 0
.../types/config_instance_retrieve_params.py | 0
.../types/config_schema.py | 0
.../types/config_schema_list.py | 0
.../types/config_type.py | 0
.../types/deployment.py | 0
.../types/deployment_create_params.py | 0
.../types/deployment_list_params.py | 0
.../types/deployment_list_response.py | 0
.../types/deployment_retrieve_params.py | 0
.../types/deployment_validate_params.py | 0
.../types/deployment_validate_response.py | 0
src/{miru => miru_server_sdk}/types/device.py | 0
.../device_create_activation_token_params.py | 0
...device_create_activation_token_response.py | 0
.../types/device_create_params.py | 0
.../types/device_delete_response.py | 0
.../types/device_list_params.py | 0
.../types/device_list_response.py | 0
.../types/device_update_params.py | 0
.../types/paginated_list.py | 0
.../types/release.py | 0
.../types/release_list_params.py | 0
.../types/release_list_response.py | 0
.../types/release_retrieve_params.py | 0
tests/api_resources/test_config_instances.py | 6 +--
tests/api_resources/test_deployments.py | 6 +--
tests/api_resources/test_devices.py | 6 +--
tests/api_resources/test_releases.py | 4 +-
tests/conftest.py | 6 +--
tests/test_client.py | 44 +++++++++----------
tests/test_deepcopy.py | 2 +-
tests/test_extract_files.py | 4 +-
tests/test_files.py | 2 +-
tests/test_models.py | 6 +--
tests/test_qs.py | 2 +-
tests/test_required_args.py | 2 +-
tests/test_response.py | 14 +++---
tests/test_streaming.py | 4 +-
tests/test_transform.py | 8 ++--
tests/test_utils/test_datetime_parse.py | 2 +-
tests/test_utils/test_proxy.py | 2 +-
tests/test_utils/test_typing.py | 2 +-
tests/utils.py | 8 ++--
87 files changed, 134 insertions(+), 128 deletions(-)
rename src/{miru => miru_server_sdk}/__init__.py (94%)
rename src/{miru => miru_server_sdk}/_base_client.py (99%)
rename src/{miru => miru_server_sdk}/_client.py (100%)
rename src/{miru => miru_server_sdk}/_compat.py (100%)
rename src/{miru => miru_server_sdk}/_constants.py (100%)
rename src/{miru => miru_server_sdk}/_exceptions.py (100%)
rename src/{miru => miru_server_sdk}/_files.py (100%)
rename src/{miru => miru_server_sdk}/_models.py (100%)
rename src/{miru => miru_server_sdk}/_qs.py (100%)
rename src/{miru => miru_server_sdk}/_resource.py (100%)
rename src/{miru => miru_server_sdk}/_response.py (98%)
rename src/{miru => miru_server_sdk}/_streaming.py (100%)
rename src/{miru => miru_server_sdk}/_types.py (99%)
rename src/{miru => miru_server_sdk}/_utils/__init__.py (100%)
rename src/{miru => miru_server_sdk}/_utils/_compat.py (100%)
rename src/{miru => miru_server_sdk}/_utils/_datetime_parse.py (100%)
rename src/{miru => miru_server_sdk}/_utils/_logs.py (75%)
rename src/{miru => miru_server_sdk}/_utils/_proxy.py (100%)
rename src/{miru => miru_server_sdk}/_utils/_reflection.py (100%)
rename src/{miru => miru_server_sdk}/_utils/_resources_proxy.py (50%)
rename src/{miru => miru_server_sdk}/_utils/_streams.py (100%)
rename src/{miru => miru_server_sdk}/_utils/_sync.py (100%)
rename src/{miru => miru_server_sdk}/_utils/_transform.py (100%)
rename src/{miru => miru_server_sdk}/_utils/_typing.py (100%)
rename src/{miru => miru_server_sdk}/_utils/_utils.py (100%)
rename src/{miru => miru_server_sdk}/_version.py (82%)
create mode 100644 src/miru_server_sdk/lib/.keep
rename src/{miru => miru_server_sdk}/py.typed (100%)
rename src/{miru => miru_server_sdk}/resources/__init__.py (100%)
rename src/{miru => miru_server_sdk}/resources/config_instances.py (100%)
rename src/{miru => miru_server_sdk}/resources/deployments.py (100%)
rename src/{miru => miru_server_sdk}/resources/devices.py (100%)
rename src/{miru => miru_server_sdk}/resources/releases.py (100%)
rename src/{miru => miru_server_sdk}/types/__init__.py (100%)
rename src/{miru => miru_server_sdk}/types/config_instance.py (100%)
rename src/{miru => miru_server_sdk}/types/config_instance_list_params.py (100%)
rename src/{miru => miru_server_sdk}/types/config_instance_list_response.py (100%)
rename src/{miru => miru_server_sdk}/types/config_instance_retrieve_params.py (100%)
rename src/{miru => miru_server_sdk}/types/config_schema.py (100%)
rename src/{miru => miru_server_sdk}/types/config_schema_list.py (100%)
rename src/{miru => miru_server_sdk}/types/config_type.py (100%)
rename src/{miru => miru_server_sdk}/types/deployment.py (100%)
rename src/{miru => miru_server_sdk}/types/deployment_create_params.py (100%)
rename src/{miru => miru_server_sdk}/types/deployment_list_params.py (100%)
rename src/{miru => miru_server_sdk}/types/deployment_list_response.py (100%)
rename src/{miru => miru_server_sdk}/types/deployment_retrieve_params.py (100%)
rename src/{miru => miru_server_sdk}/types/deployment_validate_params.py (100%)
rename src/{miru => miru_server_sdk}/types/deployment_validate_response.py (100%)
rename src/{miru => miru_server_sdk}/types/device.py (100%)
rename src/{miru => miru_server_sdk}/types/device_create_activation_token_params.py (100%)
rename src/{miru => miru_server_sdk}/types/device_create_activation_token_response.py (100%)
rename src/{miru => miru_server_sdk}/types/device_create_params.py (100%)
rename src/{miru => miru_server_sdk}/types/device_delete_response.py (100%)
rename src/{miru => miru_server_sdk}/types/device_list_params.py (100%)
rename src/{miru => miru_server_sdk}/types/device_list_response.py (100%)
rename src/{miru => miru_server_sdk}/types/device_update_params.py (100%)
rename src/{miru => miru_server_sdk}/types/paginated_list.py (100%)
rename src/{miru => miru_server_sdk}/types/release.py (100%)
rename src/{miru => miru_server_sdk}/types/release_list_params.py (100%)
rename src/{miru => miru_server_sdk}/types/release_list_response.py (100%)
rename src/{miru => miru_server_sdk}/types/release_retrieve_params.py (100%)
diff --git a/.stats.yml b/.stats.yml
index 0872e67..8846e78 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 14
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/miru-ml%2Fmiru-server-7d0dd143c8ea9bc230d9810d8cfb3fde8b1d4eb48295ebf2db7ea67916fb96c3.yml
openapi_spec_hash: b6667a2e80a356a67bab83f8d5f6e51a
-config_hash: 5cc88c35128978e4da46092835211852
+config_hash: 78c50efd3bbfb4969846973cb0609eff
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 184ae75..993bc19 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -36,7 +36,7 @@ $ pip install -r requirements-dev.lock
Most of the SDK is generated code. Modifications to code will be persisted between generations, but may
result in merge conflicts between manual patches and changes from the generator. The generator will never
-modify the contents of the `src/miru/lib/` and `examples/` directories.
+modify the contents of the `src/miru_server_sdk/lib/` and `examples/` directories.
## Adding and running examples
diff --git a/README.md b/README.md
index 78392fa..7875699 100644
--- a/README.md
+++ b/README.md
@@ -26,7 +26,7 @@ The full API of this library can be found in [api.md](api.md).
```python
import os
-from miru import Miru
+from miru_server_sdk import Miru
client = Miru(
api_key=os.environ.get("MIRU_SERVER_API_KEY"), # This is the default and can be omitted
@@ -50,7 +50,7 @@ Simply import `AsyncMiru` instead of `Miru` and use `await` with each API call:
```python
import os
import asyncio
-from miru import AsyncMiru
+from miru_server_sdk import AsyncMiru
client = AsyncMiru(
api_key=os.environ.get("MIRU_SERVER_API_KEY"), # This is the default and can be omitted
@@ -84,8 +84,8 @@ Then you can enable it by instantiating the client with `http_client=DefaultAioH
```python
import asyncio
-from miru import DefaultAioHttpClient
-from miru import AsyncMiru
+from miru_server_sdk import DefaultAioHttpClient
+from miru_server_sdk import AsyncMiru
async def main() -> None:
@@ -113,16 +113,16 @@ Typed requests and responses provide autocomplete and documentation within your
## Handling errors
-When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `miru.APIConnectionError` is raised.
+When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `miru_server_sdk.APIConnectionError` is raised.
When the API returns a non-success status code (that is, 4xx or 5xx
-response), a subclass of `miru.APIStatusError` is raised, containing `status_code` and `response` properties.
+response), a subclass of `miru_server_sdk.APIStatusError` is raised, containing `status_code` and `response` properties.
-All errors inherit from `miru.APIError`.
+All errors inherit from `miru_server_sdk.APIError`.
```python
-import miru
-from miru import Miru
+import miru_server_sdk
+from miru_server_sdk import Miru
client = Miru()
@@ -130,12 +130,12 @@ try:
client.config_instances.retrieve(
config_instance_id="cfg_inst_123",
)
-except miru.APIConnectionError as e:
+except miru_server_sdk.APIConnectionError as e:
print("The server could not be reached")
print(e.__cause__) # an underlying Exception, likely raised within httpx.
-except miru.RateLimitError as e:
+except miru_server_sdk.RateLimitError as e:
print("A 429 status code was received; we should back off a bit.")
-except miru.APIStatusError as e:
+except miru_server_sdk.APIStatusError as e:
print("Another non-200-range status code was received")
print(e.status_code)
print(e.response)
@@ -163,7 +163,7 @@ Connection errors (for example, due to a network connectivity problem), 408 Requ
You can use the `max_retries` option to configure or disable retry settings:
```python
-from miru import Miru
+from miru_server_sdk import Miru
# Configure the default for all requests:
client = Miru(
@@ -183,7 +183,7 @@ By default requests time out after 1 minute. You can configure this with a `time
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:
```python
-from miru import Miru
+from miru_server_sdk import Miru
# Configure the default for all requests:
client = Miru(
@@ -237,7 +237,7 @@ if response.my_field is None:
The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,
```py
-from miru import Miru
+from miru_server_sdk import Miru
client = Miru()
response = client.config_instances.with_raw_response.retrieve(
@@ -249,9 +249,9 @@ config_instance = response.parse() # get the object that `config_instances.retr
print(config_instance.id)
```
-These methods return an [`APIResponse`](https://github.com/miruml/python-server-sdk/tree/main/src/miru/_response.py) object.
+These methods return an [`APIResponse`](https://github.com/miruml/python-server-sdk/tree/main/src/miru_server_sdk/_response.py) object.
-The async client returns an [`AsyncAPIResponse`](https://github.com/miruml/python-server-sdk/tree/main/src/miru/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
+The async client returns an [`AsyncAPIResponse`](https://github.com/miruml/python-server-sdk/tree/main/src/miru_server_sdk/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
#### `.with_streaming_response`
@@ -315,7 +315,7 @@ You can directly override the [httpx client](https://www.python-httpx.org/api/#c
```python
import httpx
-from miru import Miru, DefaultHttpxClient
+from miru_server_sdk import Miru, DefaultHttpxClient
client = Miru(
# Or use the `MIRU_BASE_URL` env var
@@ -338,7 +338,7 @@ client.with_options(http_client=DefaultHttpxClient(...))
By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.
```py
-from miru import Miru
+from miru_server_sdk import Miru
with Miru() as client:
# make requests here
@@ -366,8 +366,8 @@ If you've upgraded to the latest version but aren't seeing any new features you
You can determine the version that is being used at runtime with:
```py
-import miru
-print(miru.__version__)
+import miru_server_sdk
+print(miru_server_sdk.__version__)
```
## Requirements
diff --git a/api.md b/api.md
index cd85faf..84bec5c 100644
--- a/api.md
+++ b/api.md
@@ -3,7 +3,7 @@
Types:
```python
-from miru.types import (
+from miru_server_sdk.types import (
ConfigInstance,
ConfigSchema,
ConfigSchemaList,
@@ -15,30 +15,30 @@ from miru.types import (
Methods:
-- client.config_instances.retrieve(config_instance_id, \*\*params) -> ConfigInstance
-- client.config_instances.list(\*\*params) -> ConfigInstanceListResponse
+- client.config_instances.retrieve(config_instance_id, \*\*params) -> ConfigInstance
+- client.config_instances.list(\*\*params) -> ConfigInstanceListResponse
# Deployments
Types:
```python
-from miru.types import Deployment, DeploymentListResponse, DeploymentValidateResponse
+from miru_server_sdk.types import Deployment, DeploymentListResponse, DeploymentValidateResponse
```
Methods:
-- client.deployments.create(\*\*params) -> Deployment
-- client.deployments.retrieve(deployment_id, \*\*params) -> Deployment
-- client.deployments.list(\*\*params) -> DeploymentListResponse
-- client.deployments.validate(deployment_id, \*\*params) -> DeploymentValidateResponse
+- client.deployments.create(\*\*params) -> Deployment
+- client.deployments.retrieve(deployment_id, \*\*params) -> Deployment
+- client.deployments.list(\*\*params) -> DeploymentListResponse
+- client.deployments.validate(deployment_id, \*\*params) -> DeploymentValidateResponse
# Devices
Types:
```python
-from miru.types import (
+from miru_server_sdk.types import (
Device,
DeviceListResponse,
DeviceDeleteResponse,
@@ -48,22 +48,22 @@ from miru.types import (
Methods:
-- client.devices.create(\*\*params) -> Device
-- client.devices.retrieve(device_id) -> Device
-- client.devices.update(device_id, \*\*params) -> Device
-- client.devices.list(\*\*params) -> DeviceListResponse
-- client.devices.delete(device_id) -> DeviceDeleteResponse
-- client.devices.create_activation_token(device_id, \*\*params) -> DeviceCreateActivationTokenResponse
+- client.devices.create(\*\*params) -> Device
+- client.devices.retrieve(device_id) -> Device
+- client.devices.update(device_id, \*\*params) -> Device
+- client.devices.list(\*\*params) -> DeviceListResponse
+- client.devices.delete(device_id) -> DeviceDeleteResponse
+- client.devices.create_activation_token(device_id, \*\*params) -> DeviceCreateActivationTokenResponse
# Releases
Types:
```python
-from miru.types import Release, ReleaseListResponse
+from miru_server_sdk.types import Release, ReleaseListResponse
```
Methods:
-- client.releases.retrieve(release_id, \*\*params) -> Release
-- client.releases.list(\*\*params) -> ReleaseListResponse
+- client.releases.retrieve(release_id, \*\*params) -> Release
+- client.releases.list(\*\*params) -> ReleaseListResponse
diff --git a/pyproject.toml b/pyproject.toml
index 5720900..9e90f74 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -78,14 +78,14 @@ format = { chain = [
"check:ruff" = "ruff check ."
"fix:ruff" = "ruff check --fix ."
-"check:importable" = "python -c 'import miru'"
+"check:importable" = "python -c 'import miru_server_sdk'"
typecheck = { chain = [
"typecheck:pyright",
"typecheck:mypy"
]}
"typecheck:pyright" = "pyright"
-"typecheck:verify-types" = "pyright --verifytypes miru --ignoreexternal"
+"typecheck:verify-types" = "pyright --verifytypes miru_server_sdk --ignoreexternal"
"typecheck:mypy" = "mypy ."
[build-system]
@@ -98,7 +98,7 @@ include = [
]
[tool.hatch.build.targets.wheel]
-packages = ["src/miru"]
+packages = ["src/miru_server_sdk"]
[tool.hatch.build.targets.sdist]
# Basically everything except hidden files/directories (such as .github, .devcontainers, .python-version, etc)
@@ -166,7 +166,7 @@ show_error_codes = true
#
# We also exclude our `tests` as mypy doesn't always infer
# types correctly and Pyright will still catch any type errors.
-exclude = ['src/miru/_files.py', '_dev/.*.py', 'tests/.*']
+exclude = ['src/miru_server_sdk/_files.py', '_dev/.*.py', 'tests/.*']
strict_equality = true
implicit_reexport = true
@@ -254,7 +254,7 @@ length-sort = true
length-sort-straight = true
combine-as-imports = true
extra-standard-library = ["typing_extensions"]
-known-first-party = ["miru", "tests"]
+known-first-party = ["miru_server_sdk", "tests"]
[tool.ruff.lint.per-file-ignores]
"bin/**.py" = ["T201", "T203"]
diff --git a/release-please-config.json b/release-please-config.json
index dc00bb0..6b06d69 100644
--- a/release-please-config.json
+++ b/release-please-config.json
@@ -61,6 +61,6 @@
],
"release-type": "python",
"extra-files": [
- "src/miru/_version.py"
+ "src/miru_server_sdk/_version.py"
]
}
\ No newline at end of file
diff --git a/scripts/lint b/scripts/lint
index 230252a..e7476c4 100755
--- a/scripts/lint
+++ b/scripts/lint
@@ -8,4 +8,4 @@ echo "==> Running lints"
rye run lint
echo "==> Making sure it imports"
-rye run python -c 'import miru'
+rye run python -c 'import miru_server_sdk'
diff --git a/src/miru/__init__.py b/src/miru_server_sdk/__init__.py
similarity index 94%
rename from src/miru/__init__.py
rename to src/miru_server_sdk/__init__.py
index 4d27d30..55231d3 100644
--- a/src/miru/__init__.py
+++ b/src/miru_server_sdk/__init__.py
@@ -81,12 +81,12 @@
# Update the __module__ attribute for exported symbols so that
# error messages point to this module instead of the module
# it was originally defined in, e.g.
-# miru._exceptions.NotFoundError -> miru.NotFoundError
+# miru_server_sdk._exceptions.NotFoundError -> miru_server_sdk.NotFoundError
__locals = locals()
for __name in __all__:
if not __name.startswith("__"):
try:
- __locals[__name].__module__ = "miru"
+ __locals[__name].__module__ = "miru_server_sdk"
except (TypeError, AttributeError):
# Some of our exported symbols are builtins which we can't set attributes for.
pass
diff --git a/src/miru/_base_client.py b/src/miru_server_sdk/_base_client.py
similarity index 99%
rename from src/miru/_base_client.py
rename to src/miru_server_sdk/_base_client.py
index 199ea1f..4b80ce9 100644
--- a/src/miru/_base_client.py
+++ b/src/miru_server_sdk/_base_client.py
@@ -389,7 +389,7 @@ def __init__(
if max_retries is None: # pyright: ignore[reportUnnecessaryComparison]
raise TypeError(
- "max_retries cannot be None. If you want to disable retries, pass `0`; if you want unlimited retries, pass `math.inf` or a very high number; if you want the default behavior, pass `miru.DEFAULT_MAX_RETRIES`"
+ "max_retries cannot be None. If you want to disable retries, pass `0`; if you want unlimited retries, pass `math.inf` or a very high number; if you want the default behavior, pass `miru_server_sdk.DEFAULT_MAX_RETRIES`"
)
def _enforce_trailing_slash(self, url: URL) -> URL:
diff --git a/src/miru/_client.py b/src/miru_server_sdk/_client.py
similarity index 100%
rename from src/miru/_client.py
rename to src/miru_server_sdk/_client.py
diff --git a/src/miru/_compat.py b/src/miru_server_sdk/_compat.py
similarity index 100%
rename from src/miru/_compat.py
rename to src/miru_server_sdk/_compat.py
diff --git a/src/miru/_constants.py b/src/miru_server_sdk/_constants.py
similarity index 100%
rename from src/miru/_constants.py
rename to src/miru_server_sdk/_constants.py
diff --git a/src/miru/_exceptions.py b/src/miru_server_sdk/_exceptions.py
similarity index 100%
rename from src/miru/_exceptions.py
rename to src/miru_server_sdk/_exceptions.py
diff --git a/src/miru/_files.py b/src/miru_server_sdk/_files.py
similarity index 100%
rename from src/miru/_files.py
rename to src/miru_server_sdk/_files.py
diff --git a/src/miru/_models.py b/src/miru_server_sdk/_models.py
similarity index 100%
rename from src/miru/_models.py
rename to src/miru_server_sdk/_models.py
diff --git a/src/miru/_qs.py b/src/miru_server_sdk/_qs.py
similarity index 100%
rename from src/miru/_qs.py
rename to src/miru_server_sdk/_qs.py
diff --git a/src/miru/_resource.py b/src/miru_server_sdk/_resource.py
similarity index 100%
rename from src/miru/_resource.py
rename to src/miru_server_sdk/_resource.py
diff --git a/src/miru/_response.py b/src/miru_server_sdk/_response.py
similarity index 98%
rename from src/miru/_response.py
rename to src/miru_server_sdk/_response.py
index 5de180d..6412f06 100644
--- a/src/miru/_response.py
+++ b/src/miru_server_sdk/_response.py
@@ -217,7 +217,9 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T:
and not issubclass(origin, BaseModel)
and issubclass(origin, pydantic.BaseModel)
):
- raise TypeError("Pydantic models must subclass our base model type, e.g. `from miru import BaseModel`")
+ raise TypeError(
+ "Pydantic models must subclass our base model type, e.g. `from miru_server_sdk import BaseModel`"
+ )
if (
cast_to is not object
@@ -283,7 +285,7 @@ def parse(self, *, to: type[_T] | None = None) -> R | _T:
the `to` argument, e.g.
```py
- from miru import BaseModel
+ from miru_server_sdk import BaseModel
class MyModel(BaseModel):
@@ -385,7 +387,7 @@ async def parse(self, *, to: type[_T] | None = None) -> R | _T:
the `to` argument, e.g.
```py
- from miru import BaseModel
+ from miru_server_sdk import BaseModel
class MyModel(BaseModel):
@@ -556,7 +558,7 @@ async def stream_to_file(
class MissingStreamClassError(TypeError):
def __init__(self) -> None:
super().__init__(
- "The `stream` argument was set to `True` but the `stream_cls` argument was not given. See `miru._streaming` for reference",
+ "The `stream` argument was set to `True` but the `stream_cls` argument was not given. See `miru_server_sdk._streaming` for reference",
)
diff --git a/src/miru/_streaming.py b/src/miru_server_sdk/_streaming.py
similarity index 100%
rename from src/miru/_streaming.py
rename to src/miru_server_sdk/_streaming.py
diff --git a/src/miru/_types.py b/src/miru_server_sdk/_types.py
similarity index 99%
rename from src/miru/_types.py
rename to src/miru_server_sdk/_types.py
index b3f722f..09529e8 100644
--- a/src/miru/_types.py
+++ b/src/miru_server_sdk/_types.py
@@ -92,7 +92,7 @@
# This unfortunately means that you will either have
# to import this type and pass it explicitly:
#
-# from miru import NoneType
+# from miru_server_sdk import NoneType
# client.get('/foo', cast_to=NoneType)
#
# or build it yourself:
diff --git a/src/miru/_utils/__init__.py b/src/miru_server_sdk/_utils/__init__.py
similarity index 100%
rename from src/miru/_utils/__init__.py
rename to src/miru_server_sdk/_utils/__init__.py
diff --git a/src/miru/_utils/_compat.py b/src/miru_server_sdk/_utils/_compat.py
similarity index 100%
rename from src/miru/_utils/_compat.py
rename to src/miru_server_sdk/_utils/_compat.py
diff --git a/src/miru/_utils/_datetime_parse.py b/src/miru_server_sdk/_utils/_datetime_parse.py
similarity index 100%
rename from src/miru/_utils/_datetime_parse.py
rename to src/miru_server_sdk/_utils/_datetime_parse.py
diff --git a/src/miru/_utils/_logs.py b/src/miru_server_sdk/_utils/_logs.py
similarity index 75%
rename from src/miru/_utils/_logs.py
rename to src/miru_server_sdk/_utils/_logs.py
index 60916f9..8194d2f 100644
--- a/src/miru/_utils/_logs.py
+++ b/src/miru_server_sdk/_utils/_logs.py
@@ -1,12 +1,12 @@
import os
import logging
-logger: logging.Logger = logging.getLogger("miru")
+logger: logging.Logger = logging.getLogger("miru_server_sdk")
httpx_logger: logging.Logger = logging.getLogger("httpx")
def _basic_config() -> None:
- # e.g. [2023-10-05 14:12:26 - miru._base_client:818 - DEBUG] HTTP Request: POST http://127.0.0.1:4010/foo/bar "200 OK"
+ # e.g. [2023-10-05 14:12:26 - miru_server_sdk._base_client:818 - DEBUG] HTTP Request: POST http://127.0.0.1:4010/foo/bar "200 OK"
logging.basicConfig(
format="[%(asctime)s - %(name)s:%(lineno)d - %(levelname)s] %(message)s",
datefmt="%Y-%m-%d %H:%M:%S",
diff --git a/src/miru/_utils/_proxy.py b/src/miru_server_sdk/_utils/_proxy.py
similarity index 100%
rename from src/miru/_utils/_proxy.py
rename to src/miru_server_sdk/_utils/_proxy.py
diff --git a/src/miru/_utils/_reflection.py b/src/miru_server_sdk/_utils/_reflection.py
similarity index 100%
rename from src/miru/_utils/_reflection.py
rename to src/miru_server_sdk/_utils/_reflection.py
diff --git a/src/miru/_utils/_resources_proxy.py b/src/miru_server_sdk/_utils/_resources_proxy.py
similarity index 50%
rename from src/miru/_utils/_resources_proxy.py
rename to src/miru_server_sdk/_utils/_resources_proxy.py
index 22893c0..ea09025 100644
--- a/src/miru/_utils/_resources_proxy.py
+++ b/src/miru_server_sdk/_utils/_resources_proxy.py
@@ -7,17 +7,17 @@
class ResourcesProxy(LazyProxy[Any]):
- """A proxy for the `miru.resources` module.
+ """A proxy for the `miru_server_sdk.resources` module.
- This is used so that we can lazily import `miru.resources` only when
- needed *and* so that users can just import `miru` and reference `miru.resources`
+ This is used so that we can lazily import `miru_server_sdk.resources` only when
+ needed *and* so that users can just import `miru_server_sdk` and reference `miru_server_sdk.resources`
"""
@override
def __load__(self) -> Any:
import importlib
- mod = importlib.import_module("miru.resources")
+ mod = importlib.import_module("miru_server_sdk.resources")
return mod
diff --git a/src/miru/_utils/_streams.py b/src/miru_server_sdk/_utils/_streams.py
similarity index 100%
rename from src/miru/_utils/_streams.py
rename to src/miru_server_sdk/_utils/_streams.py
diff --git a/src/miru/_utils/_sync.py b/src/miru_server_sdk/_utils/_sync.py
similarity index 100%
rename from src/miru/_utils/_sync.py
rename to src/miru_server_sdk/_utils/_sync.py
diff --git a/src/miru/_utils/_transform.py b/src/miru_server_sdk/_utils/_transform.py
similarity index 100%
rename from src/miru/_utils/_transform.py
rename to src/miru_server_sdk/_utils/_transform.py
diff --git a/src/miru/_utils/_typing.py b/src/miru_server_sdk/_utils/_typing.py
similarity index 100%
rename from src/miru/_utils/_typing.py
rename to src/miru_server_sdk/_utils/_typing.py
diff --git a/src/miru/_utils/_utils.py b/src/miru_server_sdk/_utils/_utils.py
similarity index 100%
rename from src/miru/_utils/_utils.py
rename to src/miru_server_sdk/_utils/_utils.py
diff --git a/src/miru/_version.py b/src/miru_server_sdk/_version.py
similarity index 82%
rename from src/miru/_version.py
rename to src/miru_server_sdk/_version.py
index 028ca67..9ba2454 100644
--- a/src/miru/_version.py
+++ b/src/miru_server_sdk/_version.py
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-__title__ = "miru"
+__title__ = "miru_server_sdk"
__version__ = "0.4.0" # x-release-please-version
diff --git a/src/miru_server_sdk/lib/.keep b/src/miru_server_sdk/lib/.keep
new file mode 100644
index 0000000..5e2c99f
--- /dev/null
+++ b/src/miru_server_sdk/lib/.keep
@@ -0,0 +1,4 @@
+File generated from our OpenAPI spec by Stainless.
+
+This directory can be used to store custom files to expand the SDK.
+It is ignored by Stainless code generation and its content (other than this keep file) won't be touched.
\ No newline at end of file
diff --git a/src/miru/py.typed b/src/miru_server_sdk/py.typed
similarity index 100%
rename from src/miru/py.typed
rename to src/miru_server_sdk/py.typed
diff --git a/src/miru/resources/__init__.py b/src/miru_server_sdk/resources/__init__.py
similarity index 100%
rename from src/miru/resources/__init__.py
rename to src/miru_server_sdk/resources/__init__.py
diff --git a/src/miru/resources/config_instances.py b/src/miru_server_sdk/resources/config_instances.py
similarity index 100%
rename from src/miru/resources/config_instances.py
rename to src/miru_server_sdk/resources/config_instances.py
diff --git a/src/miru/resources/deployments.py b/src/miru_server_sdk/resources/deployments.py
similarity index 100%
rename from src/miru/resources/deployments.py
rename to src/miru_server_sdk/resources/deployments.py
diff --git a/src/miru/resources/devices.py b/src/miru_server_sdk/resources/devices.py
similarity index 100%
rename from src/miru/resources/devices.py
rename to src/miru_server_sdk/resources/devices.py
diff --git a/src/miru/resources/releases.py b/src/miru_server_sdk/resources/releases.py
similarity index 100%
rename from src/miru/resources/releases.py
rename to src/miru_server_sdk/resources/releases.py
diff --git a/src/miru/types/__init__.py b/src/miru_server_sdk/types/__init__.py
similarity index 100%
rename from src/miru/types/__init__.py
rename to src/miru_server_sdk/types/__init__.py
diff --git a/src/miru/types/config_instance.py b/src/miru_server_sdk/types/config_instance.py
similarity index 100%
rename from src/miru/types/config_instance.py
rename to src/miru_server_sdk/types/config_instance.py
diff --git a/src/miru/types/config_instance_list_params.py b/src/miru_server_sdk/types/config_instance_list_params.py
similarity index 100%
rename from src/miru/types/config_instance_list_params.py
rename to src/miru_server_sdk/types/config_instance_list_params.py
diff --git a/src/miru/types/config_instance_list_response.py b/src/miru_server_sdk/types/config_instance_list_response.py
similarity index 100%
rename from src/miru/types/config_instance_list_response.py
rename to src/miru_server_sdk/types/config_instance_list_response.py
diff --git a/src/miru/types/config_instance_retrieve_params.py b/src/miru_server_sdk/types/config_instance_retrieve_params.py
similarity index 100%
rename from src/miru/types/config_instance_retrieve_params.py
rename to src/miru_server_sdk/types/config_instance_retrieve_params.py
diff --git a/src/miru/types/config_schema.py b/src/miru_server_sdk/types/config_schema.py
similarity index 100%
rename from src/miru/types/config_schema.py
rename to src/miru_server_sdk/types/config_schema.py
diff --git a/src/miru/types/config_schema_list.py b/src/miru_server_sdk/types/config_schema_list.py
similarity index 100%
rename from src/miru/types/config_schema_list.py
rename to src/miru_server_sdk/types/config_schema_list.py
diff --git a/src/miru/types/config_type.py b/src/miru_server_sdk/types/config_type.py
similarity index 100%
rename from src/miru/types/config_type.py
rename to src/miru_server_sdk/types/config_type.py
diff --git a/src/miru/types/deployment.py b/src/miru_server_sdk/types/deployment.py
similarity index 100%
rename from src/miru/types/deployment.py
rename to src/miru_server_sdk/types/deployment.py
diff --git a/src/miru/types/deployment_create_params.py b/src/miru_server_sdk/types/deployment_create_params.py
similarity index 100%
rename from src/miru/types/deployment_create_params.py
rename to src/miru_server_sdk/types/deployment_create_params.py
diff --git a/src/miru/types/deployment_list_params.py b/src/miru_server_sdk/types/deployment_list_params.py
similarity index 100%
rename from src/miru/types/deployment_list_params.py
rename to src/miru_server_sdk/types/deployment_list_params.py
diff --git a/src/miru/types/deployment_list_response.py b/src/miru_server_sdk/types/deployment_list_response.py
similarity index 100%
rename from src/miru/types/deployment_list_response.py
rename to src/miru_server_sdk/types/deployment_list_response.py
diff --git a/src/miru/types/deployment_retrieve_params.py b/src/miru_server_sdk/types/deployment_retrieve_params.py
similarity index 100%
rename from src/miru/types/deployment_retrieve_params.py
rename to src/miru_server_sdk/types/deployment_retrieve_params.py
diff --git a/src/miru/types/deployment_validate_params.py b/src/miru_server_sdk/types/deployment_validate_params.py
similarity index 100%
rename from src/miru/types/deployment_validate_params.py
rename to src/miru_server_sdk/types/deployment_validate_params.py
diff --git a/src/miru/types/deployment_validate_response.py b/src/miru_server_sdk/types/deployment_validate_response.py
similarity index 100%
rename from src/miru/types/deployment_validate_response.py
rename to src/miru_server_sdk/types/deployment_validate_response.py
diff --git a/src/miru/types/device.py b/src/miru_server_sdk/types/device.py
similarity index 100%
rename from src/miru/types/device.py
rename to src/miru_server_sdk/types/device.py
diff --git a/src/miru/types/device_create_activation_token_params.py b/src/miru_server_sdk/types/device_create_activation_token_params.py
similarity index 100%
rename from src/miru/types/device_create_activation_token_params.py
rename to src/miru_server_sdk/types/device_create_activation_token_params.py
diff --git a/src/miru/types/device_create_activation_token_response.py b/src/miru_server_sdk/types/device_create_activation_token_response.py
similarity index 100%
rename from src/miru/types/device_create_activation_token_response.py
rename to src/miru_server_sdk/types/device_create_activation_token_response.py
diff --git a/src/miru/types/device_create_params.py b/src/miru_server_sdk/types/device_create_params.py
similarity index 100%
rename from src/miru/types/device_create_params.py
rename to src/miru_server_sdk/types/device_create_params.py
diff --git a/src/miru/types/device_delete_response.py b/src/miru_server_sdk/types/device_delete_response.py
similarity index 100%
rename from src/miru/types/device_delete_response.py
rename to src/miru_server_sdk/types/device_delete_response.py
diff --git a/src/miru/types/device_list_params.py b/src/miru_server_sdk/types/device_list_params.py
similarity index 100%
rename from src/miru/types/device_list_params.py
rename to src/miru_server_sdk/types/device_list_params.py
diff --git a/src/miru/types/device_list_response.py b/src/miru_server_sdk/types/device_list_response.py
similarity index 100%
rename from src/miru/types/device_list_response.py
rename to src/miru_server_sdk/types/device_list_response.py
diff --git a/src/miru/types/device_update_params.py b/src/miru_server_sdk/types/device_update_params.py
similarity index 100%
rename from src/miru/types/device_update_params.py
rename to src/miru_server_sdk/types/device_update_params.py
diff --git a/src/miru/types/paginated_list.py b/src/miru_server_sdk/types/paginated_list.py
similarity index 100%
rename from src/miru/types/paginated_list.py
rename to src/miru_server_sdk/types/paginated_list.py
diff --git a/src/miru/types/release.py b/src/miru_server_sdk/types/release.py
similarity index 100%
rename from src/miru/types/release.py
rename to src/miru_server_sdk/types/release.py
diff --git a/src/miru/types/release_list_params.py b/src/miru_server_sdk/types/release_list_params.py
similarity index 100%
rename from src/miru/types/release_list_params.py
rename to src/miru_server_sdk/types/release_list_params.py
diff --git a/src/miru/types/release_list_response.py b/src/miru_server_sdk/types/release_list_response.py
similarity index 100%
rename from src/miru/types/release_list_response.py
rename to src/miru_server_sdk/types/release_list_response.py
diff --git a/src/miru/types/release_retrieve_params.py b/src/miru_server_sdk/types/release_retrieve_params.py
similarity index 100%
rename from src/miru/types/release_retrieve_params.py
rename to src/miru_server_sdk/types/release_retrieve_params.py
diff --git a/tests/api_resources/test_config_instances.py b/tests/api_resources/test_config_instances.py
index 5e69226..bcc8388 100644
--- a/tests/api_resources/test_config_instances.py
+++ b/tests/api_resources/test_config_instances.py
@@ -7,12 +7,12 @@
import pytest
-from miru import Miru, AsyncMiru
-from miru.types import (
+from tests.utils import assert_matches_type
+from miru_server_sdk import Miru, AsyncMiru
+from miru_server_sdk.types import (
ConfigInstance,
ConfigInstanceListResponse,
)
-from tests.utils import assert_matches_type
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
diff --git a/tests/api_resources/test_deployments.py b/tests/api_resources/test_deployments.py
index 2d57a7c..7bcb5f3 100644
--- a/tests/api_resources/test_deployments.py
+++ b/tests/api_resources/test_deployments.py
@@ -7,13 +7,13 @@
import pytest
-from miru import Miru, AsyncMiru
-from miru.types import (
+from tests.utils import assert_matches_type
+from miru_server_sdk import Miru, AsyncMiru
+from miru_server_sdk.types import (
Deployment,
DeploymentListResponse,
DeploymentValidateResponse,
)
-from tests.utils import assert_matches_type
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
diff --git a/tests/api_resources/test_devices.py b/tests/api_resources/test_devices.py
index 334a261..6d33ecd 100644
--- a/tests/api_resources/test_devices.py
+++ b/tests/api_resources/test_devices.py
@@ -7,14 +7,14 @@
import pytest
-from miru import Miru, AsyncMiru
-from miru.types import (
+from tests.utils import assert_matches_type
+from miru_server_sdk import Miru, AsyncMiru
+from miru_server_sdk.types import (
Device,
DeviceListResponse,
DeviceDeleteResponse,
DeviceCreateActivationTokenResponse,
)
-from tests.utils import assert_matches_type
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
diff --git a/tests/api_resources/test_releases.py b/tests/api_resources/test_releases.py
index 8f4ca2d..bf0a70e 100644
--- a/tests/api_resources/test_releases.py
+++ b/tests/api_resources/test_releases.py
@@ -7,9 +7,9 @@
import pytest
-from miru import Miru, AsyncMiru
-from miru.types import Release, ReleaseListResponse
from tests.utils import assert_matches_type
+from miru_server_sdk import Miru, AsyncMiru
+from miru_server_sdk.types import Release, ReleaseListResponse
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
diff --git a/tests/conftest.py b/tests/conftest.py
index 8ed685b..db67c60 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -10,15 +10,15 @@
import pytest
from pytest_asyncio import is_async_test
-from miru import Miru, AsyncMiru, DefaultAioHttpClient
-from miru._utils import is_dict
+from miru_server_sdk import Miru, AsyncMiru, DefaultAioHttpClient
+from miru_server_sdk._utils import is_dict
if TYPE_CHECKING:
from _pytest.fixtures import FixtureRequest # pyright: ignore[reportPrivateImportUsage]
pytest.register_assert_rewrite("tests.utils")
-logging.getLogger("miru").setLevel(logging.DEBUG)
+logging.getLogger("miru_server_sdk").setLevel(logging.DEBUG)
# automatically add `pytest.mark.asyncio()` to all of our async tests
diff --git a/tests/test_client.py b/tests/test_client.py
index e0c2639..fb773fd 100644
--- a/tests/test_client.py
+++ b/tests/test_client.py
@@ -18,12 +18,12 @@
from respx import MockRouter
from pydantic import ValidationError
-from miru import Miru, AsyncMiru, APIResponseValidationError
-from miru._types import Omit
-from miru._utils import asyncify
-from miru._models import BaseModel, FinalRequestOptions
-from miru._exceptions import MiruError, APIStatusError, APITimeoutError, APIResponseValidationError
-from miru._base_client import (
+from miru_server_sdk import Miru, AsyncMiru, APIResponseValidationError
+from miru_server_sdk._types import Omit
+from miru_server_sdk._utils import asyncify
+from miru_server_sdk._models import BaseModel, FinalRequestOptions
+from miru_server_sdk._exceptions import MiruError, APIStatusError, APITimeoutError, APIResponseValidationError
+from miru_server_sdk._base_client import (
DEFAULT_TIMEOUT,
HTTPX_DEFAULT_TIMEOUT,
BaseClient,
@@ -232,10 +232,10 @@ def add_leak(leaks: list[tracemalloc.StatisticDiff], diff: tracemalloc.Statistic
# to_raw_response_wrapper leaks through the @functools.wraps() decorator.
#
# removing the decorator fixes the leak for reasons we don't understand.
- "miru/_legacy_response.py",
- "miru/_response.py",
+ "miru_server_sdk/_legacy_response.py",
+ "miru_server_sdk/_response.py",
# pydantic.BaseModel.model_dump || pydantic.BaseModel.dict leak memory for some reason.
- "miru/_compat.py",
+ "miru_server_sdk/_compat.py",
# Standard library leaks we don't care about.
"/logging/__init__.py",
]
@@ -703,7 +703,7 @@ def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str
calculated = client._calculate_retry_timeout(remaining_retries, options, headers)
assert calculated == pytest.approx(timeout, 0.5 * 0.875) # pyright: ignore[reportUnknownMemberType]
- @mock.patch("miru._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
+ @mock.patch("miru_server_sdk._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@pytest.mark.respx(base_url=base_url)
def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter, client: Miru) -> None:
respx_mock.get("/config_instances/cfg_inst_123").mock(side_effect=httpx.TimeoutException("Test timeout error"))
@@ -713,7 +713,7 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter, clien
assert _get_open_connections(self.client) == 0
- @mock.patch("miru._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
+ @mock.patch("miru_server_sdk._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@pytest.mark.respx(base_url=base_url)
def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter, client: Miru) -> None:
respx_mock.get("/config_instances/cfg_inst_123").mock(return_value=httpx.Response(500))
@@ -723,7 +723,7 @@ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter, client
assert _get_open_connections(self.client) == 0
@pytest.mark.parametrize("failures_before_success", [0, 2, 4])
- @mock.patch("miru._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
+ @mock.patch("miru_server_sdk._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@pytest.mark.respx(base_url=base_url)
@pytest.mark.parametrize("failure_mode", ["status", "exception"])
def test_retries_taken(
@@ -754,7 +754,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
assert int(response.http_request.headers.get("x-stainless-retry-count")) == failures_before_success
@pytest.mark.parametrize("failures_before_success", [0, 2, 4])
- @mock.patch("miru._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
+ @mock.patch("miru_server_sdk._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@pytest.mark.respx(base_url=base_url)
def test_omit_retry_count_header(self, client: Miru, failures_before_success: int, respx_mock: MockRouter) -> None:
client = client.with_options(max_retries=4)
@@ -777,7 +777,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0
@pytest.mark.parametrize("failures_before_success", [0, 2, 4])
- @mock.patch("miru._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
+ @mock.patch("miru_server_sdk._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@pytest.mark.respx(base_url=base_url)
def test_overwrite_retry_count_header(
self, client: Miru, failures_before_success: int, respx_mock: MockRouter
@@ -1027,10 +1027,10 @@ def add_leak(leaks: list[tracemalloc.StatisticDiff], diff: tracemalloc.Statistic
# to_raw_response_wrapper leaks through the @functools.wraps() decorator.
#
# removing the decorator fixes the leak for reasons we don't understand.
- "miru/_legacy_response.py",
- "miru/_response.py",
+ "miru_server_sdk/_legacy_response.py",
+ "miru_server_sdk/_response.py",
# pydantic.BaseModel.model_dump || pydantic.BaseModel.dict leak memory for some reason.
- "miru/_compat.py",
+ "miru_server_sdk/_compat.py",
# Standard library leaks we don't care about.
"/logging/__init__.py",
]
@@ -1510,7 +1510,7 @@ async def test_parse_retry_after_header(self, remaining_retries: int, retry_afte
calculated = client._calculate_retry_timeout(remaining_retries, options, headers)
assert calculated == pytest.approx(timeout, 0.5 * 0.875) # pyright: ignore[reportUnknownMemberType]
- @mock.patch("miru._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
+ @mock.patch("miru_server_sdk._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@pytest.mark.respx(base_url=base_url)
async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter, async_client: AsyncMiru) -> None:
respx_mock.get("/config_instances/cfg_inst_123").mock(side_effect=httpx.TimeoutException("Test timeout error"))
@@ -1522,7 +1522,7 @@ async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter,
assert _get_open_connections(self.client) == 0
- @mock.patch("miru._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
+ @mock.patch("miru_server_sdk._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@pytest.mark.respx(base_url=base_url)
async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter, async_client: AsyncMiru) -> None:
respx_mock.get("/config_instances/cfg_inst_123").mock(return_value=httpx.Response(500))
@@ -1534,7 +1534,7 @@ async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter,
assert _get_open_connections(self.client) == 0
@pytest.mark.parametrize("failures_before_success", [0, 2, 4])
- @mock.patch("miru._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
+ @mock.patch("miru_server_sdk._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@pytest.mark.respx(base_url=base_url)
@pytest.mark.asyncio
@pytest.mark.parametrize("failure_mode", ["status", "exception"])
@@ -1566,7 +1566,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
assert int(response.http_request.headers.get("x-stainless-retry-count")) == failures_before_success
@pytest.mark.parametrize("failures_before_success", [0, 2, 4])
- @mock.patch("miru._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
+ @mock.patch("miru_server_sdk._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@pytest.mark.respx(base_url=base_url)
@pytest.mark.asyncio
async def test_omit_retry_count_header(
@@ -1592,7 +1592,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0
@pytest.mark.parametrize("failures_before_success", [0, 2, 4])
- @mock.patch("miru._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
+ @mock.patch("miru_server_sdk._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@pytest.mark.respx(base_url=base_url)
@pytest.mark.asyncio
async def test_overwrite_retry_count_header(
diff --git a/tests/test_deepcopy.py b/tests/test_deepcopy.py
index 6d9aefc..0d2dca7 100644
--- a/tests/test_deepcopy.py
+++ b/tests/test_deepcopy.py
@@ -1,4 +1,4 @@
-from miru._utils import deepcopy_minimal
+from miru_server_sdk._utils import deepcopy_minimal
def assert_different_identities(obj1: object, obj2: object) -> None:
diff --git a/tests/test_extract_files.py b/tests/test_extract_files.py
index 3da088c..93d424a 100644
--- a/tests/test_extract_files.py
+++ b/tests/test_extract_files.py
@@ -4,8 +4,8 @@
import pytest
-from miru._types import FileTypes
-from miru._utils import extract_files
+from miru_server_sdk._types import FileTypes
+from miru_server_sdk._utils import extract_files
def test_removes_files_from_input() -> None:
diff --git a/tests/test_files.py b/tests/test_files.py
index 4ac5608..f69686d 100644
--- a/tests/test_files.py
+++ b/tests/test_files.py
@@ -4,7 +4,7 @@
import pytest
from dirty_equals import IsDict, IsList, IsBytes, IsTuple
-from miru._files import to_httpx_files, async_to_httpx_files
+from miru_server_sdk._files import to_httpx_files, async_to_httpx_files
readme_path = Path(__file__).parent.parent.joinpath("README.md")
diff --git a/tests/test_models.py b/tests/test_models.py
index 10f5796..f658293 100644
--- a/tests/test_models.py
+++ b/tests/test_models.py
@@ -7,9 +7,9 @@
import pydantic
from pydantic import Field
-from miru._utils import PropertyInfo
-from miru._compat import PYDANTIC_V1, parse_obj, model_dump, model_json
-from miru._models import BaseModel, construct_type
+from miru_server_sdk._utils import PropertyInfo
+from miru_server_sdk._compat import PYDANTIC_V1, parse_obj, model_dump, model_json
+from miru_server_sdk._models import BaseModel, construct_type
class BasicModel(BaseModel):
diff --git a/tests/test_qs.py b/tests/test_qs.py
index 6f865a7..1f24b94 100644
--- a/tests/test_qs.py
+++ b/tests/test_qs.py
@@ -4,7 +4,7 @@
import pytest
-from miru._qs import Querystring, stringify
+from miru_server_sdk._qs import Querystring, stringify
def test_empty() -> None:
diff --git a/tests/test_required_args.py b/tests/test_required_args.py
index 3844648..cb175a8 100644
--- a/tests/test_required_args.py
+++ b/tests/test_required_args.py
@@ -2,7 +2,7 @@
import pytest
-from miru._utils import required_args
+from miru_server_sdk._utils import required_args
def test_too_many_positional_params() -> None:
diff --git a/tests/test_response.py b/tests/test_response.py
index 81aead8..0e67a17 100644
--- a/tests/test_response.py
+++ b/tests/test_response.py
@@ -6,8 +6,8 @@
import pytest
import pydantic
-from miru import Miru, AsyncMiru, BaseModel
-from miru._response import (
+from miru_server_sdk import Miru, AsyncMiru, BaseModel
+from miru_server_sdk._response import (
APIResponse,
BaseAPIResponse,
AsyncAPIResponse,
@@ -15,8 +15,8 @@
AsyncBinaryAPIResponse,
extract_response_type,
)
-from miru._streaming import Stream
-from miru._base_client import FinalRequestOptions
+from miru_server_sdk._streaming import Stream
+from miru_server_sdk._base_client import FinalRequestOptions
class ConcreteBaseAPIResponse(APIResponse[bytes]): ...
@@ -37,7 +37,7 @@ def test_extract_response_type_direct_classes() -> None:
def test_extract_response_type_direct_class_missing_type_arg() -> None:
with pytest.raises(
RuntimeError,
- match="Expected type to have a type argument at index 0 but it did not",
+ match="Expected type to have a type argument at index 0 but it did not",
):
extract_response_type(AsyncAPIResponse)
@@ -68,7 +68,7 @@ def test_response_parse_mismatched_basemodel(client: Miru) -> None:
with pytest.raises(
TypeError,
- match="Pydantic models must subclass our base model type, e.g. `from miru import BaseModel`",
+ match="Pydantic models must subclass our base model type, e.g. `from miru_server_sdk import BaseModel`",
):
response.parse(to=PydanticModel)
@@ -86,7 +86,7 @@ async def test_async_response_parse_mismatched_basemodel(async_client: AsyncMiru
with pytest.raises(
TypeError,
- match="Pydantic models must subclass our base model type, e.g. `from miru import BaseModel`",
+ match="Pydantic models must subclass our base model type, e.g. `from miru_server_sdk import BaseModel`",
):
await response.parse(to=PydanticModel)
diff --git a/tests/test_streaming.py b/tests/test_streaming.py
index 3d5cb6e..8d461eb 100644
--- a/tests/test_streaming.py
+++ b/tests/test_streaming.py
@@ -5,8 +5,8 @@
import httpx
import pytest
-from miru import Miru, AsyncMiru
-from miru._streaming import Stream, AsyncStream, ServerSentEvent
+from miru_server_sdk import Miru, AsyncMiru
+from miru_server_sdk._streaming import Stream, AsyncStream, ServerSentEvent
@pytest.mark.asyncio
diff --git a/tests/test_transform.py b/tests/test_transform.py
index 674e6cb..26d72c8 100644
--- a/tests/test_transform.py
+++ b/tests/test_transform.py
@@ -8,15 +8,15 @@
import pytest
-from miru._types import Base64FileInput, omit, not_given
-from miru._utils import (
+from miru_server_sdk._types import Base64FileInput, omit, not_given
+from miru_server_sdk._utils import (
PropertyInfo,
transform as _transform,
parse_datetime,
async_transform as _async_transform,
)
-from miru._compat import PYDANTIC_V1
-from miru._models import BaseModel
+from miru_server_sdk._compat import PYDANTIC_V1
+from miru_server_sdk._models import BaseModel
_T = TypeVar("_T")
diff --git a/tests/test_utils/test_datetime_parse.py b/tests/test_utils/test_datetime_parse.py
index 08e43e1..de0bd10 100644
--- a/tests/test_utils/test_datetime_parse.py
+++ b/tests/test_utils/test_datetime_parse.py
@@ -8,7 +8,7 @@
import pytest
-from miru._utils import parse_date, parse_datetime
+from miru_server_sdk._utils import parse_date, parse_datetime
def create_tz(minutes: int) -> timezone:
diff --git a/tests/test_utils/test_proxy.py b/tests/test_utils/test_proxy.py
index 422c987..47cf0f2 100644
--- a/tests/test_utils/test_proxy.py
+++ b/tests/test_utils/test_proxy.py
@@ -2,7 +2,7 @@
from typing import Any
from typing_extensions import override
-from miru._utils import LazyProxy
+from miru_server_sdk._utils import LazyProxy
class RecursiveLazyProxy(LazyProxy[Any]):
diff --git a/tests/test_utils/test_typing.py b/tests/test_utils/test_typing.py
index 7c52762..cd8b866 100644
--- a/tests/test_utils/test_typing.py
+++ b/tests/test_utils/test_typing.py
@@ -2,7 +2,7 @@
from typing import Generic, TypeVar, cast
-from miru._utils import extract_type_var_from_base
+from miru_server_sdk._utils import extract_type_var_from_base
_T = TypeVar("_T")
_T2 = TypeVar("_T2")
diff --git a/tests/utils.py b/tests/utils.py
index af0a82c..dfb5131 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -8,8 +8,8 @@
from datetime import date, datetime
from typing_extensions import Literal, get_args, get_origin, assert_type
-from miru._types import Omit, NoneType
-from miru._utils import (
+from miru_server_sdk._types import Omit, NoneType
+from miru_server_sdk._utils import (
is_dict,
is_list,
is_list_type,
@@ -19,8 +19,8 @@
is_annotated_type,
is_type_alias_type,
)
-from miru._compat import PYDANTIC_V1, field_outer_type, get_model_fields
-from miru._models import BaseModel
+from miru_server_sdk._compat import PYDANTIC_V1, field_outer_type, get_model_fields
+from miru_server_sdk._models import BaseModel
BaseModelT = TypeVar("BaseModelT", bound=BaseModel)
From 0ed82f34d52002341f86e885a9808d0690baf46b Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Sun, 5 Oct 2025 19:20:41 +0000
Subject: [PATCH 3/3] release: 0.4.1-beta.0
---
.release-please-manifest.json | 2 +-
CHANGELOG.md | 9 +++++++++
README.md | 4 ++--
pyproject.toml | 2 +-
src/miru_server_sdk/_version.py | 2 +-
5 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index da59f99..880a183 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.4.0"
+ ".": "0.4.1-beta.0"
}
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0b09dd2..2f20356 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,14 @@
# Changelog
+## 0.4.1-beta.0 (2025-10-05)
+
+Full Changelog: [v0.4.0...v0.4.1-beta.0](https://github.com/miruml/python-server-sdk/compare/v0.4.0...v0.4.1-beta.0)
+
+### Refactors
+
+* **api:** rename miru-server to miru ([163c465](https://github.com/miruml/python-server-sdk/commit/163c4659c64f6b954d9b91e7b340554f0919efa6))
+* **api:** revert package name to miru_server_sdk ([0c8b7d7](https://github.com/miruml/python-server-sdk/commit/0c8b7d74ae67df4005fc069c4575ffae78b975c6))
+
## 0.4.0 (2025-09-23)
Full Changelog: [v0.0.1...v0.4.0](https://github.com/miruml/python-server-sdk/compare/v0.0.1...v0.4.0)
diff --git a/README.md b/README.md
index 7875699..4f8a048 100644
--- a/README.md
+++ b/README.md
@@ -17,7 +17,7 @@ The full API of this library can be found in [api.md](api.md).
```sh
# install from PyPI
-pip install miru_server_sdk
+pip install --pre miru_server_sdk
```
## Usage
@@ -77,7 +77,7 @@ You can enable this by installing `aiohttp`:
```sh
# install from PyPI
-pip install miru_server_sdk[aiohttp]
+pip install --pre miru_server_sdk[aiohttp]
```
Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
diff --git a/pyproject.toml b/pyproject.toml
index 9e90f74..ccf86cb 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "miru_server_sdk"
-version = "0.4.0"
+version = "0.4.1-beta.0"
description = "The official Python library for the miru API"
dynamic = ["readme"]
license = "MIT"
diff --git a/src/miru_server_sdk/_version.py b/src/miru_server_sdk/_version.py
index 9ba2454..11b2276 100644
--- a/src/miru_server_sdk/_version.py
+++ b/src/miru_server_sdk/_version.py
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
__title__ = "miru_server_sdk"
-__version__ = "0.4.0" # x-release-please-version
+__version__ = "0.4.1-beta.0" # x-release-please-version