diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 765e8d73..7e11ec06 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,7 @@ 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: @@ -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 }} diff --git a/.gitignore b/.gitignore index 87797408..95ceb189 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ .prism.log -.vscode _dev __pycache__ diff --git a/.release-please-manifest.json b/.release-please-manifest.json index cce9d1c6..c523ce19 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.7.0" + ".": "1.8.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 36de0786..66b5e742 100644 --- a/.stats.yml +++ b/.stats.yml @@ -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 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/arcade-ai%2Farcade-engine-842222b234397c7c4e1d9f58b11a3321295d67d98a0dde5d5cea00240b99e042.yml +openapi_spec_hash: ecc74c95d5c66e7e972cf83b3cae8c5a config_hash: 3ff9aba9377f3c19253a0f87243f40d9 diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..5b010307 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "python.analysis.importFormat": "relative", +} diff --git a/CHANGELOG.md b/CHANGELOG.md index cb2f6e57..c3d7875e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # Changelog +## 1.8.0 (2025-08-22) + +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 ([2002172](https://github.com/ArcadeAI/arcade-py/commit/2002172f8b3ae40bc4369bf2bd855d5c226f32c6)) +* **client:** support file upload requests ([adee680](https://github.com/ArcadeAI/arcade-py/commit/adee6802723e2d39f46ae63d65fb8436b3407c88)) + + +### Chores + +* **internal:** fix ruff target version ([c10bfbb](https://github.com/ArcadeAI/arcade-py/commit/c10bfbb961d2e10744e2b8fc5940cadd2a5adb74)) +* **internal:** update comment in script ([e248479](https://github.com/ArcadeAI/arcade-py/commit/e248479421494f9f585b6a035477e95b2a04c8a1)) +* **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) diff --git a/pyproject.toml b/pyproject.toml index c38d29b8..b170ab12 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" @@ -159,7 +159,7 @@ reportPrivateUsage = false [tool.ruff] line-length = 120 output-format = "grouped" -target-version = "py37" +target-version = "py38" [tool.ruff.format] docstring-code-format = true diff --git a/scripts/mock b/scripts/mock index d2814ae6..0b28f6ea 100755 --- a/scripts/mock +++ b/scripts/mock @@ -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" @@ -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 diff --git a/scripts/test b/scripts/test index 2b878456..dbeda2d2 100755 --- a/scripts/test +++ b/scripts/test @@ -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 diff --git a/src/arcadepy/_base_client.py b/src/arcadepy/_base_client.py index 84d00c4f..2590b31c 100644 --- a/src/arcadepy/_base_client.py +++ b/src/arcadepy/_base_client.py @@ -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) diff --git a/src/arcadepy/_files.py b/src/arcadepy/_files.py index 715cc207..cc14c14f 100644 --- a/src/arcadepy/_files.py +++ b/src/arcadepy/_files.py @@ -69,12 +69,12 @@ def _transform_file(file: FileTypes) -> HttpxFileTypes: return file if is_tuple_t(file): - return (file[0], _read_file_content(file[1]), *file[2:]) + return (file[0], read_file_content(file[1]), *file[2:]) raise TypeError(f"Expected file types input to be a FileContent type or to be a tuple") -def _read_file_content(file: FileContent) -> HttpxFileContent: +def read_file_content(file: FileContent) -> HttpxFileContent: if isinstance(file, os.PathLike): return pathlib.Path(file).read_bytes() return file @@ -111,12 +111,12 @@ async def _async_transform_file(file: FileTypes) -> HttpxFileTypes: return file if is_tuple_t(file): - return (file[0], await _async_read_file_content(file[1]), *file[2:]) + return (file[0], await async_read_file_content(file[1]), *file[2:]) raise TypeError(f"Expected file types input to be a FileContent type or to be a tuple") -async def _async_read_file_content(file: FileContent) -> HttpxFileContent: +async def async_read_file_content(file: FileContent) -> HttpxFileContent: if isinstance(file, os.PathLike): return await anyio.Path(file).read_bytes() diff --git a/src/arcadepy/_version.py b/src/arcadepy/_version.py index 29087484..39976b07 100644 --- a/src/arcadepy/_version.py +++ b/src/arcadepy/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "arcadepy" -__version__ = "1.7.0" # x-release-please-version +__version__ = "1.8.0" # x-release-please-version diff --git a/src/arcadepy/resources/admin/auth_providers.py b/src/arcadepy/resources/admin/auth_providers.py index ff56a837..076fd7e6 100644 --- a/src/arcadepy/resources/admin/auth_providers.py +++ b/src/arcadepy/resources/admin/auth_providers.py @@ -47,6 +47,7 @@ def create( *, id: str, description: str | NotGiven = NOT_GIVEN, + external_id: str | NotGiven = NOT_GIVEN, oauth2: auth_provider_create_params.Oauth2 | NotGiven = NOT_GIVEN, provider_id: str | NotGiven = NOT_GIVEN, status: str | NotGiven = NOT_GIVEN, @@ -62,6 +63,8 @@ def create( Create a new auth provider Args: + external_id: The unique external ID for the auth provider + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -76,6 +79,7 @@ def create( { "id": id, "description": description, + "external_id": external_id, "oauth2": oauth2, "provider_id": provider_id, "status": status, @@ -250,6 +254,7 @@ async def create( *, id: str, description: str | NotGiven = NOT_GIVEN, + external_id: str | NotGiven = NOT_GIVEN, oauth2: auth_provider_create_params.Oauth2 | NotGiven = NOT_GIVEN, provider_id: str | NotGiven = NOT_GIVEN, status: str | NotGiven = NOT_GIVEN, @@ -265,6 +270,8 @@ async def create( Create a new auth provider Args: + external_id: The unique external ID for the auth provider + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -279,6 +286,7 @@ async def create( { "id": id, "description": description, + "external_id": external_id, "oauth2": oauth2, "provider_id": provider_id, "status": status, diff --git a/src/arcadepy/types/admin/auth_provider_create_params.py b/src/arcadepy/types/admin/auth_provider_create_params.py index 3ce5f3a9..1695d898 100644 --- a/src/arcadepy/types/admin/auth_provider_create_params.py +++ b/src/arcadepy/types/admin/auth_provider_create_params.py @@ -24,6 +24,9 @@ class AuthProviderCreateParams(TypedDict, total=False): description: str + external_id: str + """The unique external ID for the auth provider""" + oauth2: Oauth2 provider_id: str diff --git a/src/arcadepy/types/admin/auth_provider_response.py b/src/arcadepy/types/admin/auth_provider_response.py index 9037c9eb..4db96d56 100644 --- a/src/arcadepy/types/admin/auth_provider_response.py +++ b/src/arcadepy/types/admin/auth_provider_response.py @@ -162,6 +162,9 @@ class Oauth2(BaseModel): pkce: Optional[Oauth2Pkce] = None + redirect_uri: Optional[str] = None + """The redirect URI required for this provider.""" + refresh_request: Optional[Oauth2RefreshRequest] = None scope_delimiter: Optional[str] = None diff --git a/tests/api_resources/admin/test_auth_providers.py b/tests/api_resources/admin/test_auth_providers.py index c0553381..5b9a415a 100644 --- a/tests/api_resources/admin/test_auth_providers.py +++ b/tests/api_resources/admin/test_auth_providers.py @@ -32,6 +32,7 @@ def test_method_create_with_all_params(self, client: Arcade) -> None: auth_provider = client.admin.auth_providers.create( id="id", description="description", + external_id="external_id", oauth2={ "client_id": "client_id", "authorize_request": { @@ -342,6 +343,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncArcade) -> auth_provider = await async_client.admin.auth_providers.create( id="id", description="description", + external_id="external_id", oauth2={ "client_id": "client_id", "authorize_request": {