Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
9611226
chore(project): add settings file for vscode
stainless-app[bot] Jul 25, 2025
adee680
feat(client): support file upload requests
stainless-app[bot] Jul 31, 2025
c10bfbb
chore(internal): fix ruff target version
stainless-app[bot] Aug 6, 2025
2002172
feat(api): api update
stainless-app[bot] Aug 8, 2025
6fed0b8
chore: update @stainless-api/prism-cli to v5.15.0
stainless-app[bot] Aug 9, 2025
e248479
chore(internal): update comment in script
stainless-app[bot] Aug 9, 2025
66ec9db
chore: update github action
stainless-app[bot] Aug 22, 2025
3238508
chore(internal): change ci workflow machines
stainless-app[bot] Aug 26, 2025
565f29d
fix: avoid newer type syntax
stainless-app[bot] Aug 27, 2025
b322b28
chore(internal): update pyright exclude list
stainless-app[bot] Aug 27, 2025
1b662d6
codegen metadata
stainless-app[bot] Aug 28, 2025
bb04ab5
chore(internal): add Sequence related utils
stainless-app[bot] Aug 30, 2025
f71ac4f
codegen metadata
stainless-app[bot] Sep 1, 2025
acea6f7
feat(types): replace List[str] with SequenceNotStr in params
stainless-app[bot] Sep 3, 2025
b0fee8f
feat: improve future compat with pydantic v3
stainless-app[bot] Sep 4, 2025
56a8476
codegen metadata
stainless-app[bot] Sep 4, 2025
b5347f1
feat(api): api update
stainless-app[bot] Sep 4, 2025
1eebbfd
chore(internal): move mypy configurations to `pyproject.toml` file
stainless-app[bot] Sep 5, 2025
67c2153
chore(internal): codegen related update
stainless-app[bot] Sep 6, 2025
f658a31
feat(api): api update
stainless-app[bot] Sep 9, 2025
11e687d
codegen metadata
stainless-app[bot] Sep 11, 2025
e10bffb
codegen metadata
stainless-app[bot] Sep 11, 2025
e6346e2
codegen metadata
stainless-app[bot] Sep 11, 2025
1615c57
codegen metadata
stainless-app[bot] Sep 11, 2025
9ab5bc2
codegen metadata
stainless-app[bot] Sep 11, 2025
8d37bcc
release: 1.8.0
stainless-app[bot] Sep 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ jobs:
run: ./scripts/lint

