Skip to content

Commit

Permalink
upgrade pydantic (#266)
Browse files Browse the repository at this point in the history
* upgrade pydantic

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* update other deps

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* update other deps

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* ruff

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* bump more deps

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* update

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* format

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* bump

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
  • Loading branch information
jessfraz authored Sep 10, 2024
1 parent b430b49 commit bf0710f
Show file tree
Hide file tree
Showing 221 changed files with 1,839 additions and 2,790 deletions.
38 changes: 0 additions & 38 deletions .github/workflows/black.yml

This file was deleted.

1 change: 1 addition & 0 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ jobs:
shell: bash
run: |
poetry run ruff check --output-format=github .
poetry run ruff format --check
2 changes: 1 addition & 1 deletion generate/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ poetry run python generate/generate.py

# Format and lint.
poetry run isort .
poetry run black . generate/generate.py docs/conf.py kittycad/client_test.py kittycad/examples_test.py kittycad/models/*.py kittycad/api/*.py kittycad/api/*/*.py
poetry run ruff check --fix .
poetry run ruff format
poetry run mypy . --exclude venv || true


Expand Down
750 changes: 375 additions & 375 deletions kittycad.py.patch.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion kittycad/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
""" A client library for accessing KittyCAD """
"""A client library for accessing KittyCAD"""
2 changes: 1 addition & 1 deletion kittycad/api/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
""" Contains methods for accessing the API """
"""Contains methods for accessing the API"""
2 changes: 1 addition & 1 deletion kittycad/api/api_calls/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
""" Contains methods for accessing the api_calls API paths: API calls that have been performed by users can be queried by the API. This is helpful for debugging as well as billing. """ # noqa: E501
"""Contains methods for accessing the api_calls API paths: API calls that have been performed by users can be queried by the API. This is helpful for debugging as well as billing.""" # noqa: E501
1 change: 0 additions & 1 deletion kittycad/api/api_calls/get_api_call_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ def _get_kwargs(
) # noqa: E501

if group_by is not None:

if "?" in url:
url = url + "&group_by=" + str(group_by)
else:
Expand Down
14 changes: 8 additions & 6 deletions kittycad/api/api_calls/get_async_operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ def _get_kwargs(
}


def _parse_response(*, response: httpx.Response) -> Optional[
def _parse_response(
*, response: httpx.Response
) -> Optional[
Union[
FileConversion,
FileCenterOfMass,
Expand Down Expand Up @@ -132,7 +134,9 @@ def _parse_response(*, response: httpx.Response) -> Optional[
return Error(**response.json())


def _build_response(*, response: httpx.Response) -> Response[
def _build_response(
*, response: httpx.Response
) -> Response[
Optional[
Union[
FileConversion,
Expand Down Expand Up @@ -207,8 +211,7 @@ def sync(
"""Get the status and output of an async operation.
This endpoint requires authentication by any Zoo user. It returns details of the requested async operation for the user.
If the user is not authenticated to view the specified async operation, then it is not returned.
Only Zoo employees with the proper access can view async operations for other users.
""" # noqa: E501
Only Zoo employees with the proper access can view async operations for other users.""" # noqa: E501

return sync_detailed(
id=id,
Expand Down Expand Up @@ -266,8 +269,7 @@ async def asyncio(
"""Get the status and output of an async operation.
This endpoint requires authentication by any Zoo user. It returns details of the requested async operation for the user.
If the user is not authenticated to view the specified async operation, then it is not returned.
Only Zoo employees with the proper access can view async operations for other users.
""" # noqa: E501
Only Zoo employees with the proper access can view async operations for other users.""" # noqa: E501

return (
await asyncio_detailed(
Expand Down
3 changes: 0 additions & 3 deletions kittycad/api/api_calls/list_api_calls.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,18 @@ def _get_kwargs(
) # noqa: E501

if limit is not None:

if "?" in url:
url = url + "&limit=" + str(limit)
else:
url = url + "?limit=" + str(limit)

if page_token is not None:

if "?" in url:
url = url + "&page_token=" + str(page_token)
else:
url = url + "?page_token=" + str(page_token)

if sort_by is not None:

if "?" in url:
url = url + "&sort_by=" + str(sort_by)
else:
Expand Down
9 changes: 2 additions & 7 deletions kittycad/api/api_calls/list_api_calls_for_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,18 @@ def _get_kwargs(
) # noqa: E501

if limit is not None:

if "?" in url:
url = url + "&limit=" + str(limit)
else:
url = url + "?limit=" + str(limit)

if page_token is not None:

if "?" in url:
url = url + "&page_token=" + str(page_token)
else:
url = url + "?page_token=" + str(page_token)

if sort_by is not None:

if "?" in url:
url = url + "&sort_by=" + str(sort_by)
else:
Expand Down Expand Up @@ -115,8 +112,7 @@ def sync(
"""This endpoint requires authentication by any Zoo user. It returns the API calls for the authenticated user if "me" is passed as the user id.
Alternatively, you can use the `/user/api-calls` endpoint to get the API calls for your user.
If the authenticated user is a Zoo employee, then the API calls are returned for the user specified by the user id.
The API calls are returned in order of creation, with the most recently created API calls first.
""" # noqa: E501
The API calls are returned in order of creation, with the most recently created API calls first.""" # noqa: E501

return sync_detailed(
id=id,
Expand Down Expand Up @@ -160,8 +156,7 @@ async def asyncio(
"""This endpoint requires authentication by any Zoo user. It returns the API calls for the authenticated user if "me" is passed as the user id.
Alternatively, you can use the `/user/api-calls` endpoint to get the API calls for your user.
If the authenticated user is a Zoo employee, then the API calls are returned for the user specified by the user id.
The API calls are returned in order of creation, with the most recently created API calls first.
""" # noqa: E501
The API calls are returned in order of creation, with the most recently created API calls first.""" # noqa: E501

return (
await asyncio_detailed(
Expand Down
4 changes: 0 additions & 4 deletions kittycad/api/api_calls/list_async_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,24 @@ def _get_kwargs(
) # noqa: E501

if limit is not None:

if "?" in url:
url = url + "&limit=" + str(limit)
else:
url = url + "?limit=" + str(limit)

if page_token is not None:

if "?" in url:
url = url + "&page_token=" + str(page_token)
else:
url = url + "?page_token=" + str(page_token)

if sort_by is not None:

if "?" in url:
url = url + "&sort_by=" + str(sort_by)
else:
url = url + "?sort_by=" + str(sort_by)

if status is not None:

if "?" in url:
url = url + "&status=" + str(status)
else:
Expand Down
9 changes: 2 additions & 7 deletions kittycad/api/api_calls/org_list_api_calls.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,18 @@ def _get_kwargs(
) # noqa: E501

if limit is not None:

if "?" in url:
url = url + "&limit=" + str(limit)
else:
url = url + "?limit=" + str(limit)

if page_token is not None:

if "?" in url:
url = url + "&page_token=" + str(page_token)
else:
url = url + "?page_token=" + str(page_token)

if sort_by is not None:

if "?" in url:
url = url + "&sort_by=" + str(sort_by)
else:
Expand Down Expand Up @@ -109,8 +106,7 @@ def sync(
) -> Optional[Union[ApiCallWithPriceResultsPage, Error]]:
"""This includes all API calls that were made by users in the org.
This endpoint requires authentication by an org admin. It returns the API calls for the authenticated user's org.
The API calls are returned in order of creation, with the most recently created API calls first.
""" # noqa: E501
The API calls are returned in order of creation, with the most recently created API calls first.""" # noqa: E501

return sync_detailed(
limit=limit,
Expand Down Expand Up @@ -149,8 +145,7 @@ async def asyncio(
) -> Optional[Union[ApiCallWithPriceResultsPage, Error]]:
"""This includes all API calls that were made by users in the org.
This endpoint requires authentication by an org admin. It returns the API calls for the authenticated user's org.
The API calls are returned in order of creation, with the most recently created API calls first.
""" # noqa: E501
The API calls are returned in order of creation, with the most recently created API calls first.""" # noqa: E501

return (
await asyncio_detailed(
Expand Down
9 changes: 2 additions & 7 deletions kittycad/api/api_calls/user_list_api_calls.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,18 @@ def _get_kwargs(
) # noqa: E501

if limit is not None:

if "?" in url:
url = url + "&limit=" + str(limit)
else:
url = url + "?limit=" + str(limit)

if page_token is not None:

if "?" in url:
url = url + "&page_token=" + str(page_token)
else:
url = url + "?page_token=" + str(page_token)

if sort_by is not None:

if "?" in url:
url = url + "&sort_by=" + str(sort_by)
else:
Expand Down Expand Up @@ -108,8 +105,7 @@ def sync(
page_token: Optional[str] = None,
) -> Optional[Union[ApiCallWithPriceResultsPage, Error]]:
"""This endpoint requires authentication by any Zoo user. It returns the API calls for the authenticated user.
The API calls are returned in order of creation, with the most recently created API calls first.
""" # noqa: E501
The API calls are returned in order of creation, with the most recently created API calls first.""" # noqa: E501

return sync_detailed(
limit=limit,
Expand Down Expand Up @@ -147,8 +143,7 @@ async def asyncio(
page_token: Optional[str] = None,
) -> Optional[Union[ApiCallWithPriceResultsPage, Error]]:
"""This endpoint requires authentication by any Zoo user. It returns the API calls for the authenticated user.
The API calls are returned in order of creation, with the most recently created API calls first.
""" # noqa: E501
The API calls are returned in order of creation, with the most recently created API calls first.""" # noqa: E501

return (
await asyncio_detailed(
Expand Down
2 changes: 1 addition & 1 deletion kittycad/api/api_tokens/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
""" Contains methods for accessing the api_tokens API paths: API tokens allow users to call the API outside of their session token that is used as a cookie in the user interface. Users can create, delete, and list their API tokens. But, of course, you need an API token to do this, so first be sure to generate one in the account UI. """ # noqa: E501
"""Contains methods for accessing the api_tokens API paths: API tokens allow users to call the API outside of their session token that is used as a cookie in the user interface. Users can create, delete, and list their API tokens. But, of course, you need an API token to do this, so first be sure to generate one in the account UI.""" # noqa: E501
1 change: 0 additions & 1 deletion kittycad/api/api_tokens/create_api_token_for_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ def _get_kwargs(
) # noqa: E501

if label is not None:

if "?" in url:
url = url + "&label=" + str(label)
else:
Expand Down
6 changes: 2 additions & 4 deletions kittycad/api/api_tokens/delete_api_token_for_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ def sync(
client: Client,
) -> Optional[Error]:
"""This endpoint requires authentication by any Zoo user. It deletes the requested API token for the user.
This endpoint does not actually delete the API token from the database. It merely marks the token as invalid. We still want to keep the token in the database for historical purposes.
""" # noqa: E501
This endpoint does not actually delete the API token from the database. It merely marks the token as invalid. We still want to keep the token in the database for historical purposes.""" # noqa: E501

return sync_detailed(
token=token,
Expand Down Expand Up @@ -104,8 +103,7 @@ async def asyncio(
client: Client,
) -> Optional[Error]:
"""This endpoint requires authentication by any Zoo user. It deletes the requested API token for the user.
This endpoint does not actually delete the API token from the database. It merely marks the token as invalid. We still want to keep the token in the database for historical purposes.
""" # noqa: E501
This endpoint does not actually delete the API token from the database. It merely marks the token as invalid. We still want to keep the token in the database for historical purposes.""" # noqa: E501

return (
await asyncio_detailed(
Expand Down
9 changes: 2 additions & 7 deletions kittycad/api/api_tokens/list_api_tokens_for_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,18 @@ def _get_kwargs(
) # noqa: E501

if limit is not None:

if "?" in url:
url = url + "&limit=" + str(limit)
else:
url = url + "?limit=" + str(limit)

if page_token is not None:

if "?" in url:
url = url + "&page_token=" + str(page_token)
else:
url = url + "?page_token=" + str(page_token)

if sort_by is not None:

if "?" in url:
url = url + "&sort_by=" + str(sort_by)
else:
Expand Down Expand Up @@ -108,8 +105,7 @@ def sync(
page_token: Optional[str] = None,
) -> Optional[Union[ApiTokenResultsPage, Error]]:
"""This endpoint requires authentication by any Zoo user. It returns the API tokens for the authenticated user.
The API tokens are returned in order of creation, with the most recently created API tokens first.
""" # noqa: E501
The API tokens are returned in order of creation, with the most recently created API tokens first.""" # noqa: E501

return sync_detailed(
limit=limit,
Expand Down Expand Up @@ -147,8 +143,7 @@ async def asyncio(
page_token: Optional[str] = None,
) -> Optional[Union[ApiTokenResultsPage, Error]]:
"""This endpoint requires authentication by any Zoo user. It returns the API tokens for the authenticated user.
The API tokens are returned in order of creation, with the most recently created API tokens first.
""" # noqa: E501
The API tokens are returned in order of creation, with the most recently created API tokens first.""" # noqa: E501

return (
await asyncio_detailed(
Expand Down
2 changes: 1 addition & 1 deletion kittycad/api/apps/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
""" Contains methods for accessing the apps API paths: Endpoints for third party app grant flows. """ # noqa: E501
"""Contains methods for accessing the apps API paths: Endpoints for third party app grant flows.""" # noqa: E501
6 changes: 2 additions & 4 deletions kittycad/api/apps/apps_github_callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ def sync(
client: Client,
) -> Optional[Error]:
"""This is different than OAuth 2.0 authentication for users. This endpoint grants access for Zoo to access user's repos.
The user doesn't need Zoo OAuth authorization for this endpoint, this is purely for the GitHub permissions to access repos.
""" # noqa: E501
The user doesn't need Zoo OAuth authorization for this endpoint, this is purely for the GitHub permissions to access repos.""" # noqa: E501

return sync_detailed(
client=client,
Expand All @@ -94,8 +93,7 @@ async def asyncio(
client: Client,
) -> Optional[Error]:
"""This is different than OAuth 2.0 authentication for users. This endpoint grants access for Zoo to access user's repos.
The user doesn't need Zoo OAuth authorization for this endpoint, this is purely for the GitHub permissions to access repos.
""" # noqa: E501
The user doesn't need Zoo OAuth authorization for this endpoint, this is purely for the GitHub permissions to access repos.""" # noqa: E501

return (
await asyncio_detailed(
Expand Down
Loading

0 comments on commit bf0710f

Please sign in to comment.