Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/benchify-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/benchify-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/benchify-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/benchify-python'
env:
URL: https://pkg.stainless.com/s
AUTH: ${{ steps.github-oidc.outputs.github_token }}
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.3.0"
".": "0.4.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 1
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/benchify%2Fbenchify-882428dc42061ac58fad8814f920a7afec0a8fb54bb744e8e709b27156b8afb3.yml
openapi_spec_hash: 4778a24a07fa3aafa7a9befb36579c19
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/benchify%2Fbenchify-b4fa495d3fe9c1e5c4c77be554c5bc36b5cec7aad6c973a8470e156b0b29451d.yml
openapi_spec_hash: 0c2a2285e0908eeaf060114573a7e023
config_hash: 935baad1727a1116efdc14e9ce6e4405
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# Changelog

## 0.4.0 (2025-08-30)

Full Changelog: [v0.3.0...v0.4.0](https://github.com/Benchify/benchify-sdk-python/compare/v0.3.0...v0.4.0)

### Features

* **api:** api update ([fbfc4f7](https://github.com/Benchify/benchify-sdk-python/commit/fbfc4f7deb9daa0f44e63faac6679de268c4b168))
* **api:** api update ([07eecd5](https://github.com/Benchify/benchify-sdk-python/commit/07eecd55d41eccc9e0458e86953cfd2ace4df597))
* **api:** api update ([f87668b](https://github.com/Benchify/benchify-sdk-python/commit/f87668b95b3994606ff161fec99b6db3e784dd78))
* **api:** api update ([54363e0](https://github.com/Benchify/benchify-sdk-python/commit/54363e025d3bc72b709c6396ae0106ebc8ac10e3))
* **api:** api update ([64bb2c7](https://github.com/Benchify/benchify-sdk-python/commit/64bb2c7146518ea47ac317ca9f8057ff9856b83d))


### Bug Fixes

* avoid newer type syntax ([a7101dd](https://github.com/Benchify/benchify-sdk-python/commit/a7101dde3a1454ff7cad1fdb75e342a896fe180d))


### Chores

* **internal:** change ci workflow machines ([266d71e](https://github.com/Benchify/benchify-sdk-python/commit/266d71e50478d32e3f3974bdc53926791437af75))
* **internal:** update pyright exclude list ([f2e7661](https://github.com/Benchify/benchify-sdk-python/commit/f2e7661d7d4776cdd258671f1da3133d9a9d22a5))
* update github action ([4b44888](https://github.com/Benchify/benchify-sdk-python/commit/4b44888aed8836ba34f24dade4456e9769334b52))

## 0.3.0 (2025-08-18)

Full Changelog: [v0.2.0...v0.3.0](https://github.com/Benchify/benchify-sdk-python/compare/v0.2.0...v0.3.0)
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "benchify"
version = "0.3.0"
version = "0.4.0"
description = "The official Python library for the benchify API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down Expand Up @@ -148,6 +148,7 @@ exclude = [
"_dev",
".venv",
".nox",
".git",
]

reportImplicitOverride = true
Expand Down
2 changes: 1 addition & 1 deletion src/benchify/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ def model_dump(
exclude_none=exclude_none,
)

return cast(dict[str, Any], json_safe(dumped)) if mode == "json" else dumped
return cast("dict[str, Any]", json_safe(dumped)) if mode == "json" else dumped

@override
def model_dump_json(
Expand Down
2 changes: 1 addition & 1 deletion src/benchify/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "benchify"
__version__ = "0.3.0" # x-release-please-version
__version__ = "0.4.0" # x-release-please-version
4 changes: 2 additions & 2 deletions src/benchify/resources/fixer.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def run(
*,
files: Iterable[fixer_run_params.File],
bundle: bool | NotGiven = NOT_GIVEN,
fix_types: List[Literal["import_export", "string_literals", "css", "tailwind", "ai_fallback", "types"]]
fix_types: List[Literal["import_export", "string_literals", "css", "ai_fallback", "types", "sql"]]
| NotGiven = NOT_GIVEN,
fixes: Optional[fixer_run_params.Fixes] | NotGiven = NOT_GIVEN,
meta: Optional[fixer_run_params.Meta] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -134,7 +134,7 @@ async def run(
*,
files: Iterable[fixer_run_params.File],
bundle: bool | NotGiven = NOT_GIVEN,
fix_types: List[Literal["import_export", "string_literals", "css", "tailwind", "ai_fallback", "types"]]
fix_types: List[Literal["import_export", "string_literals", "css", "ai_fallback", "types", "sql"]]
| NotGiven = NOT_GIVEN,
fixes: Optional[fixer_run_params.Fixes] | NotGiven = NOT_GIVEN,
meta: Optional[fixer_run_params.Meta] | NotGiven = NOT_GIVEN,
Expand Down
2 changes: 1 addition & 1 deletion src/benchify/types/fixer_run_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class FixerRunParams(TypedDict, total=False):
bundle: bool
"""Whether to bundle the project (experimental)"""

fix_types: List[Literal["import_export", "string_literals", "css", "tailwind", "ai_fallback", "types"]]
fix_types: List[Literal["import_export", "string_literals", "css", "ai_fallback", "types", "sql"]]
"""Configuration for which fix types to apply"""

fixes: Optional[Fixes]
Expand Down
41 changes: 37 additions & 4 deletions src/benchify/types/fixer_run_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"FixerRunResponse",
"Data",
"DataStatus",
"DataBundle",
"DataSuggestedChanges",
"DataSuggestedChangesDiffFormat",
"DataSuggestedChangesChangedFilesFormat",
Expand All @@ -20,8 +21,35 @@


class DataStatus(BaseModel):
file_to_status: Optional[Dict[str, Literal["FIXED", "PARTIALLY_FIXED", "FAILED", "NO_ISSUES_FOUND"]]] = None
"""Fix status of each file sent."""
composite_status: Literal[
"FIXED_EVERYTHING", "FIXED_REQUESTED", "PARTIALLY_FIXED", "NO_REQUESTED_ISSUES", "NO_ISSUES", "FAILED"
]

file_to_composite_status: Optional[
Dict[
str,
Literal[
"FIXED_EVERYTHING", "FIXED_REQUESTED", "PARTIALLY_FIXED", "NO_REQUESTED_ISSUES", "NO_ISSUES", "FAILED"
],
]
] = None
"""Status of each file."""


class DataBundle(BaseModel):
build_system: Literal[
"OLIVE_TEMPLATE", "VITE_SUBDIR", "VITE_ROOT", "NEXT", "ESBUILD", "WEBPACK", "PARCEL", "UNKNOWN"
]
"""The detected project/build system type"""

status: Literal["SUCCESS", "FAILED", "NOT_ATTEMPTED", "PARTIAL_SUCCESS"]
"""Overall status of the bundling operation"""

template_path: str
"""Template path used for bundling"""

files: Optional[List[FileChange]] = None
"""Successfully bundled files"""


class DataSuggestedChangesDiffFormat(BaseModel):
Expand All @@ -48,8 +76,13 @@ class Data(BaseModel):
status: DataStatus
"""Final per-file status after fixing"""

bundled_files: Optional[List[FileChange]] = None
"""Bundled files"""
bundle: Optional[DataBundle] = None
"""Information about the bundling process and results"""

fix_types_used: Optional[
List[Literal["import_export", "string_literals", "css", "ai_fallback", "types", "sql"]]
] = None
"""List of fix types that were actually applied during the fixer run"""

suggested_changes: Optional[DataSuggestedChanges] = None
"""Changes made by the fixer in the requested format"""
Expand Down