build:
if: github.repository == 'stainless-sdks/arcade-engine-python' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork)
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
timeout-minutes: 10
name: build
permissions:
contents: read
id-token: write
runs-on: depot-ubuntu-24.04
runs-on: ${{ github.repository == 'stainless-sdks/arcade-engine-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@v4

Expand All @@ -61,12 +61,14 @@ jobs:
run: rye build

- name: Get GitHub OIDC Token
if: github.repository == 'stainless-sdks/arcade-engine-python'
id: github-oidc
uses: actions/github-script@v6
with:
script: core.setOutput('github_token', await core.getIDToken());

- name: Upload tarball
if: github.repository == 'stainless-sdks/arcade-engine-python'
env:
URL: https://pkg.stainless.com/s
AUTH: ${{ steps.github-oidc.outputs.github_token }}
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.prism.log
.vscode
_dev

__pycache__
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.7.0"
".": "1.8.0"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 29
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/arcade-ai%2Farcade-engine-b75dffb978bef36324c145a749091760738e0279993d012612135ca0cbee18f5.yml
openapi_spec_hash: b4beb7b5837d4f8074832f0f42bff1b4
config_hash: 3ff9aba9377f3c19253a0f87243f40d9
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/arcade-ai%2Farcade-engine-e67b8e285739a9a3998fbe39b5eb97fac5bb8f571781d4f5d242b3824d4d743e.yml
openapi_spec_hash: bd661c93deb864b606bfc2d2ee110a1f
config_hash: 00b1a3fd1b197bd253cdd6b7bc360c02
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"python.analysis.importFormat": "relative",
}
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
# Changelog

## 1.8.0 (2025-09-11)

Full Changelog: [v1.7.0...v1.8.0](https://github.com/ArcadeAI/arcade-py/compare/v1.7.0...v1.8.0)

### Features

* **api:** api update ([f658a31](https://github.com/ArcadeAI/arcade-py/commit/f658a31f59d48a0b98af76f8a8c9b26c18b63c90))
* **api:** api update ([b5347f1](https://github.com/ArcadeAI/arcade-py/commit/b5347f1b9010f3fbc6021cca7815cd7b23e1024b))
* **api:** api update ([2002172](https://github.com/ArcadeAI/arcade-py/commit/2002172f8b3ae40bc4369bf2bd855d5c226f32c6))
* **client:** support file upload requests ([adee680](https://github.com/ArcadeAI/arcade-py/commit/adee6802723e2d39f46ae63d65fb8436b3407c88))
* improve future compat with pydantic v3 ([b0fee8f](https://github.com/ArcadeAI/arcade-py/commit/b0fee8f9f58da07007420ac5b741136c41672bd9))
* **types:** replace List[str] with SequenceNotStr in params ([acea6f7](https://github.com/ArcadeAI/arcade-py/commit/acea6f763810d79845f31d73e2ea79b153ca0007))


### Bug Fixes

* avoid newer type syntax ([565f29d](https://github.com/ArcadeAI/arcade-py/commit/565f29d37e13c4cb4bb7d6b6675c2a4f74a24ef0))


### Chores

* **internal:** add Sequence related utils ([bb04ab5](https://github.com/ArcadeAI/arcade-py/commit/bb04ab57e41ddc0d2053d43e8accfd4299c7803a))
* **internal:** change ci workflow machines ([3238508](https://github.com/ArcadeAI/arcade-py/commit/3238508b90610f40a34f4b3c214bb8082ac28f07))
* **internal:** codegen related update ([67c2153](https://github.com/ArcadeAI/arcade-py/commit/67c215338a0af06d69a1345d312aff24190e369f))
* **internal:** fix ruff target version ([c10bfbb](https://github.com/ArcadeAI/arcade-py/commit/c10bfbb961d2e10744e2b8fc5940cadd2a5adb74))
* **internal:** move mypy configurations to `pyproject.toml` file ([1eebbfd](https://github.com/ArcadeAI/arcade-py/commit/1eebbfd15baf996cf5f2cf50c097a7d846c3360f))
* **internal:** update comment in script ([e248479](https://github.com/ArcadeAI/arcade-py/commit/e248479421494f9f585b6a035477e95b2a04c8a1))
* **internal:** update pyright exclude list ([b322b28](https://github.com/ArcadeAI/arcade-py/commit/b322b2808fb8b419f4f895f39353e000efe51767))
* **project:** add settings file for vscode ([9611226](https://github.com/ArcadeAI/arcade-py/commit/9611226ac1d0bb9ea0e2e5cc3dbf66c392ef90af))
* update @stainless-api/prism-cli to v5.15.0 ([6fed0b8](https://github.com/ArcadeAI/arcade-py/commit/6fed0b8458e33c4abc422430069a7a22007e52c2))
* update github action ([66ec9db](https://github.com/ArcadeAI/arcade-py/commit/66ec9db0a712543f3e35554d02c2c7eb8d1f0bc1))

## 1.7.0 (2025-07-23)

Full Changelog: [v1.6.0...v1.7.0](https://github.com/ArcadeAI/arcade-py/compare/v1.6.0...v1.7.0)
Expand Down
50 changes: 0 additions & 50 deletions mypy.ini

This file was deleted.

58 changes: 55 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "arcadepy"
version = "1.7.0"
version = "1.8.0"
description = "The official Python library for the Arcade API"
dynamic = ["readme"]
license = "MIT"
Expand Down Expand Up @@ -56,7 +56,6 @@ dev-dependencies = [
"dirty-equals>=0.6.0",
"importlib-metadata>=6.7.0",
"rich>=13.7.1",
"nest_asyncio==1.6.0",
"pytest-xdist>=3.6.1",
]

Expand Down Expand Up @@ -148,6 +147,7 @@ exclude = [
"_dev",
".venv",
".nox",
".git",
]

reportImplicitOverride = true
Expand All @@ -156,10 +156,62 @@ reportOverlappingOverload = false
reportImportCycles = false
reportPrivateUsage = false

[tool.mypy]
pretty = true
show_error_codes = true

# Exclude _files.py because mypy isn't smart enough to apply
# the correct type narrowing and as this is an internal module
# it's fine to just use Pyright.
#
# We also exclude our `tests` as mypy doesn't always infer
# types correctly and Pyright will still catch any type errors.
exclude = ['src/arcadepy/_files.py', '_dev/.*.py', 'tests/.*']

strict_equality = true
implicit_reexport = true
check_untyped_defs = true
no_implicit_optional = true

warn_return_any = true
warn_unreachable = true
warn_unused_configs = true

# Turn these options off as it could cause conflicts
# with the Pyright options.
warn_unused_ignores = false
warn_redundant_casts = false

disallow_any_generics = true
disallow_untyped_defs = true
disallow_untyped_calls = true
disallow_subclassing_any = true
disallow_incomplete_defs = true
disallow_untyped_decorators = true
cache_fine_grained = true

# By default, mypy reports an error if you assign a value to the result
# of a function call that doesn't return anything. We do this in our test
# cases:
# ```
# result = ...
# assert result is None
# ```
# Changing this codegen to make mypy happy would increase complexity
# and would not be worth it.
disable_error_code = "func-returns-value,overload-cannot-match"

# https://github.com/python/mypy/issues/12162
[[tool.mypy.overrides]]
module = "black.files.*"
ignore_errors = true
ignore_missing_imports = true


[tool.ruff]
line-length = 120
output-format = "grouped"
target-version = "py37"
target-version = "py38"

[tool.ruff.format]
docstring-code-format = true
Expand Down
1 change: 0 additions & 1 deletion requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ multidict==6.4.4
mypy==1.14.1
mypy-extensions==1.0.0
# via mypy
nest-asyncio==1.6.0
nodeenv==1.8.0
# via pyright
nox==2023.4.22
Expand Down
4 changes: 2 additions & 2 deletions scripts/mock
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ echo "==> Starting mock server with URL ${URL}"

# Run prism mock on the given spec
if [ "$1" == "--daemon" ]; then
npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL" &> .prism.log &
npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log &

# Wait for server to come online
echo -n "Waiting for server"
Expand All @@ -37,5 +37,5 @@ if [ "$1" == "--daemon" ]; then

echo
else
npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL"
npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL"
fi
2 changes: 1 addition & 1 deletion scripts/test
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ elif ! prism_is_running ; then
echo -e "To run the server, pass in the path or url of your OpenAPI"
echo -e "spec to the prism command:"
echo
echo -e " \$ ${YELLOW}npm exec --package=@stoplight/prism-cli@~5.3.2 -- prism mock path/to/your.openapi.yml${NC}"
echo -e " \$ ${YELLOW}npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}"
echo

exit 1
Expand Down
11 changes: 7 additions & 4 deletions src/arcadepy/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
ModelBuilderProtocol,
)
from ._utils import is_dict, is_list, asyncify, is_given, lru_cache, is_mapping
from ._compat import PYDANTIC_V2, model_copy, model_dump
from ._compat import PYDANTIC_V1, model_copy, model_dump
from ._models import GenericModel, FinalRequestOptions, validate_type, construct_type
from ._response import (
APIResponse,
Expand Down Expand Up @@ -232,7 +232,7 @@ def _set_private_attributes(
model: Type[_T],
options: FinalRequestOptions,
) -> None:
if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None:
if (not PYDANTIC_V1) and getattr(self, "__pydantic_private__", None) is None:
self.__pydantic_private__ = {}

self._model = model
Expand Down Expand Up @@ -320,7 +320,7 @@ def _set_private_attributes(
client: AsyncAPIClient,
options: FinalRequestOptions,
) -> None:
if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None:
if (not PYDANTIC_V1) and getattr(self, "__pydantic_private__", None) is None:
self.__pydantic_private__ = {}

self._model = model
Expand Down Expand Up @@ -532,7 +532,10 @@ def _build_request(
is_body_allowed = options.method.lower() != "get"

if is_body_allowed:
kwargs["json"] = json_data if is_given(json_data) else None
if isinstance(json_data, bytes):
kwargs["content"] = json_data
else:
kwargs["json"] = json_data if is_given(json_data) else None
kwargs["files"] = files
else:
headers.pop("Content-Type", None)
Expand Down
Loading